chili 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/README.md +15 -15
- data/lib/chili/extensions/rails/engine.rb +1 -1
- data/lib/chili/version.rb +1 -1
- data/lib/generators/chili/chili_generator.rb +3 -3
- data/spec/dummy/example/config/application.rb +1 -1
- data/spec/dummy/example/config/boot.rb +1 -1
- data/spec/dummy/example/db/migrate/20120513032032_create_social_ext_likes.rb +11 -0
- data/spec/dummy/example/db/schema.rb +5 -5
- data/spec/dummy/example/vendor/{chili_social/app/assets/images/chili_social → chili/social_ext/app/assets/images/social_ext}/.gitkeep +0 -0
- data/spec/dummy/example/vendor/{chili_social/app/assets/javascripts/chili_social → chili/social_ext/app/assets/javascripts/social_ext}/application.js +0 -0
- data/spec/dummy/example/vendor/{chili_social/app/assets/stylesheets/chili_social → chili/social_ext/app/assets/stylesheets/social_ext}/application.css.scss +0 -0
- data/spec/dummy/example/vendor/chili/social_ext/app/controllers/social_ext/likes_controller.rb +14 -0
- data/spec/dummy/example/vendor/{chili_social/app/models/chili_social → chili/social_ext/app/models/social_ext}/like.rb +1 -1
- data/spec/dummy/example/vendor/{chili_social/app/models/chili_social → chili/social_ext/app/models/social_ext}/post.rb +1 -1
- data/spec/dummy/example/vendor/{chili_social/app/models/chili_social → chili/social_ext/app/models/social_ext}/user.rb +1 -1
- data/spec/dummy/example/vendor/chili/social_ext/app/overrides/layouts/application/assets.html.erb.deface +2 -0
- data/spec/dummy/example/vendor/{chili_social → chili/social_ext}/app/overrides/posts/_post/like_actions.html.erb.deface +1 -1
- data/spec/dummy/example/vendor/{chili_social → chili/social_ext}/app/overrides/posts/index/disclaimer.html.erb.deface +0 -0
- data/spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/index/like_links.html.erb.deface +2 -0
- data/spec/dummy/example/vendor/{chili_social/app/views/chili_social → chili/social_ext/app/views/social_ext}/likes/index.html.erb +0 -0
- data/spec/dummy/example/vendor/chili/social_ext/config/routes.rb +4 -0
- data/spec/dummy/example/vendor/chili/social_ext/db/migrate/20120513031021_create_likes_ext_likes.rb +10 -0
- data/spec/dummy/example/vendor/{chili_social/db/migrate/20120513031021_create_chili_likes_likes.rb → chili/social_ext/db/migrate/20120513031021_create_social_ext_likes.rb} +1 -1
- data/spec/dummy/example/vendor/{chili_social/lib/chili_social.rb → chili/social_ext/lib/social_ext.rb} +2 -2
- data/spec/dummy/example/vendor/{chili_social/lib/chili_social → chili/social_ext/lib/social_ext}/engine.rb +2 -2
- data/spec/dummy/{template → template_ext}/MIT-LICENSE +0 -0
- data/spec/dummy/template_ext/README.rdoc +3 -0
- data/spec/dummy/{template/app/assets/images/chili_template → template_ext/app/assets/images/template_ext}/.gitkeep +0 -0
- data/spec/dummy/{template/app/assets/javascripts/chili_template → template_ext/app/assets/javascripts/template_ext}/application.js +0 -0
- data/spec/dummy/{template/app/assets/stylesheets/chili_template → template_ext/app/assets/stylesheets/template_ext}/application.css +0 -0
- data/spec/dummy/template_ext/app/overrides/layouts/application/assets.html.erb.deface +3 -0
- data/spec/dummy/{template → template_ext}/app/overrides/layouts/application/example.html.erb.deface +2 -2
- data/spec/dummy/template_ext/config/routes.rb +3 -0
- data/spec/dummy/{template/lib/tasks/chili_template_tasks.rake → template_ext/lib/tasks/template_ext_tasks.rake} +1 -1
- data/spec/dummy/{template/lib/chili_template.rb → template_ext/lib/template_ext.rb} +2 -2
- data/spec/dummy/{template/lib/chili_template → template_ext/lib/template_ext}/engine.rb +2 -2
- data/spec/dummy/{template/lib/chili_template → template_ext/lib/template_ext}/version.rb +1 -1
- data/spec/dummy/{template → template_ext}/script/rails +1 -1
- data/spec/dummy/{template/chili_template.gemspec → template_ext/template_ext.gemspec} +7 -7
- data/spec/generators/chili/chili_generator_spec.rb +5 -5
- data/spec/requests/{chili_social_spec.rb → social_ext_spec.rb} +2 -2
- metadata +85 -118
- data/spec/dummy/example/db/migrate/20120513032032_create_chili_social_likes.chili_likes.rb +0 -11
- data/spec/dummy/example/vendor/chili_social/app/controllers/chili_social/likes_controller.rb +0 -14
- data/spec/dummy/example/vendor/chili_social/app/overrides/layouts/application/stylesheets.html.erb.deface +0 -2
- data/spec/dummy/example/vendor/chili_social/app/overrides/posts/index/like_links.html.erb.deface +0 -2
- data/spec/dummy/example/vendor/chili_social/config/routes.rb +0 -4
- data/spec/dummy/template/README.rdoc +0 -3
- data/spec/dummy/template/app/overrides/layouts/application/assets.html.erb.deface +0 -3
- data/spec/dummy/template/config/routes.rb +0 -3
data/.gitignore
CHANGED
@@ -16,7 +16,7 @@ spec/dummy/example/db/*.sqlite3
|
|
16
16
|
spec/dummy/example/log/*.log
|
17
17
|
spec/dummy/example/tmp/
|
18
18
|
spec/dummy/example/.sass-cache
|
19
|
-
spec/dummy/example/vendor/
|
19
|
+
spec/dummy/example/vendor/chili/template_ext
|
20
20
|
spec/dummy/example/Gemfile
|
21
21
|
tmp
|
22
22
|
.DS_Store
|
data/README.md
CHANGED
@@ -23,14 +23,14 @@ Chili extensions are like mini apps that are created inside your main app's vend
|
|
23
23
|
|
24
24
|
### Creating a new chili extension
|
25
25
|
|
26
|
-
As an example, assuming you want to add a new extension named "social" that exposes a new
|
26
|
+
As an example, assuming you want to add a new extension named "social" that exposes a new feature in the form of a like-button
|
27
27
|
to a subset of users, first within your main app run:
|
28
28
|
|
29
29
|
$ rails g chili social
|
30
30
|
|
31
31
|
This is basically a shortcut for running the `rails plugin new` engine generator with a custom template and will:
|
32
32
|
|
33
|
-
1. Create a the directory `vendor/
|
33
|
+
1. Create a the directory `vendor/chili/social_ext` containing the basic structure for the extension
|
34
34
|
2. Add a reference to the extension to the main app gemfile
|
35
35
|
|
36
36
|
Since the extension is mounted as a gem you'll have to run `bundle`
|
@@ -42,8 +42,8 @@ Use the active_if block to control whether new controllers/overrides are visible
|
|
42
42
|
The context of the active_if block is the application controller so you can use any methods available to that.
|
43
43
|
|
44
44
|
```ruby
|
45
|
-
# lib/
|
46
|
-
module
|
45
|
+
# lib/social_ext.rb
|
46
|
+
module SocialExt
|
47
47
|
extend Chili::Activatable
|
48
48
|
active_if { logged_in? && current_user.admin? } # Extension is only visible to logged in admin users
|
49
49
|
end
|
@@ -58,13 +58,13 @@ For example, assuming the main app has the partial `app/views/posts/_post.html.e
|
|
58
58
|
```erb
|
59
59
|
<% # app/overrides/posts/_post/like_button.html.erb.deface (folder should mirror main app view path) %>
|
60
60
|
<!-- insert_bottom 'tr' -->
|
61
|
-
<td><%= link_to 'Like!',
|
61
|
+
<td><%= link_to 'Like!', social_ext.likes_path(like: {post_id: post}), method: :post %></td>
|
62
62
|
```
|
63
63
|
|
64
64
|
### Adding new resources
|
65
65
|
|
66
|
-
Go to the extension's directory and use `rails g scaffold Like`. The new resource will be namespaced to
|
67
|
-
and automounted in the main app at `/chili/
|
66
|
+
Go to the extension's directory and use `rails g scaffold Like`. The new resource will be namespaced to SocialExt::Like
|
67
|
+
and automounted in the main app at `/chili/social_ext/likes`, but only accessible when active_if is true.
|
68
68
|
All the rules for using [isolated engine models](http://railscasts.com/episodes/277-mountable-engines?view=asciicast) apply.
|
69
69
|
|
70
70
|
### Migrations
|
@@ -72,7 +72,7 @@ All the rules for using [isolated engine models](http://railscasts.com/episodes/
|
|
72
72
|
Migrations are handled the same way as engines. Use the
|
73
73
|
following commands after you've added a new migration to your extension:
|
74
74
|
|
75
|
-
$ rake
|
75
|
+
$ rake social_ext:migrations:install
|
76
76
|
$ rake db:migrate
|
77
77
|
|
78
78
|
### Modifying existing models
|
@@ -81,8 +81,8 @@ Create a model with the same name as the one you want to modify by running: `rai
|
|
81
81
|
and edit it to inherit from the original:
|
82
82
|
|
83
83
|
```ruby
|
84
|
-
# app/models/
|
85
|
-
module
|
84
|
+
# app/models/social_ext/user.rb
|
85
|
+
module SocialExt
|
86
86
|
class User < ::User
|
87
87
|
has_many :likes
|
88
88
|
end
|
@@ -92,19 +92,19 @@ end
|
|
92
92
|
Access in your overrides/extension views through the namespaced model:
|
93
93
|
|
94
94
|
```erb
|
95
|
-
<%=
|
96
|
-
<%= current_user.becomes(
|
95
|
+
<%= SocialExt::User.first.likes %>
|
96
|
+
<%= current_user.becomes(SocialExt::User).likes %>
|
97
97
|
```
|
98
98
|
|
99
99
|
### Stylesheets/javascripts
|
100
100
|
|
101
|
-
Files added to the extension's `app/assets/
|
101
|
+
Files added to the extension's `app/assets/social_ext/javascripts|stylesheets` directory are automatically injected into the layout using a pre-generated override:
|
102
102
|
|
103
103
|
```erb
|
104
104
|
<% # app/overrides/layouts/application/assets.html.erb.deface %>
|
105
105
|
<!-- insert_bottom 'head' -->
|
106
|
-
<%= stylesheet_link_tag '
|
107
|
-
<%= javascript_include_tag '
|
106
|
+
<%= stylesheet_link_tag 'social_ext/application' %>
|
107
|
+
<%= javascript_include_tag 'social_ext/application' %>
|
108
108
|
```
|
109
109
|
|
110
110
|
If you don't need any css/js in your extension, you can remove this file.
|
data/lib/chili/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class ChiliGenerator < Rails::Generators::NamedBase
|
2
|
-
NAME = "
|
3
|
-
PATH = "vendor/#{NAME}"
|
2
|
+
NAME = "#{ARGV[0]}_ext"
|
3
|
+
PATH = "vendor/chili/#{NAME}"
|
4
4
|
|
5
5
|
def run_plugin_generator
|
6
6
|
ARGV[0] = PATH
|
@@ -27,7 +27,7 @@ class ChiliGenerator < Rails::Generators::NamedBase
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def add_gem_to_main_gemfile
|
30
|
-
append_to_file "
|
30
|
+
append_to_file "../../../Gemfile", "gem '#{NAME}', path: '#{PATH}'"
|
31
31
|
end
|
32
32
|
|
33
33
|
def remove_unused_files
|
@@ -13,15 +13,15 @@
|
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(:version => 20120513032032) do
|
15
15
|
|
16
|
-
create_table "
|
17
|
-
t.
|
18
|
-
t.integer "user_id"
|
16
|
+
create_table "posts", :force => true do |t|
|
17
|
+
t.string "title"
|
19
18
|
t.datetime "created_at", :null => false
|
20
19
|
t.datetime "updated_at", :null => false
|
21
20
|
end
|
22
21
|
|
23
|
-
create_table "
|
24
|
-
t.
|
22
|
+
create_table "social_ext_likes", :force => true do |t|
|
23
|
+
t.integer "post_id"
|
24
|
+
t.integer "user_id"
|
25
25
|
t.datetime "created_at", :null => false
|
26
26
|
t.datetime "updated_at", :null => false
|
27
27
|
end
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/example/vendor/chili/social_ext/app/controllers/social_ext/likes_controller.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module SocialExt
|
2
|
+
class LikesController < Chili::ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
@likes = current_user.becomes(SocialExt::User).likes
|
6
|
+
end
|
7
|
+
|
8
|
+
def create
|
9
|
+
@like = current_user.becomes(SocialExt::User).likes.create!(params[:like])
|
10
|
+
redirect_to :back, notice: 'Post liked!'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<!-- insert_bottom 'tr' -->
|
2
|
-
<% post.becomes(
|
2
|
+
<% post.becomes(SocialExt::Post).tap do |post| %>
|
3
3
|
<td><%= link_to 'Like!', chili_social.likes_path(like: {post_id: post}), method: :post %></td>
|
4
4
|
<td><%= pluralize post.likes.size, 'like' %></td>
|
5
5
|
<td><%= post.well_liked? ? 'This post is well liked!' : 'This post is boring...' %></td>
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module SocialExt
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
-
isolate_namespace
|
3
|
+
isolate_namespace SocialExt
|
4
4
|
config.generators do |g|
|
5
5
|
g.scaffold_controller :chili
|
6
6
|
g.test_framework :rspec, view_specs: false, routing_specs: false, controller_specs: false
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/{template → template_ext}/app/overrides/layouts/application/example.html.erb.deface
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
<!-- insert_bottom 'body' -->
|
2
2
|
<div style='background: #FFF;text-align: center; padding: 4px 0;position: fixed;width: 100%;z-index: 9999;top: 0;'>
|
3
|
-
|
4
|
-
<strong>vendor/
|
3
|
+
template_ext active - edit/remove this file:<br/>
|
4
|
+
<strong>vendor/chili/template_ext/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
|
5
5
|
<%= link_to 'deface docs', 'https://github.com/railsdog/deface', target: '_blank' %>
|
6
6
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module TemplateExt
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
-
isolate_namespace
|
3
|
+
isolate_namespace TemplateExt
|
4
4
|
config.generators do |g|
|
5
5
|
g.scaffold_controller :chili
|
6
6
|
g.test_framework :rspec, view_specs: false, routing_specs: false, controller_specs: false
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
3
|
|
4
4
|
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
-
ENGINE_PATH = File.expand_path('../../lib/
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/template_ext/engine', __FILE__)
|
6
6
|
|
7
7
|
require 'rails/all'
|
8
8
|
require 'rails/engine/commands'
|
@@ -1,22 +1,22 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
2
|
|
3
3
|
# Maintain your gem's version:
|
4
|
-
require "
|
4
|
+
require "template_ext/version"
|
5
5
|
|
6
6
|
# Describe your gem and declare its dependencies:
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "
|
9
|
-
s.version =
|
8
|
+
s.name = "template_ext"
|
9
|
+
s.version = TemplateExt::VERSION
|
10
10
|
s.authors = ["GIT_AUTHOR"]
|
11
11
|
s.email = ["GIT_EMAIL"]
|
12
12
|
s.homepage = ""
|
13
|
-
s.summary = "Summary of
|
14
|
-
s.description = "Description of
|
13
|
+
s.summary = "Summary of TemplateExt."
|
14
|
+
s.description = "Description of TemplateExt."
|
15
15
|
|
16
16
|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
|
17
17
|
|
18
|
-
s.add_dependency "rails", "~> 3.2.
|
19
|
-
s.add_dependency 'chili', '~> 0.3.
|
18
|
+
s.add_dependency "rails", "~> 3.2.6"
|
19
|
+
s.add_dependency 'chili', '~> 0.3.1'
|
20
20
|
|
21
21
|
s.add_development_dependency "sqlite3"
|
22
22
|
end
|
@@ -3,10 +3,10 @@ require 'spec_helper'
|
|
3
3
|
describe 'ChiliGenerator' do
|
4
4
|
describe 'rails g chili EXTENSION_NAME' do
|
5
5
|
let(:app_path) { File.expand_path("../../../dummy/example", __FILE__) }
|
6
|
-
let(:template_path) { File.expand_path("../../../dummy/
|
6
|
+
let(:template_path) { File.expand_path("../../../dummy/template_ext", __FILE__) }
|
7
7
|
|
8
8
|
before do
|
9
|
-
FileUtils.rm_rf File.join(app_path, 'vendor/
|
9
|
+
FileUtils.rm_rf File.join(app_path, 'vendor/chili/template_ext')
|
10
10
|
FileUtils.rm_rf File.join(app_path, 'Gemfile')
|
11
11
|
FileUtils.touch File.join(app_path, 'Gemfile')
|
12
12
|
end
|
@@ -15,11 +15,11 @@ describe 'ChiliGenerator' do
|
|
15
15
|
puts `cd #{app_path} && rails g chili template`
|
16
16
|
|
17
17
|
Dir.glob(File.join(template_path, "**/*")).reject { |f| File.directory?(f) }.each do |template|
|
18
|
-
result = File.join(app_path, 'vendor/
|
18
|
+
result = File.join(app_path, 'vendor/chili/template_ext', template.sub(template_path, ''))
|
19
19
|
result_text = File.open(result, 'rb').read
|
20
20
|
template_text = File.open(template, 'rb').read
|
21
|
-
template_text.sub!('GIT_AUTHOR',`git config user.name`.chomp) # Git author is
|
22
|
-
template_text.sub!('GIT_EMAIL',`git config user.email`.chomp) # Git email is
|
21
|
+
template_text.sub!('GIT_AUTHOR',`git config user.name`.chomp) # Git author is different on each machine
|
22
|
+
template_text.sub!('GIT_EMAIL',`git config user.email`.chomp) # Git email is different on each machine
|
23
23
|
result_text.should == template_text
|
24
24
|
end
|
25
25
|
end
|
@@ -18,12 +18,12 @@ end
|
|
18
18
|
feature 'Togglable controllers' do
|
19
19
|
scenario 'when user is not admin active_if hides engine controller' do
|
20
20
|
User.create!
|
21
|
-
expect { visit('/chili/
|
21
|
+
expect { visit('/chili/social_ext/likes') }.to raise_error(ActionController::RoutingError)
|
22
22
|
end
|
23
23
|
|
24
24
|
scenario 'when admin active_if toggles overrides on' do
|
25
25
|
User.create!(admin: true)
|
26
|
-
visit('/chili/
|
26
|
+
visit('/chili/social_ext/likes')
|
27
27
|
page.should have_content('Your Likes')
|
28
28
|
end
|
29
29
|
end
|
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: 0.3.
|
4
|
+
version: 0.3.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-
|
12
|
+
date: 2012-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70140538496960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.2'
|
24
|
+
version_requirements: *70140538496960
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: deface
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70140538496460 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ~>
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: 0.9.1
|
38
33
|
type: :runtime
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 0.9.1
|
35
|
+
version_requirements: *70140538496460
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: rspec
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70140538495960 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ~>
|
@@ -53,15 +43,10 @@ dependencies:
|
|
53
43
|
version: 2.9.0
|
54
44
|
type: :development
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.9.0
|
46
|
+
version_requirements: *70140538495960
|
62
47
|
- !ruby/object:Gem::Dependency
|
63
48
|
name: rspec-rails
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirement: &70140538495460 !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
51
|
requirements:
|
67
52
|
- - ~>
|
@@ -69,15 +54,10 @@ dependencies:
|
|
69
54
|
version: 2.9.0
|
70
55
|
type: :development
|
71
56
|
prerelease: false
|
72
|
-
version_requirements:
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 2.9.0
|
57
|
+
version_requirements: *70140538495460
|
78
58
|
- !ruby/object:Gem::Dependency
|
79
59
|
name: jquery-rails
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirement: &70140538495060 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
62
|
requirements:
|
83
63
|
- - ! '>='
|
@@ -85,15 +65,10 @@ dependencies:
|
|
85
65
|
version: '0'
|
86
66
|
type: :development
|
87
67
|
prerelease: false
|
88
|
-
version_requirements:
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
68
|
+
version_requirements: *70140538495060
|
94
69
|
- !ruby/object:Gem::Dependency
|
95
70
|
name: capybara
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirement: &70140538494580 !ruby/object:Gem::Requirement
|
97
72
|
none: false
|
98
73
|
requirements:
|
99
74
|
- - ! '>='
|
@@ -101,15 +76,10 @@ dependencies:
|
|
101
76
|
version: '0'
|
102
77
|
type: :development
|
103
78
|
prerelease: false
|
104
|
-
version_requirements:
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
79
|
+
version_requirements: *70140538494580
|
110
80
|
- !ruby/object:Gem::Dependency
|
111
81
|
name: sqlite3
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
82
|
+
requirement: &70140538494120 !ruby/object:Gem::Requirement
|
113
83
|
none: false
|
114
84
|
requirements:
|
115
85
|
- - ! '>='
|
@@ -117,12 +87,7 @@ dependencies:
|
|
117
87
|
version: '0'
|
118
88
|
type: :development
|
119
89
|
prerelease: false
|
120
|
-
version_requirements:
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
90
|
+
version_requirements: *70140538494120
|
126
91
|
description: The spicy extension framework
|
127
92
|
email:
|
128
93
|
- jens@balvig.com
|
@@ -195,7 +160,7 @@ files:
|
|
195
160
|
- spec/dummy/example/config/routes.rb
|
196
161
|
- spec/dummy/example/db/migrate/20120513023816_create_posts.rb
|
197
162
|
- spec/dummy/example/db/migrate/20120513023840_create_users.rb
|
198
|
-
- spec/dummy/example/db/migrate/
|
163
|
+
- spec/dummy/example/db/migrate/20120513032032_create_social_ext_likes.rb
|
199
164
|
- spec/dummy/example/db/schema.rb
|
200
165
|
- spec/dummy/example/lib/assets/.gitkeep
|
201
166
|
- spec/dummy/example/log/.gitkeep
|
@@ -204,39 +169,40 @@ files:
|
|
204
169
|
- spec/dummy/example/public/500.html
|
205
170
|
- spec/dummy/example/public/favicon.ico
|
206
171
|
- spec/dummy/example/script/rails
|
207
|
-
- spec/dummy/example/vendor/
|
208
|
-
- spec/dummy/example/vendor/
|
209
|
-
- spec/dummy/example/vendor/
|
210
|
-
- spec/dummy/example/vendor/
|
211
|
-
- spec/dummy/example/vendor/
|
212
|
-
- spec/dummy/example/vendor/
|
213
|
-
- spec/dummy/example/vendor/
|
214
|
-
- spec/dummy/example/vendor/
|
215
|
-
- spec/dummy/example/vendor/
|
216
|
-
- spec/dummy/example/vendor/
|
217
|
-
- spec/dummy/example/vendor/
|
218
|
-
- spec/dummy/example/vendor/
|
219
|
-
- spec/dummy/example/vendor/
|
220
|
-
- spec/dummy/example/vendor/
|
221
|
-
- spec/dummy/example/vendor/
|
222
|
-
- spec/dummy/example/vendor/
|
223
|
-
- spec/dummy/
|
224
|
-
- spec/dummy/
|
225
|
-
- spec/dummy/
|
226
|
-
- spec/dummy/
|
227
|
-
- spec/dummy/
|
228
|
-
- spec/dummy/
|
229
|
-
- spec/dummy/
|
230
|
-
- spec/dummy/
|
231
|
-
- spec/dummy/
|
232
|
-
- spec/dummy/
|
233
|
-
- spec/dummy/
|
234
|
-
- spec/dummy/
|
235
|
-
- spec/dummy/
|
236
|
-
- spec/dummy/
|
172
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/images/social_ext/.gitkeep
|
173
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/javascripts/social_ext/application.js
|
174
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/stylesheets/social_ext/application.css.scss
|
175
|
+
- spec/dummy/example/vendor/chili/social_ext/app/controllers/social_ext/likes_controller.rb
|
176
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/like.rb
|
177
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/post.rb
|
178
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/user.rb
|
179
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/layouts/application/assets.html.erb.deface
|
180
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/_post/like_actions.html.erb.deface
|
181
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/index/disclaimer.html.erb.deface
|
182
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/index/like_links.html.erb.deface
|
183
|
+
- spec/dummy/example/vendor/chili/social_ext/app/views/social_ext/likes/index.html.erb
|
184
|
+
- spec/dummy/example/vendor/chili/social_ext/config/routes.rb
|
185
|
+
- spec/dummy/example/vendor/chili/social_ext/db/migrate/20120513031021_create_likes_ext_likes.rb
|
186
|
+
- spec/dummy/example/vendor/chili/social_ext/db/migrate/20120513031021_create_social_ext_likes.rb
|
187
|
+
- spec/dummy/example/vendor/chili/social_ext/lib/social_ext.rb
|
188
|
+
- spec/dummy/example/vendor/chili/social_ext/lib/social_ext/engine.rb
|
189
|
+
- spec/dummy/template_ext/MIT-LICENSE
|
190
|
+
- spec/dummy/template_ext/README.rdoc
|
191
|
+
- spec/dummy/template_ext/app/assets/images/template_ext/.gitkeep
|
192
|
+
- spec/dummy/template_ext/app/assets/javascripts/template_ext/application.js
|
193
|
+
- spec/dummy/template_ext/app/assets/stylesheets/template_ext/application.css
|
194
|
+
- spec/dummy/template_ext/app/overrides/layouts/application/assets.html.erb.deface
|
195
|
+
- spec/dummy/template_ext/app/overrides/layouts/application/example.html.erb.deface
|
196
|
+
- spec/dummy/template_ext/config/routes.rb
|
197
|
+
- spec/dummy/template_ext/lib/tasks/template_ext_tasks.rake
|
198
|
+
- spec/dummy/template_ext/lib/template_ext.rb
|
199
|
+
- spec/dummy/template_ext/lib/template_ext/engine.rb
|
200
|
+
- spec/dummy/template_ext/lib/template_ext/version.rb
|
201
|
+
- spec/dummy/template_ext/script/rails
|
202
|
+
- spec/dummy/template_ext/template_ext.gemspec
|
237
203
|
- spec/generators/chili/chili_generator_spec.rb
|
238
204
|
- spec/lib/chili/activatable_spec.rb
|
239
|
-
- spec/requests/
|
205
|
+
- spec/requests/social_ext_spec.rb
|
240
206
|
- spec/spec_helper.rb
|
241
207
|
homepage: https://github.com/balvig/chili
|
242
208
|
licenses: []
|
@@ -252,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
252
218
|
version: '0'
|
253
219
|
segments:
|
254
220
|
- 0
|
255
|
-
hash: -
|
221
|
+
hash: -2004242061848083253
|
256
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
223
|
none: false
|
258
224
|
requirements:
|
@@ -261,10 +227,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
227
|
version: '0'
|
262
228
|
segments:
|
263
229
|
- 0
|
264
|
-
hash: -
|
230
|
+
hash: -2004242061848083253
|
265
231
|
requirements: []
|
266
232
|
rubyforge_project:
|
267
|
-
rubygems_version: 1.8.
|
233
|
+
rubygems_version: 1.8.11
|
268
234
|
signing_key:
|
269
235
|
specification_version: 3
|
270
236
|
summary: The spicy extension framework
|
@@ -316,7 +282,7 @@ test_files:
|
|
316
282
|
- spec/dummy/example/config/routes.rb
|
317
283
|
- spec/dummy/example/db/migrate/20120513023816_create_posts.rb
|
318
284
|
- spec/dummy/example/db/migrate/20120513023840_create_users.rb
|
319
|
-
- spec/dummy/example/db/migrate/
|
285
|
+
- spec/dummy/example/db/migrate/20120513032032_create_social_ext_likes.rb
|
320
286
|
- spec/dummy/example/db/schema.rb
|
321
287
|
- spec/dummy/example/lib/assets/.gitkeep
|
322
288
|
- spec/dummy/example/log/.gitkeep
|
@@ -325,37 +291,38 @@ test_files:
|
|
325
291
|
- spec/dummy/example/public/500.html
|
326
292
|
- spec/dummy/example/public/favicon.ico
|
327
293
|
- spec/dummy/example/script/rails
|
328
|
-
- spec/dummy/example/vendor/
|
329
|
-
- spec/dummy/example/vendor/
|
330
|
-
- spec/dummy/example/vendor/
|
331
|
-
- spec/dummy/example/vendor/
|
332
|
-
- spec/dummy/example/vendor/
|
333
|
-
- spec/dummy/example/vendor/
|
334
|
-
- spec/dummy/example/vendor/
|
335
|
-
- spec/dummy/example/vendor/
|
336
|
-
- spec/dummy/example/vendor/
|
337
|
-
- spec/dummy/example/vendor/
|
338
|
-
- spec/dummy/example/vendor/
|
339
|
-
- spec/dummy/example/vendor/
|
340
|
-
- spec/dummy/example/vendor/
|
341
|
-
- spec/dummy/example/vendor/
|
342
|
-
- spec/dummy/example/vendor/
|
343
|
-
- spec/dummy/example/vendor/
|
344
|
-
- spec/dummy/
|
345
|
-
- spec/dummy/
|
346
|
-
- spec/dummy/
|
347
|
-
- spec/dummy/
|
348
|
-
- spec/dummy/
|
349
|
-
- spec/dummy/
|
350
|
-
- spec/dummy/
|
351
|
-
- spec/dummy/
|
352
|
-
- spec/dummy/
|
353
|
-
- spec/dummy/
|
354
|
-
- spec/dummy/
|
355
|
-
- spec/dummy/
|
356
|
-
- spec/dummy/
|
357
|
-
- spec/dummy/
|
294
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/images/social_ext/.gitkeep
|
295
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/javascripts/social_ext/application.js
|
296
|
+
- spec/dummy/example/vendor/chili/social_ext/app/assets/stylesheets/social_ext/application.css.scss
|
297
|
+
- spec/dummy/example/vendor/chili/social_ext/app/controllers/social_ext/likes_controller.rb
|
298
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/like.rb
|
299
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/post.rb
|
300
|
+
- spec/dummy/example/vendor/chili/social_ext/app/models/social_ext/user.rb
|
301
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/layouts/application/assets.html.erb.deface
|
302
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/_post/like_actions.html.erb.deface
|
303
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/index/disclaimer.html.erb.deface
|
304
|
+
- spec/dummy/example/vendor/chili/social_ext/app/overrides/posts/index/like_links.html.erb.deface
|
305
|
+
- spec/dummy/example/vendor/chili/social_ext/app/views/social_ext/likes/index.html.erb
|
306
|
+
- spec/dummy/example/vendor/chili/social_ext/config/routes.rb
|
307
|
+
- spec/dummy/example/vendor/chili/social_ext/db/migrate/20120513031021_create_likes_ext_likes.rb
|
308
|
+
- spec/dummy/example/vendor/chili/social_ext/db/migrate/20120513031021_create_social_ext_likes.rb
|
309
|
+
- spec/dummy/example/vendor/chili/social_ext/lib/social_ext.rb
|
310
|
+
- spec/dummy/example/vendor/chili/social_ext/lib/social_ext/engine.rb
|
311
|
+
- spec/dummy/template_ext/MIT-LICENSE
|
312
|
+
- spec/dummy/template_ext/README.rdoc
|
313
|
+
- spec/dummy/template_ext/app/assets/images/template_ext/.gitkeep
|
314
|
+
- spec/dummy/template_ext/app/assets/javascripts/template_ext/application.js
|
315
|
+
- spec/dummy/template_ext/app/assets/stylesheets/template_ext/application.css
|
316
|
+
- spec/dummy/template_ext/app/overrides/layouts/application/assets.html.erb.deface
|
317
|
+
- spec/dummy/template_ext/app/overrides/layouts/application/example.html.erb.deface
|
318
|
+
- spec/dummy/template_ext/config/routes.rb
|
319
|
+
- spec/dummy/template_ext/lib/tasks/template_ext_tasks.rake
|
320
|
+
- spec/dummy/template_ext/lib/template_ext.rb
|
321
|
+
- spec/dummy/template_ext/lib/template_ext/engine.rb
|
322
|
+
- spec/dummy/template_ext/lib/template_ext/version.rb
|
323
|
+
- spec/dummy/template_ext/script/rails
|
324
|
+
- spec/dummy/template_ext/template_ext.gemspec
|
358
325
|
- spec/generators/chili/chili_generator_spec.rb
|
359
326
|
- spec/lib/chili/activatable_spec.rb
|
360
|
-
- spec/requests/
|
327
|
+
- spec/requests/social_ext_spec.rb
|
361
328
|
- spec/spec_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# This migration comes from chili_social (originally 20120513031021)
|
2
|
-
class CreateChiliSocialLikes < ActiveRecord::Migration
|
3
|
-
def change
|
4
|
-
create_table :chili_social_likes do |t|
|
5
|
-
t.integer :post_id
|
6
|
-
t.integer :user_id
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
data/spec/dummy/example/vendor/chili_social/app/controllers/chili_social/likes_controller.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
module ChiliSocial
|
2
|
-
class LikesController < Chili::ApplicationController
|
3
|
-
|
4
|
-
def index
|
5
|
-
@likes = current_user.becomes(ChiliSocial::User).likes
|
6
|
-
end
|
7
|
-
|
8
|
-
def create
|
9
|
-
@like = current_user.becomes(ChiliSocial::User).likes.create!(params[:like])
|
10
|
-
redirect_to :back, notice: 'Post liked!'
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|