compact_index 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdd91f796331f34e5733ec038c001ad044049e92
4
- data.tar.gz: fce1c12e543be6a8076b721835b7c0d2e4188737
3
+ metadata.gz: a8225581475001c319a2ff2e5d1975ff28be15ce
4
+ data.tar.gz: f47097c19665f643ec5fd64b688cdb45cc2637f1
5
5
  SHA512:
6
- metadata.gz: cc06a2a9928ea2b4e25299053c9603657d57dafb422abd388baebb09fee7635a400e2c8245ec4031e4cdbd2f5f1a0bbafa803e812b0aa29ff80794ec0ff93ffa
7
- data.tar.gz: 94b78e91b9a77a9aeefc7097efac739c741312862b005f405fe6c1dc41e8eb319c19b2c50ad790eba8eef55213739bfb38f47a070a04e3324e95a36db9a426ed
6
+ metadata.gz: af3eb881ad6373f6d012c73932dfcc88cc63d76e2490241aaf028629203ab309f7def27cb4765a06f8bff839054dd347f77d0c32d6f0ff1e49efc7f9b774c66c
7
+ data.tar.gz: e1d6ddc1389494ba678250bb05fa97f1cdfe6e061bcc12e97b4838836b7c7afa7036b0e1db382e74bda7d3d0ccfefee5b482519131fb4a7a89b18e07361535b3
@@ -1,3 +1,9 @@
1
+ ## 0.7.0 (August 4, 2015)
2
+
3
+ Features:
4
+
5
+ - Change versions file interface to receive separated number and platform
6
+
1
7
  ## 0.6.0 (August 1, 2015)
2
8
 
3
9
  Features:
@@ -1,3 +1,3 @@
1
1
  module CompactIndex
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -49,7 +49,7 @@ class CompactIndex::VersionsFile
49
49
 
50
50
  def parse_gems_for_create(gems)
51
51
  fixed_format_gems = gems.map do |k,v|
52
- numbers = v.map { |x| x[:number] }
52
+ numbers = v.map { |x| [x[:number], x[:platform] ] }
53
53
  { name: k, versions: numbers, checksum: v.first[:checksum] }
54
54
  end
55
55
  fixed_format_gems.sort! { |a,b| a[:name] <=> b[:name] }
@@ -68,7 +68,7 @@ class CompactIndex::VersionsFile
68
68
  versions.each do |v|
69
69
  by_created_at[v[:created_at]] ||= {}
70
70
  by_created_at[v[:created_at]][name] ||= []
71
- by_created_at[v[:created_at]][name] << number_and_platform(v[:number], v[:platform])
71
+ by_created_at[v[:created_at]][name] << [v[:number], v[:platform]]
72
72
  checksums[v[:created_at]] ||= {}
73
73
  checksums[v[:created_at]] = v[:checksum]
74
74
  end
@@ -83,12 +83,13 @@ class CompactIndex::VersionsFile
83
83
  def gem_lines(gems)
84
84
  gems.reduce("") do |concat, entry|
85
85
  versions = sort_versions(entry[:versions])
86
+ versions.map! { |version, platform| number_and_platform(version, platform) }
86
87
  concat << "#{entry[:name]} #{versions.join(',')} #{entry[:checksum]}\n"
87
88
  end
88
89
  end
89
90
 
90
91
  def sort_versions(versions)
91
- versions.sort_by { |v| Gem::Version.create(v) }
92
+ versions.sort_by { |v| Gem::Version.create(v.first) }
92
93
  end
93
94
 
94
95
  def number_and_platform(number, platform)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compact_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fotanus@gmail.com
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-01 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake