Class: TYCiCore::SpecODM
- Inherits:
-
Object
- Object
- TYCiCore::SpecODM
- Defined in:
- lib/tuya/ci/core/spec/odm/spec_odm.rb
Instance Attribute Summary collapse
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#module_version ⇒ Object
Returns the value of attribute module_version.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#repo_url ⇒ Object
Returns the value of attribute repo_url.
Instance Method Summary collapse
- #add_repo ⇒ Object
-
#initialize(repo, repo_url, module_name, module_version) ⇒ SpecODM
constructor
A new instance of SpecODM.
- #odm_config ⇒ Object
- #podspec_des ⇒ Object
- #repo_update ⇒ Object
- #spec_exist? ⇒ Boolean
Constructor Details
#initialize(repo, repo_url, module_name, module_version) ⇒ SpecODM
Returns a new instance of SpecODM.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 6 def initialize(repo, repo_url, module_name, module_version) @repo = repo @repo_url = repo_url @module_name = module_name @module_version = module_version home = ENV["HOME"] # /Users/dong/.cocoapods/repos/TYSpecs/Specs/TestDemo/12.0.8 @repo_path = "#{home}/.cocoapods/repos/#{@repo}" # @repo_module_path = "#{@repo_path}/Specs/#{@module_name}/#{module_version}/" @repo_module_path = "#{@repo_path}/#{@module_name}/#{module_version}/" end |
Instance Attribute Details
#module_name ⇒ Object
Returns the value of attribute module_name.
4 5 6 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 4 def module_name @module_name end |
#module_version ⇒ Object
Returns the value of attribute module_version.
4 5 6 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 4 def module_version @module_version end |
#repo ⇒ Object
Returns the value of attribute repo.
4 5 6 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 4 def repo @repo end |
#repo_url ⇒ Object
Returns the value of attribute repo_url.
4 5 6 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 4 def repo_url @repo_url end |
Instance Method Details
#add_repo ⇒ Object
25 26 27 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 25 def add_repo TYCiCore::EXE.exe 'pod', %W(repo add #{@repo} #{@repo_url}) end |
#odm_config ⇒ Object
19 20 21 22 23 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 19 def odm_config add_repo unless spec_exist? repo_update podspec_des end |
#podspec_des ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 29 def podspec_des podspec_path = "#{@repo_module_path}#{@module_name}.podspec" puts "ODM #{module_name}'s podspec path is #{podspec_path}".yellow podspec = TYCiCore::PodSpec.new podspec_path podspec.value_key 'summary' end |
#repo_update ⇒ Object
37 38 39 40 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 37 def repo_update puts "ODM pod repo update #{@repo}".yellow TYCiCore::EXE.exe 'pod', %W(repo update #{@repo}) end |
#spec_exist? ⇒ Boolean
42 43 44 45 46 |
# File 'lib/tuya/ci/core/spec/odm/spec_odm.rb', line 42 def spec_exist? result = File.exist? @repo_path puts "ODM repo: #{@repo} exist? #{result}".yellow result end |