carthage_remote_cache 0.0.5 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '0.0.5'
1
+ VERSION = "0.0.10"
data/lib/version_file.rb CHANGED
@@ -1,13 +1,14 @@
1
- require 'json'
2
- require 'fileutils'
1
+ require "json"
2
+ require "fileutils"
3
3
 
4
4
  # .version file representation, see Carthage documentation on them:
5
5
  # https://github.com/Carthage/Carthage/blob/master/Documentation/VersionFile.md
6
6
  class VersionFile
7
- attr_reader :path, :version, :frameworks_by_platform
7
+ attr_reader :path, :platforms, :json, :version, :frameworks_by_platform
8
8
 
9
- def initialize(path)
9
+ def initialize(path, platforms = PLATFORMS)
10
10
  @path = path
11
+ @platforms = platforms
11
12
  parse
12
13
  end
13
14
 
@@ -55,32 +56,45 @@ class VersionFile
55
56
  if other_version_file.nil?
56
57
  false
57
58
  else
58
- FileUtils.compare_file(@path, other_version_file.path)
59
+ @json == other_version_file.json
59
60
  end
60
61
  end
61
62
 
62
63
  private
63
64
 
64
65
  def parse
65
- raise AppError.new, "File #{path} doesn't exist, has carthage been bootstrapped?" unless File.exist?(@path)
66
+ raise VersionFileDoesNotExistError.new, "File #{path} doesn't exist, has carthage been bootstrapped?" unless File.exist?(@path)
66
67
 
68
+ @json = read_json
69
+
70
+ @version = @json["commitish"]
71
+ raise AppError.new, "Version is missing in #{@path}:\n\n#{@json}" if @version.nil? || @version.empty?
72
+
73
+ @frameworks_by_platform = PLATFORMS.to_h { |platform| [platform, parse_platform(platform)] }
74
+ end
75
+
76
+ # Reads json from `@path` and cleans up entries, tha are not defined in `@platforms`.
77
+ def read_json
67
78
  file = File.read(@path)
68
79
  json = JSON.parse(file)
80
+ stripped_json = strip_platforms(json)
81
+ stripped_json
82
+ end
69
83
 
70
- @version = json['commitish']
71
- raise AppError.new, "Version is missing in #{@path}" if @version.nil? || @version.empty?
72
-
73
- @frameworks_by_platform = {
74
- :iOS => parse_platform_array(json['iOS']),
75
- :macOS => parse_platform_array(json['Mac']),
76
- :tvOS => parse_platform_array(json['tvOS']),
77
- :watchOS => parse_platform_array(json['watchOS']),
78
- }
84
+ def strip_platforms(json)
85
+ for platform in PLATFORMS
86
+ if !@platforms.include?(platform)
87
+ json[platform_to_carthage_dir_string(platform)] = []
88
+ end
89
+ end
90
+ json
79
91
  end
80
92
 
81
- def parse_platform_array(array)
93
+ def parse_platform(platform)
94
+ carthage_platform_name = platform_to_carthage_dir_string(platform)
95
+ array = @json[carthage_platform_name]
82
96
  if array.kind_of?(Array)
83
- array.map { |entry| entry['name'] }
97
+ array.map { |entry| entry["name"] }
84
98
  else
85
99
  []
86
100
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carthage_remote_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juraj Blahunka
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-09 00:00:00.000000000 Z
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: guard
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '13.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rerun
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +140,22 @@ dependencies:
140
140
  name: rack
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 2.0.4
145
+ version: 2.0.6
146
+ - - "<"
147
+ - !ruby/object:Gem::Version
148
+ version: 2.3.0
146
149
  type: :runtime
147
150
  prerelease: false
148
151
  version_requirements: !ruby/object:Gem::Requirement
149
152
  requirements:
150
- - - "~>"
153
+ - - ">="
151
154
  - !ruby/object:Gem::Version
152
- version: 2.0.4
155
+ version: 2.0.6
156
+ - - "<"
157
+ - !ruby/object:Gem::Version
158
+ version: 2.3.0
153
159
  - !ruby/object:Gem::Dependency
154
160
  name: rest-client
155
161
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +176,14 @@ dependencies:
170
176
  requirements:
171
177
  - - "~>"
172
178
  - !ruby/object:Gem::Version
173
- version: 2.0.0
179
+ version: 2.0.4
174
180
  type: :runtime
175
181
  prerelease: false
176
182
  version_requirements: !ruby/object:Gem::Requirement
177
183
  requirements:
178
184
  - - "~>"
179
185
  - !ruby/object:Gem::Version
180
- version: 2.0.0
186
+ version: 2.0.4
181
187
  description: Centralized cache to serve carthage frameworks. Useful for distributed
182
188
  CI setup with several build machines.
183
189
  email:
@@ -189,6 +195,7 @@ extra_rdoc_files: []
189
195
  files:
190
196
  - ".gitignore"
191
197
  - ".travis.yml"
198
+ - Dockerfile
192
199
  - Gemfile
193
200
  - Gemfile.lock
194
201
  - Guardfile
@@ -197,7 +204,6 @@ files:
197
204
  - Rakefile
198
205
  - bin/carthagerc
199
206
  - carthage_remote_cache.gemspec
200
- - com.kayak.carthagerc.server.plist
201
207
  - dev/console
202
208
  - dev/setup
203
209
  - dev/start_server
@@ -210,6 +216,7 @@ files:
210
216
  - lib/commands/init_command.rb
211
217
  - lib/commands/server_command.rb
212
218
  - lib/commands/upload_command.rb
219
+ - lib/commands/verify_command.rb
213
220
  - lib/configuration.rb
214
221
  - lib/constants.rb
215
222
  - lib/crc32.rb
@@ -219,6 +226,7 @@ files:
219
226
  - lib/server/config.ru
220
227
  - lib/server/server_app.rb
221
228
  - lib/shell_wrapper.rb
229
+ - lib/table.rb
222
230
  - lib/utils.rb
223
231
  - lib/version.rb
224
232
  - lib/version_file.rb
@@ -226,7 +234,7 @@ homepage: https://github.com/kayak/carthage_remote_cache
226
234
  licenses:
227
235
  - Apache-2.0
228
236
  metadata: {}
229
- post_install_message:
237
+ post_install_message:
230
238
  rdoc_options: []
231
239
  require_paths:
232
240
  - lib
@@ -241,9 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
249
  - !ruby/object:Gem::Version
242
250
  version: '0'
243
251
  requirements: []
244
- rubyforge_project:
245
- rubygems_version: 2.7.4
246
- signing_key:
252
+ rubygems_version: 3.2.4
253
+ signing_key:
247
254
  specification_version: 4
248
255
  summary: Centralized cache to serve carthage frameworks. Useful for distributed CI
249
256
  setup with several build machines.
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>Label</key>
6
- <string>com.kayak.carthagerc.server</string>
7
- <key>ProgramArguments</key>
8
- <array>
9
- <string>/usr/local/bin/carthagerc</string>
10
- <string>server</string>
11
- <string>--port=9292</string>
12
- </array>
13
- <key>KeepAlive</key>
14
- <true/>
15
- <key>StandardOutPath</key>
16
- <string>/Users/MY_USER/Library/Logs/carthagerc.server.stdout.log</string>
17
- <key>StandardErrorPath</key>
18
- <string>/Users/MY_USER/Library/Logs/carthagerc.server.stderr.log</string>
19
- </dict>
20
- </plist>