Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: resolve/refinerycms
...
head fork: resolve/refinerycms
  • 13 commits
  • 16 files changed
  • 0 commit comments
  • 2 contributors
View
17 Gemfile
@@ -3,17 +3,17 @@ source :rubygems
# Specify the database driver as appropriate for your application (only one is necessary).
# Defaults to sqlite3. Don't remove any of these below in the core or gems won't install.
gem 'sqlite3-ruby', :require => 'sqlite3' #db_adapter=sqlite3
-#gem 'mysql', :require => 'mysql' #db_adapter=mysql
-#gem 'pg' #db_adapter=postgresql
+# gem 'mysql', :require => 'mysql' #db_adapter=mysql
+# gem 'pg' #db_adapter=postgresql
# Specify your favourite web server (only one) - not required.
-#gem 'unicorn', :group => :development
-#gem 'mongrel', :group => :development
+# gem 'unicorn', :group => :development
+# gem 'mongrel', :group => :development
# Deploy with Capistrano
# gem 'capistrano'
-# If you are using s3 you probably want this gem:
+# If you are using Amazon S3 you probably want this gem:
# gem 'aws-s3'
#===REFINERY REQUIRED GEMS===
@@ -31,7 +31,6 @@ group :test do
gem 'rspec-rails'
gem 'factory_girl'
gem 'test-unit', '= 1.2.3'
-
gem 'cucumber-rails'
gem 'capybara'
gem 'factory_girl'
@@ -42,11 +41,11 @@ end
#===REQUIRED FOR REFINERY GEM INSTALL===
# Leave the gem below disabled (commented out) if you're not using the gem install method.
-#gem 'refinerycms', '= 0.9.7.2'
+# gem 'refinerycms', '= 0.9.7.3'
#===END OF REFINERY GEM INSTALL REQUIREMENTS===
# Bundle gems for certain environments:
# Specify your application's gem requirements here. See the examples below:
-# gem "refinerycms-news", "~> 0.9.7", :require => "news"
-# gem "refinerycms-portfolio", "~> 0.9.3.8", :require => "portfolio"
+# gem "refinerycms-news", "~> 0.9.7.3", :require => "news"
+# gem "refinerycms-portfolio", "~> 0.9.6", :require => "portfolio"
View
10 bin/refinery
@@ -86,15 +86,15 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
# read in the Gemfile and write it back out with the refinerycms gem enabled.
(lines = refinery_root.join('Gemfile').open('r').read.split("\n")).each do |line|
- line.gsub!("#gem 'refinerycms'", "gem 'refinerycms'")
+ line.gsub!(/\#*\s?gem 'refinerycms'/, "gem 'refinerycms'")
# Ensure that the correct database gem libraries are included for the database adapter
# that the user has specified in the refinery install command.
if line =~ /\#db\_adapter\=/
if line =~ %r{#db_adapter=#{db_adapter}}
- line.gsub!(/^(\#*\ ?gem)/, 'gem')
+ line.gsub!(/^(\#*\s?gem)/, 'gem')
else
- line.gsub!(/^(\ ?gem)/, '#gem')
+ line.gsub!(/^(\s?gem)/, '# gem')
end
end
end
@@ -114,11 +114,11 @@ unless (app_path = ARGV.shift).nil? or app_path.length == 0
puts `#{cmd}`
puts "\n\nSetting up your development database..\n"
- puts (cmd="rake -f #{File.join(rails_root, 'Rakefile')} db:setup")
+ puts (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' db:setup")
puts `#{cmd}`
puts "\n\nUpdating some core refinery files..\n"
- puts (cmd="rake -f #{File.join(rails_root, 'Rakefile')} refinery:update from_installer=true")
+ puts (cmd="rake -f '#{File.join(rails_root, 'Rakefile')}' refinery:update from_installer=true")
puts `#{cmd}`
end
View
8 changelog.md
@@ -1,3 +1,11 @@
+## 0.9.7.3 [07 July 2010]
+
+- Falls back to default locale when a translation key can not be located in the current locale, only in production mode. [Philip Arndt]
+- Fixed issue creating a Refinery site using bin/refinery where directory paths contained spaces. [Philip Arndt]
+- Fixed issue when using script/generate refinery surrounding the migration incorrectly using the plugin's title. [Philip Arndt]
+- Added verbose=true option when running rake refinery:update that prints out everything it's doing. [Philip Arndt]
+- [See full list](http://github.com/resolve/refinerycms/compare/0.9.7.2...0.9.7.3)
+
## 0.9.7.2 [06 July 2010]
- Bugfixes with users and roles [Philip Arndt and Amanda Wagener]
View
4 refinerycms.gemspec
@@ -1,8 +1,8 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms}
- s.version = %q{0.9.7.2}
+ s.version = %q{0.9.7.3}
s.description = %q{A beautiful open source Ruby on Rails content manager for small business. Easy to extend, easy to use, lightweight and all wrapped up in a super slick UI.}
- s.date = %q{2010-07-06}
+ s.date = %q{2010-07-07}
s.summary = %q{A beautiful open source Ruby on Rails content manager for small business.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
View
2  vendor/plugins/dashboard/config/locales/en.yml
@@ -8,7 +8,7 @@ en:
quick_tasks: Quick tasks
add_a_new_page: Add a new page
update_a_page: Update a page
- upload_a_image: Upload a image
+ upload_a_image: Upload an image
upload_a_file: Upload a file
change_language: Change Language
see_home_page: See home page
View
27 vendor/plugins/i18n/lib/i18n.rb
@@ -89,15 +89,6 @@ def setup!
self.load_refinery_locales!
self.load_app_locales!
self.set_default_locale!
-
- # Mislav trick to fallback to default for missing translations
- ::I18n.exception_handler = lambda do |e, locale, key, options|
- if ::I18n::MissingTranslationData === e and locale != ::Refinery::I18n.default_locale
- ::I18n.translate(key, (options || {}).update(:locale => ::Refinery::I18n.default_locale, :raise => true))
- else
- raise e
- end
- end if Rails.env.production?
end
def load_base_locales!
@@ -128,5 +119,23 @@ def load_locales(locale_files)
end
if RefinerySetting.table_exists?
+ # override translate, but only in production
+ ::I18n.module_eval do
+ class << self
+ alias_method :original_rails_i18n_translate, :translate
+ def translate(key, options = {})
+ begin
+ original_rails_i18n_translate(key, options.merge!({:raise => true}))
+ rescue ::I18n::MissingTranslationData => e
+ if self.config.locale != ::Refinery::I18n.default_locale
+ self.translate(key, options.update(:locale => ::Refinery::I18n.default_locale))
+ else
+ raise e
+ end
+ end
+ end
+ end
+ end if Rails.env.production?
+
::Refinery::I18n.setup!
end
View
2  vendor/plugins/refinery/config/locales/da.yml
@@ -27,8 +27,6 @@ da:
shared:
site_bar:
log_out: Log af
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
admin:
message:
close: Luk
View
2  vendor/plugins/refinery/config/locales/de.yml
@@ -27,8 +27,6 @@ de:
shared:
site_bar:
log_out: Ausloggen
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
admin:
message:
close: Schließen
View
2  vendor/plugins/refinery/config/locales/es.yml
@@ -27,8 +27,6 @@ es:
shared:
site_bar:
log_out: "Cerrar sesión"
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
admin:
message:
close: Cerrar
View
5 vendor/plugins/refinery/config/locales/it.yml
@@ -27,8 +27,6 @@ it:
shared:
site_bar:
log_out: Log out
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
admin:
message:
close: Fine
@@ -55,9 +53,6 @@ it:
resource: risorsa
message:
close: Fine
- site_bar:
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
activerecord:
models:
View
2  vendor/plugins/refinery/config/locales/nb.yml
@@ -27,8 +27,6 @@ nb:
shared:
site_bar:
log_out: Logg ut
- switch_to_your_website: Switch to your website
- switch_to_your_website_editor: Switch to your website editor
admin:
message:
close: Lukk
View
2  vendor/plugins/refinery/lib/generators/refinery/templates/config/locales/nl.yml
@@ -1,4 +1,4 @@
-en:
+nl:
admin:
<%= plural_name %>:
index:
View
2  vendor/plugins/refinery/lib/generators/refinery/templates/seed.rb
@@ -1,5 +1,5 @@
User.find(:all).each do |user|
- user.plugins.create(:name => "<%= class_name.pluralize.underscore.titleize %>",
+ user.plugins.create(:name => "<%= class_name.pluralize.underscore.downcase %>",
:position => (user.plugins.maximum(:position) || -1) +1)
end
View
2  vendor/plugins/refinery/lib/refinery.rb
@@ -27,7 +27,7 @@ class Version
MAJOR = 0
MINOR = 9
TINY = 7
- BUILD = 2
+ BUILD = 3
STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
View
4 vendor/plugins/refinery/lib/refinery/application_controller.rb
@@ -59,7 +59,7 @@ def login?
protected
def default_url_options(options={})
- Refinery::I18n.enabled? ? { :locale => I18n.locale } : {}
+ ::Refinery::I18n.enabled? ? { :locale => I18n.locale } : {}
end
# get all the pages to be displayed in the site menu.
@@ -88,7 +88,7 @@ def find_or_set_locale
::I18n.locale = locale
elsif locale.present? and locale != ::Refinery::I18n.default_frontend_locale
params[:locale] = I18n.locale = ::Refinery::I18n.default_frontend_locale
- redirect_to(params, :message => "The locale '#{locale.to_s}' is not supported.") and return
+ redirect_to(params, :notice => "The locale '#{locale.to_s}' is not supported.") and return
else
::I18n.locale = ::Refinery::I18n.default_frontend_locale
end
View
55 vendor/plugins/refinery/lib/tasks/refinery.rake
@@ -98,6 +98,7 @@ namespace :refinery do
desc "Update the core files with the gem"
task :update => :environment do
+ verbose = ENV["verbose"] || false
require 'fileutils'
# ensure asset directories exist.
@@ -107,17 +108,17 @@ namespace :refinery do
# copy in the new assets.
assets = [%w(public stylesheets refinery), %w(public javascripts refinery), %w(public javascripts wymeditor), %w(public images wymeditor skins refinery), %w(public images refinery), %w(public stylesheets wymeditor skins refinery), %w(public javascripts jquery)]
assets.each do |asset|
- FileUtils::rm_rf File.join(Rails.root, asset), :secure => true # ensure the destination is clear.
- FileUtils::cp_r File.join(Refinery.root, asset), File.join(Rails.root, asset) # copy the new assets into the project.
+ FileUtils::rm_rf File.join(Rails.root, asset), :secure => true, :verbose => verbose # ensure the destination is clear.
+ FileUtils::cp_r File.join(Refinery.root, asset), File.join(Rails.root, asset), :verbose => verbose # copy the new assets into the project.
end
# copy in any new migrations.
- FileUtils::cp Dir[Refinery.root.join("db", "migrate", "*.rb").cleanpath.to_s], Rails.root.join("db", "migrate").cleanpath.to_s
+ FileUtils::cp Dir[Refinery.root.join("db", "migrate", "*.rb").cleanpath.to_s], Rails.root.join("db", "migrate").cleanpath.to_s, :verbose => verbose
# replace rakefile and gemfile.
- FileUtils::cp Refinery.root.join("Rakefile").cleanpath.to_s, Rails.root.join("Rakefile").cleanpath.to_s
+ FileUtils::cp Refinery.root.join("Rakefile").cleanpath.to_s, Rails.root.join("Rakefile").cleanpath.to_s, :verbose => verbose
unless Rails.root.join("Gemfile").exist?
- FileUtils::cp Refinery.root.join("Gemfile").cleanpath.to_s, Rails.root.join("Gemfile").cleanpath.to_s
+ FileUtils::cp Refinery.root.join("Gemfile").cleanpath.to_s, Rails.root.join("Gemfile").cleanpath.to_s, :verbose => verbose
else
# replace refinery's gem requirements in the Gemfile
refinery_gem_requirements = Refinery.root.join('Gemfile').read.to_s.scan(/(#===REFINERY REQUIRED GEMS===.+?#===REFINERY END OF REQUIRED GEMS===)/m).first.join('\n')
@@ -133,18 +134,18 @@ namespace :refinery do
Rails.root.join('features', 'support').mkpath
# copy in cucumber features
- FileUtils::cp Dir[Refinery.root.join('features', 'refinery', '*.feature').to_s], Rails.root.join('features', 'refinery').to_s
- FileUtils::cp Dir[Refinery.root.join('features', 'step_definitions', 'refinery', '*.rb').to_s], Rails.root.join('features', 'step_definitions', 'refinery').to_s
- FileUtils::cp Dir[Refinery.root.join('features', 'step_definitions', 'web_steps.rb').to_s], Rails.root.join('features', 'step_definitions').to_s
- FileUtils::cp Dir[Refinery.root.join('features', 'support', '*.rb').to_s], Rails.root.join('features', 'support').to_s
+ FileUtils::cp Dir[Refinery.root.join('features', 'refinery', '*.feature').to_s], Rails.root.join('features', 'refinery').to_s, :verbose => verbose
+ FileUtils::cp Dir[Refinery.root.join('features', 'step_definitions', 'refinery', '*.rb').to_s], Rails.root.join('features', 'step_definitions', 'refinery').to_s, :verbose => verbose
+ FileUtils::cp Dir[Refinery.root.join('features', 'step_definitions', 'web_steps.rb').to_s], Rails.root.join('features', 'step_definitions').to_s, :verbose => verbose
+ FileUtils::cp Dir[Refinery.root.join('features', 'support', '*.rb').to_s], Rails.root.join('features', 'support').to_s, :verbose => verbose
# update the script directory for any fixes that have happened.
- FileUtils::cp_r Dir[Refinery.root.join('script', '*').to_s], Rails.root.join('script').to_s
- FileUtils::chmod_R 0755, Rails.root.join('script').to_s
+ FileUtils::cp_r Dir[Refinery.root.join('script', '*').to_s], Rails.root.join('script').to_s, :verbose => verbose
+ FileUtils::chmod_R 0755, Rails.root.join('script').to_s, :verbose => verbose
# add the cucumber environment file if it's not present
unless (cucumber_environment_file = Rails.root.join('config', 'environments', 'cucumber.rb')).exist?
- FileUtils::cp Refinery.root.join('config', 'environments', 'cucumber.rb').to_s, cucumber_environment_file.to_s
+ FileUtils::cp Refinery.root.join('config', 'environments', 'cucumber.rb').to_s, cucumber_environment_file.to_s, :verbose => verbose
# Add cucumber database adapter (link to test)
existing_db_config = Rails.root.join('config', 'database.yml').read.to_s
Rails.root.join('config', 'database.yml').open('w+') do |f|
@@ -153,23 +154,23 @@ namespace :refinery do
end
# replace the preinitializer.
- FileUtils::cp Refinery.root.join("config", "preinitializer.rb").cleanpath.to_s, Rails.root.join("config", "preinitializer.rb").cleanpath.to_s
+ FileUtils::cp Refinery.root.join("config", "preinitializer.rb").cleanpath.to_s, Rails.root.join("config", "preinitializer.rb").cleanpath.to_s, :verbose => verbose
# replace the config.ru file
- FileUtils::cp Refinery.root.join('config.ru').cleanpath.to_s, Rails.root.join('config.ru').cleanpath.to_s
+ FileUtils::cp Refinery.root.join('config.ru').cleanpath.to_s, Rails.root.join('config.ru').cleanpath.to_s, :verbose => verbose
# copy the lib/refinery directory in
- FileUtils::cp_r Refinery.root.join("lib", "refinery").cleanpath.to_s, Rails.root.join("lib").cleanpath.to_s
+ FileUtils::cp_r Refinery.root.join("lib", "refinery").cleanpath.to_s, Rails.root.join("lib").cleanpath.to_s, :verbose => verbose
# copy any initializers
Dir[Refinery.root.join('config', 'initializers', '*.rb').to_s].each do |initializer|
unless (rails_initializer = Rails.root.join('config', 'initializers', initializer.split(File::SEPARATOR).last)).exist?
- FileUtils::cp initializer, rails_initializer
+ FileUtils::cp initializer, rails_initializer, :verbose => verbose
end
end
unless (aai_config_file = Rails.root.join('config', 'acts_as_indexed_config.rb')).exist?
- FileUtils::cp Refinery.root.join('config', 'acts_as_indexed_config.rb').to_s, aai_config_file.to_s
+ FileUtils::cp Refinery.root.join('config', 'acts_as_indexed_config.rb').to_s, aai_config_file.to_s, :verbose => verbose
end
# get current secret key
@@ -189,10 +190,10 @@ namespace :refinery do
# read in the config files
if Rails.root.join("config", "application.rb").exist?
- FileUtils::cp Refinery.root.join("config", "environment.rb").cleanpath.to_s, Rails.root.join("config", "environment.rb").cleanpath.to_s
+ FileUtils::cp Refinery.root.join("config", "environment.rb").cleanpath.to_s, Rails.root.join("config", "environment.rb").cleanpath.to_s, :verbose => verbose
else
# write the new content into the file.
- FileUtils::cp Refinery.root.join("config", "application.rb").cleanpath.to_s, Rails.root.join("config", "application.rb").cleanpath.to_s
+ FileUtils::cp Refinery.root.join("config", "application.rb").cleanpath.to_s, Rails.root.join("config", "application.rb").cleanpath.to_s, :verbose => verbose
(app_rb_lines = Rails.root.join("config", "application.rb").read.split('\n')).each do |line|
secret_match = line.scan(/(:secret)([^']*)([\'])([^\']*)/).flatten.last
@@ -202,11 +203,11 @@ namespace :refinery do
# write the new content into the file.
Rails.root.join("config", "application.rb").open("w").puts(app_rb_lines.join('\n'))
- FileUtils::cp Refinery.root.join('config', 'environment.rb').cleanpath.to_s, Rails.root.join('config', 'environment.rb').cleanpath.to_s
+ FileUtils::cp Refinery.root.join('config', 'environment.rb').cleanpath.to_s, Rails.root.join('config', 'environment.rb').cleanpath.to_s, :verbose => verbose
end
unless Rails.root.join("config", "settings.rb").exist?
- FileUtils::cp(Refinery.root.join('config', 'settings.rb').cleanpath.to_s, Rails.root.join('config', 'settings.rb').cleanpath.to_s)
+ FileUtils::cp Refinery.root.join('config', 'settings.rb').cleanpath.to_s, Rails.root.join('config', 'settings.rb').cleanpath.to_s, :verbose => verbose
end
app_config_file = "application.rb"
@@ -214,9 +215,9 @@ namespace :refinery do
app_config = Rails.root.join("config", app_config_file).read
# copy new jquery javascripts.
- FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery.js').cleanpath.to_s
- FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery-min.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery-min.js').cleanpath.to_s
- FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery-ui-custom-min.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery-ui-custom-min.js').cleanpath.to_s
+ FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery.js').cleanpath.to_s, :verbose => verbose
+ FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery-min.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery-min.js').cleanpath.to_s, :verbose => verbose
+ FileUtils.cp Refinery.root.join('public', 'javascripts', 'jquery-ui-custom-min.js').cleanpath.to_s, Rails.root.join('public', 'javascripts', 'jquery-ui-custom-min.js').cleanpath.to_s, :verbose => verbose
# Test the admin file to see if it's old
if ((admin_js_contents = Rails.root.join('public', 'javascripts', 'admin.js').readlines.join('')) == "if (!wymeditorClassesItems) {\n var wymeditorClassesItems = [];\n}\n\nwymeditorClassesItems = $.extend([\n {name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}\n , {name: 'image-align', rules:['left', 'right'], join: '-'}\n , {name: 'font-size', rules:['small', 'normal', 'large'], join: '-'}\n], wymeditorClassesItems);")
@@ -227,10 +228,12 @@ namespace :refinery do
end
end
# backup the config file.
- FileUtils.cp Rails.root.join('config', app_config_file).cleanpath.to_s, Rails.root.join('config', "#{app_config_file.gsub('.rb', '')}.autobackupbyrefinery.rb").cleanpath.to_s
+ FileUtils.cp Rails.root.join('config', app_config_file).cleanpath.to_s, Rails.root.join('config', "#{app_config_file.gsub('.rb', '')}.autobackupbyrefinery.rb").cleanpath.to_s, :verbose => verbose
# copy the new config file.
- FileUtils.cp Refinery.root.join('config', app_config_file).cleanpath.to_s, Rails.root.join('config', app_config_file).cleanpath.to_s
+ FileUtils.cp Refinery.root.join('config', app_config_file).cleanpath.to_s, Rails.root.join('config', app_config_file).cleanpath.to_s, :verbose => verbose
+
+ puts "\n" if verbose
unless (ENV["from_installer"] || 'false').to_s == 'true'
puts "---------"

No commit comments for this range

Something went wrong with that request. Please try again.