lib/timber/cli/installers.rb in timber-2.1.0.rc2 vs lib/timber/cli/installers.rb in timber-2.1.0.rc3
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
require "timber/cli/api"
require "timber/cli/installers/root"
require "timber/cli/io/messages"
require "timber/cli/os_helper"
@@ -12,16 +14,44 @@
io.puts IO::Messages.contact, :green
io.puts IO::Messages.separator, :green
io.puts ""
if !api_key
- io.puts IO::Messages.no_api_key_provided
+ app_url = IO::Messages::APP_URL
- case io.ask_yes_no("Open the Timber app in your brower now?")
- when :yes
- OSHelper.open(IO::Messages::APP_URL)
+ io.puts "Hey there! Welcome to Timber. In order to proceed, you'll need an API key."
+ io.puts "You can grab one by registering at #{IO::ANSI.colorize(app_url, :blue)}."
+ io.puts ""
+ io.puts "It takes less than a minute, with one click Google and Github registration."
+ io.puts ""
+
+ if OSHelper.can_open?
+ case io.ask_yes_no("Open #{app_url}?")
+ when :yes
+ puts ""
+ io.task("Opening #{app_url}") do
+ OSHelper.open(app_url)
+ end
+ when :no
+ io.puts ""
+ io.puts "No problem, navigate to the following URL:"
+ io.puts ""
+ io.puts " #{IO::ANSI.colorize(app_url, :blue)}"
+ end
+ else
+ io.puts ""
+ io.puts "Please navigate to:"
+ io.puts ""
+ io.puts " #{IO::ANSI.colorize(app_url, :blue)}"
end
+ io.puts ""
+ io.puts "Once you obtain your API key, you can run the installer like"
+ io.puts ""
+ io.puts " #{IO::ANSI.colorize("bundle exec timber my-api-key", :blue)}"
+ io.puts ""
+ io.puts "See you soon! 🎈"
+ io.puts ""
else
api = API.new(api_key)
api.event(:started)
io.api = api
\ No newline at end of file