Class: LMK::GistSender

Inherits:
Object
  • Object
show all
Defined in:
lib/lmk/gist_sender.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



23
24
25
# File 'lib/lmk/gist_sender.rb', line 23

def client
  Octokit::Client.new
end

#options(command) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lmk/gist_sender.rb', line 11

def options(command)
  { 
    :description => command.command, 
    :public => false, 
    :files => {
      "#{command.timestamp.strftime '%FT%R'}.lmk" => { 
        :content => command.full_output 
      }
    }
  }
end

#send(commmand) ⇒ Object



5
6
7
8
9
# File 'lib/lmk/gist_sender.rb', line 5

def send(commmand)
  result = client.create_gist options(commmand)
  commmand.html_url = result[:html_url]
  commmand
end