cocoapods-vemars 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a851c66bb67131db1792030b809e4e1e67efabe6f572773ad7dafb1074b44ad9
4
- data.tar.gz: 37e96f45ae54e967b493d77c74862524e0d4dc2292dc4cddc24cf9c23011d3ae
3
+ metadata.gz: 2ba9ab90fd36b586347031093d3cc9149fba48e2e7b046803f3378cf8befff96
4
+ data.tar.gz: 1099a71408c4ed0fc8adf99e17ce337d382f9917a5adcfe6526ccdd7c7ba422d
5
5
  SHA512:
6
- metadata.gz: ea27b65735cc062c672fd4c40beb42704c0445f9878a577c2d0ae28dea4052dc88edb1e1bf0d51c67cf36feba19f94cf93eb67a01b5d857df9bb8b1ec67cbcbf
7
- data.tar.gz: c579291d9c2719de1135781d658634190d88cca41042df43a82fb86fd79e980e18548bd2bfef179549e39cc57f9daca7038017059396c743351da8b0d3bf5cb5
6
+ metadata.gz: 0d7b77ac2bc9d11a0427f63baa4cd1a69476514536aa1ab997d8449406cbbd66fc6e69a9edec0b383757f42e9fe44f03dfd532753e173eee0790e7c3c0d51bf8
7
+ data.tar.gz: 9bfcffa24880642f69fe529a055febf5d404f54ab5e0316a3af556217ac0dc7c5c3bfc24b891b2b7113c41b5a3cfc399bcce1fdf85b88b8a77378b1fde4f49c0
data/Gemfile CHANGED
@@ -9,7 +9,8 @@ gem 'concurrent-ruby', require: 'concurrent'
9
9
  gem 'xcodeproj'
10
10
  gem 'json_pure'
11
11
  gem 'cocoapods'
12
- # gem 'json'
12
+ gem 'rubyzip', '>= 1.0.0'
13
+ gem 'open-uri'
13
14
  group :debug do
14
15
  gem 'ruby-debug-ide'
15
16
  gem 'debase', '0.2.5.beta2'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-vemars (0.0.9)
4
+ cocoapods-vemars (0.0.10)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -78,6 +78,7 @@ GEM
78
78
  nanaimo (0.3.0)
79
79
  nap (1.1.0)
80
80
  netrc (0.11.0)
81
+ open-uri (0.1.0)
81
82
  plist (3.6.0)
82
83
  public_suffix (4.0.6)
83
84
  rake (13.0.6)
@@ -85,6 +86,7 @@ GEM
85
86
  ruby-debug-ide (0.7.2)
86
87
  rake (>= 0.8.1)
87
88
  ruby-macho (1.4.0)
89
+ rubyzip (2.3.2)
88
90
  thread_safe (0.3.6)
89
91
  typhoeus (1.4.0)
90
92
  ethon (>= 0.9.0)
@@ -108,10 +110,12 @@ DEPENDENCIES
108
110
  concurrent-ruby
109
111
  debase (= 0.2.5.beta2)
110
112
  json_pure
113
+ open-uri
111
114
  plist (~> 3.2)
112
115
  rake
113
116
  rexml
114
117
  ruby-debug-ide
118
+ rubyzip (>= 1.0.0)
115
119
  xcodeproj
116
120
 
117
121
  BUNDLED WITH
@@ -3,6 +3,8 @@ require_relative '../services/patcher'
3
3
  require_relative '../services/tailor'
4
4
  require_relative 'basicInfo'
5
5
  require_relative '../services/renamer'
6
+ require 'zip'
7
+ require 'open-uri'
6
8
  require 'json/pure'
7
9
  module Pod
8
10
 
@@ -15,13 +17,13 @@ module Pod
15
17
  attr_reader :service_url
16
18
 
17
19
  attr_accessor :components_details
18
- attr_accessor :source
20
+ attr_accessor :sources
19
21
 
20
22
  def project_folder
21
23
  File.join(Dir.pwd, "Project")
22
24
  end
23
25
 
24
- def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url)
26
+ def initialize(app_key, components, config_json, version=nil, bundle_id=nil, name='', language='objc', git_url, service_url,sources)
25
27
  @language = language
26
28
  @basicInfo = BasicInfo.new(app_key, bundle_id, name, version)
27
29
  @git_url = git_url
@@ -29,6 +31,7 @@ module Pod
29
31
  @selected_components = components | (language == 'swift' ? %w[OneKit SwiftOneKit] : ['OneKit'])
30
32
  @components_details = []
31
33
  @service_url = service_url
34
+ @sources = sources
32
35
  end
33
36
 
34
37
  def generate
@@ -55,7 +58,7 @@ module Pod
55
58
  collect_components
56
59
  Dir.chdir(podfile_dir) do
57
60
  construct_plist
58
- patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @source, @git_url)
61
+ patcher = Patcher.new(podfile_dir, @basicInfo.version, @components_details, @sources, @git_url)
59
62
  patcher.execute
60
63
  end
61
64
  end
@@ -65,9 +68,27 @@ module Pod
65
68
  if File.directory?(basicInfo.name) || File.file?(basicInfo.name)
66
69
  system("rm -rf #{basicInfo.name}")
67
70
  end
71
+ if git_url.end_with?(".git")
72
+ cmd = "git clone #{git_url} #{basicInfo.name}"
73
+ system(cmd)
74
+ else
75
+ destination = basicInfo.name
76
+ FileUtils.mkdir_p(destination)
77
+ content = URI.open(git_url)
78
+
79
+ Zip::File.open_buffer(content) do |zip|
80
+ zip.each do |f|
81
+ fname = f.name
82
+ if fname.start_with?("ve_Template_iOS")
83
+ paths = fname.split("/")
84
+ fname = fname.sub(paths[0],"")
85
+ end
86
+ fpath = File.join(destination, fname)
87
+ zip.extract(f, fpath) unless File.exist?(fpath)
88
+ end
89
+ end
68
90
 
69
- cmd = "git clone #{git_url} #{basicInfo.name}"
70
- system(cmd)
91
+ end
71
92
  end
72
93
 
73
94
  def language_switch
@@ -87,7 +108,6 @@ module Pod
87
108
  def collect_components
88
109
  components_api = Components_api.new(@basicInfo.version,@service_url)
89
110
  all_components = components_api.getComponents
90
- @source = components_api.source
91
111
  @selected_components.each do |com|
92
112
  existed_com = all_components.find { |acom|
93
113
  acom.name == com
@@ -98,7 +118,7 @@ module Pod
98
118
  end
99
119
 
100
120
  def construct_podfile
101
- template = PodfileTemplate.new(@basicInfo.version, @components_details, @source)
121
+ template = PodfileTemplate.new(@basicInfo.version, @components_details, @sources)
102
122
 
103
123
  File.open('Podfile', "w") { |file| file.puts template.to_dsl }
104
124
  end
@@ -25,7 +25,8 @@ module Pod
25
25
  ['--config=CONFIG_PATH', 'config path of vemars.'],
26
26
  ['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
27
27
  ['--git=GIT_URL', 'git url of demo repo'],
28
- ['--pod_repo_no_update', 'do not run pod repo update']
28
+ ['--pod_repo_no_update', 'do not run pod repo update'],
29
+ ['--sources','pod repos sources']
29
30
  ]
30
31
  options.concat(super.reject { |option, _| option == '--silent' })
31
32
  end
@@ -34,7 +35,7 @@ module Pod
34
35
  @name = argv.shift_argument
35
36
  @version = argv.shift_argument
36
37
  @language = argv.option('language', 'objc')
37
- git_url = argv.option('git', 'git@github.com:volcengine/ve_Template_iOS.git')
38
+ git_url = argv.option('git', 'https://github.com/volcengine/ve_Template_iOS.git')
38
39
  @silent = argv.flag?('silent', false)
39
40
  @repo_no_update = argv.flag?('pod_repo_no_update',false)
40
41
  @appkey = argv.option('appkey', '')
@@ -42,7 +43,8 @@ module Pod
42
43
  @selected_components = argv.option('com', "").split(',')
43
44
  @config_json = argv.option('config', '/onekit-config.json')
44
45
  service_url = argv.option('service_url',nil)
45
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url,service_url)
46
+ sources = argv.option('sources','https://github.com/volcengine/volcengine-specs.git,https://cdn.cocoapods.org/')
47
+ @project = VemarsProject.new(@appkey, @selected_components, @config_json, @version, @bundle_id, @name, @language, git_url,service_url,sources)
46
48
  super
47
49
  @additional_args = argv.remainder!
48
50
  end
@@ -22,7 +22,8 @@ module Pod
22
22
  ['--config=CONFIG_PATH', 'config path of vemars.'],
23
23
  ['--service_url=SERVICE_URL', 'url of vemars CLI service.'],
24
24
  ['--git=GIT_URL', 'git url of demo repo'],
25
- ['--pod_repo_no_update', 'do not run pod repo update']
25
+ ['--pod_repo_no_update', 'do not run pod repo update'],
26
+ ['--sources','pod repos sources']
26
27
  ]
27
28
  options.concat(super.reject { |option, _| option == '--silent' })
28
29
  end
@@ -33,9 +34,10 @@ module Pod
33
34
  @selected_components = argv.option('com', '').split(',')
34
35
  @config_json = argv.option('config', '/onekit-config.json')
35
36
  @repo_no_update = argv.flag?('pod_repo_no_update',false)
36
- git_url = argv.option('git', 'git@github.com:volcengine/ve_Template_iOS.git')
37
+ git_url = argv.option('git', 'https://github.com/volcengine/ve_Template_iOS.git')
37
38
  service_url = argv.option('service_url',nil)
38
- @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url)
39
+ sources = argv.option('sources','https://github.com/volcengine/volcengine-specs.git,https://cdn.cocoapods.org/')
40
+ @project = VemarsProject.new(@appkey, @selected_components, @config_json, @baseline, git_url, service_url,sources)
39
41
  super
40
42
  @additional_args = argv.remainder!
41
43
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsVemars
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -2,15 +2,15 @@ module Pod
2
2
  class PodfileTemplate
3
3
 
4
4
  attr_reader :componentsList
5
- attr_reader :source
5
+ attr_reader :sources
6
6
  attr_reader :baseline_version
7
7
 
8
8
  IOS_VERSION = '9.0'.freeze
9
9
 
10
- def initialize(baseline_version, componentsList, source)
10
+ def initialize(baseline_version, componentsList, sources)
11
11
  @baseline_version = baseline_version
12
12
  @componentsList = componentsList
13
- @source = source
13
+ @sources = sources
14
14
  end
15
15
 
16
16
  def to_dsl
@@ -21,7 +21,6 @@ module Pod
21
21
  #plugin 'cocoapods-vemars'
22
22
  install! 'cocoapods', :deterministic_uuids => false
23
23
 
24
- source 'https://cdn.cocoapods.org/'
25
24
  #{source_template}
26
25
 
27
26
  #{releasePod}
@@ -38,7 +37,8 @@ inhibit_all_warnings!
38
37
  end
39
38
 
40
39
  def source_template
41
- "source '#{source}'"
40
+ source_urls = sources.split(",")
41
+ "#{source_urls.map{ |url| "source '#{url}'"}.join("\n")}"
42
42
  end
43
43
 
44
44
  def releasePod
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-vemars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - huangbomao@bytedance.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler