chili 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +1 -1
  3. data/app/controllers/chili/application_controller.rb +1 -0
  4. data/chili.gemspec +5 -4
  5. data/lib/chili/overrides.rb +2 -1
  6. data/lib/chili/version.rb +1 -1
  7. data/lib/generators/chili/feature/feature_generator.rb +1 -1
  8. data/spec/dummy/app/config/application.rb +14 -1
  9. data/spec/dummy/app/config/boot.rb +3 -8
  10. data/spec/dummy/app/config/environment.rb +2 -2
  11. data/spec/dummy/app/config/environments/test.rb +13 -14
  12. data/spec/dummy/blank_feature/app/assets/javascripts/blank_feature/application.js +3 -3
  13. data/spec/dummy/blank_feature/blank_feature.gemspec +3 -2
  14. data/spec/example_app/README.rdoc +15 -248
  15. data/spec/example_app/Rakefile +0 -1
  16. data/spec/example_app/app/controllers/posts_controller.rb +8 -2
  17. data/spec/example_app/app/controllers/users_controller.rb +8 -2
  18. data/spec/example_app/app/models/post.rb +0 -1
  19. data/spec/example_app/app/models/user.rb +0 -1
  20. data/spec/example_app/app/overrides/posts/index/spree.html.erb.deface +2 -0
  21. data/spec/example_app/config/application.rb +3 -35
  22. data/spec/example_app/config/boot.rb +3 -8
  23. data/spec/example_app/config/environment.rb +2 -2
  24. data/spec/example_app/config/environments/development.rb +11 -19
  25. data/spec/example_app/config/environments/production.rb +40 -27
  26. data/spec/example_app/config/environments/test.rb +13 -14
  27. data/spec/example_app/config/initializers/filter_parameter_logging.rb +4 -0
  28. data/spec/example_app/config/initializers/inflections.rb +6 -5
  29. data/spec/example_app/config/initializers/secret_token.rb +7 -2
  30. data/spec/example_app/config/initializers/session_store.rb +0 -5
  31. data/spec/example_app/config/initializers/wrap_parameters.rb +6 -6
  32. data/spec/example_app/config/locales/en.yml +20 -2
  33. data/spec/example_app/config/routes.rb +1 -1
  34. data/spec/example_app/lib/chili/social_feature/app/controllers/social_feature/likes_controller.rb +4 -0
  35. data/spec/example_app/lib/chili/social_feature/app/models/social_feature/like.rb +0 -2
  36. data/spec/features/{social_extension_spec.rb → social_feature_spec.rb} +13 -7
  37. data/spec/spec_helper.rb +0 -2
  38. metadata +41 -49
  39. data/spec/dummy/app/config/environments/development.rb +0 -37
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6fa1262ef5fc373083b0aa0194347cc451fdeaa3
4
+ data.tar.gz: d6ebee76c32266046467e23a7724043806cc2a1b
5
+ SHA512:
6
+ metadata.gz: e461f0198946117a498ee92bda8742057c30d1b1b1d6ac9d1c87ef82c689c0d8ad441e9204320d9ab599e2c1f41ee575b84974a94d3499a3e14d511994a41cf2
7
+ data.tar.gz: ed6742a6ef8e3514c4817ac6db8ff8301e3b45f75f9f631ee0e6e6703da253b45c63b628275b6836acf583c36e04a7733c7ad5b1c7b7b6f3f8646cfbfc028285
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  script: "rake app:db:setup && rake app:db:test:prepare && rake"
3
3
  rvm:
4
- - 1.9.2
5
4
  - 1.9.3
5
+ - 2.0.0
@@ -3,6 +3,7 @@ module Chili
3
3
  before_filter :activate_feature
4
4
 
5
5
  private
6
+
6
7
  def activate_feature
7
8
  raise ActionController::RoutingError, 'Feature Disabled' unless self.class.parent.active?(self)
8
9
  end
@@ -15,13 +15,14 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Chili::VERSION
17
17
 
18
- gem.add_dependency "rails", "~> 3.2"
19
- gem.add_dependency "deface", "~> 1.0.0.rc2"
18
+ gem.add_dependency "rails", ">= 3.2"
19
+ gem.add_dependency "deface", "~> 1.0.0"
20
20
 
21
- gem.add_development_dependency 'rspec', '~> 2.12.0'
22
- gem.add_development_dependency 'rspec-rails', '~> 2.12.0'
21
+ gem.add_development_dependency 'rspec', '~> 2.14.0'
22
+ gem.add_development_dependency 'rspec-rails', '~> 2.14.0'
23
23
  gem.add_development_dependency 'jquery-rails'
24
24
  gem.add_development_dependency 'capybara', '~> 2.0'
25
25
  gem.add_development_dependency 'xpath'
26
26
  gem.add_development_dependency 'sqlite3'
27
+ gem.add_development_dependency 'pry'
27
28
  end
@@ -8,7 +8,8 @@ module Chili
8
8
  module InstanceMethods
9
9
  def activate_overrides
10
10
  Deface::Override.all.values.map(&:values).flatten.each do |override|
11
- override.args[:disabled] = !override.railtie_class.constantize.parent.active?(self)
11
+ engine = override.railtie_class.constantize.parent
12
+ override.args[:disabled] = !engine.active?(self) if engine.respond_to?(:active?)
12
13
  end
13
14
  end
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module Chili
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
@@ -20,10 +20,10 @@ module Chili
20
20
  def edit_gemspec
21
21
  require File.expand_path('../../../../chili/version', __FILE__)
22
22
  gemspec = "#{feature.name}.gemspec"
23
- gsub_file gemspec, '# s.add_dependency "jquery-rails"', "s.add_dependency 'chili', '~> #{Chili::VERSION.sub(/\.\d+$/,'')}'"
24
23
  gsub_file gemspec, 'TODO: Your name', `git config user.NAME`.chomp
25
24
  gsub_file gemspec, 'TODO: Your email', `git config user.email`.chomp
26
25
  gsub_file gemspec, /TODO(:\s)?/, ''
26
+ inject_into_file gemspec, " s.add_dependency 'chili', '~> #{Chili::VERSION.sub(/\.\d+$/,'')}'\n\n", before: ' s.add_development_dependency "sqlite3"'
27
27
  end
28
28
 
29
29
  def add_gem_to_main_gemfile
@@ -2,7 +2,9 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- Bundler.require
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env)
6
8
  require "chili"
7
9
  Dir.glob(File.expand_path('../../lib/chili/*', __FILE__)).each do |dir|
8
10
  require File.basename(dir)
@@ -10,5 +12,16 @@ end
10
12
 
11
13
  module Dummy
12
14
  class Application < Rails::Application
15
+ # Settings in config/environments/* take precedence over those specified here.
16
+ # Application configuration should go into files in config/initializers
17
+ # -- all .rb files in that directory are automatically loaded.
18
+
19
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
20
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
21
+ # config.time_zone = 'Central Time (US & Canada)'
22
+
23
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25
+ # config.i18n.default_locale = :de
13
26
  end
14
27
  end
@@ -1,11 +1,6 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../../Gemfile', __FILE__)
9
3
 
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
10
5
  $:.unshift File.expand_path('../../../../../lib', __FILE__)
11
6
  $:.unshift File.expand_path('../../lib/chili/blank_feature/lib', __FILE__)
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
4
+ # Initialize the Rails application.
5
5
  Dummy::Application.initialize!
@@ -1,5 +1,5 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,31 +7,30 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
13
14
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
16
18
 
17
- # Show full error reports and disable caching
19
+ # Show full error reports and disable caching.
18
20
  config.consider_all_requests_local = true
19
21
  config.action_controller.perform_caching = false
20
22
 
21
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
22
24
  config.action_dispatch.show_exceptions = false
23
25
 
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
26
28
 
27
29
  # Tell Action Mailer not to deliver emails to the real world.
28
30
  # The :test delivery method accumulates sent emails in the
29
31
  # ActionMailer::Base.deliveries array.
30
32
  config.action_mailer.delivery_method = :test
31
33
 
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
34
+ # Print deprecation notices to the stderr.
36
35
  config.active_support.deprecation = :stderr
37
36
  end
@@ -5,9 +5,9 @@
5
5
  // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // the compiled file.
8
+ // compiled file.
9
9
  //
10
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
- // GO AFTER THE REQUIRES BELOW.
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
12
  //
13
13
  //= require_tree .
@@ -13,9 +13,10 @@ Gem::Specification.new do |s|
13
13
  s.summary = "Summary of BlankFeature."
14
14
  s.description = "Description of BlankFeature."
15
15
 
16
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
16
+ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
17
+
18
+ s.add_dependency "rails", "~> 4.0.0"
17
19
 
18
- s.add_dependency "rails", "~> 3.2.13"
19
20
  s.add_dependency 'chili', '~> 3.1'
20
21
 
21
22
  s.add_development_dependency "sqlite3"
@@ -1,261 +1,28 @@
1
- == Welcome to Rails
1
+ == README
2
2
 
3
- Rails is a web-application framework that includes everything needed to create
4
- database-backed web applications according to the Model-View-Control pattern.
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
5
 
6
- This pattern splits the view (also called the presentation) into "dumb"
7
- templates that are primarily responsible for inserting pre-built data in between
8
- HTML tags. The model contains the "smart" domain objects (such as Account,
9
- Product, Person, Post) that holds all the business logic and knows how to
10
- persist themselves to a database. The controller handles the incoming requests
11
- (such as Save New Account, Update Product, Show Post) by manipulating the model
12
- and directing data to the view.
6
+ Things you may want to cover:
13
7
 
14
- In Rails, the model is handled by what's called an object-relational mapping
15
- layer entitled Active Record. This layer allows you to present the data from
16
- database rows as objects and embellish these data objects with business logic
17
- methods. You can read more about Active Record in
18
- link:files/vendor/rails/activerecord/README.html.
8
+ * Ruby version
19
9
 
20
- The controller and view are handled by the Action Pack, which handles both
21
- layers by its two parts: Action View and Action Controller. These two layers
22
- are bundled in a single package due to their heavy interdependence. This is
23
- unlike the relationship between the Active Record and Action Pack that is much
24
- more separate. Each of these packages can be used independently outside of
25
- Rails. You can read more about Action Pack in
26
- link:files/vendor/rails/actionpack/README.html.
10
+ * System dependencies
27
11
 
12
+ * Configuration
28
13
 
29
- == Getting Started
14
+ * Database creation
30
15
 
31
- 1. At the command prompt, create a new Rails application:
32
- <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
16
+ * Database initialization
33
17
 
34
- 2. Change directory to <tt>myapp</tt> and start the web server:
35
- <tt>cd myapp; rails server</tt> (run with --help for options)
18
+ * How to run the test suite
36
19
 
37
- 3. Go to http://localhost:3000/ and you'll see:
38
- "Welcome aboard: You're riding Ruby on Rails!"
20
+ * Services (job queues, cache servers, search engines, etc.)
39
21
 
40
- 4. Follow the guidelines to start developing your application. You can find
41
- the following resources handy:
22
+ * Deployment instructions
42
23
 
43
- * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
- * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
24
+ * ...
45
25
 
46
26
 
47
- == Debugging Rails
48
-
49
- Sometimes your application goes wrong. Fortunately there are a lot of tools that
50
- will help you debug it and get it back on the rails.
51
-
52
- First area to check is the application log files. Have "tail -f" commands
53
- running on the server.log and development.log. Rails will automatically display
54
- debugging and runtime information to these files. Debugging info will also be
55
- shown in the browser on requests from 127.0.0.1.
56
-
57
- You can also log your own messages directly into the log file from your code
58
- using the Ruby logger class from inside your controllers. Example:
59
-
60
- class WeblogController < ActionController::Base
61
- def destroy
62
- @weblog = Weblog.find(params[:id])
63
- @weblog.destroy
64
- logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
65
- end
66
- end
67
-
68
- The result will be a message in your log file along the lines of:
69
-
70
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
71
-
72
- More information on how to use the logger is at http://www.ruby-doc.org/core/
73
-
74
- Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
75
- several books available online as well:
76
-
77
- * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
78
- * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
79
-
80
- These two books will bring you up to speed on the Ruby language and also on
81
- programming in general.
82
-
83
-
84
- == Debugger
85
-
86
- Debugger support is available through the debugger command when you start your
87
- Mongrel or WEBrick server with --debugger. This means that you can break out of
88
- execution at any point in the code, investigate and change the model, and then,
89
- resume execution! You need to install ruby-debug to run the server in debugging
90
- mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91
-
92
- class WeblogController < ActionController::Base
93
- def index
94
- @posts = Post.all
95
- debugger
96
- end
97
- end
98
-
99
- So the controller will accept the action, run the first line, then present you
100
- with a IRB prompt in the server window. Here you can do things like:
101
-
102
- >> @posts.inspect
103
- => "[#<Post:0x14a6be8
104
- @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
105
- #<Post:0x14a6620
106
- @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
107
- >> @posts.first.title = "hello from a debugger"
108
- => "hello from a debugger"
109
-
110
- ...and even better, you can examine how your runtime objects actually work:
111
-
112
- >> f = @posts.first
113
- => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
114
- >> f.
115
- Display all 152 possibilities? (y or n)
116
-
117
- Finally, when you're ready to resume execution, you can enter "cont".
118
-
119
-
120
- == Console
121
-
122
- The console is a Ruby shell, which allows you to interact with your
123
- application's domain model. Here you'll have all parts of the application
124
- configured, just like it is when the application is running. You can inspect
125
- domain models, change values, and save to the database. Starting the script
126
- without arguments will launch it in the development environment.
127
-
128
- To start the console, run <tt>rails console</tt> from the application
129
- directory.
130
-
131
- Options:
132
-
133
- * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
134
- made to the database.
135
- * Passing an environment name as an argument will load the corresponding
136
- environment. Example: <tt>rails console production</tt>.
137
-
138
- To reload your controllers and models after launching the console run
139
- <tt>reload!</tt>
140
-
141
- More information about irb can be found at:
142
- link:http://www.rubycentral.org/pickaxe/irb.html
143
-
144
-
145
- == dbconsole
146
-
147
- You can go to the command line of your database directly through <tt>rails
148
- dbconsole</tt>. You would be connected to the database with the credentials
149
- defined in database.yml. Starting the script without arguments will connect you
150
- to the development database. Passing an argument will connect you to a different
151
- database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
152
- PostgreSQL and SQLite 3.
153
-
154
- == Description of Contents
155
-
156
- The default directory structure of a generated Ruby on Rails application:
157
-
158
- |-- app
159
- | |-- assets
160
- | |-- images
161
- | |-- javascripts
162
- | `-- stylesheets
163
- | |-- controllers
164
- | |-- helpers
165
- | |-- mailers
166
- | |-- models
167
- | `-- views
168
- | `-- layouts
169
- |-- config
170
- | |-- environments
171
- | |-- initializers
172
- | `-- locales
173
- |-- db
174
- |-- doc
175
- |-- lib
176
- | `-- tasks
177
- |-- log
178
- |-- public
179
- |-- script
180
- |-- test
181
- | |-- fixtures
182
- | |-- functional
183
- | |-- integration
184
- | |-- performance
185
- | `-- unit
186
- |-- tmp
187
- | |-- cache
188
- | |-- pids
189
- | |-- sessions
190
- | `-- sockets
191
- `-- vendor
192
- |-- assets
193
- `-- stylesheets
194
- `-- plugins
195
-
196
- app
197
- Holds all the code that's specific to this particular application.
198
-
199
- app/assets
200
- Contains subdirectories for images, stylesheets, and JavaScript files.
201
-
202
- app/controllers
203
- Holds controllers that should be named like weblogs_controller.rb for
204
- automated URL mapping. All controllers should descend from
205
- ApplicationController which itself descends from ActionController::Base.
206
-
207
- app/models
208
- Holds models that should be named like post.rb. Models descend from
209
- ActiveRecord::Base by default.
210
-
211
- app/views
212
- Holds the template files for the view that should be named like
213
- weblogs/index.html.erb for the WeblogsController#index action. All views use
214
- eRuby syntax by default.
215
-
216
- app/views/layouts
217
- Holds the template files for layouts to be used with views. This models the
218
- common header/footer method of wrapping views. In your views, define a layout
219
- using the <tt>layout :default</tt> and create a file named default.html.erb.
220
- Inside default.html.erb, call <% yield %> to render the view using this
221
- layout.
222
-
223
- app/helpers
224
- Holds view helpers that should be named like weblogs_helper.rb. These are
225
- generated for you automatically when using generators for controllers.
226
- Helpers can be used to wrap functionality for your views into methods.
227
-
228
- config
229
- Configuration files for the Rails environment, the routing map, the database,
230
- and other dependencies.
231
-
232
- db
233
- Contains the database schema in schema.rb. db/migrate contains all the
234
- sequence of Migrations for your schema.
235
-
236
- doc
237
- This directory is where your application documentation will be stored when
238
- generated using <tt>rake doc:app</tt>
239
-
240
- lib
241
- Application specific libraries. Basically, any kind of custom code that
242
- doesn't belong under controllers, models, or helpers. This directory is in
243
- the load path.
244
-
245
- public
246
- The directory available for the web server. Also contains the dispatchers and the
247
- default HTML files. This should be set as the DOCUMENT_ROOT of your web
248
- server.
249
-
250
- script
251
- Helper scripts for automation and generation.
252
-
253
- test
254
- Unit and functional tests along with fixtures. When using the rails generate
255
- command, template test files will be generated for you and placed in this
256
- directory.
257
-
258
- vendor
259
- External libraries that the application depends on. Also includes the plugins
260
- subdirectory. If the app has frozen rails, those gems also go here, under
261
- vendor/rails/. This directory is in the load path.
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.