Class: Feedcellar::Web::Command
- Inherits:
-
Thor
- Object
- Thor
- Feedcellar::Web::Command
- Defined in:
- lib/feedcellar/web/command.rb
Instance Attribute Summary collapse
-
#database_dir ⇒ Object
readonly
Returns the value of attribute database_dir.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Command
constructor
A new instance of Command.
- #start ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(*args) ⇒ Command
Returns a new instance of Command.
30 31 32 33 34 35 |
# File 'lib/feedcellar/web/command.rb', line 30 def initialize(*args) super default_base_dir = File.join(File.("~"), ".feedcellar") @base_dir = ENV["FEEDCELLAR_HOME"] || default_base_dir @database_dir = File.join(@base_dir, "db") end |
Instance Attribute Details
#database_dir ⇒ Object (readonly)
Returns the value of attribute database_dir.
28 29 30 |
# File 'lib/feedcellar/web/command.rb', line 28 def database_dir @database_dir end |
Instance Method Details
#start ⇒ Object
44 45 46 47 48 |
# File 'lib/feedcellar/web/command.rb', line 44 def start web_server_thread = Thread.new { Feedcellar::Web::App.run! } Launchy.open("http://localhost:4567") unless [:silent] web_server_thread.join end |
#version ⇒ Object
38 39 40 |
# File 'lib/feedcellar/web/command.rb', line 38 def version puts Feedcellar::Web::VERSION end |