Class: Snipcheat::Task
- Inherits:
-
Thor
- Object
- Thor
- Snipcheat::Task
- Includes:
- Thor::Actions
- Defined in:
- lib/snipcheat/task.rb
Instance Method Summary collapse
Instance Method Details
#generate ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/snipcheat/task.rb', line 12 def generate vsay "Looking for snippets in #{[:dir]}" snippet_dir = SnippetDir.new([:dir]) if snippet_dir.empty? say "No snippets found in #{[:dir]}" return else vsay "Found: #{snippet_dir.filenames.join(', ')}" out = [:out] || 'cheatsheet.html' vsay "Writing to #{out}..." Output.new(snippet_dir.snippets, out).write end end |