Class: Tuya::Command::Repo::Push
- Inherits:
-
Tuya::Command::Repo
- Object
- CLAide::Command
- Tuya::Command
- Tuya::Command::Repo
- Tuya::Command::Repo::Push
- Defined in:
- lib/tuya/cli/odm/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.
18 19 20 21 22 23 24 25 26 |
# File 'lib/tuya/cli/odm/command/repo/push.rb', line 18 def initialize(argv) super @is_commit = argv.flag?('commit', true) @version = argv.option('version') @podspec = argv.shift_argument end |
Instance Method Details
#run ⇒ Object
28 29 30 31 32 |
# File 'lib/tuya/cli/odm/command/repo/push.rb', line 28 def run puts "Pushing the podspec: #{@podspec} to version: #{@version}".green Tuya::SpecRepo.push(@version, @is_commit, @podspec, @verbose) end |
#validate! ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/tuya/cli/odm/command/repo/push.rb', line 9 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 |