Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #1897 by defining generator_command in all generators.

  • Loading branch information...
commit ac1c68f557a77e0864bd6d74cb05662a2582d8ec 1 parent 25b6213
@parndt parndt authored
View
4 core/lib/generators/refinery/engine/engine_generator.rb
@@ -33,6 +33,10 @@ def generate
protected
+ def generator_command
+ 'rails generate refinery:engine'
+ end
+
def reject_file_with_skip_frontend?(file)
(skip_frontend? && (file.to_s.include?('app') && file.to_s.scan(/admin|models|mailers/).empty?)) ||
reject_file_without_skip_frontend?(file)
View
10 core/lib/generators/refinery/form/form_generator.rb
@@ -11,10 +11,6 @@ def description
"Generates an extension which is set up for frontend form submissions like a contact page."
end
- def generator_command
- 'rails generate refinery:form'
- end
-
def generate
sanity_check!
@@ -29,5 +25,11 @@ def generate
finalize_extension!
end
+ protected
+
+ def generator_command
+ 'rails generate refinery:form'
+ end
+
end
end
View
9 core/lib/refinery/extension_generation.rb
@@ -208,6 +208,10 @@ def gemfile
end
end
+ def generator_command
+ raise "You must override the method 'generator_command' in your generator."
+ end
+
def merge_locales!
if existing_extension?
# go through all of the temporary files and merge what we need into the current files.
@@ -304,11 +308,12 @@ def sanity_check!
else
"Please specify the singular name '#{singular_name.singularize}' instead of '#{plural_name}'."
end
- exit_with_message!(message)
+ exit_with_message! message
end
if attributes.empty? && self.behavior != :revoke
- exit_with_message!("You must specify a name and at least one field. For help: #{generator_command}")
+ exit_with_message! "You must specify a name and at least one field." \
+ "\nFor help, run: #{generator_command}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.