Class: Trove::CLI
Instance Method Summary collapse
- #delete(filename = nil) ⇒ Object
- #init ⇒ Object
- #list ⇒ Object
- #pull(filename = nil) ⇒ Object
- #push(filename) ⇒ Object
- #version ⇒ Object
- #versions(filename) ⇒ Object
Instance Method Details
#delete(filename = nil) ⇒ Object
42 43 44 |
# File 'lib/trove/cli.rb', line 42 def delete(filename = nil) Trove.delete(filename) end |
#init ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/trove/cli.rb', line 8 def init create_file "trove/.keep", "" if File.exist?(".gitignore") contents = <<~EOS # Ignore Trove storage /trove/* !/trove/.keep EOS unless File.read(".gitignore").include?(contents) append_to_file(".gitignore", contents) end else say "Check in trove/.keep and ignore trove/*" end create_file ".trove.yml", <<~EOS storage: s3://my-bucket/trove EOS end |
#list ⇒ Object
47 48 49 50 51 52 |
# File 'lib/trove/cli.rb', line 47 def list say table( Trove.list, [:filename, :size, :updated_at] ) end |
#pull(filename = nil) ⇒ Object
37 38 39 |
# File 'lib/trove/cli.rb', line 37 def pull(filename = nil) Trove.pull(filename, version: [:version]) end |