chili 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -4
- data/lib/chili.rb +4 -0
- data/lib/chili/activatable.rb +4 -0
- data/lib/chili/engine.rb +6 -1
- data/lib/chili/feature.rb +1 -1
- data/lib/chili/version.rb +1 -1
- data/spec/README.md +18 -0
- metadata +56 -19
data/README.md
CHANGED
@@ -50,7 +50,7 @@ Use the active_if block to control whether new the feature is active for each us
|
|
50
50
|
The context of the active_if block is the application controller so you can use any methods available to that.
|
51
51
|
|
52
52
|
```ruby
|
53
|
-
# lib/social_feature.rb
|
53
|
+
# {feature}/lib/social_feature.rb
|
54
54
|
module SocialFeature
|
55
55
|
extend Chili::Activatable
|
56
56
|
active_if { logged_in? && current_user.admin? } # Feature is only visible to logged in admin users
|
@@ -64,7 +64,7 @@ Add overrides to the `app/overides` directory mirroring the path of the view you
|
|
64
64
|
For example, assuming the main app has the partial `app/views/posts/_post.html.erb`:
|
65
65
|
|
66
66
|
```erb
|
67
|
-
<% # app/overrides/posts/_post/like_button.html.erb.deface (folder should mirror main app view path) %>
|
67
|
+
<% # {feature}/app/overrides/posts/_post/like_button.html.erb.deface (folder should mirror main app view path) %>
|
68
68
|
<!-- insert_bottom 'tr' -->
|
69
69
|
<td><%= link_to 'Like!', social_feature.likes_path(like: {post_id: post}), method: :post %></td>
|
70
70
|
```
|
@@ -94,7 +94,7 @@ following commands after you've added a new migration to a feature:
|
|
94
94
|
Create a model with the same name as the one you want to modify by running: `rails g social_feature model User --migration=false` and edit it to inherit from the original:
|
95
95
|
|
96
96
|
```ruby
|
97
|
-
# app/models/social_feature/user.rb
|
97
|
+
# {feature}/app/models/social_feature/user.rb
|
98
98
|
module SocialFeature
|
99
99
|
class User < ::User
|
100
100
|
has_many :likes
|
@@ -114,7 +114,7 @@ Access in your overrides/feature views through the namespaced model:
|
|
114
114
|
Files added to the feature's `app/assets/social_feature/javascripts|stylesheets` directory are automatically injected into the layout using a pre-generated override:
|
115
115
|
|
116
116
|
```erb
|
117
|
-
<% # app/overrides/layouts/application/assets.html.erb.deface %>
|
117
|
+
<% # {feature}/app/overrides/layouts/application/assets.html.erb.deface %>
|
118
118
|
<!-- insert_bottom 'head' -->
|
119
119
|
<%= stylesheet_link_tag 'social_feature/application' %>
|
120
120
|
<%= javascript_include_tag 'social_feature/application' %>
|
data/lib/chili.rb
CHANGED
data/lib/chili/activatable.rb
CHANGED
data/lib/chili/engine.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module Chili
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
-
|
3
|
+
|
4
|
+
initializer "chili.add_autoload_paths", before: :set_autoload_paths do |app|
|
5
|
+
app.config.autoload_paths += Dir["#{app.config.root}/#{FEATURE_FOLDER}/*/lib"]
|
6
|
+
end
|
7
|
+
|
8
|
+
initializer 'chili.deface' do |app|
|
4
9
|
app.config.deface.namespaced = true
|
5
10
|
end
|
6
11
|
|
data/lib/chili/feature.rb
CHANGED
data/lib/chili/version.rb
CHANGED
data/spec/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Running tests
|
2
|
+
|
3
|
+
```bash
|
4
|
+
$ rake app:db:setup
|
5
|
+
$ rake app:db:test:prepare
|
6
|
+
$ rake
|
7
|
+
```
|
8
|
+
|
9
|
+
## Folders
|
10
|
+
|
11
|
+
```bash
|
12
|
+
spec/dummy/app # dummy app for generating chili features inside
|
13
|
+
spec/dummy/blank_feature # blank feature template used to compare output of generators
|
14
|
+
spec/example_app # rails app containing 2 chili features for integration testing
|
15
|
+
spec/generators # generator tests
|
16
|
+
spec/lib # lib unit tests
|
17
|
+
spec/requests # integration tests
|
18
|
+
```
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chili
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: deface
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 1.0.0.rc1
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.0.rc1
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: rspec
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: 2.9.0
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.9.0
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: rspec-rails
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ~>
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: 2.9.0
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.9.0
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: jquery-rails
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: capybara
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: sqlite3
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,7 +117,12 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
description: The spicy feature toggle framework
|
92
127
|
email:
|
93
128
|
- jens@balvig.com
|
@@ -114,6 +149,7 @@ files:
|
|
114
149
|
- lib/generators/chili/feature/USAGE
|
115
150
|
- lib/generators/chili/feature/feature_generator.rb
|
116
151
|
- lib/generators/chili/generator_proxy.rb
|
152
|
+
- spec/README.md
|
117
153
|
- spec/dummy/app/app/controllers/application_controller.rb
|
118
154
|
- spec/dummy/app/config/application.rb
|
119
155
|
- spec/dummy/app/config/boot.rb
|
@@ -244,7 +280,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
244
280
|
version: '0'
|
245
281
|
segments:
|
246
282
|
- 0
|
247
|
-
hash:
|
283
|
+
hash: 1121667919544637223
|
248
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
249
285
|
none: false
|
250
286
|
requirements:
|
@@ -253,14 +289,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
289
|
version: '0'
|
254
290
|
segments:
|
255
291
|
- 0
|
256
|
-
hash:
|
292
|
+
hash: 1121667919544637223
|
257
293
|
requirements: []
|
258
294
|
rubyforge_project:
|
259
|
-
rubygems_version: 1.8.
|
295
|
+
rubygems_version: 1.8.23
|
260
296
|
signing_key:
|
261
297
|
specification_version: 3
|
262
298
|
summary: The spicy feature toggle framework
|
263
299
|
test_files:
|
300
|
+
- spec/README.md
|
264
301
|
- spec/dummy/app/app/controllers/application_controller.rb
|
265
302
|
- spec/dummy/app/config/application.rb
|
266
303
|
- spec/dummy/app/config/boot.rb
|