Permalink
Browse files

Chili features live in lib now.

  • Loading branch information...
1 parent 13771ef commit e477e98528f7faee6a6b1fb424f454495edbed14 @balvig committed Oct 16, 2012
Showing with 19 additions and 19 deletions.
  1. +1 −1 .gitignore
  2. +3 −3 README.md
  3. +1 −1 lib/chili/feature.rb
  4. +1 −1 spec/dummy/app/config/application.rb
  5. +1 −1 spec/dummy/app/config/boot.rb
  6. +1 −1 spec/dummy/blank_feature/app/overrides/layouts/application/example.html.erb.deface
  7. +2 −2 spec/example_app/config/boot.rb
  8. 0 spec/example_app/{vendor → lib}/chili/invites_feature/.gitignore
  9. 0 ...ets/images/social_feature → lib/chili/invites_feature/app/assets/images/invites_feature}/.gitkeep
  10. 0 ...social_feature → lib/chili/invites_feature/app/assets/javascripts/invites_feature}/application.js
  11. 0 ...e_app/{vendor → lib}/chili/invites_feature/app/assets/stylesheets/invites_feature/application.css
  12. 0 ...pp/{vendor → lib}/chili/invites_feature/app/controllers/invites_feature/application_controller.rb
  13. 0 ...ple_app/{vendor → lib}/chili/invites_feature/app/overrides/posts/index/disclaimer.html.erb.deface
  14. 0 spec/example_app/{vendor → lib}/chili/invites_feature/config/routes.rb
  15. 0 spec/example_app/{vendor → lib}/chili/invites_feature/lib/generators/invites_feature_generator.rb
  16. 0 spec/example_app/{vendor → lib}/chili/invites_feature/lib/invites_feature.rb
  17. 0 spec/example_app/{vendor → lib}/chili/invites_feature/lib/invites_feature/engine.rb
  18. 0 ...sets/images/invites_feature → lib/chili/social_feature/app/assets/images/social_feature}/.gitkeep
  19. 0 .../invites_feature → lib/chili/social_feature/app/assets/javascripts/social_feature}/application.js
  20. 0 ...pp/{vendor → lib}/chili/social_feature/app/assets/stylesheets/social_feature/application.css.scss
  21. 0 ..._app/{vendor → lib}/chili/social_feature/app/controllers/social_feature/application_controller.rb
  22. 0 ...xample_app/{vendor → lib}/chili/social_feature/app/controllers/social_feature/likes_controller.rb
  23. 0 spec/example_app/{vendor → lib}/chili/social_feature/app/models/social_feature/like.rb
  24. 0 spec/example_app/{vendor → lib}/chili/social_feature/app/models/social_feature/post.rb
  25. 0 spec/example_app/{vendor → lib}/chili/social_feature/app/models/social_feature/user.rb
  26. 0 .../{vendor → lib}/chili/social_feature/app/overrides/layouts/application/likes_link.html.erb.deface
  27. 0 ...le_app/{vendor → lib}/chili/social_feature/app/overrides/posts/_post/like_actions.html.erb.deface
  28. 0 ...mple_app/{vendor → lib}/chili/social_feature/app/overrides/posts/index/disclaimer.html.erb.deface
  29. 0 ...e_app/{vendor → lib}/chili/social_feature/app/overrides/posts/index/table_headers.html.erb.deface
  30. 0 spec/example_app/{vendor → lib}/chili/social_feature/app/views/social_feature/likes/index.html.erb
  31. 0 spec/example_app/{vendor → lib}/chili/social_feature/config/routes.rb
  32. 0 ..._app/{vendor → lib}/chili/social_feature/db/migrate/20120513031021_create_social_feature_likes.rb
  33. 0 spec/example_app/{vendor → lib}/chili/social_feature/lib/generators/social_feature_generator.rb
  34. 0 spec/example_app/{vendor → lib}/chili/social_feature/lib/social_feature.rb
  35. 0 spec/example_app/{vendor → lib}/chili/social_feature/lib/social_feature/engine.rb
  36. +4 −4 spec/generators/chili/feature_generator_spec.rb
  37. +4 −4 spec/generators/chili/generator_proxy_spec.rb
  38. +1 −1 spec/support/dummy_app.rb
View
@@ -18,7 +18,7 @@ spec/example_app/tmp/
spec/example_app/.sass-cache
spec/dummy/app/Gemfile
spec/dummy/app/log/
-spec/dummy/app/vendor/
+spec/dummy/app/lib/
tmp
.DS_Store
.pt
View
@@ -28,7 +28,7 @@ and run `bundle`.
## Usage
-Chili features are like mini apps that are created inside your main app's vendor directory using using the "chili" generator.
+Chili features are like mini apps that are created inside your main app's lib/chili directory using using the "chili" generator.
### Creating a new chili feature
@@ -39,7 +39,7 @@ to a subset of users, first within your main app run:
This will:
-1. Create the directory `vendor/chili/social_feature` containing the basic structure for the feature
+1. Create the directory `lib/chili/social_feature` containing the basic structure for the feature
2. Add a reference to the feature to the main app gemfile
Since the feature is mounted as a gem you'll have to restart the app.
@@ -84,7 +84,7 @@ but will only be accessible when active_if is true.
### Migrations
Migrations are handled the same way as engines. Use the
-following commands after you've added a new migration to your feature:
+following commands after you've added a new migration to a feature:
$ rake social_feature:migrations:install
$ rake db:migrate
@@ -9,7 +9,7 @@ def name
end
def path
- "vendor/chili/#{name}"
+ "lib/chili/#{name}"
end
end
end
@@ -4,7 +4,7 @@
Bundler.require
require "chili"
-Dir.glob(File.expand_path('../../vendor/chili/*', __FILE__)).each do |dir|
+Dir.glob(File.expand_path('../../lib/chili/*', __FILE__)).each do |dir|
require File.basename(dir)
end
@@ -8,4 +8,4 @@
end
$:.unshift File.expand_path('../../../../../lib', __FILE__)
-$:.unshift File.expand_path('../../vendor/chili/blank_feature/lib', __FILE__)
+$:.unshift File.expand_path('../../lib/chili/blank_feature/lib', __FILE__)
@@ -1,6 +1,6 @@
<!-- insert_bottom 'body' -->
<div style='background: #FFF;text-align: center; padding: 4px 0;position: fixed;width: 100%;z-index: 9999;top: 0;'>
blank_feature active - edit/remove this file:<br/>
- <strong>vendor/chili/blank_feature/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
+ <strong>lib/chili/blank_feature/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
<%= link_to 'deface docs', 'https://github.com/spree/deface', target: '_blank' %>
</div>
@@ -8,5 +8,5 @@
end
$:.unshift File.expand_path('../../../../../lib', __FILE__)
-$:.unshift File.expand_path('../../vendor/chili/social_feature/lib', __FILE__)
-$:.unshift File.expand_path('../../vendor/chili/invites_feature/lib', __FILE__)
+$:.unshift File.expand_path('../../lib/chili/social_feature/lib', __FILE__)
+$:.unshift File.expand_path('../../lib/chili/invites_feature/lib', __FILE__)
@@ -11,7 +11,7 @@
puts `cd #{app.path} && rails g chili:feature blank`
Dir.glob(File.join(template_path, "**/*")).reject { |f| File.directory?(f) }.each do |template|
- result = File.join(app.path, 'vendor/chili/blank_feature', template.sub(template_path, ''))
+ result = File.join(app.path, 'lib/chili/blank_feature', template.sub(template_path, ''))
result_text = File.open(result, 'rb').read
template_text = File.open(template, 'rb').read
template_text.sub!('GIT_AUTHOR',`git config user.name`.chomp) # Git author is different on each machine
@@ -24,15 +24,15 @@
puts `cd #{app.path} && rails g chili:feature blank`
File.open(app.gemfile, 'rb').read.should include <<-RUBY.chomp
group :chili do
- gem 'blank_feature', path: 'vendor/chili/blank_feature'
+ gem 'blank_feature', path: 'lib/chili/blank_feature'
end
RUBY
puts `cd #{app.path} && rails g chili:feature another_blank`
File.open(app.gemfile, 'rb').read.should include <<-RUBY.chomp
group :chili do
- gem 'another_blank_feature', path: 'vendor/chili/another_blank_feature'
- gem 'blank_feature', path: 'vendor/chili/blank_feature'
+ gem 'another_blank_feature', path: 'lib/chili/another_blank_feature'
+ gem 'blank_feature', path: 'lib/chili/blank_feature'
end
RUBY
end
@@ -12,16 +12,16 @@
context 'running generator from a newly created feature' do
it "generates resources properly" do
puts `cd #{app.path} && rails g blank_feature scaffold post`
- File.exist?(File.join(app.path, 'vendor/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
- File.exist?(File.join(app.path, 'vendor/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_true
+ File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
+ File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_true
end
end
context 'passing in options' do
it "passes options on to rails generator" do
puts `cd #{app.path} && rails g blank_feature scaffold post --stylesheets=false`
- File.exist?(File.join(app.path, 'vendor/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
- File.exist?(File.join(app.path, 'vendor/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_false
+ File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/controllers/blank_feature/posts_controller.rb')).should be_true
+ File.exist?(File.join(app.path, 'lib/chili/blank_feature/app/assets/stylesheets/blank_feature/posts.css')).should be_false
end
end
@@ -8,7 +8,7 @@ def gemfile
end
def setup!
- FileUtils.rm_rf File.join(path, 'vendor')
+ FileUtils.rm_rf File.join(path, 'lib')
FileUtils.rm_rf gemfile
File.open(gemfile, 'w') do |f|
f.write <<-RUBY

0 comments on commit e477e98

Please sign in to comment.