Class: TYRepo::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/tuya/ci/core/spec/ty_repo.rb

Direct Known Subclasses

RepoTuya

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(podspec_path) ⇒ Repo

Returns a new instance of Repo.



12
13
14
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 12

def initialize(podspec_path)
	raise 'Path cannot be nil' unless podspec_path
end

Instance Attribute Details

#podspec_pathObject

Returns the value of attribute podspec_path.



8
9
10
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 8

def podspec_path
  @podspec_path
end

#repoObject

Returns the value of attribute repo.



10
11
12
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 10

def repo
  @repo
end

#sourcesObject

Returns the value of attribute sources.



9
10
11
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 9

def sources
  @sources
end

Instance Method Details

#commandObject



24
25
26
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 24

def command
	"pod repo push #{@repo} #{@podspec_path}" << command_sources << ' --use-libraries --allow-warnings'
end

#command_sourcesObject



16
17
18
19
20
21
22
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 16

def command_sources
	result = ' --sources=\''
	@sources.each_with_index do |source, index|
		result << source << ((index != @sources.size - 1) ? ',':'')
	end
	result << '\''
end

#pushObject



28
29
30
31
32
33
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 28

def push

	puts "Repo push: #{command}".green

	`#{command}`
end