Class: TYRepo::Repo
- Inherits:
-
Object
- Object
- TYRepo::Repo
- Defined in:
- lib/tuya/ci/core/spec/ty_repo.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#podspec_path ⇒ Object
Returns the value of attribute podspec_path.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#sources ⇒ Object
Returns the value of attribute sources.
Instance Method Summary collapse
- #command ⇒ Object
- #command_sources ⇒ Object
-
#initialize(podspec_path) ⇒ Repo
constructor
A new instance of Repo.
- #push ⇒ Object
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_path ⇒ Object
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 |
#repo ⇒ Object
Returns the value of attribute repo.
10 11 12 |
# File 'lib/tuya/ci/core/spec/ty_repo.rb', line 10 def repo @repo end |
#sources ⇒ Object
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
#command ⇒ Object
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_sources ⇒ Object
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 |
#push ⇒ Object
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 |