Class: Chillfile::CLI
- Inherits:
-
Thor
- Object
- Thor
- Chillfile::CLI
- Defined in:
- lib/chillfile/cli.rb
Overview
CLI handles the command line interface for the ‘chillfile` binary. It is a `Thor` application.
Instance Method Summary collapse
- #dblist ⇒ Object
- #fslist ⇒ Object
-
#initialize ⇒ CLI
constructor
create a new instance with the args passed from the command line i.e.
- #sync ⇒ Object
Constructor Details
#initialize ⇒ CLI
create a new instance with the args passed from the command line i.e. ARGV
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/chillfile/cli.rb', line 31 def initialize(*) super cfg = {} cfg["path"] = [:path] cfg["couchdb_server"] = [:couchdb_server] cfg["couchdb_database"] = [:couchdb_database] cfg["couchdb_type_key"] = [:couchdb_type_key] Chillfile.boot!(cfg) if [:version] say "chillfile v#{Chillfile::VERSION}", :red exit end end |
Instance Method Details
#dblist ⇒ Object
64 65 66 |
# File 'lib/chillfile/cli.rb', line 64 def dblist say Chillfile.db_list end |
#fslist ⇒ Object
59 60 61 |
# File 'lib/chillfile/cli.rb', line 59 def fslist say Chillfile.fs_list end |
#sync ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/chillfile/cli.rb', line 49 def sync = lambda do |info, notifier| = ::ProgressBar.new("#{info[:name]} (#{info[:size]})", info[:size]) notifier.call(lambda{ .inc }) .finish end Chillfile.sync!() end |