Class: ToptranslationCli::Push
- Inherits:
-
Object
- Object
- ToptranslationCli::Push
- Defined in:
- lib/toptranslation_cli/push.rb
Overview
rubocop:disable Metrics/ClassLength
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Push
constructor
A new instance of Push.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Push
Returns a new instance of Push.
16 17 18 19 20 21 22 |
# File 'lib/toptranslation_cli/push.rb', line 16 def initialize ToptranslationCli.configuration.load @pastel = Pastel.new @spinner_settings = { success_mark: @pastel.green('+'), error_mark: @pastel.red('-') } @spinner = TTY::Spinner.new("[#{@pastel.yellow(':spinner')}] :title", @spinner_settings) end |
Class Method Details
.run ⇒ Object
11 12 13 |
# File 'lib/toptranslation_cli/push.rb', line 11 def run new.run end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/toptranslation_cli/push.rb', line 24 def run @documents = fetch_documents changed = changed_files(local_files) upload_files(changed) rescue RestClient::Forbidden @spinner.error('invalid access token') exit 1 end |