Skip to content

Commit

Permalink
Merge pull request #229 from shakacode/fix-rake-task-names
Browse files Browse the repository at this point in the history
Fix rake task names
  • Loading branch information
justin808 committed Jan 26, 2016
2 parents 01cd5bc + 5184bb6 commit b18a4cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions rakelib/example_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,12 @@ def rails_options
"--skip-bundle --skip-spring --skip-git --skip-test-unit --skip-active-record"
end

# Methods for retrieving the name of a task specific to the example type
%w(gen prepare clean clobber npm_install build_webpack_bundles).each do |task_type|
method = "#{task_type}_task_name" # ex: `clean_task_name`
task_name = "#{task_type}_#{name}" # ex: `clean_basic`
method_name_normal = "#{task_type}_task_name" # ex: `clean_task_name`
method_name_short = "#{method_name_normal}_short" # ex: `clean_task_name_short`

define_method(method) { "#{self.class.namespace_name}:#{task_name}" }
define_method("#{method}_short") { task_name }
define_method(method_name_normal) { "#{self.class.namespace_name}:#{task_type}_#{name}" }
define_method(method_name_short) { "#{task_type}_#{name}" }
end

def rspec_task_name_short
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PATH
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 2.0)
rainbow (~> 2.1)

GEM
remote: https://rubygems.org/
Expand Down

0 comments on commit b18a4cb

Please sign in to comment.