diff --git a/Gemfile b/Gemfile index 331b1828..d690ef57 100644 --- a/Gemfile +++ b/Gemfile @@ -46,8 +46,8 @@ gem 'rubyzip' gem 'actionmailer-with-request', '~> 0.3.0', :require => 'actionmailer_with_request' gem 'httparty', '~> 0.8.1' -gem 'delayed_job', '~> 2.1.1' -gem 'delayed_job_mongoid', '~> 1.0.4' +gem 'delayed_job', '~> 3.0.0.pre4' +gem 'delayed_job_mongoid', '~> 1.0.6' gem 'SystemTimer', :platforms => :ruby_18 # The rest of the dependencies are for use when in the locomotive dev environment diff --git a/Gemfile.lock b/Gemfile.lock index 12ffabc2..cb343e45 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -128,13 +128,13 @@ GEM capybara (>= 1.1.1) cucumber (>= 1.1.1) nokogiri (>= 1.5.0) - daemons (1.1.4) + daemons (1.0.10) database_cleaner (0.7.0) - delayed_job (2.1.4) + delayed_job (3.0.0.pre4) activesupport (~> 3.0) - daemons - delayed_job_mongoid (1.0.4) - delayed_job (~> 2.1.1) + daemons (= 1.0.10) + delayed_job_mongoid (1.0.6) + delayed_job (= 3.0.0.pre4) mongoid (>= 2.0) diff-lcs (1.1.3) dragonfly (0.9.8) @@ -324,8 +324,8 @@ DEPENDENCIES cucumber-rails custom_fields! database_cleaner - delayed_job (~> 2.1.1) - delayed_job_mongoid (~> 1.0.4) + delayed_job (~> 3.0.0.pre4) + delayed_job_mongoid (~> 1.0.6) devise! dragonfly (~> 0.9.8) factory_girl_rails (~> 1.1) diff --git a/README.textile b/README.textile index 263ed9cb..a3b1b0b4 100644 --- a/README.textile +++ b/README.textile @@ -1,5 +1,8 @@ h1. Locomotive CMS +"!https://secure.travis-ci.org/locomotivecms/engine.png!":http://travis-ci.org/locomotivecms/engine + + Locomotive is a simple but powerful CMS based on liquid templates and mongodb database. At my company ("NoCoffee":http://www.nocoffee.fr), we use it for our clients when they request a simple website. If we have to give only 5 main features to describe our application, there will be: @@ -32,6 +35,12 @@ h2. Installation See the "official website":http://www.locomotivecms.com +h2. Community + +* Get help or discuss locomotive CMS at the "LocomotiveCMS Discussion Forums":http://locomotive.vanillaforums.com/ +* Join us on IRC "#locomotivecms at irc.freenode.net!":http://webchat.freenode.net/ +* "Follow us on twitter":http://twitter.com/locomotiveapp + h2. Team * Developers: "Didier Lafforgue":http://www.nocoffee.fr, "Jacques Crocker":http://www.railsjedi.com, "Mario Visic":http://www.mariovisic.com diff --git a/features/step_definitions/admin_steps.rb b/features/step_definitions/admin_steps.rb index 42ad9c29..2a85d18b 100644 --- a/features/step_definitions/admin_steps.rb +++ b/features/step_definitions/admin_steps.rb @@ -7,18 +7,18 @@ end Given /^I am an authenticated "([^"]*)"$/ do |role| @member = Site.first.memberships.where(:role => role.downcase).first || FactoryGirl.create(role.downcase.to_sym, :site => Site.first) - Given %{I go to login} - And %{I fill in "Email" with "#{@member.account.email}"} - And %{I fill in "Password" with "easyone"} - And %{I press "Log in"} + step %{I go to login} + step %{I fill in "Email" with "#{@member.account.email}"} + step %{I fill in "Password" with "easyone"} + step %{I press "Log in"} end Given /^I am an authenticated user$/ do - Given %{I am an authenticated "admin"} + step %{I am an authenticated "admin"} end Then /^I should see the access denied message$/ do - Then %{I should see "You are not authorized to access this page"} + step %{I should see "You are not authorized to access this page"} end Then /^I am redirected to "([^\"]*)"$/ do |url| diff --git a/features/step_definitions/current_site_steps.rb b/features/step_definitions/current_site_steps.rb index e2dc0545..abef1b24 100644 --- a/features/step_definitions/current_site_steps.rb +++ b/features/step_definitions/current_site_steps.rb @@ -7,7 +7,7 @@ Then /^I should see the role dropdown on the "([^"]*)" without the "([^"]*)" opt end Then /^I should see the role dropdown on myself$/ do - Then %{I should see the role dropdown on the "#{@member.role}"} + step %{I should see the role dropdown on the "#{@member.role}"} end Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user| @@ -15,7 +15,7 @@ Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user| end Then /^I should not see the role dropdown on myself$/ do - Then %{I should not see the role dropdown on the "#{@member.role}"} + step %{I should not see the role dropdown on the "#{@member.role}"} end Then /^I should not see any role dropdowns$/ do @@ -31,7 +31,7 @@ Then /^I should not see delete on the "([^"]*)"$/ do |role| end Then /^I should not see delete on myself$/ do - Then %{I should not see delete on the "#{@member.role}"} + step %{I should not see delete on the "#{@member.role}"} end Then /^I should not see any delete buttons$/ do @@ -39,5 +39,5 @@ Then /^I should not see any delete buttons$/ do end When /^I select the "([^"]*)" role for the "author" user/ do |role| - Given %{I select "#{role}" from "site[memberships_attributes][2][role]"} + step %{I select "#{role}" from "site[memberships_attributes][2][role]"} end diff --git a/features/step_definitions/has_many_steps.rb b/features/step_definitions/has_many_steps.rb index 4d4e5ce0..45455f41 100644 --- a/features/step_definitions/has_many_steps.rb +++ b/features/step_definitions/has_many_steps.rb @@ -19,7 +19,7 @@ end Then /^I should be able to view a paginaed list of a has many association$/ do # Create models - Given %{I have an "Articles" model which has many "Comments"} + step %{I have an "Articles" model which has many "Comments"} # Create contents article = @parent_model.contents.create!(:slug => 'parent', :body => 'Parent') diff --git a/features/step_definitions/site_steps.rb b/features/step_definitions/site_steps.rb index ee03442a..6746fb14 100644 --- a/features/step_definitions/site_steps.rb +++ b/features/step_definitions/site_steps.rb @@ -14,7 +14,7 @@ Given /^I have the site: "([^"]*)" set up(?: with #{capture_fields})?$/ do |site end Given /^I have a site set up$/ do - Given %{I have the site: "test site" set up} + step %{I have the site: "test site" set up} end Given /^I have a designer and an author$/ do diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index b82f78eb..b7663109 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -19,12 +19,12 @@ World(WithinHelpers) # Single-line step scoper When /^(.*) within (.*[^:])$/ do |step, parent| - with_scope(parent) { When step } + with_scope(parent) { step step } end # Multi-line step scoper When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string| - with_scope(parent) { When "#{step}:", table_or_string } + with_scope(parent) { step "#{step}:", table_or_string } end Given /^(?:|I )am on (.+)$/ do |page_name| @@ -64,7 +64,7 @@ end # When /^(?:|I )fill in the following:$/ do |fields| fields.rows_hash.each do |name, value| - When %{I fill in "#{name}" with "#{value}"} + step %{I fill in "#{name}" with "#{value}"} end end @@ -194,4 +194,4 @@ end Then /^show me the page$/ do save_and_open_page -end \ No newline at end of file +end diff --git a/features/support/env.rb b/features/support/env.rb index efcb084c..a1c12dda 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -12,7 +12,6 @@ require 'cucumber/rails' require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support require 'cucumber/rails/rspec' require 'cucumber/rails/world' -require 'cucumber/web/tableish' require 'capybara' require 'capybara/rails' @@ -68,4 +67,4 @@ ActionController::Base.allow_rescue = false require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/carrierwave') require File.expand_path(File.dirname(__FILE__) + '/../../spec/support/locomotive') -Locomotive.configure_for_test(true) \ No newline at end of file +Locomotive.configure_for_test(true) diff --git a/lib/locomotive/liquid/filters/html.rb b/lib/locomotive/liquid/filters/html.rb index e67127d4..6b20aebf 100644 --- a/lib/locomotive/liquid/filters/html.rb +++ b/lib/locomotive/liquid/filters/html.rb @@ -163,7 +163,7 @@ module Locomotive end def absolute_url(url) - url.starts_with('/') ? url : "/#{url}" + url.starts_with?('/') ? url : "/#{url}" end end diff --git a/lib/locomotive/liquid/filters/resize.rb b/lib/locomotive/liquid/filters/resize.rb index 0672ed52..3d499a12 100644 --- a/lib/locomotive/liquid/filters/resize.rb +++ b/lib/locomotive/liquid/filters/resize.rb @@ -13,4 +13,4 @@ module Locomotive end end -end \ No newline at end of file +end diff --git a/lib/locomotive/middlewares/seo_trailing_slash.rb b/lib/locomotive/middlewares/seo_trailing_slash.rb index 6f5a1918..ec01afa6 100644 --- a/lib/locomotive/middlewares/seo_trailing_slash.rb +++ b/lib/locomotive/middlewares/seo_trailing_slash.rb @@ -9,7 +9,7 @@ module Locomotive def call(env) path = env['PATH_INFO'] - if !path.starts_with('/admin/') && (match = path.match(%r{(.+)/$})) + if !path.starts_with?('/admin/') && (match = path.match(%r{(.+)/$})) response = Rack::Response.new response.redirect(match[1], 301) # moved permanently response.finish diff --git a/locomotive_cms.gemspec b/locomotive_cms.gemspec index aed7e666..57ded121 100644 --- a/locomotive_cms.gemspec +++ b/locomotive_cms.gemspec @@ -55,8 +55,8 @@ Gem::Specification.new do |s| s.add_dependency 'actionmailer-with-request' s.add_dependency 'httparty', '0.7.8' s.add_dependency 'RedCloth', '4.2.8' - s.add_dependency 'delayed_job', '2.1.4' - s.add_dependency 'delayed_job_mongoid', '1.0.2' + s.add_dependency 'delayed_job', '3.0.0.pre4' + s.add_dependency 'delayed_job_mongoid', '1.0.6' s.add_dependency 'rubyzip' s.add_dependency 'locomotive_jammit-s3' diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb index eba06813..44525f5d 100644 --- a/spec/dummy/config/boot.rb +++ b/spec/dummy/config/boot.rb @@ -1,10 +1,20 @@ require 'rubygems' gemfile = File.expand_path('../../../../Gemfile', __FILE__) +# Need to explicitly use syck for yaml. This fixes a problem with the current +# delayed job parsing of YAML +# +# FIXME: I don't expect end users to have to modify their config/boot.rb for an +# app using the locomotiveCMS gem. Perhaps we can remove this when a newer +# delayed job version is released? +# +require 'yaml' +YAML::ENGINE.yamler = 'syck' + if File.exist?(gemfile) ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler' Bundler.setup end -$:.unshift File.expand_path('../../../../lib', __FILE__) \ No newline at end of file +$:.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/spec/lib/locomotive/liquid/filters/resize_spec.rb b/spec/lib/locomotive/liquid/filters/resize_spec.rb index 880ed397..8ef3097b 100644 --- a/spec/lib/locomotive/liquid/filters/resize_spec.rb +++ b/spec/lib/locomotive/liquid/filters/resize_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe Locomotive::Liquid::Filters::Resize do - before :each do @site = FactoryGirl.create(:site) @theme_asset = FactoryGirl.create(:theme_asset, :source => FixturedAsset.open('5k.png'), :site => @site) @@ -10,13 +9,10 @@ describe Locomotive::Liquid::Filters::Resize do @asset_url = @asset.source.url @asset_path = "/sites/#{@asset.site_id}/assets/#{@asset.id}/5k.png" @context = Liquid::Context.new( { }, { 'asset_url' => @asset_url, 'theme_asset' => @theme_asset.to_liquid }, { :site => @site }) - @app = Locomotive::Dragonfly.app end describe '#resize' do - context 'when an asset url string is given' do - before :each do @template = Liquid::Template.parse('{{ asset_url | resize: "40x30" }}') end @@ -26,13 +22,11 @@ describe Locomotive::Liquid::Filters::Resize do end it 'should use the path in the public folder to generate a location' do - @template.render(@context).should == @app.fetch_file("public#{@asset_path}").thumb('40x30').url + @template.render(@context).should == Locomotive::Dragonfly.resize_url(@asset_path, '40x30') end - end context 'when a theme asset is given' do - before :each do @template = Liquid::Template.parse("{{ theme_asset | resize: '300x400' }}") end @@ -42,13 +36,11 @@ describe Locomotive::Liquid::Filters::Resize do end it 'should use the path of the theme asset to generate a location' do - @template.render(@context).should == @app.fetch_file("public#{@theme_asset_path}").thumb('300x400').url + @template.render(@context).should == Locomotive::Dragonfly.resize_url(@theme_asset_path, '300x400') end - end context 'when no resize string is given' do - before :each do @template = Liquid::Template.parse('{{ asset | resize: }}') end @@ -56,9 +48,6 @@ describe Locomotive::Liquid::Filters::Resize do it 'should return a liquid error' do @template.render(@context).should include 'Liquid error: wrong number of arguments' end - end - end - -end \ No newline at end of file +end