Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

We call them *extensions* now and not *engines*

  • Loading branch information...
commit f484734854345c8f99e46a3db944dd8500f2e91d 1 parent 0711fb2
@parndt parndt authored
Showing with 348 additions and 415 deletions.
  1. +14 −14 Guardfile
  2. +1 −1  authentication/lib/refinery/authenticated_system.rb
  3. +1 −1  authentication/lib/refinery/authentication/engine.rb
  4. +2 −2 authentication/refinerycms-authentication.gemspec
  5. +1 −0  changelog.md
  6. +0 −18 core/lib/generators/refinery/engine/templates/refinerycms-engine_plural_name.gemspec
  7. +0 −49 ...nerators/refinery/form/templates/app/controllers/refinery/plural_name/plural_name/plural_name_controller.rb
  8. +5 −5 core/lib/refinery/cli.rb
  9. +26 −25 core/lib/refinery/core.rb
  10. +3 −2 core/lib/refinery/core/engine.rb
  11. +1 −1  core/lib/refinery/errors.rb
  12. +31 −32 core/lib/refinery/extension_generation.rb
  13. +2 −2 core/refinerycms-core.gemspec
  14. +2 −2 core/spec/lib/generators/refinery/engine/engine_generator_spec.rb
  15. +3 −5 core/spec/lib/generators/refinery/form/form_generator_spec.rb
  16. +38 −38 core/spec/lib/refinery/core_spec.rb
  17. +6 −6 core/spec/requests/refinery/search_spec.rb
  18. +1 −1  dashboard/lib/refinery/dashboard/engine.rb
  19. +2 −2 dashboard/refinerycms-dashboard.gemspec
  20. +52 −52 doc/guides/1 - Getting Started/2 - Getting Started with Refinery.textile
  21. +2 −2 doc/guides/1 - Getting Started/3 - Attaching Refinery CMS to an existing Rails application.textile
  22. +3 −3 ...uides/1 - Getting Started/4 - Attaching Refinery CMS as part of a larger Rails + Devise application.textile
  23. +1 −1  doc/guides/1 - Getting Started/5 - Attaching Refinery CMS as part of a larger Rails 3.1.x + Devise.textile
  24. +1 −1  doc/guides/2 - Advanced/1 - Extending Controllers and Models with Decorators.textile
  25. +1 −1  doc/guides/4 - Customising your Design/2 - How to override a view.textile
  26. +4 −4 doc/guides/5 - Extending with Engines/1 - Tabbed fields in your engine's admin area.textile
  27. +71 −71 doc/guides/5 - Extending with Engines/2 - Creating Multiple Data-Tables in a Single Engine.textile
  28. +6 −6 doc/guides/5 - Extending with Engines/3 - How to test your engine.textile
  29. +5 −5 doc/guides/5 - Extending with Engines/4 - How to Add Marketable URLs to your Engine.textile
  30. +2 −2 doc/guides/8 - Tips and Tricks/1 - How to add an image gallery to pages.textile
  31. +1 −1  images/lib/refinery/images/engine.rb
  32. +1 −1  images/refinerycms-images.gemspec
  33. +2 −2 lib/refinery/all.rb
  34. +1 −1  pages/app/models/refinery/page.rb
  35. +1 −1  pages/lib/generators/refinery/pages/pages_generator.rb
  36. +1 −1  pages/lib/refinery/pages/engine.rb
  37. +2 −2 pages/refinerycms-pages.gemspec
  38. +8 −8 readme.md
  39. +1 −1  resources/lib/refinery/resources/engine.rb
  40. +1 −1  resources/refinerycms-resources.gemspec
  41. +1 −1  resources/spec/requests/refinery/admin/resources_spec.rb
  42. +8 −8 tasks/release.rake
  43. +14 −14 testing/lib/generators/refinery/testing/templates/Guardfile
  44. +9 −9 testing/lib/refinery/tasks/testing.rake
  45. +4 −4 testing/lib/refinery/testing.rb
  46. +6 −6 testing/lib/refinery/testing/railtie.rb
View
28 Guardfile
@@ -1,4 +1,4 @@
-engines = (ENV['ENGINES'] && ENV['ENGINES'].to_s.split(',')) || %w(
+extensions = (ENV['ENGINES'] && ENV['ENGINES'].to_s.split(',')) || %w(
authentication
core
dashboard
@@ -15,23 +15,23 @@ guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => '
watch('spec/spec_helper.rb')
watch(%r{^spec/support/.+\.rb$})
- engines.each do |engine|
- watch(%r{^#{engine}/spec/support/.+\.rb$})
+ extensions.each do |extension|
+ watch(%r{^#{extension}/spec/support/.+\.rb$})
end
end
-guard 'rspec', :version => 2, :spec_paths => engines.map{|e| "#{e}/spec"},
+guard 'rspec', :version => 2, :spec_paths => extensions.map{|e| "#{e}/spec"},
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
- engines.each do |engine|
- watch(%r{^#{engine}/spec/.+_spec\.rb$})
- watch(%r{^#{engine}/app/(.+)\.rb$}) { |m| "#{engine}/spec/#{m[1]}_spec.rb" }
- watch(%r{^#{engine}/lib/(.+)\.rb$}) { |m| "#{engine}/spec/lib/#{m[1]}_spec.rb" }
- watch(%r{^#{engine}/app/controllers/(.+)_(controller)\.rb$}) { |m| ["#{engine}/spec/routing/#{m[1]}_routing_spec.rb", "#{engine}/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "#{engine}/spec/requests/#{m[1]}_spec.rb"] }
- watch(%r{^#{engine}/spec/support/(.+)\.rb$}) { "#{engine}/spec" }
- watch("#{engine}/spec/spec_helper.rb") { "#{engine}/spec" }
- watch("#{engine}/config/routes.rb") { "#{engine}/spec/routing" }
- watch("#{engine}/app/controllers/application_controller.rb") { "#{engine}/spec/controllers" }
+ extensions.each do |extension|
+ watch(%r{^#{extension}/spec/.+_spec\.rb$})
+ watch(%r{^#{extension}/app/(.+)\.rb$}) { |m| "#{extension}/spec/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/lib/(.+)\.rb$}) { |m| "#{extension}/spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/app/controllers/(.+)_(controller)\.rb$}) { |m| ["#{extension}/spec/routing/#{m[1]}_routing_spec.rb", "#{extension}/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "#{extension}/spec/requests/#{m[1]}_spec.rb"] }
+ watch(%r{^#{extension}/spec/support/(.+)\.rb$}) { "#{extension}/spec" }
+ watch("#{extension}/spec/spec_helper.rb") { "#{extension}/spec" }
+ watch("#{extension}/config/routes.rb") { "#{extension}/spec/routing" }
+ watch("#{extension}/app/controllers/application_controller.rb") { "#{extension}/spec/controllers" }
# Capybara request specs
- watch(%r{^#{engine}/app/views/(.+)/.*\.(erb|haml)$}) { |m| "#{engine}/spec/requests/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/app/views/(.+)/.*\.(erb|haml)$}) { |m| "#{extension}/spec/requests/#{m[1]}_spec.rb" }
end
end
View
2  authentication/lib/refinery/authenticated_system.rb
@@ -15,7 +15,7 @@ def redirect_back_or_default(default)
end
# This just defines the devise method for after sign in to support
- # engine namespace isolation...
+ # extension namespace isolation...
def after_sign_in_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
home_path = "#{scope}_root_path"
View
2  authentication/lib/refinery/authentication/engine.rb
@@ -29,7 +29,7 @@ class Engine < ::Rails::Engine
end
config.after_initialize do
- Refinery.register_engine(Refinery::Authentication)
+ Refinery.register_extension(Refinery::Authentication)
end
end
end
View
4 authentication/refinerycms-authentication.gemspec
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-authentication}
s.version = version
- s.summary = %q{Authentication engine for Refinery CMS}
- s.description = %q{The default authentication engine for Refinery CMS}
+ s.summary = %q{Authentication extension for Refinery CMS}
+ s.description = %q{The default authentication extension for Refinery CMS}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
View
1  changelog.md
@@ -6,6 +6,7 @@
* 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)
+* `vendor/engines` is now `vendor/extensions` [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/1.0.8...master)
## 1.0.8 [1 September 2011]
View
18 core/lib/generators/refinery/engine/templates/refinerycms-engine_plural_name.gemspec
@@ -1,18 +0,0 @@
-# Encoding: UTF-8
-
-Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = 'refinerycms-<%= engine_plural_name %>'
- s.version = '1.0'
- s.description = 'Ruby on Rails <%= engine_plural_name.titleize %> engine for Refinery CMS'
- s.date = '<%= Time.now.strftime('%Y-%m-%d') %>'
- s.summary = '<%= engine_plural_name.titleize %> engine for Refinery CMS'
- s.require_paths = %w(lib)
- s.files = Dir["{app,config,db,lib}/**/*"] + ["readme.md"]
-
- # Runtime dependencies
- s.add_dependency 'refinerycms-core', '~> <%= Refinery::Version %>'
-
- # Development dependencies (usually used for testing)
- s.add_development_dependency 'refinerycms-testing', '~> <%= Refinery::Version %>'
-end
View
49 ...form/templates/app/controllers/refinery/plural_name/plural_name/plural_name_controller.rb
@@ -1,49 +0,0 @@
-module Refinery
- module <%= class_name.pluralize %>
- class <%= class_name.pluralize %>Controller < ::ApplicationController
-
- before_filter :find_page, :only => [:create, :new]
-
- def index
- redirect_to :action => "new"
- end
-
- def thank_you
- @page = Refinery::Page.find_by_link_url("/<%= plural_name %>/thank_you", :include => [:parts])
- end
-
- def new
- @<%= singular_name %> = <%= class_name %>.new
- end
-
- def create
- @<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>])
-
- if @<%= singular_name %>.save
- begin
- <%= class_name %>Mailer.notification(@<%= singular_name %>, request).deliver
- rescue
- logger.warn "There was an error delivering an <%= singular_name %> notification.\n#{$!}\n"
- end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
-
- begin
- <%= class_name %>Mailer.confirmation(@<%= singular_name %>, request).deliver
- rescue
- logger.warn "There was an error delivering an <%= singular_name %> confirmation:\n#{$!}\n"
- end<% if @includes_spam %> if @<%= singular_name %>.ham?<% end %>
-
- redirect_to thank_you_<%= plural_name %>_url
- else
- render :action => 'new'
- end
- end
-
- protected
-
- def find_page
- @page = Refinery::Page.find_by_link_url('/<%= plural_name %>/new', :include => [:parts])
- end
-
- end
- end
-end
View
10 core/lib/refinery/cli.rb
@@ -24,7 +24,7 @@ def override(env)
puts "Copied view template file to #{destination.gsub("#{Rails.root.to_s}#{File::SEPARATOR}", '')}"
end
else
- puts "Couldn't match any view template files in any engines like #{view}"
+ puts "Couldn't match any view template files in any extensions like #{view}"
end
elsif (controller = env["controller"]).present?
pattern = "{refinery#{File::SEPARATOR},}#{controller.split("/").join(File::SEPARATOR)}*.rb"
@@ -44,7 +44,7 @@ def override(env)
puts "Copied controller file to #{destination.gsub("#{Rails.root.to_s}#{File::SEPARATOR}", '')}"
end
else
- puts "Couldn't match any controller files in any engines like #{controller}"
+ puts "Couldn't match any controller files in any extensions like #{controller}"
end
elsif (model = env["model"]).present?
pattern = "{refinery#{File::SEPARATOR},}#{model.split("/").join(File::SEPARATOR)}*.rb"
@@ -64,7 +64,7 @@ def override(env)
puts "Copied model file to #{destination.gsub("#{Rails.root.to_s}#{File::SEPARATOR}", '')}"
end
else
- puts "Couldn't match any model files in any engines like #{model}"
+ puts "Couldn't match any model files in any extensions like #{model}"
end
elsif (javascripts = env["javascript"]).present?
pattern = "#{javascripts.split("/").join(File::SEPARATOR)}*.js"
@@ -84,7 +84,7 @@ def override(env)
puts "Copied javascript file to #{destination.gsub("#{Rails.root.to_s}#{File::SEPARATOR}", '')}"
end
else
- puts "Couldn't match any javascript files in any engines like #{javascripts}"
+ puts "Couldn't match any javascript files in any extensions like #{javascripts}"
end
elsif (stylesheets = env["stylesheet"]).present?
pattern = "#{stylesheets.split("/").join(File::SEPARATOR)}*.css.scss"
@@ -104,7 +104,7 @@ def override(env)
puts "Copied stylesheet file to #{destination.gsub("#{Rails.root.to_s}#{File::SEPARATOR}", '')}"
end
else
- puts "Couldn't match any stylesheet files in any engines like #{stylesheets}"
+ puts "Couldn't match any stylesheet files in any extensions like #{stylesheets}"
end
else
puts "You didn't specify anything to override. Here are some examples:"
View
51 core/lib/refinery/core.rb
@@ -35,42 +35,43 @@ module Admin
autoload :EngineGenerator, 'generators/refinery/engine/engine_generator'
class << self
- @@engines = []
+ @@extensions = []
# Returns an array of modules representing currently registered Refinery Engines
#
# Example:
- # Refinery.engines => [Refinery::Core, Refinery::Pages]
- def engines
- @@engines
+ # Refinery.extensions => [Refinery::Core, Refinery::Pages]
+ def extensions
+ @@extensions
end
- # Register an engine with Refinery
+ # Register an extension with Refinery
#
# Example:
- # Refinery.register_engine(Refinery::Core)
- def register_engine(const)
- return if engine_registered?(const)
+ # Refinery.register_extension(Refinery::Core)
+ def register_extension(const)
+ return if extension_registered?(const)
- validate_engine!(const)
+ validate_extension!(const)
- @@engines << const
+ @@extensions << const
end
+ alias_method :register_engine, :register_extension
- # Unregister an engine from Refinery
+ # Unregister an extension from Refinery
#
# Example:
- # Refinery.unregister_engine(Refinery::Core)
- def unregister_engine(const)
- @@engines.delete(const)
+ # Refinery.unregister_extension(Refinery::Core)
+ def unregister_extension(const)
+ @@extensions.delete(const)
end
- # Returns true if an engine is currently registered with Refinery
+ # Returns true if an extension is currently registered with Refinery
#
# Example:
- # Refinery.engine_registered?(Refinery::Core)
- def engine_registered?(const)
- @@engines.include?(const)
+ # Refinery.extension_registered?(Refinery::Core)
+ def extension_registered?(const)
+ @@extensions.include?(const)
end
# Constructs a deprecation warning message and warns with Kernel#warn
@@ -115,23 +116,23 @@ def root
@root ||= Pathname.new(File.expand_path('../../../../', __FILE__))
end
- # Returns an array of Pathnames pointing to the root directory of each engine that
+ # Returns an array of Pathnames pointing to the root directory of each extension that
# has been registered with Refinery.
#
# Example:
# Refinery.roots => [#<Pathname:/Users/Reset/Code/refinerycms/core>, #<Pathname:/Users/Reset/Code/refinerycms/pages>]
#
- # An optional engine_name parameter can be specified to return just the Pathname for
- # the specified engine. This can be represented in Constant, Symbol, or String form.
+ # An optional extension_name parameter can be specified to return just the Pathname for
+ # the specified extension. This can be represented in Constant, Symbol, or String form.
#
# Example:
# Refinery.roots(Refinery::Core) => #<Pathname:/Users/Reset/Code/refinerycms/core>
# Refinery.roots(:'refinery/core') => #<Pathname:/Users/Reset/Code/refinerycms/core>
# Refinery.roots("refinery/core") => #<Pathname:/Users/Reset/Code/refinerycms/core>
- def roots(engine_name = nil)
- return @roots ||= self.engines.map { |engine| engine.root } if engine_name.nil?
+ def roots(extension_name = nil)
+ return @roots ||= self.extensions.map { |extension| extension.root } if extension_name.nil?
- engine_name.to_s.camelize.constantize.root
+ extension_name.to_s.camelize.constantize.root
end
def version
@@ -159,7 +160,7 @@ def route_for_model(klass, plural = false)
end
private
- def validate_engine!(const)
+ def validate_extension!(const)
unless const.respond_to?(:root) && const.root.is_a?(Pathname)
raise InvalidEngineError, "Engine must define a root accessor that returns a pathname to its root"
end
View
5 core/lib/refinery/core/engine.rb
@@ -7,7 +7,8 @@ class Engine < ::Rails::Engine
engine_name :refinery
class << self
- # Require/load (based on Rails app.config) all decorators from app/decorators/ and vendor/engines/*
+ # Require/load (based on Rails app.config) all decorators from app/decorators/
+ # and from registered plugins' paths too.
def load_decorators
[Rails.root, Refinery::Plugins.registered.pathnames].flatten.map { |p|
Dir[p.join('app', 'decorators', '**', '*_decorator.rb')]
@@ -135,7 +136,7 @@ def refinery_inclusion!
end
config.after_initialize do
- Refinery.register_engine(Refinery::Core)
+ Refinery.register_extension(Refinery::Core)
end
end
end
View
2  core/lib/refinery/errors.rb
@@ -6,7 +6,7 @@ module Refinery
class RefineryError < StandardError
end
- # Raised when an engine has not been properly defined. See the exception message for further
+ # Raised when an extension has not been properly defined. See the exception message for further
# details
class InvalidEngineError < RefineryError
end
View
63 core/lib/refinery/extension_generation.rb
@@ -6,7 +6,7 @@ def self.included(base)
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
class_option :namespace, :type => :string, :default => nil, :banner => 'NAMESPACE', :required => false
- class_option :engine, :type => :string, :default => nil, :banner => 'ENGINE', :required => false
+ class_option :extension, :type => :string, :default => nil, :banner => 'ENGINE', :required => false
class_option :i18n, :type => :array, :default => [], :required => false, :banner => "field field", :desc => 'Indicates generated fields'
remove_class_option :skip_namespace
@@ -20,34 +20,34 @@ def namespacing
end
end
- def engine_name
- @engine_name ||= if options[:engine].present?
+ def extension_name
+ @extension_name ||= if options[:extension].present?
# Use exactly what the user requested, not a made up version.
- options[:engine].to_s
+ options[:extension].to_s
else
singular_name
end
end
- def engine_class_name
- @engine_class_name ||= engine_name.camelize
+ def extension_class_name
+ @extension_class_name ||= extension_name.camelize
end
- def engine_plural_class_name
- @engine_plural_class_name ||= if options[:engine].present?
+ def extension_plural_class_name
+ @extension_plural_class_name ||= if options[:extension].present?
# Use exactly what the user requested, not a plural version.
- engine_class_name
+ extension_class_name
else
- engine_class_name.pluralize
+ extension_class_name.pluralize
end
end
- def engine_plural_name
- @engine_plural_name ||= if options[:engine].present?
+ def extension_plural_name
+ @extension_plural_name ||= if options[:extension].present?
# Use exactly what the user requested, not a plural version.
- engine_name
+ extension_name
else
- engine_name.pluralize
+ extension_name.pluralize
end
end
@@ -67,7 +67,7 @@ def attributes_for_translation_table
def append_extension_to_gemfile!
unless Rails.env.test? || (self.behavior != :revoke && extension_in_gemfile?)
- path = destination_pathname.join('vendor', 'engines').relative_path_from(gemfile.parent)
+ path = extension_pathname.parent.relative_path_from(gemfile.parent)
append_file gemfile, "\ngem '#{gem_name}', :path => '#{path}'"
end
end
@@ -88,20 +88,20 @@ def destination_pathname
end
def extension_pathname
- destination_pathname.join('vendor', 'extensions', engine_plural_name)
+ destination_pathname.join('vendor', 'extensions', extension_plural_name)
end
- def engine_path_for(path, engine)
+ def extension_path_for(path, extension)
path = extension_pathname.join(path.to_s.gsub(%r{#{source_pathname}/?}, '')).to_s
- path.gsub!('engine_plural_name', engine_plural_name)
+ path.gsub!('extension_plural_name', extension_plural_name)
path.gsub!('plural_name', plural_name)
path.gsub!('singular_name', singular_name)
path.gsub!('namespace', namespacing.underscore)
- if options[:namespace].present? || options[:engine].present?
+ if options[:namespace].present? || options[:extension].present?
# Increment the migration file leading number
- # Only relevant for nested or namespaced engines, where a previous migration exists
+ # Only relevant for nested or namespaced extensions, where a previous migration exists
if path =~ %r{/migrate/\d+\w*.rb\z}
if last_migration = Dir["#{destination_pathname.join(path.split(File::SEPARATOR)[0..-2], '*.rb')}"].sort.last
path.gsub!(%r{\d+_}) { |m| "#{last_migration.match(%r{migrate/(\d+)_})[1].to_i + 1}_" }
@@ -109,8 +109,8 @@ def engine_path_for(path, engine)
end
# Detect whether this is a special file that needs to get merged not overwritten.
- # This is important only when nesting engines.
- if engine.present? && File.exist?(path)
+ # This is important only when nesting extensions.
+ if extension.present? && File.exist?(path)
path = if path =~ %r{/locales/.*\.yml$} or path =~ %r{/routes.rb$} or path =~ %r{/#{gem_name}.rb$}
# put new translations into a tmp directory
path.split(File::SEPARATOR).insert(-2, "tmp").join(File::SEPARATOR)
@@ -119,7 +119,7 @@ def engine_path_for(path, engine)
else
path
end
- elsif engine.present? and path =~ /lib\/#{plural_name}.rb$/
+ elsif extension.present? and path =~ /lib\/#{plural_name}.rb$/
path = nil
end
end
@@ -138,14 +138,14 @@ def evaluate_templates!
Pathname.glob(source_pathname.join('**', '**')).reject{|f|
reject_template?(f)
}.sort.each do |path|
- if (template_path = engine_path_for(path, engine_name)).present?
+ if (template_path = extension_path_for(path, extension_name)).present?
template path, template_path
end
end
end
def existing_extension?
- options[:engine].present? && extension_pathname.directory? && extension_in_gemfile?
+ options[:extension].present? && extension_pathname.directory? && extension_in_gemfile?
end
def exit_with_message!(message)
@@ -168,7 +168,7 @@ def finalize_extension!
end
def gem_name
- "refinerycms-#{engine_plural_name}"
+ "refinerycms-#{extension_plural_name}"
end
def gemfile
@@ -181,9 +181,9 @@ def merge_locales!
if existing_extension?
# go through all of the temporary files and merge what we need into the current files.
tmp_directories = []
- Dir.glob(source_pathname.join("{config/locales/*.yml,config/routes.rb,lib/refinerycms-engine_plural_name.rb}"), File::FNM_DOTMATCH).sort.each do |path|
+ Dir.glob(source_pathname.join("{config/locales/*.yml,config/routes.rb,lib/refinerycms-extension_plural_name.rb}"), File::FNM_DOTMATCH).sort.each do |path|
# get the path to the current tmp file.
- new_file_path = destination_pathname.join(engine_path_for(path, engine_name))
+ new_file_path = destination_pathname.join(extension_path_for(path, extension_name))
tmp_directories << Pathname.new(new_file_path.to_s.split(File::SEPARATOR)[0..-2].join(File::SEPARATOR)) # save for later
# get the path to the existing file and perform a deep hash merge.
current_path = Pathname.new(new_file_path.to_s.split(File::SEPARATOR).reject{|f| f == 'tmp'}.join(File::SEPARATOR))
@@ -214,7 +214,7 @@ def puts_instructions!
puts "------------------------"
puts "Now run:"
puts "bundle install"
- puts "rails generate refinery:#{engine_plural_name}"
+ puts "rails generate refinery:#{extension_plural_name}"
puts "rake db:migrate"
puts "rake db:seed"
puts "------------------------"
@@ -222,8 +222,7 @@ def puts_instructions!
end
def reject_file?(file)
- (file.to_s.include?('app') && file.to_s.scan(/admin|models/).empty?) ||
- (!localized? && file.to_s.include?('locale_picker'))
+ !localized? && file.to_s.include?('locale_picker')
end
def reject_template?(file)
@@ -237,7 +236,7 @@ def sanity_check!
if singular_name == plural_name
message = if singular_name.singularize == singular_name
- "The engine name you specified will not work as the singular name is equal to the plural name."
+ "The extension name you specified will not work as the singular name is equal to the plural name."
else
"Please specify the singular name '#{singular_name.singularize}' instead of '#{plural_name}'."
end
View
4 core/refinerycms-core.gemspec
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-core}
s.version = version
- 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.summary = %q{Core extension for Refinery CMS}
+ s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most extensions}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
View
4 core/spec/lib/generators/refinery/engine/engine_generator_spec.rb
@@ -13,7 +13,7 @@ module Refinery
end
specify do
- destination_root.should have_structure do
+ destination_root.should have_structure {
directory "vendor" do
directory "extensions" do
directory "rspec_product_tests" do
@@ -78,7 +78,7 @@ module Refinery
end
end
end
- end
+ }
end
end
end
View
8 core/spec/lib/generators/refinery/form/form_generator_spec.rb
@@ -13,7 +13,7 @@ module Refinery
end
specify do
- destination_root.should have_structure do
+ destination_root.should have_structure {
directory "vendor" do
directory "extensions" do
directory "rspec_form_tests" do
@@ -24,9 +24,7 @@ module Refinery
directory "admin" do
file "rspec_form_tests_controller.rb"
end
- directory "rspec_form_tests" do
- file "rspec_form_tests_controller.rb"
- end
+ file "rspec_form_tests_controller.rb"
end
end
end
@@ -83,7 +81,7 @@ module Refinery
end
end
end
- end
+ }
end
end
end
View
76 core/spec/lib/refinery/core_spec.rb
@@ -1,94 +1,94 @@
require 'spec_helper'
describe Refinery do
- describe "#engines" do
- it "should return an array of modules representing registered engines" do
- subject.engines.should be_a(Array)
- subject.engines.each do |e|
+ describe "#extensions" do
+ it "should return an array of modules representing registered extensions" do
+ subject.extensions.should be_a(Array)
+ subject.extensions.each do |e|
e.should be_a(Module)
end
end
end
- describe "#register_engine" do
- before(:each) { subject.engines.clear }
+ describe "#register_extension" do
+ before(:each) { subject.extensions.clear }
- it "should add the engine's module to the array of registered engines" do
- subject.register_engine(Refinery::Core)
+ it "should add the extension's module to the array of registered extensions" do
+ subject.register_extension(Refinery::Core)
- Refinery.engines.should include(Refinery::Core)
- Refinery.engines.should have(1).item
+ Refinery.extensions.should include(Refinery::Core)
+ Refinery.extensions.should have(1).item
end
- it "should not allow same engine to be registered twice" do
- subject.register_engine(Refinery::Core)
- subject.register_engine(Refinery::Core)
+ it "should not allow same extension to be registered twice" do
+ subject.register_extension(Refinery::Core)
+ subject.register_extension(Refinery::Core)
- Refinery.engines.should have(1).item
+ Refinery.extensions.should have(1).item
end
end
- describe "#engine_registered?" do
+ describe "#extension_registered?" do
context "with Refinery::Core::Engine registered" do
- before(:each) { subject.register_engine(Refinery::Core) }
+ before(:each) { subject.register_extension(Refinery::Core) }
- it "should return true if the engine is registered" do
- subject.engine_registered?(Refinery::Core).should == true
+ it "should return true if the extension is registered" do
+ subject.extension_registered?(Refinery::Core).should == true
end
end
- context "with no engines registered" do
- before(:each) { subject.engines.clear }
+ context "with no extensions registered" do
+ before(:each) { subject.extensions.clear }
- it "should return false if the engine is not registered" do
- subject.engine_registered?(Refinery::Core).should == false
+ it "should return false if the extension is not registered" do
+ subject.extension_registered?(Refinery::Core).should == false
end
end
end
- describe "#unregister_engine" do
+ describe "#unregister_extension" do
before(:each) do
- subject.engines.clear
- subject.register_engine(Refinery::Images)
+ subject.extensions.clear
+ subject.register_extension(Refinery::Images)
end
- it "should remove the engine's module from the array of registered engines" do
- subject.unregister_engine(Refinery::Images)
+ it "should remove the extension's module from the array of registered extensions" do
+ subject.unregister_extension(Refinery::Images)
- subject.engines.should have(0).item
+ subject.extensions.should have(0).item
end
end
- describe "#validate_engine!" do
- context "with a valid engine" do
+ describe "#validate_extension!" do
+ context "with a valid extension" do
it "should return nil" do
- subject.send(:validate_engine!, Refinery::ValidEngine).should be_nil
+ subject.send(:validate_extension!, Refinery::ValidEngine).should be_nil
end
end
- context "with an invalid engine" do
- it "should raise invalid engine exception" do
+ context "with an invalid extension" do
+ it "should raise invalid extension exception" do
lambda {
- subject.send(:validate_engine!, Refinery::InvalidEngine)
+ subject.send(:validate_extension!, Refinery::InvalidEngine)
}.should raise_error(Refinery::InvalidEngineError, "Engine must define a root accessor that returns a pathname to its root")
end
end
end
describe "#roots" do
- it "should return pathname to engine root when given constant as parameter" do
+ it "should return pathname to extension root when given constant as parameter" do
subject.roots(Refinery::Core).should == Refinery::Core.root
end
- it "should return pathname to engine root when given symbol as parameter" do
+ it "should return pathname to extension root when given symbol as parameter" do
subject.roots(:'refinery/core').should == Refinery::Core.root
end
- it "should return pathname to engine root when given string as parameter" do
+ it "should return pathname to extension root when given string as parameter" do
subject.roots("refinery/core").should == Refinery::Core.root
end
- it "should return an array of all pathnames if no engine_name is specified" do
+ it "should return an array of all pathnames if no extension_name is specified" do
subject.roots.should be_a(Array)
subject.roots.each do |root|
root.should be_a(Pathname)
View
12 core/spec/requests/refinery/search_spec.rb
@@ -5,7 +5,7 @@ module Refinery
login_refinery_user
context "when searched item exists" do
- describe "image engine" do
+ describe "image extension" do
before(:each) { FactoryGirl.create(:image) }
it "returns found image" do
@@ -16,7 +16,7 @@ module Refinery
end
end
- describe "resource engine" do
+ describe "resource extension" do
before(:each) { FactoryGirl.create(:resource) }
it "returns found resource" do
@@ -27,7 +27,7 @@ module Refinery
end
end
- describe "page engine" do
+ describe "page extension" do
before(:each) { FactoryGirl.create(:page, :title => "Ugis Ozols") }
it "returns found page" do
@@ -46,21 +46,21 @@ def shared_stuff
page.should have_content("Sorry, no results found")
end
- describe "image engine" do
+ describe "image extension" do
it "returns no results" do
visit refinery.admin_images_path
shared_stuff
end
end
- describe "resource engine" do
+ describe "resource extension" do
it "returns no results" do
visit refinery.admin_resources_path
shared_stuff
end
end
- describe "page engine" do
+ describe "page extension" do
it "returns no results" do
visit refinery.admin_pages_path
shared_stuff
View
2  dashboard/lib/refinery/dashboard/engine.rb
@@ -21,7 +21,7 @@ class Engine < ::Rails::Engine
end
config.after_initialize do
- Refinery.register_engine(Refinery::Dashboard)
+ Refinery.register_extension(Refinery::Dashboard)
end
end
end
View
4 dashboard/refinerycms-dashboard.gemspec
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-dashboard}
s.version = version
- 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.summary = %q{Dashboard extension for Refinery CMS}
+ s.description = %q{The dashboard is usually the first extension the user sees in the backend of Refinery CMS. It displays useful information and contains links to common functionality.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.rubyforge_project = %q{refinerycms}
View
104 doc/guides/1 - Getting Started/2 - Getting Started with Refinery.textile
@@ -4,7 +4,7 @@ This guide covers getting up and running with Refinery CMS. After reading it, yo
* Installing and creating a new Refinery site
* Changing the front end design of a Refinery site
-* Extending Refinery's functionality with custom engines
+* Extending Refinery's functionality with custom extensions
endprologue.
@@ -50,14 +50,14 @@ The Refinery philosophy includes several guiding principles:
h4. Refinery's architecture
-Refinery comprises of several Rails Engines. Each engine acts like a mini Rails application with its own routes and views. Refinery is architected like this so that it keeps out of the way of any custom development you will do in the +/app+ directory.
+Refinery comprises of several Rails Engines. Each extension acts like a mini Rails application with its own routes and views. Refinery is architected like this so that it keeps out of the way of any custom development you will do in the +/app+ directory.
-h4. Core engines
+h4. Core extensions
-The engines Refinery comes with are:
+The extensions Refinery comes with are:
* *Authentication* - manages users and sessions within Refinery.
-* *Core* - contains default layouts, views, javascripts and CSS. This engine also has an engine API for extending Refinery and everything Refinery needs to hook into Rails.
+* *Core* - contains default layouts, views, javascripts and CSS. This extension also has an extension API for extending Refinery and everything Refinery needs to hook into Rails.
* *Dashboard* - shows you what's recently been updated.
* *Images* - handles image upload, insertion and processing images using "Dragonfly":https://github.com/markevans/dragonfly.
* *Pages* - allows you to manage pages including the structure of your site displayed in the front end.
@@ -68,7 +68,7 @@ h3. Creating a new Refinery project
!>/system/images/BAhbBlsHOgZmSSJEMjAxMC8xMi8wMi8xMl8wN18xNF82NDdfcmlja19hc3RsZXlfbmV2ZXJfZ29ubmFfZ2l2ZV95b3VfdXAuanBnBjoGRVQ/12_07_14_647_rick_astley_never_gonna_give_you_up.jpg!
-If you follow this guide, you'll create a Refinery site called <tt>rickrockstar</tt> that will have a custom design and an events engine to allow Rick to tell his fans when his next gig is.
+If you follow this guide, you'll create a Refinery site called <tt>rickrockstar</tt> that will have a custom design and an events extension to allow Rick to tell his fans when his next gig is.
Before you can start building this site, you need to make sure that you have Refinery itself installed.
@@ -160,7 +160,7 @@ To do this, you'll have to edit +config/initializers/refinery/core.rb+. Look for
The +#+ character prefixing the line is a comment character. The configuration options in this file (and in other Refinery initializer files) are all commented out, because these options are already set deep inside of Refinery. If you uncomment a line, Refinery will prefer the value you set inside these initializers. Go ahead and remove the +#+ character plus the space before the word 'config', and then change "Company Name" to "Rick Rock Star". Make sure you save, and then restart your server (if you're using the built-in Rails server, hit +Ctrl+C+, and then type +rails server+ again.
-TIP: Many parts of Refinery can be customized by changing the options contained within the +config/initializers/refinery/+ folder. As you add engines to Refinery, more files will be created here specific to the engines you install.
+TIP: Many parts of Refinery can be customized by changing the options contained within the +config/initializers/refinery/+ folder. As you add extensions to Refinery, more files will be created here specific to the extensions you install.
h4. Explore Refinery
@@ -300,11 +300,11 @@ h3. Extending Refinery with your first Engine
h4. The Anatomy of an Engine
-Think of a Refinery engine as a miniature Rails application running in your +vendor/engines+ directory. Each engine specifies its own routes in its config directory and has its own views and controllers in its own app directory. Engines can even serve up their own images, stylesheets and javascripts by utilizing the asset pipeline, which got introduced in Rails 3.1.
+Think of a Refinery extension as a miniature Rails application running in your +vendor/extensions+ directory. Each extension specifies its own routes in its config directory and has its own views and controllers in its own app directory. Engines can even serve up their own images, stylesheets and javascripts by utilizing the asset pipeline, which got introduced in Rails 3.1.
-h4. Generating an engine
+h4. Generating an extension
-Refinery ships with an engine generator that makes adding your own functionality a breeze. It works just like the Rails scaffold generator.
+Refinery ships with an extension generator that makes adding your own functionality a breeze. It works just like the Rails scaffold generator.
<shell>
$ rails generate refinery:engine singular_model_name attribute:type [attribute:type ...]
@@ -320,7 +320,7 @@ Here is a list of the different field types and what they give you:
|image|a link which pops open a dialog which allows the user to select an existing image or upload a new one|
|string and integer|a standard single line text input|
-If you remember, we told Rick that we'll give him an area to post up events he'll be at. Although he could technically create a new page in Refinery to add this content there, areas that have special functionality are much better suited as an engine.
+If you remember, we told Rick that we'll give him an area to post up events he'll be at. Although he could technically create a new page in Refinery to add this content there, areas that have special functionality are much better suited as an extension.
Rick is going to want to enter the following information about each event:
@@ -329,7 +329,7 @@ Rick is going to want to enter the following information about each event:
* A photo
* A little blurb about the event.
-Run this command to generate the events engine for Rick:
+Run this command to generate the events extension for Rick:
<shell>
$ rails generate refinery:engine event title:string date:datetime photo:image blurb:text
@@ -337,34 +337,34 @@ $ rails generate refinery:engine event title:string date:datetime photo:image bl
This results in the following:
<shell>
- create vendor/engines/events/app/controllers/refinery/admin/events_controller.rb
- create vendor/engines/events/app/controllers/refinery/events_controller.rb
- create vendor/engines/events/app/models/refinery/event.rb
- create vendor/engines/events/app/views/refinery/admin/events/_actions.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/_form.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/_events.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/_records.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/_event.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/_sortable_list.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/edit.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/index.html.erb
- create vendor/engines/events/app/views/refinery/admin/events/new.html.erb
- create vendor/engines/events/app/views/refinery/events/index.html.erb
- create vendor/engines/events/app/views/refinery/events/show.html.erb
- create vendor/engines/events/config/locales/en.yml
- create vendor/engines/events/config/locales/es.yml
- create vendor/engines/events/config/locales/fr.yml
- create vendor/engines/events/config/locales/lolcat.yml
- create vendor/engines/events/config/locales/nb.yml
- create vendor/engines/events/config/locales/nl.yml
- create vendor/engines/events/config/routes.rb
- create vendor/engines/events/db/migrate/20111031210430_create_events.rb
- create vendor/engines/events/db/seeds.rb
- create vendor/engines/events/lib/generators/refinery/events_generator.rb
- create vendor/engines/events/lib/refinerycms-events.rb
- create vendor/engines/events/lib/tasks/events.rake
- create vendor/engines/events/readme.md
- create vendor/engines/events/refinerycms-events.gemspec
+ create vendor/extensions/events/app/controllers/refinery/admin/events_controller.rb
+ create vendor/extensions/events/app/controllers/refinery/events_controller.rb
+ create vendor/extensions/events/app/models/refinery/event.rb
+ create vendor/extensions/events/app/views/refinery/admin/events/_actions.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/_form.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/_events.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/_records.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/_event.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/_sortable_list.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/edit.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/index.html.erb
+ create vendor/extensions/events/app/views/refinery/admin/events/new.html.erb
+ create vendor/extensions/events/app/views/refinery/events/index.html.erb
+ create vendor/extensions/events/app/views/refinery/events/show.html.erb
+ create vendor/extensions/events/config/locales/en.yml
+ create vendor/extensions/events/config/locales/es.yml
+ create vendor/extensions/events/config/locales/fr.yml
+ create vendor/extensions/events/config/locales/lolcat.yml
+ create vendor/extensions/events/config/locales/nb.yml
+ create vendor/extensions/events/config/locales/nl.yml
+ create vendor/extensions/events/config/routes.rb
+ create vendor/extensions/events/db/migrate/20111031210430_create_events.rb
+ create vendor/extensions/events/db/seeds.rb
+ create vendor/extensions/events/lib/generators/refinery/events_generator.rb
+ create vendor/extensions/events/lib/refinerycms-events.rb
+ create vendor/extensions/events/lib/tasks/events.rake
+ create vendor/extensions/events/readme.md
+ create vendor/extensions/events/refinerycms-events.gemspec
...
------------------------
Now run:
@@ -386,7 +386,7 @@ $ rake db:seed
A +refinery:events+ generator is created for you to install the migration to create the events table.
-TIP: When new engines are added it's a good idea to restart your server for new changes to be loaded in.
+TIP: When new extensions are added it's a good idea to restart your server for new changes to be loaded in.
Now go to the backend of your Refinery site ("http://localhost:3000/refinery":http://localhost:3000/refinery) and you'll notice a new tab called "Events". Click on "Add new event" and you'll see something like this:
@@ -394,27 +394,27 @@ Now go to the backend of your Refinery site ("http://localhost:3000/refinery":ht
You'll see the entire form has been generated for you based off the field types you specified when generating the events section. The blurb has a visual editor, the date field is a date picker and the photo allows you to pick or upload a new photo from a built-in Refinery dialog.
-Add a couple of mock events to your events engine.
+Add a couple of mock events to your events extension.
Now click on "Switch to your website", and navigate to "http://localhost:3000/events":http://localhost:3000/events
-You'll notice not only has Refinery generated the backend "Events" tab but also a new menu item called "Events" and two new front-end views, +index.html.erb+ and +show.html.erb+, located in +vendor/engines/events/app/views/refinery/events/+ for you to customise.
+You'll notice not only has Refinery generated the backend "Events" tab but also a new menu item called "Events" and two new front-end views, +index.html.erb+ and +show.html.erb+, located in +vendor/extensions/events/app/views/refinery/events/+ for you to customise.
-!/system/images/BAhbBlsHOgZmSSI0MjAxMC8xMi8wMi8xNF8yNF81MV80MTVfZXZlbnRzX2VuZ2luZV9zbWFsbC5wbmcGOgZFVA/14_24_51_415_events_engine_small.png!
+!/system/images/BAhbBlsHOgZmSSI0MjAxMC8xMi8wMi8xNF8yNF81MV80MTVfZXZlbnRzX2VuZ2luZV9zbWFsbC5wbmcGOgZFVA/14_24_51_415_events_extension_small.png!
-As you can see, Refinery makes it insanely easy to quickly add new engines to manage various areas of a site.
+As you can see, Refinery makes it insanely easy to quickly add new extensions to manage various areas of a site.
-But I've noticed one problem. The "2011 Music Awards" is showing up in the middle when it makes more sense to order the events with the latest event at the top. To fix this we need to understand what's happening under the hood of a Refinery engine. Let's dive in.
+But I've noticed one problem. The "2011 Music Awards" is showing up in the middle when it makes more sense to order the events with the latest event at the top. To fix this we need to understand what's happening under the hood of a Refinery extension. Let's dive in.
-h4. Testing your engine
+h4. Testing your extension
There is a separate guide which covers this subject found at "How to Test Your Engine":/guides/how-to-enable-testing-in-your-application.
h4. Crudify: The Backbone of Refinery Engines
-Any Refinery engine, even the built-in ones, that focus on Create, Read, Update and Delete are driven by crudify. Crudify is a highly reusable module included with Refinery that gives you all the standard CRUD actions as well as reordering, searching and paging.
+Any Refinery extension, even the built-in ones, that focus on Create, Read, Update and Delete are driven by crudify. Crudify is a highly reusable module included with Refinery that gives you all the standard CRUD actions as well as reordering, searching and paging.
-Open up +vendor/engines/events/app/controllers/refinery/admin/events_controller.rb+ and look at its contents:
+Open up +vendor/extensions/events/app/controllers/refinery/admin/events_controller.rb+ and look at its contents:
<ruby>
module ::Refinery
@@ -444,7 +444,7 @@ end
This will tell +crudify+ to sort by our event date field and to turn off manual sorting by the user.
-Finally edit +vendor/engines/events/app/controllers/refinery/events_controller.rb+ and replace the +find_all_events+ method with this one:
+Finally edit +vendor/extensions/events/app/controllers/refinery/events_controller.rb+ and replace the +find_all_events+ method with this one:
<ruby>
module ::Refinery
@@ -467,10 +467,10 @@ end
Now when you look at "http://localhost:3000/events":http://localhost:3000/events you'll notice they're now being sorted by the event date.
-!/system/images/BAhbBlsHOgZmSSI6MjAxMC8xMi8wMi8xNF8yNF81MV8zMTRfZXZlbnRzX2VuZ2luZV9maXhlZF9zbWFsbC5wbmcGOgZFVA/14_24_51_314_events_engine_fixed_small.png!
+!/system/images/BAhbBlsHOgZmSSI6MjAxMC8xMi8wMi8xNF8yNF81MV8zMTRfZXZlbnRzX2VuZ2luZV9maXhlZF9zbWFsbC5wbmcGOgZFVA/14_24_51_314_events_extension_fixed_small.png!
h3. What's Next?
-Now that you've made your first Refinery application with a custom events engine, you should feel free to update it and experiment on your own. But you don't have to do everything without help.
+Now that you've made your first Refinery application with a custom events extension, you should feel free to update it and experiment on your own. But you don't have to do everything without help.
If you need assistance getting up and running with Refinery, follow the "How to get help with Refinery Guide":/guides/how-to-get-help-with-refinery.
View
4 ...s/1 - Getting Started/3 - Attaching Refinery CMS to an existing Rails application.textile
@@ -14,7 +14,7 @@ This guide is designed for those who want to attach Refinery CMS to an existing
h3. Steps to add Refinery CMS to your application
-Refinery now comes as a mountable Rails engine. This is a change from previous versions, where Refinery would have to modify files in your application. Now, Refinery is completely namespaced and isolated from your existing application.
+Refinery now comes as a mountable Rails extension. This is a change from previous versions, where Refinery would have to modify files in your application. Now, Refinery is completely namespaced and isolated from your existing application.
h4. Add Refinery CMS as a dependency in your Gemfile
@@ -34,7 +34,7 @@ h4. Generate support files and migrations, and prepare the database
WARNING. Doing this will overwrite any tables that you have of the same name; please backup first. Refinery table names begin with +refinery_+, so the likelihood of a collision occurring is low, but it is nevertheless recommended you keep backups of your database and your code.
-WARNING. Running the +bundle exec rake railties:install:migrations+ task will copy migrations from any Rails engine you have listed in your Gemfile. It is recommended that you only install one engine at a time to prevent a massive influx of migrations that may conflict with each other. This will not overwrite any existing migrations you have, though, so you can run this command more than once without fear.
+WARNING. Running the +bundle exec rake railties:install:migrations+ task will copy migrations from any Rails extension you have listed in your Gemfile. It is recommended that you only install one extension at a time to prevent a massive influx of migrations that may conflict with each other. This will not overwrite any existing migrations you have, though, so you can run this command more than once without fear.
Generating Refinery on top of an existing application is marginally more complicated than it was before, but it's still quite simple:
View
6 ...Started/4 - Attaching Refinery CMS as part of a larger Rails + Devise application.textile
@@ -25,7 +25,7 @@ This guides takes a third approach of leaving the Refinery Gems unmodified to ma
h4. Assumptions About The Existing Application
-Refinery CMS 1.0.0 assumes you want a content management system to control your site, which makes it very easy to build a Refinery CMS based application from scratch, and modify that. Fortunately, it is also flexible enough to take on a smaller role to add functionality to your existing application. This guides focuses on those situations where there are large areas of your existing application that Refinery CMS should not be involved with at all. For example, you want to add a blog using refinery's blog engine, to your existing site, but don't want to otherwise alter your existing, perhaps complex, site.
+Refinery CMS 1.0.0 assumes you want a content management system to control your site, which makes it very easy to build a Refinery CMS based application from scratch, and modify that. Fortunately, it is also flexible enough to take on a smaller role to add functionality to your existing application. This guides focuses on those situations where there are large areas of your existing application that Refinery CMS should not be involved with at all. For example, you want to add a blog using refinery's blog extension, to your existing site, but don't want to otherwise alter your existing, perhaps complex, site.
Since this guide can't anticipate the unique integration issues with your situation, we'll create a minimal Rails + Devise application to reference. We'll assume that the existing application already handles authentication and authorization in a way that must be maintained to avoid breaking existing functionality, and that there are models, controllers and views that you don't want Refinery CMS to be involved with. Specifically, we'll assume that the ExistingApp will handle administration of the User table records through a non-refinery interface (perhaps the console, perhaps some ExistingApp controller).
@@ -204,7 +204,7 @@ $ git commit
h3. Integrating Refinery CMS into ExistingApp
-Now that we have a baseline example working ExistingApp using Devise, it's time to integrate using Refinery, in this case, to add a blog engine, using our existing front end styles, existing user models, and whatever specialized authentication and authorization code we may already have in place.
+Now that we have a baseline example working ExistingApp using Devise, it's time to integrate using Refinery, in this case, to add a blog extension, using our existing front end styles, existing user models, and whatever specialized authentication and authorization code we may already have in place.
+Gemfile+
<ruby>
@@ -365,7 +365,7 @@ module Refinery
end
</ruby>
-Replace post.author.username with post.author.member_name in +app/views/admin/blog/posts/_post.html.erb+ and +app/views/blog/posts/_post.html.erb+. If you are including other engines, just grep around in the gem source for user model fields that you may need to update, and override those views and/or controller methods.
+Replace post.author.username with post.author.member_name in +app/views/admin/blog/posts/_post.html.erb+ and +app/views/blog/posts/_post.html.erb+. If you are including other extensions, just grep around in the gem source for user model fields that you may need to update, and override those views and/or controller methods.
To keep ExistingApp in control of user administration, we'll block the routes to refinery controllers handling user admin.
We also need to ensure that the devise routes point to where ExistingApp is expecting them to (which may be customized), and not to where refinery wants to route them. We want some of the refinery routes defined, just not all. But we don't want to modify the refinery gems so we can upgrade more easily. The solution is to modify the routes after they are loaded, and there is probably a better way to find and remove the refinery added devise routes than this. But here is a method that worked.
View
2  ...tting Started/5 - Attaching Refinery CMS as part of a larger Rails 3.1.x + Devise.textile
@@ -18,7 +18,7 @@ This guides takes an approach of leaving the Refinery Gems unmodified to make it
h4. Assumptions About The Existing Application
-Refinery CMS edge assumes you want a content management system to control your site, which makes it very easy to build a Refinery CMS based application from scratch, and modify that. Fortunately, it is also flexible enough to take on a smaller role to add functionality to your existing application. This guides focuses on those situations where there are large areas of your existing application that Refinery CMS should not be involved with at all. For example, you want to add a blog using refinery's blog engine, to your existing site, but don't want to otherwise alter your existing, perhaps complex, site.
+Refinery CMS edge assumes you want a content management system to control your site, which makes it very easy to build a Refinery CMS based application from scratch, and modify that. Fortunately, it is also flexible enough to take on a smaller role to add functionality to your existing application. This guides focuses on those situations where there are large areas of your existing application that Refinery CMS should not be involved with at all. For example, you want to add a blog using refinery's blog extension, to your existing site, but don't want to otherwise alter your existing, perhaps complex, site.
Since this guide can't anticipate the unique integration issues with your situation, we'll create a minimal Rails + Devise application to reference. We'll assume that the existing application already handles authentication and authorization in a way that must be maintained to avoid breaking existing functionality, and that there are models, controllers and views that you don't want Refinery CMS to be involved with. Specifically, we'll assume that the ExistingApp will handle administration of the User table records through a non-refinery interface (perhaps the console, perhaps some ExistingApp controller).
View
2  doc/guides/2 - Advanced/1 - Extending Controllers and Models with Decorators.textile
@@ -55,4 +55,4 @@ We define the +find_all_blog_posts+ method and set it as a +before_filter+ for t
end
</ruby>
-The Blog engine contains a helper module which already has the +find_all_blog_posts+ method defined for this common case. Note: If you are following along, make sure that you have the refinerycms-blog engine in your gem file or you will not have access to this helper module.
+The Blog extension contains a helper module which already has the +find_all_blog_posts+ method defined for this common case. Note: If you are following along, make sure that you have the refinerycms-blog extension in your gem file or you will not have access to this helper module.
View
2  doc/guides/4 - Customising your Design/2 - How to override a view.textile
@@ -30,5 +30,5 @@ h3. Tips and Tricks
* Trim the '.html.erb' from the end of the view file name
* Only override when you really need to, as it makes upgrading to future versions of Refinery trickier
-* You only need the path to the view from inside the 'views' folder, regardless of which engine the file is in
+* You only need the path to the view from inside the 'views' folder, regardless of which extension the file is in
* This will also work to override views in plugins you've created locally
View
8 doc/guides/5 - Extending with Engines/1 - Tabbed fields in your engine's admin area.textile
@@ -1,9 +1,9 @@
-h2. Tabbed fields in your engine's admin area
+h2. Tabbed fields in your extension's admin area
-Sometimes you create an engine with a number of wymeditor fields. Having these display one after another can be overwhelming for your clients (or you!).
+Sometimes you create an extension with a number of wymeditor fields. Having these display one after another can be overwhelming for your clients (or you!).
This guide will show you how to:
-* Organise many visual editors into nice tabs like Refinery's 'pages' engine does
+* Organise many visual editors into nice tabs like Refinery's 'pages' extension does
endprologue.
@@ -11,7 +11,7 @@ WARNING: This only works on Refinery versions 0.9.9 and greater
h3. Changing your admin view to support multiple tabs
-If your engine has a number of text areas that you'd like to display as a series of tabs instead, simply edit the admin view (under +app/views/admin/engine_name/_form.html.erb+), and add:
+If your extension has a number of text areas that you'd like to display as a series of tabs instead, simply edit the admin view (under +app/views/admin/extension_name/_form.html.erb+), and add:
<erb>
<%= render :partial => '/refinery/admin/tabbed_fields',
View
142 ...s/5 - Extending with Engines/2 - Creating Multiple Data-Tables in a Single Engine.textile
@@ -2,22 +2,22 @@ h2. Creating Multiple Data-Tables in a Single Engine
This guide will show you how to:
-* Creating multiple tables on one single engine
+* Creating multiple tables on one single extension
endprologue.
WARNING: This only works on Refinery versions 0.9.9 and greater
-h4. Generating an engine
+h4. Generating an extension
-Refinery ships with an engine generator that makes adding your own functionality a breeze. It works just like the Rails scaffold generator.
+Refinery ships with an extension generator that makes adding your own functionality a breeze. It works just like the Rails scaffold generator.
<shell>
-$ rails generate refinery_engine singular_model_name attribute:type [attribute:type ...]
+$ rails generate refinery_extension singular_model_name attribute:type [attribute:type ...]
</shell>
-TIP: to see all the options supported by the +refinery_engine+ generator just run +rails g refinery_engine+
+TIP: to see all the options supported by the +refinery_extension+ generator just run +rails g refinery_extension+
Here is a list of the different field types are what they give you:
@@ -27,7 +27,7 @@ Here is a list of the different field types are what they give you:
|image|a link which pops open a dialog which allows the user to select an existing image or upload a new one|
|string and integer|a standard single line text input|
-If you remember, we told Rick that we'll give him an area to post up events he'll be at. Although he could technically create a new page in Refinery to add this content there, areas that have special functionality are much better suited as an engine.
+If you remember, we told Rick that we'll give him an area to post up events he'll be at. Although he could technically create a new page in Refinery to add this content there, areas that have special functionality are much better suited as an extension.
Rick is going to want to enter the following information about each event:
@@ -36,37 +36,37 @@ Rick is going to want to enter the following information about each event:
* A photo
* A little blurb about the event.
-Run this command to generate the events engine for Rick[1]:
+Run this command to generate the events extension for Rick[1]:
<shell>
-$ rails generate refinery_engine event title:string date:datetime photo:image blurb:text
- create vendor/engines/events/app/controllers/admin/events_controller.rb
- create vendor/engines/events/app/controllers/events_controller.rb
- create vendor/engines/events/app/models/event.rb
- create vendor/engines/events/app/views/admin/events/_form.html.erb
- create vendor/engines/events/app/views/admin/events/_event.html.erb
- create vendor/engines/events/app/views/admin/events/_sortable_list.html.erb
- create vendor/engines/events/app/views/admin/events/edit.html.erb
- create vendor/engines/events/app/views/admin/events/index.html.erb
- create vendor/engines/events/app/views/admin/events/new.html.erb
- create vendor/engines/events/app/views/events/index.html.erb
- create vendor/engines/events/app/views/events/show.html.erb
- create vendor/engines/events/config/locales/en.yml
- create vendor/engines/events/config/locales/lolcat.yml
- create vendor/engines/events/config/locales/nb.yml
- create vendor/engines/events/config/locales/nl.yml
- create vendor/engines/events/config/routes.rb
- create vendor/engines/events/db/migrate/create_events.rb
- create vendor/engines/events/db/seeds/events.rb
- create vendor/engines/events/features/manage_events.feature
- create vendor/engines/events/features/step_definitions/event_steps.rb
- create vendor/engines/events/features/support/paths.rb
- create vendor/engines/events/lib/generators/refinerycms_events_generator.rb
- create vendor/engines/events/lib/events.rb
- create vendor/engines/events/lib/tasks/events.rake
- create vendor/engines/events/public/.gitkeep
- create vendor/engines/events/readme.md
- create vendor/engines/events/refinerycms-events.gemspec
+$ rails generate refinery_extension event title:string date:datetime photo:image blurb:text
+ create vendor/extensions/events/app/controllers/admin/events_controller.rb
+ create vendor/extensions/events/app/controllers/events_controller.rb
+ create vendor/extensions/events/app/models/event.rb
+ create vendor/extensions/events/app/views/admin/events/_form.html.erb
+ create vendor/extensions/events/app/views/admin/events/_event.html.erb
+ create vendor/extensions/events/app/views/admin/events/_sortable_list.html.erb
+ create vendor/extensions/events/app/views/admin/events/edit.html.erb
+ create vendor/extensions/events/app/views/admin/events/index.html.erb
+ create vendor/extensions/events/app/views/admin/events/new.html.erb
+ create vendor/extensions/events/app/views/events/index.html.erb
+ create vendor/extensions/events/app/views/events/show.html.erb
+ create vendor/extensions/events/config/locales/en.yml
+ create vendor/extensions/events/config/locales/lolcat.yml
+ create vendor/extensions/events/config/locales/nb.yml
+ create vendor/extensions/events/config/locales/nl.yml
+ create vendor/extensions/events/config/routes.rb
+ create vendor/extensions/events/db/migrate/create_events.rb
+ create vendor/extensions/events/db/seeds/events.rb
+ create vendor/extensions/events/features/manage_events.feature
+ create vendor/extensions/events/features/step_definitions/event_steps.rb
+ create vendor/extensions/events/features/support/paths.rb
+ create vendor/extensions/events/lib/generators/refinerycms_events_generator.rb
+ create vendor/extensions/events/lib/events.rb
+ create vendor/extensions/events/lib/tasks/events.rake
+ create vendor/extensions/events/public/.gitkeep
+ create vendor/extensions/events/readme.md
+ create vendor/extensions/events/refinerycms-events.gemspec
------------------------
Now run:
bundle install
@@ -85,47 +85,47 @@ $ rake db:migrate
A +refinerycms_events+ generator is created for you to install the migration to create the events table. Run all the commands provided by in the terminal.
-TIP: When new engines are added it's a good idea to restart your server for new changes to be loaded in.
+TIP: When new extensions are added it's a good idea to restart your server for new changes to be loaded in.
-As you can see inside your text editor, in vendor/engines folder, the event engine is in stored. this is where all your files including your migration file will be in placed. Similar like a normal Rails app looks like.
+As you can see inside your text editor, in vendor/extensions folder, the event extension is in stored. this is where all your files including your migration file will be in placed. Similar like a normal Rails app looks like.
-Ok. Once you have generate an engine. It's time to create another table to put inside the engine.
+Ok. Once you have generate an extension. It's time to create another table to put inside the extension.
-To do that, run this command. Notice the last argument(+engine_name:engine+). This is where your new table will be inserted to.
+To do that, run this command. Notice the last argument(+extension_name:extension+). This is where your new table will be inserted to.
<shell>
-$ rails g refinery_engine place name:string events:engine
- create vendor/engines/events/app/controllers/admin/places_controller.rb
- create vendor/engines/events/app/controllers/places_controller.rb
- create vendor/engines/events/app/models/place.rb
- create vendor/engines/events/app/views/admin/places/_actions.html.erb
- create vendor/engines/events/app/views/admin/places/_form.html.erb
- create vendor/engines/events/app/views/admin/places/_states.html.erb
- create vendor/engines/events/app/views/admin/places/_records.html.erb
- create vendor/engines/events/app/views/admin/places/_place.html.erb
- create vendor/engines/events/app/views/admin/places/_sortable_list.html.erb
- create vendor/engines/events/app/views/admin/places/edit.html.erb
- create vendor/engines/events/app/views/admin/places/index.html.erb
- create vendor/engines/events/app/views/admin/places/new.html.erb
- create vendor/engines/events/app/views/places/index.html.erb
- create vendor/engines/events/app/views/places/show.html.erb
- create vendor/engines/events/config/locales/tmp/en.yml
- create vendor/engines/events/config/locales/tmp/fr.yml
- create vendor/engines/events/config/locales/tmp/lolcat.yml
- create vendor/engines/events/config/locales/tmp/nb.yml
- create vendor/engines/events/config/locales/tmp/nl.yml
- create vendor/engines/events/config/tmp/routes.rb
- create vendor/engines/events/db/migrate/create_places.rb
- create vendor/engines/events/db/seeds/places.rb
- create vendor/engines/events/features/manage_places.feature
- create vendor/engines/events/features/step_definitions/place_steps.rb
- create vendor/engines/events/features/support/tmp/paths.rb
- create vendor/engines/events/lib/generators/refinerycms_places_generator.rb
- create vendor/engines/events/lib/refinerycms-places.rb
- create vendor/engines/events/lib/tasks/places.rake
- create vendor/engines/events/refinerycms-places.gemspec
- create vendor/engines/events/spec/models/place_spec.rb
- append vendor/engines/events/lib/refinerycms-events.rb
+$ rails g refinery_extension place name:string events:extension
+ create vendor/extensions/events/app/controllers/admin/places_controller.rb
+ create vendor/extensions/events/app/controllers/places_controller.rb
+ create vendor/extensions/events/app/models/place.rb
+ create vendor/extensions/events/app/views/admin/places/_actions.html.erb
+ create vendor/extensions/events/app/views/admin/places/_form.html.erb
+ create vendor/extensions/events/app/views/admin/places/_states.html.erb
+ create vendor/extensions/events/app/views/admin/places/_records.html.erb
+ create vendor/extensions/events/app/views/admin/places/_place.html.erb
+ create vendor/extensions/events/app/views/admin/places/_sortable_list.html.erb
+ create vendor/extensions/events/app/views/admin/places/edit.html.erb
+ create vendor/extensions/events/app/views/admin/places/index.html.erb
+ create vendor/extensions/events/app/views/admin/places/new.html.erb
+ create vendor/extensions/events/app/views/places/index.html.erb
+ create vendor/extensions/events/app/views/places/show.html.erb
+ create vendor/extensions/events/config/locales/tmp/en.yml
+ create vendor/extensions/events/config/locales/tmp/fr.yml
+ create vendor/extensions/events/config/locales/tmp/lolcat.yml
+ create vendor/extensions/events/config/locales/tmp/nb.yml
+ create vendor/extensions/events/config/locales/tmp/nl.yml
+ create vendor/extensions/events/config/tmp/routes.rb
+ create vendor/extensions/events/db/migrate/create_places.rb
+ create vendor/extensions/events/db/seeds/places.rb
+ create vendor/extensions/events/features/manage_places.feature
+ create vendor/extensions/events/features/step_definitions/place_steps.rb
+ create vendor/extensions/events/features/support/tmp/paths.rb
+ create vendor/extensions/events/lib/generators/refinerycms_places_generator.rb
+ create vendor/extensions/events/lib/refinerycms-places.rb
+ create vendor/extensions/events/lib/tasks/places.rake
+ create vendor/extensions/events/refinerycms-places.gemspec
+ create vendor/extensions/events/spec/models/place_spec.rb
+ append vendor/extensions/events/lib/refinerycms-events.rb
------------------------
Now run:
bundle install
View
12 doc/guides/5 - Extending with Engines/3 - How to test your engine.textile
@@ -1,10 +1,10 @@
-h2. How to test your engine
+h2. How to test your extension
-Refinery ships with an optional testing engine in the form of a gem called +refinerycms-testing+ which will add generators and rake tasks to your engine that provide it with the same RSpec2 testing environment we use to test Refinery. We abstract common test helpers, controller macros, and factories into this engine so you can use these in tests of your own.
+Refinery ships with an optional testing extension in the form of a gem called +refinerycms-testing+ which will add generators and rake tasks to your extension that provide it with the same RSpec2 testing environment we use to test Refinery. We abstract common test helpers, controller macros, and factories into this extension so you can use these in tests of your own.
This guide will show you how to:
-* Bootstrap your engine with the Refinery RSpec2 testing environment
+* Bootstrap your extension with the Refinery RSpec2 testing environment
* Run the test suite with Rake for a one time run
* Run the test suite with Guard for quick TDD iterations
@@ -12,7 +12,7 @@ endprologue.
h3. Bootstrap the test environment
-In your engine's Gemfile uncomment or add the following line
+In your extension's Gemfile uncomment or add the following line
<shell>
gem 'refinerycms-testing'
@@ -26,14 +26,14 @@ $ bundle install
Now we will configure our test environment by preparing a dummy refinerycms app
-Add the following lines to your engine's Rakefile
+Add the following lines to your extension's Rakefile
<ruby>
ENGINE_PATH = File.dirname(__FILE__)
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
if File.exists?(APP_RAKEFILE)
- load 'rails/tasks/engine.rake'
+ load 'rails/tasks/extension.rake'
end
require "refinerycms-testing"
View
10 doc/guides/5 - Extending with Engines/4 - How to Add Marketable URLs to your Engine.textile
@@ -4,7 +4,7 @@ It's very important for Search Engine Optimization (SEO) purposes to have your U
This guide will show you how to:
-* Implement marketable URLs on a custom engine.
+* Implement marketable URLs on a custom extension.
endprologue.
@@ -12,9 +12,9 @@ WARNING: This method is tested with Refinery CMS v. 1.0.8 only, but should be ap
h3. Implementing Cached Slugs
-FriendlyID requires that you create a string field entitled +cached_slug+ on any model that you wish to convert. It's better to do this as a separate migration after creating the engine, because you will have to remove the administrative text fields Refinery CMS auto-generates.
+FriendlyID requires that you create a string field entitled +cached_slug+ on any model that you wish to convert. It's better to do this as a separate migration after creating the extension, because you will have to remove the administrative text fields Refinery CMS auto-generates.
-To do so, create a new migration file in the +db/migrate+ folder of your engine. Since this depends on the previous migration, it's best to rename the other migrations to include a sequence reference in the filename -- for example, +create_staff_members.rb+ becomes +001_create_staff_members.rb+. When you re-run the generator that will move these migrations over to your main +db/migrate+ folder, they will be moved in this order. Don't worry if you've already run these migrations; Rails will auto-detect that it has been run, even though the filename has been changed.
+To do so, create a new migration file in the +db/migrate+ folder of your extension. Since this depends on the previous migration, it's best to rename the other migrations to include a sequence reference in the filename -- for example, +create_staff_members.rb+ becomes +001_create_staff_members.rb+. When you re-run the generator that will move these migrations over to your main +db/migrate+ folder, they will be moved in this order. Don't worry if you've already run these migrations; Rails will auto-detect that it has been run, even though the filename has been changed.
Inside your migration, write something like this:
<ruby>
@@ -29,7 +29,7 @@ Inside your migration, write something like this:
end
</ruby>
-Run the generator that you ran initially to create your engine, and then migrate.. In the above example, since the engine is named +staff_members+, one would run:
+Run the generator that you ran initially to create your extension, and then migrate.. In the above example, since the extension is named +staff_members+, one would run:
<shell>
$ rails generate refinerycms_staff_members
@@ -47,7 +47,7 @@ In your model, add the following lines, replacing +staff_member+ where appropria
:strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'staff_member')
</ruby>
-If you want to use a different field than +name+ from which to generate the URL, be sure to change the first symbol after +has_friendly_id+ to be in accordance (for example, many engines use +title+ instead).
+If you want to use a different field than +name+ from which to generate the URL, be sure to change the first symbol after +has_friendly_id+ to be in accordance (for example, many extensions use +title+ instead).
Also be sure to remove any +to_param+ method that exists, or this will interfere.
View
4 doc/guides/8 - Tips and Tricks/1 - How to add an image gallery to pages.textile
@@ -2,11 +2,11 @@ h2. How to add an image gallery to pages
By default pages don't allow you to make galleries of images. This guide will show you how to:
-* Use the portfolio engine to display a gallery of images
+* Use the portfolio extension to display a gallery of images
endprologue.
-WARNING: This guide is for Rails 2 implementations of Refinery. If you're using Rails 3 use the "refinerycms-page-images":https://github.com/resolve/refinerycms-page-images engine instead.
+WARNING: This guide is for Rails 2 implementations of Refinery. If you're using Rails 3 use the "refinerycms-page-images":https://github.com/resolve/refinerycms-page-images extension instead.
h3. Introduction
View
2  images/lib/refinery/images/engine.rb
@@ -31,7 +31,7 @@ class Engine < ::Rails::Engine
end
config.after_initialize do
- Refinery.register_engine(Refinery::Images)
+ Refinery.register_extension(Refinery::Images)
end
end
end
View
2  images/refinerycms-images.gemspec
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-images}
s.version = version
- s.summary = %q{Images engine for Refinery CMS}
+ s.summary = %q{Images extension for Refinery CMS}
s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
View
4 lib/refinery/all.rb
@@ -1,3 +1,3 @@
-%w(core authentication dashboard images resources pages).each do |engine|
- require "refinerycms-#{engine}"
+%w(core authentication dashboard images resources pages).each do |extension|
+ require "refinerycms-#{extension}"
end
View
2  pages/app/models/refinery/page.rb
@@ -159,7 +159,7 @@ def with_globalize(conditions = {})
# Wraps up all the checks that we need to do to figure out whether
# the current frontend locale is different to the current one set by ::I18n.locale.
- # This terminates in a false if i18n engine is not defined or enabled.
+ # This terminates in a false if i18n extension is not defined or enabled.
def different_frontend_locale?
::Refinery.i18n_enabled? && ::Refinery::I18n.current_frontend_locale != ::I18n.locale
end
View
2  pages/lib/generators/refinery/pages/pages_generator.rb
@@ -11,7 +11,7 @@ def append_load_seed_data
append_file 'db/seeds.rb', :verbose => true do
<<-EOH
-# Added by Refinery CMS Pages engine
+# Added by Refinery CMS Pages extension
Refinery::Pages::Engine.load_seed
EOH
end
View
2  pages/lib/refinery/pages/engine.rb
@@ -49,7 +49,7 @@ class Engine < ::Rails::Engine
end
config.after_initialize do
- Refinery.register_engine(Refinery::Pages)
+ Refinery.register_extension(Refinery::Pages)
end
protected
View
4 pages/refinerycms-pages.gemspec
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-pages}
s.version = version
- 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.summary = %q{Pages extension for Refinery CMS}
+ s.description = %q{The default content extension of Refinery CMS. This extension handles the administration and display of user-editable pages.}
s.date = %q{2011-10-12}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
View
16 readme.md
@@ -37,7 +37,7 @@ Unlike other content managers, Refinery is truly __aimed at the end user__ makin
### For developers
* Easily customise the look to suit the business.
-* __[Extend with custom engines](https://github.com/resolve/refinerycms/blob/master/doc/engines.md#readme)__ to do anything Refinery doesn't do out of the box.
+* __[Extend with custom extensions](https://github.com/resolve/refinerycms/blob/master/doc/extensions.md#readme)__ to do anything Refinery doesn't do out of the box.
* Sticks to __"the Rails way"__ as much as possible; we don't force you to learn new templating languages.
* Uses [jQuery](http://jquery.com/) for fast and concise Javascript.
@@ -54,7 +54,7 @@ Wanna see Refinery for yourself? [Try the demo](http://demo.refinerycms.com/refi
* [GitHub repository](http://github.com/resolve/refinerycms)
* [Developer/API documentation](http://api.refinerycms.org)
* [Twitter Account](http://twitter.com/refinerycms)
-* Documentation about: [Pages](https://github.com/resolve/refinerycms/blob/master/doc/pages.md#readme), [Images](http://github.com/resolve/refinerycms/blob/master/doc/images.md#readme), [Files](http://github.com/resolve/refinerycms/blob/master/doc/resources.md#readme), [Inquiries](http://github.com/resolve/refinerycms-inquiries/blob/master/readme.md#readme), [Settings](http://github.com/resolve/refinerycms/blob/master/doc/settings.md#readme), [Dashboard](http://github.com/resolve/refinerycms/blob/master/doc/dashboard.md#readme), [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/doc/authentication.md#readme), [Extending with Engines](http://github.com/resolve/refinerycms/blob/master/doc/engines.md#readme).
+* Documentation about: [Pages](https://github.com/resolve/refinerycms/blob/master/doc/pages.md#readme), [Images](http://github.com/resolve/refinerycms/blob/master/doc/images.md#readme), [Files](http://github.com/resolve/refinerycms/blob/master/doc/resources.md#readme), [Inquiries](http://github.com/resolve/refinerycms-inquiries/blob/master/readme.md#readme), [Settings](http://github.com/resolve/refinerycms/blob/master/doc/settings.md#readme), [Dashboard](http://github.com/resolve/refinerycms/blob/master/doc/dashboard.md#readme), [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/doc/authentication.md#readme), [Extending with Engines](http://github.com/resolve/refinerycms/blob/master/doc/extensions.md#readme).
## Features
@@ -88,24 +88,24 @@ Wanna see Refinery for yourself? [Try the demo](http://demo.refinerycms.com/refi
### [Authentication & Users](http://github.com/resolve/refinerycms/blob/master/doc/authentication.md#readme)
* Manage who can access Refinery.
-* Control which engines each user has access to.
+* Control which extensions each user has access to.
* Uses the popular [devise](http://github.com/plataformatec/devise).
-### ...Want more? [Extend with Engines](http://github.com/resolve/refinerycms/blob/master/doc/engines.md#readme)
+### ...Want more? [Extend with Engines](http://github.com/resolve/refinerycms/blob/master/doc/extensions.md#readme)
-Extend Refinery easily by running the Refinery engine generator
+Extend Refinery easily by running the Refinery extension generator
rails generate refinery:engine
-to get help on how to use that. Or read the full documentation on [writing engines for Refinery](https://github.com/resolve/refinerycms/blob/master/doc/generators.md)
+to get help on how to use that. Or read the full documentation on [writing extensions for Refinery](https://github.com/resolve/refinerycms/blob/master/doc/generators.md)
### Popular Engines
-* [Blog](http://github.com/resolve/refinerycms-blog) - A simple blogging engine that supports posts, categories and comments (with moderation support if you choose to enable it)
+* [Blog](http://github.com/resolve/refinerycms-blog) - A simple blogging extension that supports posts, categories and comments (with moderation support if you choose to enable it)
* [Portfolio](http://github.com/resolve/refinerycms-portfolio) - manage groups of images like an image gallery.
* [News](http://github.com/resolve/refinerycms-news) - post and manage news items.
-[Full engine list here](http://github.com/resolve/refinerycms/wiki/engines)
+[Full extension list here](http://github.com/resolve/refinerycms/wiki/extensions)
### Example Site Showcase
View
2  resources/lib/refinery/resources/engine.rb
@@ -31,7 +31,7 @@ class Engine < ::Rails::Engine
end
config.after_initialize do
- Refinery.register_engine(Refinery::Resources)
+ Refinery.register_extension(Refinery::Resources)
end
end
end
View
2  resources/refinerycms-resources.gemspec
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-resources}
s.version = version
- s.summary = %q{Resources engine for Refinery CMS}
+ s.summary = %q{Resources extension for Refinery CMS}
s.description = %q{Handles all file upload and processing functionality in Refinery CMS.}
s.date = %q{2011-10-12}
s.email = %q{info@refinerycms.com}
View
2  resources/spec/requests/refinery/admin/resources_spec.rb
@@ -82,7 +82,7 @@ module Admin
page.should have_content("http://www.refineryhq.com/")
end
- context 'when the engine is mounted with a named space' do
+ context 'when the extension is mounted with a named space' do
before do
Rails.application.routes.draw do
mount Refinery::Core::Engine, :at => "/about"
View
16 tasks/release.rake
@@ -4,13 +4,13 @@ require File.expand_path('../../core/lib/refinery/version', __FILE__)
version = Refinery::Version.to_s
root = File.expand_path('../../', __FILE__)
-(ENGINES + ['refinerycms']).each do |engine|
- namespace engine do
- engine_name = engine
- engine_name = "refinerycms-#{engine}" unless engine == "refinerycms"
+(ENGINES + ['refinerycms']).each do |extension|
+ namespace extension do
+ extension_name = extension
+ extension_name = "refinerycms-#{extension}" unless extension == "refinerycms"
- gem_filename = "pkg/#{engine_name}-#{version}.gem"
- gemspec = "#{engine_name}.gemspec"
+ gem_filename = "pkg/#{extension_name}-#{version}.gem"
+ gemspec = "#{extension_name}.gemspec"
task :clean do
package_dir = "#{root}/pkg"
@@ -20,8 +20,8 @@ root = File.expand_path('../../', __FILE__)
task :package do
cmd = ""
- cmd << "cd #{engine} && " unless engine == "refinerycms"
- cmd << "gem build #{gemspec} && mv #{engine_name}-#{version}.gem #{root}/pkg/"
+ cmd << "cd #{extension} && " unless extension == "refinerycms"
+ cmd << "gem build #{gemspec} && mv #{extension_name}-#{version}.gem #{root}/pkg/"
sh cmd
end
View
28 testing/lib/generators/refinery/testing/templates/Guardfile
@@ -1,4 +1,4 @@
-engines = Dir[File.expand_path('../vendor/engines/*', __FILE__)]
+extensions = Dir[File.expand_path('../vendor/extensions/*', __FILE__)]
guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
@@ -8,23 +8,23 @@ guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => '
watch('spec/spec_helper.rb')
watch(%r{^spec/support/.+\.rb$})
- engines.each do |engine|
- watch(%r{^#{engine}/spec/support/.+\.rb$})
+ extensions.each do |extension|
+ watch(%r{^#{extension}/spec/support/.+\.rb$})
end
end
-guard 'rspec', :version => 2, :spec_paths => engines.map{|e| "#{e}/spec"},
+guard 'rspec', :version => 2, :spec_paths => extensions.map{|e| "#{e}/spec"},
:cli => (File.read('.rspec').split("\n").join(' ') if File.exists?('.rspec')) do
- engines.each do |engine|
- watch(%r{^#{engine}/spec/.+_spec\.rb$})
- watch(%r{^#{engine}/app/(.+)\.rb$}) { |m| "#{engine}/spec/#{m[1]}_spec.rb" }
- watch(%r{^#{engine}/lib/(.+)\.rb$}) { |m| "#{engine}/spec/lib/#{m[1]}_spec.rb" }
- watch(%r{^#{engine}/app/controllers/(.+)_(controller)\.rb$}) { |m| ["#{engine}/spec/routing/#{m[1]}_routing_spec.rb", "#{engine}/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "#{engine}/spec/requests/#{m[1]}_spec.rb"] }
- watch(%r{^#{engine}/spec/support/(.+)\.rb$}) { "#{engine}/spec" }
- watch("#{engine}/spec/spec_helper.rb") { "#{engine}/spec" }
- watch("#{engine}/config/routes.rb") { "#{engine}/spec/routing" }
- watch("#{engine}/app/controllers/application_controller.rb") { "#{engine}/spec/controllers" }
+ extensions.each do |extension|
+ watch(%r{^#{extension}/spec/.+_spec\.rb$})
+ watch(%r{^#{extension}/app/(.+)\.rb$}) { |m| "#{extension}/spec/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/lib/(.+)\.rb$}) { |m| "#{extension}/spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/app/controllers/(.+)_(controller)\.rb$}) { |m| ["#{extension}/spec/routing/#{m[1]}_routing_spec.rb", "#{extension}/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "#{extension}/spec/requests/#{m[1]}_spec.rb"] }
+ watch(%r{^#{extension}/spec/support/(.+)\.rb$}) { "#{extension}/spec" }
+ watch("#{extension}/spec/spec_helper.rb") { "#{extension}/spec" }
+ watch("#{extension}/config/routes.rb") { "#{extension}/spec/routing" }
+ watch("#{extension}/app/controllers/application_controller.rb") { "#{extension}/spec/controllers" }
# Capybara request specs
- watch(%r{^#{engine}/app/views/(.+)/.*\.(erb|haml)$}) { |m| "#{engine}/spec/requests/#{m[1]}_spec.rb" }
+ watch(%r{^#{extension}/app/views/(.+)/.*\.(erb|haml)$}) { |m| "#{extension}/spec/requests/#{m[1]}_spec.rb" }
end
end
View
18 testing/lib/refinery/tasks/testing.rake
@@ -14,14 +14,14 @@ namespace :refinery do
Refinery::CmsGenerator.start %w[--quiet --fresh-installation]
end
- # This task is a hook to allow engines to pass configuration
- # Just define this inside your engine's Rakefile or a .rake file
+ # This task is a hook to allow extensions to pass configuration
+ # Just define this inside your extension's Rakefile or a .rake file
# and pass arbitrary code. Example:
#
# namespace :refinery do
# namespace :testing do
# task :setup_extension do
- # require 'refinerycms-my-engine'
+ # require 'refinerycms-my-extension'
# Refinery::MyEngineGenerator.start %w[--quiet]
# end
# end
@@ -30,7 +30,7 @@ namespace :refinery do
end
task :migrate_dummy_app do
- engines = %w(
+ extensions = %w(
refinery
refinery_authentication
seo_meta_engine
@@ -39,14 +39,14 @@ namespace :refinery do
refinery_resources
)
- task_params = [%Q{ bundle exec rake -f #{Refinery::Testing::Railtie.target_engine_path.join('Rakefile')} }]
- task_params << %Q{ app:railties:install:migrations FROM="#{engines.join(', ')}" }
+ task_params = [%Q{ bundle exec rake -f #{Refinery::Testing::Railtie.target_extension_path.join('Rakefile')} }]
+ task_params << %Q{ app:railties:install:migrations FROM="#{extensions.join(', ')}" }
task_params << %Q{ app:db:drop app:db:create app:db:migrate }
task_params << %Q{ RAILS_ENV=development --quiet }
system task_params.join(' ')
- task_params2 = [%Q{ bundle exec rake -f #{Refinery::Testing::Railtie.target_engine_path.join('Rakefile')} }]
+ task_params2 = [%Q{ bundle exec rake -f #{Refinery::Testing::Railtie.target_extension_path.join('Rakefile')} }]
task_params2 << %Q{ app:db:seed app:db:test:prepare }
task_params2 << %Q{ RAILS_ENV=development --quiet }
@@ -55,12 +55,12 @@ namespace :refinery do
desc "Remove the dummy app used for testing"
task :clean_dummy_app do
- path = Refinery::Testing::Railtie.target_engine_path.join('spec', 'dummy')
+ path = Refinery::Testing::Railtie.target_extension_path.join('spec', 'dummy')
path.rmtree if path.exist?
end
- namespace :engine do
+ namespace :extension do
desc "Initialize the testing environment"
task :setup => [:init_test_database]
View
8 testing/lib/refinery/testing.rb
@@ -11,11 +11,11 @@ def root
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
end
- # Load the factories of all currently loaded engines
+ # Load the factories of all currently loaded extensions
def load_factories
- Refinery.engines.each do |engine_const|
- if engine_const.respond_to?(:factory_paths)
- engine_const.send(:factory_paths).each do |path|
+ Refinery.extensions.each do |extension_const|
+ if extension_const.respond_to?(:factory_paths)
+ extension_const.send(:factory_paths).each do |path|
FactoryGirl.definition_file_paths << path
end
end
View
12 testing/lib/refinery/testing/railtie.rb
@@ -4,25 +4,25 @@ class Railtie < Rails::Railtie
railtie_name :refinerycms_testing
class << self
- attr_reader :target_engine_path # :nodoc:
+ attr_reader :target_extension_path # :nodoc:
- # Loads Rake tasks to assist with manipulating dummy applications for testing engines. Takes
- # a string representing the path to your application or engine.
+ # Loads Rake tasks to assist with manipulating dummy applications for testing extensions. Takes
+ # a string representing the path to your application or extension.
#
- # This function should be used in the Rakefile of your application or engine
+ # This function should be used in the Rakefile of your application or extension
#
# Example:
# Refinery::Testing::Railtie.load_dummy_tasks(File.dirname(__FILE__))
#
# Refinery::Testing::Railtie.load_dummy_tasks('/users/reset/code/mynew_app')
def load_dummy_tasks(app_root)
- @target_engine_path = Pathname.new(app_root.to_s)
+ @target_extension_path = Pathname.new(app_root.to_s)
load 'refinery/tasks/testing.rake'
end
end
config.after_initialize do
- Refinery.register_engine(Refinery::Testing)
+ Refinery.register_extension(Refinery::Testing)
Testing.load_factories
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.