./lib/dubai/commands/generate.rb in dubai-0.0.1 vs ./lib/dubai/commands/generate.rb in dubai-0.0.3
- old
+ new
@@ -5,13 +5,13 @@
c.summary = 'Generates a template pass directory'
c.description = ''
c.example 'description', 'pk generate mypass'
c.option '-T', '--type [boardingPass|coupon|eventTicket|storeCard|generic]', 'Type of pass'
-
+
c.action do |args, options|
- @directory = args.first
+ @directory = args.first
@directory ||= ask "Enter a passbook name: "
say_error "Missing pass name" and abort if @directory.nil? or @directory.empty?
say_error "Directory #{@directory} already exists" and abort if File.directory?(@directory)
say_error "File exists at #{@directory}" and abort if File.exist?(@directory)
@@ -28,11 +28,11 @@
say_ok "Pass generated in #{@directory}"
end
end
-# alias_command :generate, :new
-# alias_command :generate, :g
+alias_command :new, :generate
+alias_command :g, :generate
private
def determine_type!
@type ||= choose "Select a pass type", *Dubai::Passbook::Pass::TYPES