Module: Blockspring::CLI

Defined in:
lib/blockspring/cli.rb,
lib/blockspring/cli/command.rb,
lib/blockspring/cli/helpers.rb,
lib/blockspring/cli/version.rb

Defined Under Namespace

Modules: Command, Helpers Classes: Auth

Constant Summary collapse

USER_AGENT =
"blockspring-cli-gem/#{Blockspring::CLI::VERSION} (#{RUBY_PLATFORM}) ruby/#{RUBY_VERSION}"
VERSION =
"0.0.7"

Class Method Summary collapse

Class Method Details

.start(*args) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/blockspring/cli.rb', line 22

def self.start(*args)
  begin
    if $stdin.isatty
      $stdin.sync = true
    end
    if $stdout.isatty
      $stdout.sync = true
    end
    command = args.shift.strip rescue "help"
    Blockspring::CLI::Command.load
    Blockspring::CLI::Command.run(command, args)
  rescue Interrupt => e
    `stty icanon echo`
    if ENV["BLOCKSPRING_DEBUG"]
      puts e.inspect
    else
      error("Command cancelled.")
    end
  # rescue => error
  #   puts error.inspect
  #   exit(1)
  end
end

.user_agentObject



14
15
16
# File 'lib/blockspring/cli.rb', line 14

def self.user_agent
  @@user_agent ||= USER_AGENT
end

.user_agent=(agent) ⇒ Object



18
19
20
# File 'lib/blockspring/cli.rb', line 18

def self.user_agent=(agent)
  @@user_agent = agent
end