Class: Dscli::Commands
- Inherits:
-
Thor
- Object
- Thor
- Dscli::Commands
- Includes:
- Thor::Actions
- Defined in:
- lib/dscli/commands.rb
Class Method Summary collapse
Instance Method Summary collapse
- #compile(csdl) ⇒ Object
-
#config ⇒ Object
option :push, type: :boolean, desc: ‘Enter details of a new Push Destination’.
- #dpu(hash) ⇒ Object
- #stream(hash) ⇒ Object
- #usage(period = 'day') ⇒ Object
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/dscli/commands.rb', line 8 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#compile(csdl) ⇒ Object
33 34 35 36 37 |
# File 'lib/dscli/commands.rb', line 33 def compile(csdl) api = Dscli::API.new definition = api.compile(csdl) puts definition end |
#config ⇒ Object
option :push, type: :boolean, desc: ‘Enter details of a new Push Destination’
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dscli/commands.rb', line 16 def config #if options[:user] open(ENV['HOME'] + '/.datasiftcli', 'w') do |f| f.write Dscli::Parameters.new.user_config().to_yaml end #end #TODO Add other config options such as new push destinations end |
#dpu(hash) ⇒ Object
46 47 48 49 |
# File 'lib/dscli/commands.rb', line 46 def dpu(hash) api = Dscli::API.new puts Yajl::Encoder.encode(api.dpu(hash), :pretty => true) end |