Class: Feedcellar::Web::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/feedcellar/web/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.expand_path("~"), ".feedcellar")
  @base_dir = ENV["FEEDCELLAR_HOME"] || default_base_dir
  @database_dir = File.join(@base_dir, "db")
end

Instance Attribute Details

#database_dirObject (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

#startObject



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 options[:silent]
  web_server_thread.join
end

#versionObject



38
39
40
# File 'lib/feedcellar/web/command.rb', line 38

def version
  puts Feedcellar::Web::VERSION
end