Class: Trailblazer::Pro::Install
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Trailblazer::Pro::Install
- Defined in:
- lib/trailblazer/pro/rails/generator.rb
Instance Method Summary collapse
- #create_session_file ⇒ Object
-
#prompt_for_api_key ⇒ Object
source_root File.expand_path(“templates”, __dir__).
Instance Method Details
#create_session_file ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/trailblazer/pro/rails/generator.rb', line 15 def create_session_file return if @api_key.nil? # FIXME: use Trailblazer instead of thor's basic control flow. create_file Rails::SESSION_PATH do uninitialized_session = Trailblazer::Pro::Session::Uninitialized.new(api_key: @api_key, trailblazer_pro_host: "https://pro.trailblazer.to") Trailblazer::Pro::Session.serialize(uninitialized_session) end end |
#prompt_for_api_key ⇒ Object
source_root File.expand_path(“templates”, __dir__)
7 8 9 10 11 12 13 |
# File 'lib/trailblazer/pro/rails/generator.rb', line 7 def prompt_for_api_key input = ask %(Your Trailblazer PRO API key:) # TODO: blank return if input.blank? @api_key = input.chomp end |