Class: BiblioTech::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bibliotech/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/bibliotech/cli.rb', line 6

def self.exit_on_failure?
  true
end

Instance Method Details

#backupObject



29
30
31
32
# File 'lib/bibliotech/cli.rb', line 29

def backup()
  app = App.new
  app.create_backup
end

#configObject



35
36
37
38
39
40
# File 'lib/bibliotech/cli.rb', line 35

def config
  require 'yaml'
  app = App.new
  puts "Loading from: #{app.valise.to_s}"
  puts YAML::dump(app.config.hash)
end

#dump(file) ⇒ Object



17
18
19
20
# File 'lib/bibliotech/cli.rb', line 17

def dump(file)
  app = App.new
  app.export(:backups => { :filename => file })
end

#latestObject



11
12
13
14
# File 'lib/bibliotech/cli.rb', line 11

def latest
  app = App.new(:log => { :target => "/dev/null" })
  puts app.latest
end

#load(file) ⇒ Object



23
24
25
26
# File 'lib/bibliotech/cli.rb', line 23

def load(file)
  app = App.new
  app.import(:backups => { :file => file })
end