Permalink
Browse files

Can depend on the deface gem now

  • Loading branch information...
1 parent cf0beb2 commit 455718f9068aeb8467c6f19a56a8702235e56f25 @balvig committed May 28, 2012
Showing with 12 additions and 15 deletions.
  1. +0 −1 Gemfile
  2. +3 −4 README.md
  3. +2 −0 chili.gemspec
  4. +1 −0 lib/chili.rb
  5. +5 −9 lib/chili/template.rb
  6. +1 −1 lib/chili/version.rb
View
@@ -3,4 +3,3 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in chili.gemspec
gemspec
gem 'rake'
-gem 'deface', github: 'railsdog/deface'
View
@@ -27,7 +27,7 @@ This is basically a shortcut for running the `rails plugin new` engine generator
1. Create a directory named chili_social containing the basic structure for the extension
2. Clone the app you are adding the extension to as a submodule into chili_social/main_app
-3. Add a reference to the extensions gemspec to the main app gemfile for testing
+3. Add a reference to the extension to the main app gemfile for development/testing
### Define who can see the extension
@@ -66,7 +66,7 @@ Create a model with the same name as the one you want to modify: `rails g model
and inherit from the original:
```ruby
-# app/model/chili_social/user.rb
+# app/models/chili_social/user.rb
module ChiliSocial
class User < ::User
has_many :likes
@@ -108,9 +108,8 @@ Add files as usual in `app/assets/chili_social/javascripts|stylesheets` and inje
### Current Issues
- Haven't found a good way to modify existing controller actions
-- Need to use deface from github
### Minor niggles
-- Have to use "path" option when adding gem to main app
- Request specs don't have access to path helpers
+- Generated specs don't namespace properly
View
@@ -16,6 +16,8 @@ Gem::Specification.new do |gem|
gem.version = Chili::VERSION
gem.add_dependency "rails", "~> 3.2"
+ gem.add_dependency "deface", "~> 0.9"
+
gem.add_development_dependency 'rspec', '~> 2.9.0'
gem.add_development_dependency 'rspec-rails', '~> 2.9.0'
gem.add_development_dependency 'jquery-rails'
View
@@ -1,3 +1,4 @@
+require "deface"
require "chili/version"
require "chili/engine"
require "chili/overrides"
View
@@ -6,14 +6,8 @@
run "cd #{destination_root} && git submodule add #{main_app_git_repo} main_app"
end
-# Add gem and deface to main app Gemfile
-append_to_file "main_app/Gemfile" do <<-RUBY
-
-# Chili dev dependencies
-gem '#{app_path}', path: '../' # git: '...'
-gem 'deface', github: 'railsdog/deface'
-RUBY
-end
+# Add gem to main app Gemfile
+append_to_file "main_app/Gemfile", "gem '#{app_path}', path: '../' # git: '...'"
# Uses Chili::ApplicationController and the layout from the main app
remove_dir "app/controllers/#{app_path}"
@@ -81,12 +75,14 @@
prepend_to_file 'config/routes.rb', "#{app_path.camelcase}::Engine.automount!\n"
# Include chili libs
+require File.expand_path('../version', __FILE__)
+
prepend_to_file "lib/#{app_path}.rb" do <<-RUBY
require "chili"
RUBY
end
-gsub_file "#{app_path}.gemspec", '# s.add_dependency "jquery-rails"', 's.add_dependency "chili"'
+gsub_file "#{app_path}.gemspec", '# s.add_dependency "jquery-rails"', "s.add_dependency 'chili', '~> #{Chili::VERSION}'"
# Include active_if
inject_into_file "lib/#{app_path}.rb", :after => "module #{app_path.camelcase}\n" do <<-RUBY
View
@@ -1,3 +1,3 @@
module Chili
- VERSION = "0.0.7"
+ VERSION = "0.0.8"
end

0 comments on commit 455718f

Please sign in to comment.