Class: Qiita::Build::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/qiita/build/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(stdin, argv) ⇒ Command

Returns a new instance of Command.



8
9
10
11
12
# File 'lib/qiita/build/command.rb', line 8

def initialize(stdin, argv)
  @options = {}
  @json = JSON.parse(stdin)
  @argv = parse_options!(argv)
end

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/qiita/build/command.rb', line 14

def run
  client = Qiita::Client.new(team: team, access_token: access_token)
  response = client.get_template(template_id)
  template = response.body["body"]
  puts Builder.new.build(template: template, json: @json)
end