Class: Methan::Console
- Inherits:
-
Thor
- Object
- Thor
- Methan::Console
- Defined in:
- lib/methan/console.rb
Instance Method Summary collapse
Instance Method Details
#new(filename) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/methan/console.rb', line 21 def new(filename) now = Time.now.strftime("%Y%m%d%H%M%S") pwd = Dir::pwd filename = "#{filename}.md" unless filename.split(".").last == "md" filename = "#{now}_#{filename}" filepath = File.join(pwd, filename) src = "# #{options[:title] || ''}\n" File.open(filepath, "w") do |io| io.write(src) end show "Create memo `#{filename} at #{pwd}`", :green end |
#server ⇒ Object
39 40 41 |
# File 'lib/methan/console.rb', line 39 def server ::Methan::Server.rackup(.dup) end |
#version ⇒ Object
15 16 17 |
# File 'lib/methan/console.rb', line 15 def version show Methan::VERSION end |