gemirro 0.16.0 → 1.0.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
- SHA1:
3
- metadata.gz: 53a589bb6c9b40c33e0a84892f1234ac29325925
4
- data.tar.gz: d5e693ae10f39df546d7775a3b75165f62f9717f
2
+ SHA256:
3
+ metadata.gz: 809eb09ef1da4fd33100b1455f0acf3b068a97b27d4ed9f01bd72c2d6724b68d
4
+ data.tar.gz: 23334e2ba6c56dc17d0f008e1de09dbc9923d5bd61d98264751a214a71224774
5
5
  SHA512:
6
- metadata.gz: aba9f0f69f137771f76210819f3116da4911c8012b8f1415c21f9598a59b3586e122d00b5e7b5337bc35940a13055db0a5596c09170f7f7d71a226f15e4d391c
7
- data.tar.gz: d3606123b938190a0dcdbd094ebb39c76f65921c20f522ea53db3409117b32698ba4225cd7f7d568736a6ca6638138715a0a8cfb3c01b2306480cbfd6e3653b0
6
+ metadata.gz: 347d4a085fee470c4f9b437fc0e1d8ae486947cbda75a27d910f8695bdf49699bd31e052b8522db5d496e21ff5adb5293adb48cc46da827aa0d6b2f7d1c9f11e
7
+ data.tar.gz: 86db43bee5247cfaea9708027128756a47c4e50ef27ca130b6c9f02cc949b25a164f23b6ed66b0a47230a797b82c43f8291becd6c69b596b3cdc485d14c2aa94
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.2
2
3
  Include:
3
4
  - '**/Gemfile'
4
5
  - lib/**/*.rb
@@ -7,6 +8,8 @@ AllCops:
7
8
  Exclude:
8
9
  - files/**/*
9
10
  - templates/**/*
11
+ - spec/**/*
12
+
10
13
  Naming/FileName:
11
14
  Exclude:
12
15
  - Rakefile
data/gemirro.gemspec CHANGED
@@ -15,8 +15,9 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.files = File.read(File.expand_path('../MANIFEST', __FILE__)).split("\n")
17
17
 
18
- s.required_ruby_version = '>= 1.9.2'
18
+ s.required_ruby_version = '>= 2.2'
19
19
 
20
+ s.add_dependency 'addressable', '~>2.5'
20
21
  s.add_dependency 'builder', '~>3.2'
21
22
  s.add_dependency 'confstruct', '~>1.0'
22
23
  s.add_dependency 'erubis', '~>2.7'
data/lib/gemirro.rb CHANGED
@@ -1,17 +1,17 @@
1
- require 'rubygems'
2
- require 'rubygems/user_interaction'
3
- require 'rubygems/indexer'
4
- require 'slop'
5
- require 'fileutils'
6
- require 'digest/sha2'
7
1
  require 'confstruct'
8
- require 'zlib'
2
+ require 'digest/sha2'
3
+ require 'fileutils'
9
4
  require 'httpclient'
10
- require 'logger'
11
- require 'stringio'
12
5
  require 'json'
6
+ require 'logger'
13
7
  require 'parallel'
8
+ require 'rubygems'
9
+ require 'rubygems/indexer'
10
+ require 'rubygems/user_interaction'
11
+ require 'slop'
12
+ require 'stringio'
14
13
  require 'tempfile'
14
+ require 'zlib'
15
15
 
16
16
  unless $LOAD_PATH.include?(File.expand_path('../', __FILE__))
17
17
  $LOAD_PATH.unshift(File.expand_path('../', __FILE__))
data/lib/gemirro/gem.rb CHANGED
@@ -12,8 +12,8 @@ module Gemirro
12
12
  # @return [Gem::Version]
13
13
  #
14
14
  class Gem
15
- attr_reader :name, :requirement, :platform
16
- attr_accessor :gemspec
15
+ attr_reader :name, :requirement
16
+ attr_accessor :gemspec, :platform
17
17
  ONLY_LATEST = %i[latest newest].freeze
18
18
 
19
19
  ##
@@ -25,7 +25,9 @@ module Gemirro
25
25
  #
26
26
  def fetch
27
27
  @source.gems.each do |gem|
28
- versions_for(gem).each do |version|
28
+ versions_for(gem).each do |versions|
29
+ gem.platform = versions[1] if versions
30
+ version = versions[0] if versions
29
31
  if gem.gemspec?
30
32
  gemfile = fetch_gemspec(gem, version)
31
33
  if gemfile
@@ -55,7 +57,7 @@ module Gemirro
55
57
  return [available.last] if gem.only_latest?
56
58
 
57
59
  versions = available.select do |v|
58
- gem.requirement.satisfied_by?(v)
60
+ gem.requirement.satisfied_by?(v[0])
59
61
  end
60
62
 
61
63
  versions = [available.last] if versions.empty?
@@ -1,6 +1,7 @@
1
1
  require 'sinatra/base'
2
2
  require 'thin'
3
3
  require 'uri'
4
+ require 'addressable/uri'
4
5
 
5
6
  module Gemirro
6
7
  ##
@@ -280,7 +281,7 @@ module Gemirro
280
281
  # @return [String]
281
282
  #
282
283
  def homepage(spec)
283
- URI.parse(URI.escape(spec.homepage))
284
+ URI.parse(Addressable::URI.escape(spec.homepage))
284
285
  end
285
286
  end
286
287
  end
@@ -1,4 +1,4 @@
1
1
  # Gemirro Version
2
2
  module Gemirro
3
- VERSION = '0.16.0'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
@@ -65,7 +65,7 @@ module Gemirro
65
65
  # @return [Array]
66
66
  #
67
67
  def versions_for(gem)
68
- versions_hash[gem].map { |version| version[1] }
68
+ versions_hash[gem].map { |version| [version[1], version[2]] }
69
69
  end
70
70
  end
71
71
  end
@@ -125,9 +125,10 @@ module Gemirro
125
125
  it 'should retrieve versions for specific gem' do
126
126
  gem = Gem.new('gemirro', '0.0.2')
127
127
  allow(@versions_file).to receive(:versions_for)
128
- .once.with('gemirro').and_return([::Gem::Version.new('0.0.1'),
129
- ::Gem::Version.new('0.0.2')])
130
- expect(@fetcher.versions_for(gem)).to eq([::Gem::Version.new('0.0.2')])
128
+ .once.with('gemirro')
129
+ .and_return([[::Gem::Version.new('0.0.1'), 'ruby'],
130
+ [::Gem::Version.new('0.0.2'), 'ruby']])
131
+ expect(@fetcher.versions_for(gem)).to eq([[::Gem::Version.new('0.0.2'), 'ruby']])
131
132
  end
132
133
 
133
134
  it 'should fetch all gems and log debug if gem is not satisfied' do
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemirro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Rambaud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: addressable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: builder
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -295,7 +309,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
295
309
  requirements:
296
310
  - - ">="
297
311
  - !ruby/object:Gem::Version
298
- version: 1.9.2
312
+ version: '2.2'
299
313
  required_rubygems_version: !ruby/object:Gem::Requirement
300
314
  requirements:
301
315
  - - ">="
@@ -303,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
317
  version: '0'
304
318
  requirements: []
305
319
  rubyforge_project:
306
- rubygems_version: 2.6.11
320
+ rubygems_version: 2.7.4
307
321
  signing_key:
308
322
  specification_version: 4
309
323
  summary: Gem for easily creating your own gems mirror.