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 4, 2012
1 parent 2a2d846 commit 7db31eb
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,23 @@ gemspec

gem 'refinerycms', '~> 2.0.0'

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

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

group :development, :test do
gem 'refinerycms-testing', '~> 2.0.0'
gem 'factory_girl_rails'
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
gem 'refinerycms-testing', :git => 'git://github.com/resolve/refinerycms.git'
gem 'guard-rspec', '~> 0.6.0'

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

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

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

platforms :jruby do
unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'growl', '~> 1.0.3'
gem 'ruby_gntp'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
Expand All @@ -67,3 +59,13 @@ group :development, :test do
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => '
watch(%r{^vendor/extensions/(.+)/spec/support/.+\.rb$})
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{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class <%= class_name %> < Refinery::Core::BaseModel
<% if localized? %>
translates <%= localized_attributes.map{|a| ":#{a.name}"}.join(', ') %><% end %>
<% 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 %>
validates <%= string_attributes.first.name.to_sym.inspect %>, :presence => true, :uniqueness => true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ def setup_environment
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'

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

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

0 comments on commit 7db31eb

Please sign in to comment.