Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Backport refinerycms --help to 2-0-stable #1931

Merged
merged 2 commits into from

2 participants

Uģis Ozols Philip Arndt
Uģis Ozols
Owner
Philip Arndt parndt merged commit e492970 into from
Uģis Ozols ugisozols referenced this pull request from a commit
Uģis Ozols ugisozols Add note to changelog about #1931. 315051c
Uģis Ozols ugisozols referenced this pull request from a commit
Uģis Ozols ugisozols Add note to changelog about #1931. b4882d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 6, 2012
  1. Uģis Ozols
  2. Philip Arndt Uģis Ozols

    Allows the help command to access the CMS generator when running as a…

    parndt authored ugisozols committed
    … gem or running in development mode and included option aliases.
This page is out of date. Refresh to see the latest.
26 bin/refinerycms
View
@@ -4,7 +4,29 @@ require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
template_path = File.expand_path('../../templates/refinery/installer.rb', __FILE__)
+if ARGV.size == 0 || ARGV[0] == "--help"
+ puts "Usage:"
+ puts " refinerycms APP_NAME [options]"
+ puts ""
+ puts "Options:"
+ # Support when running locally
+ relative_path = File.expand_path('../../core/lib/generators/refinery/cms/cms_generator.rb', __FILE__)
+ if File.exist?(relative_path)
+ require relative_path
+ else
+ gem 'refinerycms-core'
+ require 'generators/refinery/cms/cms_generator'
+ end
+ Refinery::CmsGenerator.class_options.each do |raw, option|
+ dasherized = "--#{option.name.to_s.gsub('_', '-')}"
+ dasherized = [option.aliases, "[#{dasherized}]"].flatten.join(', ') if option.aliases.any?
+ puts " #{dasherized}".ljust(28) << "# #{option.description}"
+ end
+ exit 0
+end
+
application_name = ARGV.shift
+
result = Rails::Generators::AppGenerator.start [application_name, '-m', template_path, '--skip-test-unit'] | ARGV
if result && result.include?('Gemfile')
@@ -13,7 +35,7 @@ if result && result.include?('Gemfile')
note << "\ncd #{application_name}"
note << "rails server"
note << "\nThis will launch the built-in webserver at port 3000."
- note << "You can now see your site running in your browser at http://localhost:3000"
+ note << "You can now see Refinery running in your browser at http://localhost:3000/refinery"
if ARGV.include?('--heroku')
note << "\nIf you want files and images to work on Heroku, you will need setup S3:"
@@ -24,4 +46,4 @@ if result && result.include?('Gemfile')
note << "---------\n\n"
puts note
-end
+end
2  core/lib/generators/refinery/cms/cms_generator.rb
View
@@ -1,3 +1,5 @@
+require 'pathname'
+
module Refinery
class CmsGenerator < Rails::Generators::Base
source_root Pathname.new(File.expand_path('../templates', __FILE__))
Something went wrong with that request. Please try again.