Permalink
Browse files

Upgrade to Rails 3.2/CMS 3.5

  • Loading branch information...
1 parent dc4c83a commit 3be82e381605a673cb6856e2bd6fb80a326a4014 @peakpg peakpg committed May 24, 2012
Showing with 1,763 additions and 10,293 deletions.
  1. +7 −11 .gitignore
  2. +1 −1 .rvmrc
  3. +2 −30 Gemfile
  4. +122 −0 Gemfile.lock
  5. +35 −10 Rakefile
  6. 0 public/favicon.ico → app/assets/images/bcms_event/.gitkeep
  7. +15 −0 app/assets/javascripts/bcms_event/application.js
  8. +13 −0 app/assets/stylesheets/bcms_event/application.css
  9. +2 −0 app/controllers/bcms_event/events_controller.rb
  10. +0 −2 app/controllers/cms/events_controller.rb
  11. +4 −0 app/helpers/bcms_event/application_helper.rb
  12. +7 −3 app/models/{ → bcms_event}/event.rb
  13. +2 −2 app/portlets/event_portlet.rb
  14. +3 −3 app/portlets/events_portlet.rb
  15. 0 app/views/{cms → bcms_event}/events/_form.html.erb
  16. 0 app/views/{cms → bcms_event}/events/render.html.erb
  17. +6 −12 bcms_event.gemspec
  18. +0 −6 config/boot.rb
  19. +2 −61 config/routes.rb
  20. +8 −8 db/bcms_event.seeds.rb
  21. +0 −9 db/migrate/20091109175123_browsercms_3_0_5.rb
  22. +7 −0 db/migrate/20120524204153_v120.rb
  23. +4 −2 lib/bcms_event.rb
  24. +1 −0 lib/bcms_event/engine.rb
  25. +1 −1 lib/bcms_event/version.rb
  26. +4 −0 lib/tasks/bcms_event_tasks.rake
  27. +0 −2 public/javascripts/application.js
  28. +0 −965 public/javascripts/controls.js
  29. +0 −974 public/javascripts/dragdrop.js
  30. +0 −1,123 public/javascripts/effects.js
  31. +0 −591 public/javascripts/jquery-ui.js
  32. +0 −6,001 public/javascripts/prototype.js
  33. +0 −202 public/javascripts/rails.js
  34. +4 −0 release_notes.md
  35. +5 −3 script/rails
  36. +7 −0 test/bcms_event_test.rb
  37. +261 −0 test/dummy/README.rdoc
  38. +7 −0 test/dummy/Rakefile
  39. +15 −0 test/dummy/app/assets/javascripts/application.js
  40. +13 −0 test/dummy/app/assets/stylesheets/application.css
  41. 0 { → test/dummy}/app/controllers/application_controller.rb
  42. 0 { → test/dummy}/app/helpers/application_helper.rb
  43. 0 test/dummy/app/mailers/.gitkeep
  44. 0 test/dummy/app/models/.gitkeep
  45. +14 −0 test/dummy/app/views/layouts/application.html.erb
  46. 0 { → test/dummy}/app/views/layouts/templates/default.html.erb
  47. +1 −1 { → test/dummy}/config.ru
  48. +21 −9 { → test/dummy}/config/application.rb
  49. +10 −0 test/dummy/config/boot.rb
  50. 0 { → test/dummy}/config/database.yml
  51. +1 −1 { → test/dummy}/config/environment.rb
  52. +16 −5 { → test/dummy}/config/environments/development.rb
  53. +32 −14 { → test/dummy}/config/environments/production.rb
  54. +10 −8 { → test/dummy}/config/environments/test.rb
  55. 0 { → test/dummy}/config/initializers/backtrace_silencers.rb
  56. +5 −0 { → test/dummy}/config/initializers/inflections.rb
  57. 0 { → test/dummy}/config/initializers/mime_types.rb
  58. +1 −1 { → test/dummy}/config/initializers/secret_token.rb
  59. +2 −2 { → test/dummy}/config/initializers/session_store.rb
  60. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  61. +1 −1 { → test/dummy}/config/locales/en.yml
  62. +5 −0 test/dummy/config/routes.rb
  63. +21 −15 db/seeds.rb → test/dummy/db/browsercms.seeds.rb
  64. +69 −76 ...te/20080815014337_browsercms_3_0_0.rb → test/dummy/db/migrate/20120524201150_browsercms300.cms.rb
  65. +10 −0 test/dummy/db/migrate/20120524201151_browsercms305.cms.rb
  66. +96 −0 test/dummy/db/migrate/20120524201152_browsercms315.cms.rb
  67. +6 −5 ...te/20100705083859_browsercms_3_3_0.rb → test/dummy/db/migrate/20120524201153_browsercms330.cms.rb
  68. +63 −0 test/dummy/db/migrate/20120524201154_browsercms340.cms.rb
  69. +33 −0 test/dummy/db/migrate/20120524201155_browsercms350.cms.rb
  70. +550 −0 test/dummy/db/schema.rb
  71. +3 −0 test/dummy/db/seeds.rb
  72. 0 test/dummy/lib/assets/.gitkeep
  73. 0 test/dummy/log/.gitkeep
  74. +26 −0 test/dummy/public/404.html
  75. +26 −0 test/dummy/public/422.html
  76. +25 −0 test/dummy/public/500.html
  77. 0 test/dummy/public/favicon.ico
  78. +6 −0 test/dummy/script/rails
  79. +2 −2 test/integration/events_portlet_test.rb
  80. +0 −96 test/sample_data.rb
  81. +102 −0 test/support/sample_data.rb
  82. +2 −1 test/{ → support}/test_logging.rb
  83. +10 −14 test/test_helper.rb
  84. +22 −20 test/unit/event_test.rb
View
@@ -1,12 +1,8 @@
-coverage/**/*
-.DS_Store
+.bundle/
log/*.log
-tmp/**/*
-db/*.sqlite3
-db/schema.rb
-*.gem
-.dotest
-tmp/restart.txt
-public/cache
-.idea/*
-Gemfile.lock
+pkg/
+test/dummy/db/*.sqlite3
+test/dummy/log/*.log
+test/dummy/tmp/
+test/dummy/.sass-cache
+
View
2 .rvmrc
@@ -1 +1 @@
-rvm use 1.9.2@rails3.0
+rvm use 1.9.3@r3.2
View
32 Gemfile
@@ -1,32 +1,4 @@
-source 'http://rubygems.org'
-
-# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
+source "http://rubygems.org"
+gemspec
gem 'sqlite3'
-
-# Use unicorn as the web server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-# gem 'capistrano'
-
-# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
-# gem 'ruby-debug'
-# gem 'ruby-debug19', :require => 'ruby-debug'
-
-# Bundle the extra gems:
-# gem 'bj'
-# gem 'nokogiri'
-# gem 'sqlite3-ruby', :require => 'sqlite3'
-# gem 'aws-s3', :require => 'aws/s3'
-
-# Bundle gems for the local environment. Make sure to
-# put test-only gems in this group so their generators
-# and rake tasks are available in development mode:
-# group :development, :test do
-# gem 'webrat'
-# end
-
-gem "mysql"
-gemspec
View
@@ -0,0 +1,122 @@
+PATH
+ remote: .
+ specs:
+ bcms_event (1.2.0)
+ browsercms (>= 3.5.0.rc3, < 3.6.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ ancestry (1.2.5)
+ activerecord (>= 2.2.2)
+ arel (3.0.2)
+ browsercms (3.5.0.rc4)
+ ancestry (~> 1.2.4)
+ ckeditor_rails (~> 3.6.2.2)
+ jquery-rails (~> 2.0)
+ paperclip (~> 3.0.3)
+ rails (~> 3.2.0)
+ sass-rails
+ term-ansicolor
+ builder (3.0.0)
+ ckeditor_rails (3.6.2.2)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ cocaine (0.2.1)
+ erubis (2.7.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.7.3)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.18)
+ multi_json (1.3.5)
+ paperclip (3.0.4)
+ activemodel (>= 3.0.0)
+ activerecord (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ cocaine (>= 0.0.2)
+ mime-types
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
+ bundler (~> 1.0)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.1.18)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ term-ansicolor (1.0.7)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bcms_event!
+ sqlite3
View
@@ -1,15 +1,40 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'BcmsEvent'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
-require File.expand_path('../config/application', __FILE__)
-require 'rake'
-BcmsEvent::Application.load_tasks
-require 'bundler'
Bundler::GemHelper.install_tasks
-desc "Load Sample Data"
-task :load_sample_data => :environment do
- SampleData.create_sample_data!
-end
+require 'rake/testtask'
+
+Rake::TestTask.new(:test => 'app:test:prepare') do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task :default => :test
File renamed without changes.
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+*/
@@ -0,0 +1,2 @@
+class BcmsEvent::EventsController < Cms::ContentBlockController
+end
@@ -1,2 +0,0 @@
-class Cms::EventsController < Cms::ContentBlockController
-end
@@ -0,0 +1,4 @@
+module BcmsEvent
+ module ApplicationHelper
+ end
+end
@@ -1,21 +1,24 @@
+module BcmsEvent
class Event < ActiveRecord::Base
acts_as_content_block :taggable => true
belongs_to_category
before_validation :set_slug
validates_presence_of :name, :slug, :starts_on
-
+
+ attr_accessible :category, :name, :description, :starts_on
+
scope :starts_on, lambda {|date|
d = if date.kind_of?(Hash)
Date.new(date[:year].to_i, date[:month].to_i, date[:day].to_i)
else
date
end
- {:conditions => ["events.starts_on = ?", d]}
+ {:conditions => ["starts_on = ?", d]}
}
- scope :with_slug, lambda{|slug| {:conditions => ["events.slug = ?",slug]}}
+ scope :with_slug, lambda{|slug| {:conditions => ["slug = ?",slug]}}
def self.default_order
"starts_on desc"
@@ -51,3 +54,4 @@ def day
end
end
+end
@@ -1,11 +1,11 @@
-class EventPortlet < Portlet
+class EventPortlet < Cms::Portlet
enable_template_editor true
def render
# @event should already be set by the page route
if !@event && params[:event_id]
- @event = Event.published.find(params[:event_id])
+ @event = BcmsEvent::Event.published.find(params[:event_id])
end
end
@@ -1,12 +1,12 @@
-class EventsPortlet < Portlet
+class EventsPortlet < Cms::Portlet
enable_template_editor true
def render
if self.category_id.blank?
- @events = Event.published.all
+ @events = BcmsEvent::Event.published.all
else
- @events = Event.published.all(:conditions => {:category_id => self.category_id})
+ @events = BcmsEvent::Event.published.all(:conditions => {:category_id => self.category_id})
end
end
View
@@ -10,19 +10,13 @@ Gem::Specification.new do |spec|
spec.author = "BrowserMedia"
spec.email = "github@browsermedia.com"
spec.homepage = "http://www.github.com/browsermedia/bcms_event"
- spec.files += Dir["app/**/*"]
- spec.files += Dir["db/migrate/[0-9]*_create_events.rb"]
- spec.files += Dir["db/bcms_event.seeds.rb"]
- spec.files += Dir["lib/**/*"]
+
+ spec.files = Dir["{app,config,db,lib}/**/*"]
spec.files += Dir["Gemfile", "LICENSE.txt", "COPYRIGHT.txt", "GPL.txt" ]
- spec.files -= Dir['config/**/*',
- 'public/**/*',
- 'config.ru',
- 'script/**/*',
- 'app/controllers/application_controller.rb',
- 'app/helpers/application_helper.rb',
- 'app/layouts/templates/**/*']
+ spec.test_files += Dir["test/**/*"]
+ spec.test_files -= Dir['test/dummy/**/*']
+ spec.add_dependency("browsercms", "< 3.6.0", ">= 3.5.0.rc3")
+
spec.require_paths = ["lib"]
spec.extra_rdoc_files = ["README.markdown" ]
- spec.add_dependency(%q<browsercms>, ["~> 3.3.0"])
end
View
@@ -1,6 +0,0 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Oops, something went wrong.

0 comments on commit 3be82e3

Please sign in to comment.