Class: Bard::CLI::Data
- Inherits:
-
Struct
- Object
- Struct
- Bard::CLI::Data
- Defined in:
- lib/bard/data.rb
Instance Attribute Summary collapse
-
#bard ⇒ Object
Returns the value of attribute bard.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
Instance Attribute Details
#bard ⇒ Object
Returns the value of attribute bard
2 3 4 |
# File 'lib/bard/data.rb', line 2 def @bard end |
#from ⇒ Object
Returns the value of attribute from
2 3 4 |
# File 'lib/bard/data.rb', line 2 def from @from end |
#to ⇒ Object
Returns the value of attribute to
2 3 4 |
# File 'lib/bard/data.rb', line 2 def to @to end |
Instance Method Details
#call ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bard/data.rb', line 3 def call if to == "production" server = .instance_variable_get(:@config).servers[to.to_sym] url = server.normalized_ping puts .yellow("WARNING: You are about to push data to production, overwriting everything that is there!") answer = .ask("If you really want to do this, please type in the full HTTPS url of the production server:") if answer != url puts .red("!!! ") + "Failed! We expected #{url}. Is this really where you want to overwrite all the data?" exit 1 end end if to == "local" data_pull_db from.to_sym data_pull_assets from.to_sym elsif from == "local" data_push_db to.to_sym data_push_assets to.to_sym else data_move_db from.to_sym, to.to_sym data_move_assets from.to_sym, to.to_sym end end |