Class: Blockspring::CLI::Command::Run
- Defined in:
- lib/blockspring/cli/command/run.rb
Overview
set BLOCKSPRING_API_KEY environment variable and run block
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
run:local COMMAND.
-
#local ⇒ Object
run:local COMMAND.
-
#remote ⇒ Object
run:remote USER/BLOCKID.
Methods inherited from Base
Methods included from Helpers
#display, #error, error_with_failure, error_with_failure=, #format_with_bang, #home_directory, #longest, #output_with_bang, #running_on_a_mac?, #running_on_windows?
Constructor Details
This class inherits a constructor from Blockspring::CLI::Command::Base
Instance Method Details
#index ⇒ Object
run:local COMMAND
set api key environment variable and run block
Automatically detects if local or remote Use run:local or run:remote to specify
Example:
$ blockspring run:local node block.js –zip-code=94110
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/blockspring/cli/command/run.rb', line 17 def index if ENV['BLOCKSPRING_API_KEY'].to_s.strip.empty? _, key = Blockspring::CLI::Auth.get_credentials if key ENV['BLOCKSPRING_API_KEY'] = key end end match = /([^\/]+\/)([^\/]+)/.match(@args[0]) if(match and not File.exist?(@args[0])) remote else local end end |
#local ⇒ Object
run:local COMMAND
set api key environment variable and run a local block
Example:
$ blockspring run:local node block.js –zip-code=94110
42 43 44 |
# File 'lib/blockspring/cli/command/run.rb', line 42 def local system(*@args) end |
#remote ⇒ Object
run:remote USER/BLOCKID
set api key environment variable and run a remote block
- –argname=value …
-
# specify arguments for the block
Example:
$ blockspring run:remote jtokoph/aasdfj332flk3 –zip-code=94110
56 57 58 |
# File 'lib/blockspring/cli/command/run.rb', line 56 def remote error('not yet implimented') end |