Class: Taps::Cli
- Inherits:
-
Thor
- Object
- Thor
- Taps::Cli
- Defined in:
- lib/taps/cli.rb
Instance Method Summary collapse
- #clientxfer(method, database_url, remote_url) ⇒ Object
- #pull(database_url, remote_url) ⇒ Object
- #push(database_url, remote_url) ⇒ Object
- #server(database_url, login, password) ⇒ Object
- #version ⇒ Object
Instance Method Details
#clientxfer(method, database_url, remote_url) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/taps/cli.rb', line 44 def clientxfer(method, database_url, remote_url) if [:chunksize] Taps::Config.chunksize = [:chunksize] < 100 ? 100 : [:chunksize] else Taps::Config.chunksize = 1000 end Taps::Config.database_url = database_url Taps::Config.remote_url = remote_url Taps::Config.verify_database_url require 'taps/client_session' Taps::ClientSession.quickstart do |session| session.send(method) end end |
#pull(database_url, remote_url) ⇒ Object
29 30 31 |
# File 'lib/taps/cli.rb', line 29 def pull(database_url, remote_url) clientxfer(:cmd_receive, database_url, remote_url) end |
#push(database_url, remote_url) ⇒ Object
35 36 37 |
# File 'lib/taps/cli.rb', line 35 def push(database_url, remote_url) clientxfer(:cmd_send, database_url, remote_url) end |
#server(database_url, login, password) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/taps/cli.rb', line 10 def server(database_url, login, password) Taps::Config.database_url = database_url Taps::Config.login = login Taps::Config.password = password port = [:port] || 5000 Taps::Config.verify_database_url require 'taps/server' Taps::Server.run!({ :port => port, :environment => :production, :logging => true }) end |