Class: PigMediaServer::CLI
- Inherits:
-
Thor
- Object
- Thor
- PigMediaServer::CLI
- Defined in:
- lib/pig-media-server/cli.rb
Instance Method Summary collapse
- #aspect ⇒ Object
- #backup ⇒ Object
- #crawl ⇒ Object
- #kindle_send ⇒ Object
- #restore ⇒ Object
- #server(port = nil) ⇒ Object
- #setup ⇒ Object
Instance Method Details
#aspect ⇒ Object
38 39 40 41 |
# File 'lib/pig-media-server/cli.rb', line 38 def aspect require 'pig-media-server/aspect' PigMediaServer::Aspect.new.run end |
#backup ⇒ Object
50 51 52 53 |
# File 'lib/pig-media-server/cli.rb', line 50 def backup require 'pig-media-server/backup' PigMediaServer::Backup.new.backup end |
#crawl ⇒ Object
22 23 24 25 |
# File 'lib/pig-media-server/cli.rb', line 22 def crawl require 'pig-media-server/crawl' PigMediaServer::Crawl.new.all end |
#kindle_send ⇒ Object
44 45 46 47 |
# File 'lib/pig-media-server/cli.rb', line 44 def kindle_send require 'pig-media-server/kindle_send' PigMediaServer::KindleSend.new.run end |
#restore ⇒ Object
57 58 59 60 |
# File 'lib/pig-media-server/cli.rb', line 57 def restore require 'pig-media-server/backup' PigMediaServer::Backup.new.restore_from [:path] end |
#server(port = nil) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/pig-media-server/cli.rb', line 30 def server(port = nil) require 'pig-media-server/web' port ||= [:port] Sinatra::Base.server.delete 'HTTP' # conflict with HTTP.gem PigMediaServer::Web.run! :bind => [:bind], :port => port.to_i end |
#setup ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pig-media-server/cli.rb', line 6 def setup require 'fileutils' config = Pit.get("Pig Media Server", require:{ 'hostname' => 'Your host name', 'path' => 'Path of your storage', 'groonga' => "Path of groonga's files", 'exclude_path' => 'Exclude Path(Array)', 'user_data_path' => 'Path of User Data' }) puts "Path: #{config['path']}" puts "Groonga: #{config['groonga']}" FileUtils.mkdir_p config['user_data_path'] end |