Class: Jekyll::Commands::ComposeCommand::ComposeCommandArgParser
Instance Attribute Summary
#args, #config, #options
Instance Method Summary
collapse
#force?, #initialize, #layout, #source, #timestamp_format, #title, #type
Instance Method Details
#collection ⇒ Object
57
58
59
60
61
62
63
64
65
|
# File 'lib/jekyll/commands/compose.rb', line 57
def collection
if (coll = options["collection"])
coll
elsif options["draft"]
"drafts"
else
"posts"
end
end
|
#date ⇒ Object
53
54
55
|
# File 'lib/jekyll/commands/compose.rb', line 53
def date
@date ||= options["date"] ? Date.parse(options["date"]) : Time.now
end
|
#validate! ⇒ Object
45
46
47
48
49
50
51
|
# File 'lib/jekyll/commands/compose.rb', line 45
def validate!
if options.values_at("post", "draft", "collection").compact.length > 1
raise ArgumentError, "You can only specify one of --post, --draft, or --collection COLLECTION."
end
super
end
|