lib/boty/cli.rb in boty-0.0.9 vs lib/boty/cli.rb in boty-0.0.10
- old
+ new
@@ -11,27 +11,31 @@
desc "new [BOT_NAME]",
"Creates a BOT_NAME dir with your new bot structure."
def new(bot_name)
@bot_name = bot_name
- acquire_bot_info bot_name
+ acquire_bot_info
directory "project", bot_name, verbose: verbose
- inside bot_name do
- # for some reason the example .rspec isn't been copied
- create_file ".rspec", "--require=spec_helper"
- run "chmod +x bot"
- run "bundle install"
- end
+ after_create
end
private
def verbose
options[:verbose]
end
- def acquire_bot_info(bot_name)
+ def acquire_bot_info
@company = ask("What is your Slack company name?") || "acme"
@api_key = ask("What is the #{@bot_name} api key?") || "omg-lol-bbq"
+ end
+
+ def after_create
+ inside @bot_name do
+ # for some reason the example .rspec isn't been copied
+ create_file ".rspec", "--require=spec_helper"
+ run "chmod +x bot"
+ run "bundle install"
+ end
end
end
end