chili 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. data/.gitignore +7 -7
  2. data/README.md +33 -28
  3. data/Rakefile +1 -1
  4. data/app/controllers/chili/application_controller.rb +3 -3
  5. data/chili.gemspec +3 -3
  6. data/lib/chili.rb +5 -3
  7. data/lib/chili/feature.rb +15 -0
  8. data/lib/chili/version.rb +1 -1
  9. data/lib/generators/chili/feature/USAGE +8 -0
  10. data/lib/generators/chili/{extension_generator.rb → feature/feature_generator.rb} +36 -37
  11. data/lib/generators/chili/generator_proxy.rb +20 -0
  12. data/spec/dummy/app/app/controllers/application_controller.rb +3 -0
  13. data/spec/dummy/app/config/application.rb +14 -0
  14. data/spec/dummy/{example_app → app}/config/boot.rb +1 -2
  15. data/spec/dummy/{example_app → app}/config/database.yml +0 -0
  16. data/spec/dummy/{example_app → app}/config/environment.rb +0 -0
  17. data/spec/dummy/{example_app → app}/config/environments/development.rb +0 -0
  18. data/spec/dummy/{example_app → app}/config/environments/test.rb +0 -0
  19. data/spec/dummy/{example_app → app}/script/rails +0 -0
  20. data/spec/dummy/{blank_extension → blank_feature}/MIT-LICENSE +0 -0
  21. data/spec/dummy/blank_feature/README.rdoc +3 -0
  22. data/spec/dummy/{blank_extension/app/assets/images/blank_extension → blank_feature/app/assets/images/blank_feature}/.gitkeep +0 -0
  23. data/spec/dummy/{blank_extension/app/assets/javascripts/blank_extension → blank_feature/app/assets/javascripts/blank_feature}/application.js +0 -0
  24. data/spec/dummy/{blank_extension/app/assets/stylesheets/blank_extension → blank_feature/app/assets/stylesheets/blank_feature}/application.css +0 -0
  25. data/spec/dummy/blank_feature/app/controllers/blank_feature/application_controller.rb +4 -0
  26. data/spec/dummy/blank_feature/app/overrides/layouts/application/assets.html.erb.deface +3 -0
  27. data/spec/dummy/{blank_extension → blank_feature}/app/overrides/layouts/application/example.html.erb.deface +2 -2
  28. data/spec/dummy/{blank_extension/blank_extension.gemspec → blank_feature/blank_feature.gemspec} +6 -6
  29. data/spec/dummy/blank_feature/config/routes.rb +3 -0
  30. data/spec/dummy/blank_feature/lib/blank_feature.rb +7 -0
  31. data/spec/dummy/blank_feature/lib/blank_feature/engine.rb +5 -0
  32. data/spec/dummy/{blank_extension/lib/blank_extension → blank_feature/lib/blank_feature}/version.rb +1 -1
  33. data/spec/dummy/blank_feature/lib/generators/blank_feature_generator.rb +3 -0
  34. data/spec/dummy/{blank_extension/lib/tasks/blank_extension_tasks.rake → blank_feature/lib/tasks/blank_feature_tasks.rake} +1 -1
  35. data/spec/{dummy/example_app → example_app}/README.rdoc +0 -0
  36. data/spec/{dummy/example_app → example_app}/Rakefile +0 -0
  37. data/spec/{dummy/example_app → example_app}/app/assets/javascripts/application.js +0 -0
  38. data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/application.css +0 -0
  39. data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/posts.css +0 -0
  40. data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/scaffold.css +0 -0
  41. data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/users.css +0 -0
  42. data/spec/{dummy/example_app → example_app}/app/controllers/application_controller.rb +0 -0
  43. data/spec/{dummy/example_app → example_app}/app/controllers/posts_controller.rb +0 -0
  44. data/spec/{dummy/example_app → example_app}/app/controllers/sessions_controller.rb +0 -0
  45. data/spec/{dummy/example_app → example_app}/app/controllers/users_controller.rb +0 -0
  46. data/spec/{dummy/example_app → example_app}/app/helpers/application_helper.rb +0 -0
  47. data/spec/{dummy/example_app → example_app}/app/helpers/posts_helper.rb +0 -0
  48. data/spec/{dummy/example_app → example_app}/app/helpers/users_helper.rb +0 -0
  49. data/spec/{dummy/example_app → example_app}/app/mailers/.gitkeep +0 -0
  50. data/spec/{dummy/example_app → example_app}/app/models/.gitkeep +0 -0
  51. data/spec/{dummy/example_app → example_app}/app/models/post.rb +0 -0
  52. data/spec/{dummy/example_app → example_app}/app/models/user.rb +0 -0
  53. data/spec/{dummy/example_app → example_app}/app/views/layouts/application.html.erb +0 -0
  54. data/spec/{dummy/example_app → example_app}/app/views/posts/_form.html.erb +0 -0
  55. data/spec/{dummy/example_app → example_app}/app/views/posts/_post.html.erb +0 -0
  56. data/spec/{dummy/example_app → example_app}/app/views/posts/edit.html.erb +0 -0
  57. data/spec/{dummy/example_app → example_app}/app/views/posts/index.html.erb +0 -0
  58. data/spec/{dummy/example_app → example_app}/app/views/posts/new.html.erb +0 -0
  59. data/spec/{dummy/example_app → example_app}/app/views/posts/show.html.erb +0 -0
  60. data/spec/{dummy/example_app → example_app}/app/views/sessions/new.html.erb +0 -0
  61. data/spec/{dummy/example_app → example_app}/app/views/users/_form.html.erb +0 -0
  62. data/spec/{dummy/example_app → example_app}/app/views/users/edit.html.erb +0 -0
  63. data/spec/{dummy/example_app → example_app}/app/views/users/index.html.erb +0 -0
  64. data/spec/{dummy/example_app → example_app}/app/views/users/new.html.erb +0 -0
  65. data/spec/{dummy/example_app → example_app}/app/views/users/show.html.erb +0 -0
  66. data/spec/{dummy/example_app → example_app}/config.ru +0 -0
  67. data/spec/{dummy/example_app → example_app}/config/application.rb +2 -2
  68. data/spec/example_app/config/boot.rb +12 -0
  69. data/spec/example_app/config/database.yml +25 -0
  70. data/spec/example_app/config/environment.rb +5 -0
  71. data/spec/example_app/config/environments/development.rb +37 -0
  72. data/spec/{dummy/example_app → example_app}/config/environments/production.rb +0 -0
  73. data/spec/example_app/config/environments/test.rb +37 -0
  74. data/spec/{dummy/example_app → example_app}/config/initializers/backtrace_silencers.rb +0 -0
  75. data/spec/{dummy/example_app → example_app}/config/initializers/inflections.rb +0 -0
  76. data/spec/{dummy/example_app → example_app}/config/initializers/mime_types.rb +0 -0
  77. data/spec/{dummy/example_app → example_app}/config/initializers/secret_token.rb +0 -0
  78. data/spec/{dummy/example_app → example_app}/config/initializers/session_store.rb +0 -0
  79. data/spec/{dummy/example_app → example_app}/config/initializers/wrap_parameters.rb +0 -0
  80. data/spec/{dummy/example_app → example_app}/config/locales/en.yml +0 -0
  81. data/spec/{dummy/example_app → example_app}/config/routes.rb +0 -0
  82. data/spec/{dummy/example_app → example_app}/db/migrate/20120513023816_create_posts.rb +0 -0
  83. data/spec/{dummy/example_app → example_app}/db/migrate/20120513023840_create_users.rb +0 -0
  84. data/spec/example_app/db/migrate/20120513032032_create_social_feature_likes.rb +11 -0
  85. data/spec/{dummy/example_app → example_app}/db/schema.rb +1 -1
  86. data/spec/{dummy/example_app → example_app}/lib/assets/.gitkeep +0 -0
  87. data/spec/{dummy/example_app/vendor/chili/invites_extension → example_app/lib/chili/invites_feature}/.gitignore +0 -0
  88. data/spec/{dummy/example_app/log → example_app/lib/chili/invites_feature/app/assets/images/invites_feature}/.gitkeep +0 -0
  89. data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/javascripts/invites_extension → example_app/lib/chili/invites_feature/app/assets/javascripts/invites_feature}/application.js +0 -0
  90. data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/stylesheets/invites_extension → example_app/lib/chili/invites_feature/app/assets/stylesheets/invites_feature}/application.css +0 -0
  91. data/spec/example_app/lib/chili/invites_feature/app/controllers/invites_feature/application_controller.rb +4 -0
  92. data/spec/{dummy/example_app/vendor/chili/invites_extension → example_app/lib/chili/invites_feature}/app/overrides/posts/index/disclaimer.html.erb.deface +0 -0
  93. data/spec/example_app/lib/chili/invites_feature/config/routes.rb +3 -0
  94. data/spec/example_app/lib/chili/invites_feature/lib/generators/invites_feature_generator.rb +3 -0
  95. data/spec/{dummy/example_app/vendor/chili/invites_extension/lib/invites_extension.rb → example_app/lib/chili/invites_feature/lib/invites_feature.rb} +2 -2
  96. data/spec/example_app/lib/chili/invites_feature/lib/invites_feature/engine.rb +5 -0
  97. data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/images/invites_extension → example_app/lib/chili/social_feature/app/assets/images/social_feature}/.gitkeep +0 -0
  98. data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/javascripts/social_extension → example_app/lib/chili/social_feature/app/assets/javascripts/social_feature}/application.js +0 -0
  99. data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/stylesheets/social_extension → example_app/lib/chili/social_feature/app/assets/stylesheets/social_feature}/application.css.scss +0 -0
  100. data/spec/example_app/lib/chili/social_feature/app/controllers/social_feature/application_controller.rb +4 -0
  101. data/spec/{dummy/example_app/vendor/chili/social_extension/app/controllers/social_extension → example_app/lib/chili/social_feature/app/controllers/social_feature}/likes_controller.rb +3 -3
  102. data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/like.rb +1 -1
  103. data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/post.rb +1 -1
  104. data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/user.rb +1 -1
  105. data/spec/example_app/lib/chili/social_feature/app/overrides/layouts/application/likes_link.html.erb.deface +2 -0
  106. data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/_post/like_actions.html.erb.deface +2 -2
  107. data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/index/disclaimer.html.erb.deface +0 -0
  108. data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/index/table_headers.html.erb.deface +0 -0
  109. data/spec/{dummy/example_app/vendor/chili/social_extension/app/views/social_extension → example_app/lib/chili/social_feature/app/views/social_feature}/likes/index.html.erb +0 -0
  110. data/spec/example_app/lib/chili/social_feature/config/routes.rb +4 -0
  111. data/spec/example_app/lib/chili/social_feature/db/migrate/20120513031021_create_social_feature_likes.rb +10 -0
  112. data/spec/example_app/lib/chili/social_feature/lib/generators/social_feature_generator.rb +3 -0
  113. data/spec/{dummy/example_app/vendor/chili/social_extension/lib/social_extension.rb → example_app/lib/chili/social_feature/lib/social_feature.rb} +2 -2
  114. data/spec/example_app/lib/chili/social_feature/lib/social_feature/engine.rb +5 -0
  115. data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/images/social_extension → example_app/log}/.gitkeep +0 -0
  116. data/spec/{dummy/example_app → example_app}/public/404.html +0 -0
  117. data/spec/{dummy/example_app → example_app}/public/422.html +0 -0
  118. data/spec/{dummy/example_app → example_app}/public/500.html +0 -0
  119. data/spec/{dummy/example_app → example_app}/public/favicon.ico +0 -0
  120. data/spec/example_app/script/rails +6 -0
  121. data/spec/{dummy/example_app → example_app}/spec/support/user_macros.rb +0 -0
  122. data/spec/generators/chili/feature_generator_spec.rb +40 -0
  123. data/spec/generators/chili/generator_proxy_spec.rb +28 -0
  124. data/spec/requests/social_extension_spec.rb +5 -5
  125. data/spec/spec_helper.rb +2 -1
  126. data/spec/support/dummy_app.rb +21 -0
  127. metadata +251 -256
  128. data/lib/generators/chili/USAGE +0 -8
  129. data/lib/generators/rails/chili_generator.rb +0 -11
  130. data/lib/generators/rails/templates/controller.rb +0 -73
  131. data/spec/dummy/blank_extension/README.rdoc +0 -3
  132. data/spec/dummy/blank_extension/app/overrides/layouts/application/assets.html.erb.deface +0 -3
  133. data/spec/dummy/blank_extension/config/routes.rb +0 -3
  134. data/spec/dummy/blank_extension/lib/blank_extension.rb +0 -7
  135. data/spec/dummy/blank_extension/lib/blank_extension/engine.rb +0 -10
  136. data/spec/dummy/blank_extension/script/rails +0 -8
  137. data/spec/dummy/example_app/db/migrate/20120513032032_create_social_extension_likes.rb +0 -11
  138. data/spec/dummy/example_app/vendor/chili/invites_extension/config/routes.rb +0 -3
  139. data/spec/dummy/example_app/vendor/chili/invites_extension/lib/invites_extension/engine.rb +0 -10
  140. data/spec/dummy/example_app/vendor/chili/social_extension/app/overrides/layouts/application/likes_link.html.erb.deface +0 -2
  141. data/spec/dummy/example_app/vendor/chili/social_extension/config/routes.rb +0 -4
  142. data/spec/dummy/example_app/vendor/chili/social_extension/db/migrate/20120513031021_create_likes_extension_likes.rb +0 -10
  143. data/spec/dummy/example_app/vendor/chili/social_extension/lib/social_extension/engine.rb +0 -10
  144. data/spec/generators/chili/chili_generator_spec.rb +0 -53
@@ -0,0 +1,3 @@
1
+ <!-- insert_bottom 'head' -->
2
+ <%= stylesheet_link_tag 'blank_feature/application' %>
3
+ <%= javascript_include_tag 'blank_feature/application' %>
@@ -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
- blank_extension active - edit/remove this file:<br/>
4
- <strong>vendor/chili/blank_extension/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
3
+ blank_feature active - edit/remove this file:<br/>
4
+ <strong>lib/chili/blank_feature/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
5
5
  <%= link_to 'deface docs', 'https://github.com/spree/deface', target: '_blank' %>
6
6
  </div>
@@ -1,22 +1,22 @@
1
1
  $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  # Maintain your gem's version:
4
- require "blank_extension/version"
4
+ require "blank_feature/version"
5
5
 
6
6
  # Describe your gem and declare its dependencies:
7
7
  Gem::Specification.new do |s|
8
- s.name = "blank_extension"
9
- s.version = BlankExtension::VERSION
8
+ s.name = "blank_feature"
9
+ s.version = BlankFeature::VERSION
10
10
  s.authors = ["GIT_AUTHOR"]
11
11
  s.email = ["GIT_EMAIL"]
12
12
  s.homepage = ""
13
- s.summary = "Summary of BlankExtension."
14
- s.description = "Description of BlankExtension."
13
+ s.summary = "Summary of BlankFeature."
14
+ s.description = "Description of BlankFeature."
15
15
 
16
16
  s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
17
17
 
18
18
  s.add_dependency "rails", "~> 3.2.8"
19
- s.add_dependency 'chili', '~> 1.0.1'
19
+ s.add_dependency 'chili', '~> 2.0'
20
20
 
21
21
  s.add_development_dependency "sqlite3"
22
22
  end
@@ -0,0 +1,3 @@
1
+ BlankFeature::Engine.automount!
2
+ BlankFeature::Engine.routes.draw do
3
+ end
@@ -0,0 +1,7 @@
1
+ require "chili"
2
+ require "blank_feature/engine"
3
+
4
+ module BlankFeature
5
+ extend Chili::Activatable
6
+ active_if { true } # edit this to activate/deactivate feature at runtime
7
+ end
@@ -0,0 +1,5 @@
1
+ module BlankFeature
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace BlankFeature
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
- module BlankExtension
1
+ module BlankFeature
2
2
  VERSION = "0.0.1"
3
3
  end
@@ -0,0 +1,3 @@
1
+ class BlankFeatureGenerator < Rails::Generators::Base
2
+ include Chili::GeneratorProxy
3
+ end
@@ -1,4 +1,4 @@
1
1
  # desc "Explaining what the task does"
2
- # task :blank_extension do
2
+ # task :blank_feature do
3
3
  # # Task goes here
4
4
  # end
@@ -4,8 +4,8 @@ require 'rails/all'
4
4
 
5
5
  Bundler.require
6
6
  require "chili"
7
- require "social_extension"
8
- require "invites_extension"
7
+ require "social_feature"
8
+ require "invites_feature"
9
9
 
10
10
  module Dummy
11
11
  class Application < Rails::Application
@@ -0,0 +1,12 @@
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
9
+
10
+ $:.unshift File.expand_path('../../../../../lib', __FILE__)
11
+ $:.unshift File.expand_path('../../lib/chili/social_feature/lib', __FILE__)
12
+ $:.unshift File.expand_path('../../lib/chili/invites_feature/lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
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"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
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
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from social_feature (originally 20120513031021)
2
+ class CreateSocialFeatureLikes < ActiveRecord::Migration
3
+ def change
4
+ create_table :social_feature_likes do |t|
5
+ t.integer :post_id
6
+ t.integer :user_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -19,7 +19,7 @@ ActiveRecord::Schema.define(:version => 20120513032032) do
19
19
  t.datetime "updated_at", :null => false
20
20
  end
21
21
 
22
- create_table "social_extension_likes", :force => true do |t|
22
+ create_table "social_feature_likes", :force => true do |t|
23
23
  t.integer "post_id"
24
24
  t.integer "user_id"
25
25
  t.datetime "created_at", :null => false
@@ -0,0 +1,4 @@
1
+ module InvitesFeature
2
+ class ApplicationController < Chili::ApplicationController
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ InvitesFeature::Engine.automount!
2
+ InvitesFeature::Engine.routes.draw do
3
+ end
@@ -0,0 +1,3 @@
1
+ class InvitesFeatureGenerator < Rails::Generators::Base
2
+ include Chili::GeneratorProxy
3
+ end
@@ -1,7 +1,7 @@
1
1
  require "chili"
2
- require "invites_extension/engine"
2
+ require "invites_feature/engine"
3
3
 
4
- module InvitesExtension
4
+ module InvitesFeature
5
5
  extend Chili::Activatable
6
6
  active_if { logged_in? }
7
7
  end
@@ -0,0 +1,5 @@
1
+ module InvitesFeature
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace InvitesFeature
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module SocialFeature
2
+ class ApplicationController < Chili::ApplicationController
3
+ end
4
+ end
@@ -1,5 +1,5 @@
1
- module SocialExtension
2
- class LikesController < Chili::ApplicationController
1
+ module SocialFeature
2
+ class LikesController < ApplicationController
3
3
 
4
4
  def index
5
5
  @likes = current_user.likes
@@ -13,7 +13,7 @@ module SocialExtension
13
13
  private
14
14
 
15
15
  def current_user
16
- super.becomes(SocialExtension::User)
16
+ super.becomes(SocialFeature::User)
17
17
  end
18
18
 
19
19
  end
@@ -1,4 +1,4 @@
1
- module SocialExtension
1
+ module SocialFeature
2
2
  class Like < ActiveRecord::Base
3
3
  belongs_to :post
4
4
 
@@ -1,4 +1,4 @@
1
- module SocialExtension
1
+ module SocialFeature
2
2
  class Post < ::Post
3
3
  has_many :likes
4
4
 
@@ -1,4 +1,4 @@
1
- module SocialExtension
1
+ module SocialFeature
2
2
  class User < ::User
3
3
  has_many :likes
4
4
  end
@@ -0,0 +1,2 @@
1
+ <!-- insert_after '.user' -->
2
+ <%= link_to 'See Your Likes', social_feature.likes_path %>
@@ -1,6 +1,6 @@
1
1
  <!-- insert_bottom 'tr' -->
2
- <% post.becomes(SocialExtension::Post).tap do |post| %>
3
- <td><%= link_to 'Like!', social_extension.likes_path(like: {post_id: post}), method: :post %></td>
2
+ <% post.becomes(SocialFeature::Post).tap do |post| %>
3
+ <td><%= link_to 'Like!', social_feature.likes_path(like: {post_id: post}), method: :post %></td>
4
4
  <td><%= pluralize post.likes.size, 'like' %></td>
5
5
  <td class='remark'><%= post.well_liked? ? 'This post is well liked!' : 'This post is boring...' %></td>
6
6
  <% end %>