Class: Kip::CommandLine

Inherits:
Thor
  • Object
show all
Defined in:
lib/kip/cli.rb

Instance Method Summary collapse

Instance Method Details

#post(filename) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kip/cli.rb', line 9

def post(filename)
  title = options[:title]
  tags = options[:tags]
  publish = options[:publish]
  file = open(filename)
  content = file.read
  puts "Title: " + title
  puts "Tags: " + tags
  puts "Submit as " + ((publish) ? "published post" : "a draft")
  Kip::API.create_new_post(title, tags, "This is a test", !publish) 
end