Skip to content

Commit

Permalink
Multi-kill! #1552, #1553, #1554.
Browse files Browse the repository at this point in the history
* Update generated engine Gemfile
* Remove --format Fuubar from Guardfile
* Fix failing specs for newly generated engine
  • Loading branch information
ugisozols committed Apr 3, 2012
1 parent 6ade9bb commit 5ef8e0a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
56 changes: 29 additions & 27 deletions core/lib/generators/refinery/engine/templates/Gemfile
Expand Up @@ -4,34 +4,23 @@ gemspec


gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git'


# Refinery/rails should pull in the proper versions of these # Database Configuration
group :assets do platforms :jruby do
gem 'sass-rails' gem 'activerecord-jdbcsqlite3-adapter'
gem 'coffee-rails' gem 'activerecord-jdbcmysql-adapter'
gem 'uglifier' gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'
end end


gem 'jquery-rails' platforms :ruby do
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
end


group :development, :test do group :development, :test do
gem 'refinerycms-testing', '~> 2.0.0' gem 'refinerycms-testing', :git => 'git://github.com/resolve/refinerycms.git'
gem 'factory_girl_rails' gem 'guard-rspec', '~> 0.6.0'
gem 'generator_spec'

require 'rbconfig'

platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'activerecord-jdbcmysql-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'
end

unless defined?(JRUBY_VERSION)
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
end


platforms :mswin, :mingw do platforms :mswin, :mingw do
gem 'win32console' gem 'win32console'
Expand All @@ -40,25 +29,28 @@ group :development, :test do
end end


platforms :ruby do platforms :ruby do
gem 'spork', '0.9.0.rc9' gem 'spork', '~> 0.9.0.rc'

This comment has been minimized.

Copy link
@phiggins

phiggins Apr 3, 2012

Contributor

You probably want 0.9.0. 0.9.0.rc is from 2010.

This comment has been minimized.

Copy link
@ugisozols

ugisozols Apr 3, 2012

Author Member

👍

gem 'guard-spork' gem 'guard-spork'


unless ENV['TRAVIS'] unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'rb-fsevent', '>= 0.3.9' gem 'rb-fsevent', '>= 0.3.9'
gem 'growl', '~> 1.0.3' gem 'ruby_gntp'
end end
if RbConfig::CONFIG['target_os'] =~ /linux/i if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1' gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3' gem 'libnotify', '~> 0.1.3'
gem 'therubyracer', '~> 0.9.9'

This comment has been minimized.

Copy link
@phiggins

phiggins Apr 3, 2012

Contributor

This is somewhat outdated as well. IIRC 0.10.0 is the latest.

This comment has been minimized.

Copy link
@ugisozols

ugisozols Apr 3, 2012

Author Member

Yeah, we probably need to revisit all extension Gemfiles and update versions.

end end
end end
end end


platforms :jruby do platforms :jruby do
unless ENV['TRAVIS'] unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'growl', '~> 1.0.3' gem 'ruby_gntp'
end end
if RbConfig::CONFIG['target_os'] =~ /linux/i if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1' gem 'rb-inotify', '>= 0.5.1'
Expand All @@ -67,3 +59,13 @@ group :development, :test do
end end
end end
end end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end

gem 'jquery-rails', '~> 2.0.0'
2 changes: 1 addition & 1 deletion core/lib/generators/refinery/engine/templates/Guardfile
Expand Up @@ -8,7 +8,7 @@ guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => '
watch(%r{^vendor/extensions/(.+)/spec/support/.+\.rb$}) watch(%r{^vendor/extensions/(.+)/spec/support/.+\.rb$})
end end


guard 'rspec', :version => 2, :cli => "--color --drb --format Fuubar", :all_on_start => false, :all_after_pass => false do guard 'rspec', :version => 2, :cli => "--color --drb", :all_on_start => false, :all_after_pass => false do
watch(%r{^spec/.+_spec\.rb$}) watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" } watch('spec/spec_helper.rb') { "spec" }
Expand Down
Expand Up @@ -5,6 +5,8 @@ class <%= class_name %> < Refinery::Core::BaseModel
<% if localized? %> <% if localized? %>
translates <%= localized_attributes.map{|a| ":#{a.name}"}.join(', ') %><% end %> translates <%= localized_attributes.map{|a| ":#{a.name}"}.join(', ') %><% end %>
<% if (string_attributes = attributes.select{ |a| a.type.to_s =~ /string|text/ }.uniq).any? %> <% if (string_attributes = attributes.select{ |a| a.type.to_s =~ /string|text/ }.uniq).any? %>
attr_accessible <%= string_attributes.first.name.to_sym.inspect %>, :position
acts_as_indexed :fields => <%= string_attributes.map{|s| s.name.to_sym}.inspect %> acts_as_indexed :fields => <%= string_attributes.map{|s| s.name.to_sym}.inspect %>
validates <%= string_attributes.first.name.to_sym.inspect %>, :presence => true, :uniqueness => true validates <%= string_attributes.first.name.to_sym.inspect %>, :presence => true, :uniqueness => true
Expand Down
Expand Up @@ -2,7 +2,7 @@ def setup_environment
# Configure Rails Environment # Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test' ENV["RAILS_ENV"] ||= 'test'


require File.expand_path("../dummy/config/environment", __FILE__) require File.expand_path('../../../../../config/environment', __FILE__)


require 'rspec/rails' require 'rspec/rails'
require 'capybara/rspec' require 'capybara/rspec'
Expand Down

0 comments on commit 5ef8e0a

Please sign in to comment.