Class: Tuya::Command::Repo::Push

Inherits:
Tuya::Command::Repo show all
Defined in:
lib/tycli/command/repo/push.rb

Instance Method Summary collapse

Methods inherited from Tuya::Command::Repo

options

Constructor Details

#initialize(argv) ⇒ Push

Returns a new instance of Push.



21
22
23
24
25
26
27
28
29
# File 'lib/tycli/command/repo/push.rb', line 21

def initialize(argv)
  super

  @is_commit = argv.flag?('commit', true)

  @version = argv.option('version')
  @podspec = argv.shift_argument

end

Instance Method Details

#runObject



31
32
33
34
35
# File 'lib/tycli/command/repo/push.rb', line 31

def run
  puts "Pushing the podspec: #{@podspec} to version: #{@version}".green

  Tuya::SpecRepo.push(@version, @is_commit, @podspec, @verbose)
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