Skip to content

Commit

Permalink
Merge pull request rails-api#7 from abakas/master
Browse files Browse the repository at this point in the history
Remove additional asset artifacts from generated app
  • Loading branch information
carlosantoniodasilva committed Apr 24, 2012
2 parents d0a7831 + 4a2a8af commit 9760231
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/rails-api/generators/rails/app/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
Rails::Generators::AppGenerator.source_paths.unshift(
File.expand_path('../../../../templates/rails/app', __FILE__)
)

class Rails::AppBuilder
undef tmp
undef vendor
end
11 changes: 7 additions & 4 deletions test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def test_skeleton_is_created
run_generator

default_files.each { |path| assert_file path }
skipped_files.each { |path| assert_no_file path }
end

def test_api_modified_files
Expand All @@ -18,6 +19,7 @@ def test_api_modified_files
assert_file "Gemfile" do |content|
assert_match(/gem 'rails-api'/, content)
assert_no_match(/gem 'coffee-rails'/, content)
assert_no_match(/gem 'jquery-rails'/, content)
assert_no_match(/gem 'sass-rails'/, content)
end
assert_file "app/controllers/application_controller.rb", /ActionController::API/
Expand Down Expand Up @@ -47,10 +49,11 @@ def default_files
test/functional
test/integration
test/performance
test/unit
vendor
vendor/assets
tmp/cache
test/unit)
end

def skipped_files
%w(vendor/assets
tmp/cache/assets)
end
end

0 comments on commit 9760231

Please sign in to comment.