lib/roger/generators.rb in roger-1.8.0 vs lib/roger/generators.rb in roger-1.9.0
- old
+ new
@@ -10,13 +10,15 @@
end
def self.register(name, klass = nil)
name, klass = generator_name(name, klass)
- raise(
- ArgumentError,
- "Generator name '#{name.inspect}' already in use"
- ) if Cli::Generate.tasks.key?(name)
+ if Cli::Generate.tasks.key?(name)
+ raise(
+ ArgumentError,
+ "Generator name '#{name.inspect}' already in use"
+ )
+ end
usage = "#{name} #{klass.arguments.map(&:banner).join(' ')}"
long_desc = klass.desc || "Run #{name} generator"
Cli::Generate.register klass, name, usage, long_desc