app/dev/generators/command_generator.rb in lizarb-1.0.1 vs app/dev/generators/command_generator.rb in lizarb-1.0.2
- old
+ new
@@ -4,48 +4,15 @@
FOLDER = "app/dev/commands"
generate :controller do
folder FOLDER
filename "#{name}_command.rb"
- content command_content
+ content render "command.rb"
end
generate :controller_test do
folder FOLDER
filename "#{name}_command_test.rb"
- content command_test_content
- end
-
- # helper methods
-
- def command_content
- <<~CODE
-class #{name.camelize}Command < Liza::Command
-
- def self.call args
- log :higher, "Called \#{self}.\#{__method__} with args \#{args}"
-
- #
- end
-
-end
- CODE
- end
-
- def command_test_content
- <<~CODE
-class #{name.camelize}CommandTest < Liza::CommandTest
-
- test :subject_class do
- assert subject_class == #{name.camelize}Command
- end
-
- test :settings do
- assert subject_class.log_level == :normal
- assert subject_class.log_color == :green
- end
-
-end
- CODE
+ content render "command_test.rb"
end
end