Skip to content

Commit

Permalink
Merge branch 'master' into ui
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Sep 3, 2011
2 parents 4621322 + 9ef86be commit 58cd5d3
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 46 deletions.
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -50,19 +50,23 @@ PATH
refinerycms-core (= 2.0.0)
refinerycms-generators (2.0.0)
refinerycms-images (2.0.0)
activerecord (~> 3.1.0)
dragonfly (~> 0.9.0)
rack-cache (>= 0.5.3)
refinerycms-core (= 2.0.0)
refinerycms-pages (2.0.0)
activerecord (~> 3.1.0)
awesome_nested_set (~> 2.0)
friendly_id_globalize3 (~> 3.2.1)
refinerycms-core (= 2.0.0)
seo_meta (>= 1.2.0.rc1)
refinerycms-resources (2.0.0)
activerecord (~> 3.1.0)
dragonfly (~> 0.9.0)
rack-cache (>= 0.5.3)
refinerycms-core (= 2.0.0)
refinerycms-settings (2.0.0)
activerecord (~> 3.1.0)
refinerycms-base (= 2.0.0)
refinerycms-testing (2.0.0)
capybara (~> 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion authentication/refinerycms-authentication.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Authentication engine for Refinery CMS}
s.description = %q{The default authentication engine for Refinery CMS}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down
2 changes: 1 addition & 1 deletion base/refinerycms-base.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Base engine for Refinery CMS}
s.description = %q{This provides a base for Refinery CMS which handles things like settings on the Refinery namespace.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down
16 changes: 12 additions & 4 deletions bin/refinerycms
Expand Up @@ -147,6 +147,9 @@ module Refinery

# Run any database migrations
migrate! unless @options[:database][:skip]

# Deploy to a hosting provider
deploy!

# Output helpful messages to user
output!
Expand All @@ -171,19 +174,21 @@ module Refinery
exit(1)
end

# Get the name and path of the new application
@app_path = Pathname.new(File.expand_path(@input.first))
@app_name = @app_path.to_s.split(File::SEPARATOR).last

rails_version_in_path = run_command('rails --version', {:cd => false, :bundler => false, :puts => false}).to_s.gsub(/(Rails |\n)/, '')
@rails_version_to_use = @options[:rails][:version] || rails_version_in_path
if @rails_version_to_use !~ %r{\b#{RAILS_MINOR_VERSION}}
puts "\nRails #{@rails_version_to_use} is not supported by Refinery #{::Refinery.version}, " \
"please use Rails #{RAILS_MINOR_VERSION}.x instead."
puts "\nYou can tell Refinery CMS an installed and compatible rails version to use like so:\n"
puts "\nrefinerycms #{@app_name} --rails-version #{RAILS_MINOR_VERSION}"
puts "\n"
exit(1)
end

# Get the name and path of the new application
@app_path = Pathname.new(File.expand_path(@input.first))
@app_name = @app_path.to_s.split(File::SEPARATOR).last

# Get the refinery path based on this file
@refinery_path = Pathname.new(File.expand_path('../../', __FILE__))

Expand Down Expand Up @@ -241,6 +246,9 @@ module Refinery
# Detect non-success or a blank rails output or starting with "Can't initialize" or "Error"
if !$?.success? or rails_output.to_s.length == 0 or rails_output =~ /^(Can't\ initialize|Error)/
puts "\nGenerating Rails application failed. Exiting..."
if run_command('gem list rails', {:cd => false, :puts => false, :ruby => false}) !~ %r{[( ]#{@rails_version_to_use}(.0)*[,\)]}
puts "\nDo you have Rails #{@rails_version_to_use} installed?"
end
puts "\n"
exit(1)
else
Expand Down
28 changes: 27 additions & 1 deletion changelog.md
Expand Up @@ -5,7 +5,33 @@
* Renamed `RefinerySetting` to `Refinery::Setting`. [Philip Arndt](https://github.com/parndt)
* Added `--trace` option to bin/refinerycms. [Steven Heidel](http://github.com/stevenheidel)
* Moved `/shared/*` to `/refinery/*` instead, including `/shared/admin/*` to `/refinery/admin/*` as it makes more sense. [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.4...master)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.8...master)

## 1.0.8 [1 September 2011]

* `refinerycms-core` now depends on rails so that users of 1.0.x can be confident of the entire stack being present as before. [Philip Arndt](https://github.com/parndt)
* No longer requiring autotest as a dependency of `refinerycms-testing`. [Philip Arndt](https://github.com/parndt)
* Improved 'wrong rails version' error message on install with a more helpful guide on how to specify a rails version. [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.7...1.0.8)

## 1.0.7 [31 August 2011]

* No change, just fixing corruption in the 1.0.6 gem caused by Syck. [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.6...1.0.7)

## 1.0.6 [31 August 2011]

* Added support for Devise `~> 1.4.3`. [Philip Arndt](https://github.com/parndt)
* Removed dependency on Rails but added dependencies to its components, like activerecord, where they are used. [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.5...1.0.6)

## 1.0.5 [31 August 2011]

* jQuery UI updated to `1.8.15` from `1.8.9`. [Uģis Ozols](https://github.com/ugisozols)
* Removed Duostack hosting option from the installer because the platform isn't online anymore. [Philip Arndt](https://github.com/parndt)
* Fixed non raw output into noscript section of the backend. [Philip Arndt](https://github.com/parndt)
* `will_paginate` updated to `~> 3.0.0` now that it has gone final. [Uģis Ozols](https://github.com/ugisozols)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.4...1.0.5)

## 1.0.4 [11 August 2011]

Expand Down
36 changes: 11 additions & 25 deletions core/lib/refinery/plugins.rb
@@ -1,61 +1,47 @@
module Refinery
class Plugins < Array

def initialize
@plugins = []
end

def find_activity_by_model(model)
unless (plugin = find_by_model(model)).nil?
plugin.activity.detect {|activity| activity.class == model}
end
end

def find_by_model(model)
model = model.constantize if model.is_a? String
self.detect { |plugin| plugin.activity.any? {|activity| activity.class == model } }
detect { |plugin| plugin.activity.any? {|activity| activity.class == model } }
end

def find_by_name(name)
self.detect { |plugin| plugin.name == name }
detect { |plugin| plugin.name == name }
end
alias :[] :find_by_name

def find_by_title(title)
self.detect { |plugin| plugin.title == title }
detect { |plugin| plugin.title == title }
end

def in_menu
_in_menu = self.class.new
self.each { |p| _in_menu << p unless p.hide_from_menu }
_in_menu
self.class.new(reject(&:hide_from_menu))
end

def names
self.map(&:name)
map(&:name)
end

def pathnames
self.map(&:pathname).compact.uniq
map(&:pathname).compact.uniq
end

def titles
self.map(&:title)
map(&:title)
end

class << self
def active
@active_plugins ||= self.new
@active_plugins ||= new
end

def always_allowed
_always_allowed = self.new
registered.each { |p| _always_allowed << p if p.always_allow_access? }
_always_allowed
new registered.select(&:"always_allow_access?")
end

def registered
@registered_plugins ||= self.new
@registered_plugins ||= new
end

def activate(name)
Expand All @@ -67,7 +53,7 @@ def deactivate(name)
end

def set_active(names)
@active_plugins = self.new
@active_plugins = new

names.each do |name|
activate(name)
Expand Down
2 changes: 1 addition & 1 deletion core/refinerycms-core.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Core engine for Refinery CMS}
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down
2 changes: 1 addition & 1 deletion core/spec/lib/refinery/plugins_spec.rb
Expand Up @@ -100,7 +100,7 @@ module Refinery
it 'identifies as Refinery::Plugins' do
subject.class.active.class.should == subject.class
end

it 'only contains items that are registered' do
subject.class.set_active(%w(my_plugin))
subject.class.active.any?.should be_true
Expand Down
4 changes: 2 additions & 2 deletions dashboard/app/helpers/refinery/admin/dashboard_helper.rb
Expand Up @@ -3,8 +3,8 @@ module Admin
module DashboardHelper

def activity_message_for(record)
if (plugin = ::Refinery::Plugins.active.find_by_model(record.class)).present? &&
(activity = plugin.activity.first).present?
if (plugin = ::Refinery::Plugins.active.find_by_model(record.class)) &&
(activity = plugin.activity.first)
# work out which action occured
action = record.updated_at.eql?(record.created_at) ? 'created' : 'updated'

Expand Down
2 changes: 1 addition & 1 deletion dashboard/refinerycms-dashboard.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Dashboard engine for Refinery CMS}
s.description = %q{The dashboard is usually the first engine the user sees in the backend of Refinery CMS. It displays useful information and contains links to common functionality.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down
Expand Up @@ -19,7 +19,7 @@ Take a look at "http://rubygems.org/gems/refinerycms":http://rubygems.org/gems/r
Edit your +Gemfile+ to reference the latest version of Refinery (a later version than the one shown "may exist":https://rubygems.org/gems/refinerycms/versions).

<ruby>
gem 'refinerycms', '= 1.0.0'
gem 'refinerycms', '= 1.0.8'
</ruby>

Now install the new gems using bundler ('bundle install' is outdated):
Expand All @@ -30,6 +30,8 @@ $ bundle update

Use the rails generator to update your Refinery installation:

TIP: You only need to run the below step when upgrading between major or minor versions. Bug fix releases should not change the database structure. For example, if you are going from 1.0.3 -> 1.0.8 (Bugfix) you do not need to run this command.

<shell>
$ rails generate refinerycms --update
</shell>
Expand Down
Expand Up @@ -6,6 +6,10 @@ Refinery ships with a range of specs and cucumbers to test it. This guide will s

endprologue.

h3. First configure your Refinery application for testing
<shell>
rails g refinerycms_testing
</shell>

h3. Running the Tests

Expand Down Expand Up @@ -72,4 +76,4 @@ admin:
username: "username"
email: "some@email.com"
encrypted_password: "1234567"
</code></pre>
</code></pre>
2 changes: 1 addition & 1 deletion generators/refinerycms-generators.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Core generators for Refinery CMS including refinery:engine.}
s.description = %q{Core generators for Refinery CMS including refinery:engine.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down
1 change: 1 addition & 0 deletions images/lib/gemspec.rb
Expand Up @@ -28,6 +28,7 @@
]
s.add_dependency 'refinerycms-core', '= #{::Refinery::Version}'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'dragonfly', '~> 0.9.0'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
Expand Down
3 changes: 2 additions & 1 deletion images/refinerycms-images.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Images engine for Refinery CMS}
s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down Expand Up @@ -96,6 +96,7 @@ Gem::Specification.new do |s|
]

s.add_dependency 'refinerycms-core', '= 2.0.0'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'dragonfly', '~> 0.9.0'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
1 change: 1 addition & 0 deletions pages/lib/gemspec.rb
Expand Up @@ -28,6 +28,7 @@
]
s.add_dependency 'refinerycms-core', '= #{::Refinery::Version}'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
s.add_dependency 'awesome_nested_set', '~> 2.0'
s.add_dependency 'seo_meta', '>= 1.2.0.rc1'
Expand Down
4 changes: 3 additions & 1 deletion pages/refinerycms-pages.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Pages engine for Refinery CMS}
s.description = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down Expand Up @@ -127,11 +127,13 @@ Gem::Specification.new do |s|
'spec/models/refinery/page_spec.rb',
'spec/requests',
'spec/requests/manage_pages_spec.rb',
'spec/requests/multiple_locales_spec.rb',
'spec/requests/page_frontend_spec.rb',
'spec/requests/translate_pages_spec.rb'
]

s.add_dependency 'refinerycms-core', '= 2.0.0'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
s.add_dependency 'awesome_nested_set', '~> 2.0'
s.add_dependency 'seo_meta', '>= 1.2.0.rc1'
Expand Down
2 changes: 1 addition & 1 deletion refinerycms.gemspec
Expand Up @@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.name = %q{refinerycms}
s.version = %q{2.0.0}
s.description = %q{A Ruby on Rails CMS that supports Rails 3. It's easy to extend and sticks to 'the Rails way' where possible.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.summary = %q{A Ruby on Rails CMS that supports Rails 3}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
Expand Down
1 change: 1 addition & 0 deletions resources/lib/gemspec.rb
Expand Up @@ -28,6 +28,7 @@
]
s.add_dependency 'refinerycms-core', '= #{::Refinery::Version}'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'dragonfly', '~> 0.9.0'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
Expand Down
3 changes: 2 additions & 1 deletion resources/refinerycms-resources.gemspec
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = %q{2.0.0}
s.summary = %q{Resources engine for Refinery CMS}
s.description = %q{Handles all file upload and processing functionality in Refinery CMS.}
s.date = %q{2011-08-31}
s.date = %q{2011-09-03}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
Expand Down Expand Up @@ -90,6 +90,7 @@ Gem::Specification.new do |s|
]

s.add_dependency 'refinerycms-core', '= 2.0.0'
s.add_dependency 'activerecord', '~> 3.1.0'
s.add_dependency 'dragonfly', '~> 0.9.0'
s.add_dependency 'rack-cache', '>= 0.5.3'
end
2 changes: 2 additions & 0 deletions settings/lib/gemspec.rb
Expand Up @@ -21,6 +21,8 @@
s.require_paths = %w(lib)
s.executables = %w(#{Pathname.glob(gempath.join('bin/*')).map{|d| d.relative_path_from(gempath)}.sort.join(" ")})
s.add_dependency 'activerecord', '~> 3.1.0'
s.files = [
'#{%w( **/{*,.rspec,.gitignore,.yardopts} ).map { |file| Pathname.glob(gempath.join(file)) }.flatten.reject{|f|
!f.exist? or f.to_s =~ /\.gem$/ or (f.directory? and f.children.empty?)
Expand Down

0 comments on commit 58cd5d3

Please sign in to comment.