Class: Tuya::Command::Repo::Push
- Inherits:
-
Tuya::Command::Repo
- Object
- CLAide::Command
- Tuya::Command
- Tuya::Command::Repo
- Tuya::Command::Repo::Push
- Defined in:
- lib/tycli/command/repo/push.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Push
constructor
A new instance of Push.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Tuya::Command::Repo
Constructor Details
#initialize(argv) ⇒ Push
Returns a new instance of Push.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tycli/command/repo/push.rb', line 21 def initialize(argv) super @is_commit = argv.flag?('commit', true) @version = argv.option('version') # @version = '0.0.1' unless @version @podspec = argv.shift_argument end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 |
# File 'lib/tycli/command/repo/push.rb', line 32 def run puts "Pushing the podspec: #{@podspec} to version: #{@version}".green Tuya::SpecRepo.push(@version, @is_commit, @podspec) end |
#validate! ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/tycli/command/repo/push.rb', line 12 def validate! @podspec = Tuya::PodSpec.ask_pod_spec unless @podspec help! "\npodspec can not be nil" unless @podspec @version = Tuya::PodSpec.pod_spec_version @podspec unless @version help! "\nuse --version assign your verion " unless @version end |