gemirro 1.2.0 → 1.3.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
  SHA256:
3
- metadata.gz: 743376753a6202cadfe4fb780411c3b1a5c13b551aed1025abca32ec98bb8d0d
4
- data.tar.gz: 9b251517b641c81a708c1d66e15c300d2e159d8024512107de2366418f638927
3
+ metadata.gz: f5ce407f251612fd3198509818414c754d97508355e1fc1a723a08448bfb369f
4
+ data.tar.gz: 669d4d88aa1db6241b7e8861934d12893accde19fad6454d829a9e143569622b
5
5
  SHA512:
6
- metadata.gz: 2d2bf4a45e5d4128ddfe0fe392bf326d8f35afbdb98ddbdca27edd3be53ff8841e51e6e96b7bc95a99b1a44a259a535453b2d6b28a6583a6d4cf6f46d2226bf1
7
- data.tar.gz: 6a3eebf032d60e1eaf61b55fba14c0988d85e27b80d4a90ea69cbeb50c6e7a81cb73d648bd61144e46be42600af01e5c9ae30ef350a41674c8f1a92374ee1c30
6
+ metadata.gz: 3c49aa30264c21ca2fb840f5c4b2b6dd6058c5b587e94ff5ae4e94488a00d86f25e0a56de742c9ab8078a6350bb5f15d38119b69decfdd5088e0c8b0ff4dafa6
7
+ data.tar.gz: 96e25a3b96ca072f6823b8583626b9dd502048e444423af8d50ffcc9040a139daa5aa36314ce914edef2123c335015a6f8f1f758b18a62339fcfe60d3c006afa
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.2
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.5
3
4
  Include:
4
5
  - '**/Gemfile'
5
6
  - lib/**/*.rb
@@ -14,13 +15,9 @@ AllCops:
14
15
  Naming/FileName:
15
16
  Exclude:
16
17
  - Rakefile
17
- ModuleLength:
18
+ Layout/MethodLength:
18
19
  Enabled: false
19
- MethodLength:
20
- Enabled: false
21
- ClassLength:
22
- Enabled: false
23
- ParameterLists:
20
+ Layout/ClassLength:
24
21
  Enabled: false
25
22
  Metrics/CyclomaticComplexity:
26
23
  Enabled: false
@@ -34,3 +31,7 @@ Security/MarshalLoad:
34
31
  Enabled: false
35
32
  Style/ExpandPathArguments:
36
33
  Enabled: false
34
+ Style/OptionalBooleanParameter:
35
+ Enabled: false
36
+ Lint/MissingSuper:
37
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
- - 2.4
3
+ - 2.6
5
4
 
6
5
  install: bundle install --jobs=3 --retry=3
7
6
  script: bundle exec rake
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org/'
2
4
 
3
5
  gemspec
data/bin/gemirro CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require File.expand_path('../../lib/gemirro', __FILE__)
4
5
 
data/gemirro.gemspec CHANGED
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'date'
2
4
  require File.expand_path('../lib/gemirro/version', __FILE__)
3
5
 
4
6
  Gem::Specification.new do |s|
5
7
  s.name = 'gemirro'
6
8
  s.version = Gemirro::VERSION
7
- s.date = Date.today.to_s
8
9
  s.authors = ['Pierre Rambaud']
9
10
  s.email = 'pierre.rambaud86@gmail.com'
10
11
  s.license = 'GPL-3.0'
@@ -15,22 +16,22 @@ Gem::Specification.new do |s|
15
16
 
16
17
  s.files = File.read(File.expand_path('../MANIFEST', __FILE__)).split("\n")
17
18
 
18
- s.required_ruby_version = '>= 2.2'
19
+ s.required_ruby_version = '>= 2.5'
19
20
 
20
21
  s.add_dependency 'addressable', '~>2.5'
21
22
  s.add_dependency 'builder', '~>3.2'
22
23
  s.add_dependency 'confstruct', '~>1.0'
23
24
  s.add_dependency 'erubis', '~>2.7'
24
25
  s.add_dependency 'httpclient', '~>2.8'
25
- s.add_dependency 'parallel', '~>1.12'
26
+ s.add_dependency 'parallel', '~>1.20'
26
27
  s.add_dependency 'sinatra', '~>2.0.1'
27
28
  s.add_dependency 'slop', '~>3.6'
28
29
  s.add_dependency 'thin', '~>1.7'
29
30
 
30
- s.add_development_dependency 'fakefs', '~>0.11'
31
- s.add_development_dependency 'rack-test', '~>0.7'
32
- s.add_development_dependency 'rake', '~>12.1'
33
- s.add_development_dependency 'rspec', '~>3.7'
34
- s.add_development_dependency 'rubocop', '~>0.51'
35
- s.add_development_dependency 'simplecov', '~>0.15'
31
+ s.add_development_dependency 'fakefs', '~>1'
32
+ s.add_development_dependency 'rack-test', '~>1.1'
33
+ s.add_development_dependency 'rake', '~>13'
34
+ s.add_development_dependency 'rspec', '~>3.10'
35
+ s.add_development_dependency 'rubocop', '~>1'
36
+ s.add_development_dependency 'simplecov', '~>0.21'
36
37
  end
data/lib/gemirro.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'confstruct'
2
4
  require 'digest/sha2'
3
5
  require 'fileutils'
@@ -13,9 +15,7 @@ require 'stringio'
13
15
  require 'tempfile'
14
16
  require 'zlib'
15
17
 
16
- unless $LOAD_PATH.include?(File.expand_path('../', __FILE__))
17
- $LOAD_PATH.unshift(File.expand_path('../', __FILE__))
18
- end
18
+ $LOAD_PATH.unshift(File.expand_path('../', __FILE__)) unless $LOAD_PATH.include?(File.expand_path('../', __FILE__))
19
19
 
20
20
  require 'gemirro/version'
21
21
  require 'gemirro/configuration'
data/lib/gemirro/cache.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Cache class contains all method to store marshal informations
@@ -102,6 +104,7 @@ module Gemirro
102
104
  #
103
105
  def write(key_hash, value)
104
106
  return value if value.nil? || value.empty?
107
+
105
108
  File.open(key_path(key_hash), 'wb') do |f|
106
109
  Marshal.dump(value, f)
107
110
  end
data/lib/gemirro/cli.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  # CLI mode
3
5
  module CLI
@@ -32,9 +34,7 @@ module Gemirro
32
34
  config_file += '/config.rb' unless config_file.end_with?('.rb') ||
33
35
  !File.directory?(config_file)
34
36
 
35
- unless File.file?(config_file)
36
- abort "The configuration file #{config_file} does not exist"
37
- end
37
+ abort "The configuration file #{config_file} does not exist" unless File.file?(config_file)
38
38
 
39
39
  require(config_file)
40
40
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gemirro::CLI.options.command 'index' do
2
4
  banner 'Usage: gemirro index [OPTIONS]'
3
5
  description 'Retrieve specs list from source.'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gemirro::CLI.options.command 'init' do
2
4
  banner 'Usage: gemirro init [DIRECTORY] [OPTIONS]'
3
5
  description 'Sets up a new mirror'
@@ -16,8 +18,10 @@ Gemirro::CLI.options.command 'init' do
16
18
  else
17
19
  Dir.glob("#{template}/**/*", File::FNM_DOTMATCH).each do |file|
18
20
  next if ['.', '..'].include?(File.basename(file))
21
+
19
22
  dest = File.join(directory, file.gsub(/^#{template}/, ''))
20
23
  next if File.exist?(dest)
24
+
21
25
  FileUtils.cp_r(file, dest)
22
26
  end
23
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gemirro::CLI.options.command 'list' do
2
4
  banner 'Usage: gemirro list [OPTIONS]'
3
5
  description 'List available gems.'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gemirro::CLI.options.command 'server' do
2
4
  banner 'Usage: gemirro server [OPTIONS]'
3
5
  description 'Manage web server'
@@ -36,7 +38,7 @@ Gemirro::CLI.options.command 'server' do
36
38
  end
37
39
 
38
40
  # Copy stdout because we'll need to reopen it later on
39
- @orig_stdout = STDOUT.clone
41
+ @orig_stdout = $stdout.clone
40
42
  $PROGRAM_NAME = 'gemirro'
41
43
 
42
44
  def create_pid
@@ -44,7 +46,7 @@ Gemirro::CLI.options.command 'server' do
44
46
  f.write(Process.pid.to_s)
45
47
  end
46
48
  rescue Errno::EACCES
47
- STDOUT.reopen @orig_stdout
49
+ $stdout.reopen @orig_stdout
48
50
  puts "Error: Can't write to #{@pid_file} - Permission denied"
49
51
  exit!
50
52
  end
@@ -63,20 +65,18 @@ Gemirro::CLI.options.command 'server' do
63
65
 
64
66
  def start
65
67
  puts 'Starting...'
66
- if File.exist?(@pid_file)
67
- if running?(pid)
68
- puts "Error: #{$PROGRAM_NAME} already running"
69
- abort
70
- end
68
+ if File.exist?(@pid_file) && running?(pid)
69
+ puts "Error: #{$PROGRAM_NAME} already running"
70
+ abort
71
71
  end
72
72
 
73
73
  Process.daemon if Gemirro::Utils.configuration.server.daemonize
74
74
  create_pid
75
- STDOUT.reopen @orig_stdout
75
+ $stdout.reopen @orig_stdout
76
76
  puts "done! (PID is #{pid})\n"
77
77
  Gemirro::Server.run!
78
78
  destroy_pid
79
- STDOUT.reopen '/dev/null', 'a'
79
+ $stdout.reopen '/dev/null', 'a'
80
80
  end
81
81
 
82
82
  def stop
@@ -113,6 +113,7 @@ Gemirro::CLI.options.command 'server' do
113
113
 
114
114
  def running?(process_id)
115
115
  return false if process_id.nil?
116
+
116
117
  Process.getpgid(process_id.to_i) != -1
117
118
  rescue Errno::ESRCH
118
119
  false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Gemirro::CLI.options.command 'update' do
2
4
  banner 'Usage: gemirro update [OPTIONS]'
3
5
  description 'Updates the list of Gems'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Configuration
2
4
  module Gemirro
3
5
  ##
@@ -40,7 +42,7 @@ module Gemirro
40
42
  # @return [Logger]
41
43
  #
42
44
  def logger
43
- @logger ||= Logger.new(STDOUT)
45
+ @logger ||= Logger.new($stdout)
44
46
  end
45
47
 
46
48
  ##
data/lib/gemirro/gem.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Gem class contains data about a Gem such as the name, requirement as
@@ -14,6 +16,7 @@ module Gemirro
14
16
  class Gem
15
17
  attr_reader :name, :requirement
16
18
  attr_accessor :gemspec, :platform
19
+
17
20
  ONLY_LATEST = %i[latest newest].freeze
18
21
 
19
22
  ##
@@ -33,9 +36,7 @@ module Gemirro
33
36
  def initialize(name, requirement = nil, platform = 'ruby')
34
37
  requirement ||= ::Gem::Requirement.default
35
38
 
36
- if requirement.is_a?(String)
37
- requirement = ::Gem::Requirement.new(requirement)
38
- end
39
+ requirement = ::Gem::Requirement.new(requirement) if requirement.is_a?(String)
39
40
 
40
41
  @name = name
41
42
  @requirement = requirement
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Gem class contains data about a Gem such as the name, requirement as
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The VersionCollection class contains a collection of ::Gem::Version
@@ -10,8 +12,7 @@ module Gemirro
10
12
  class GemVersionCollection
11
13
  include Enumerable
12
14
 
13
- attr_reader :gems
14
- attr_reader :grouped
15
+ attr_reader :gems, :grouped
15
16
 
16
17
  ##
17
18
  # @param [Array] gems
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The GemsFetcher class is responsible for downloading Gems from an external
data/lib/gemirro/http.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Http class is responsible for executing GET request
@@ -18,9 +20,7 @@ module Gemirro
18
20
  def self.get(url)
19
21
  response = client.get(url, follow_redirect: true)
20
22
 
21
- unless HTTP::Status.successful?(response.status)
22
- raise HTTPClient::BadResponseError, response.reason
23
- end
23
+ raise HTTPClient::BadResponseError, response.reason unless HTTP::Status.successful?(response.status)
24
24
 
25
25
  response
26
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Indexer class is responsible for downloading useful file directly
@@ -118,6 +120,7 @@ module Gemirro
118
120
  else
119
121
  source_content = download_from_source(file)
120
122
  next if source_content.nil?
123
+
121
124
  MirrorFile.new(dst_name).write(source_content)
122
125
  end
123
126
 
@@ -136,6 +139,7 @@ module Gemirro
136
139
  Utils.logger.info("Download from source: #{file}")
137
140
  resp = Http.get("#{source_host}/#{File.basename(file)}")
138
141
  return unless resp.code == 200
142
+
139
143
  resp.body
140
144
  end
141
145
 
@@ -155,7 +159,7 @@ module Gemirro
155
159
  #
156
160
  def build_indicies
157
161
  specs = *map_gems_to_specs(gem_file_list)
158
- specs.select! { |s| s.class == ::Gem::Specification }
162
+ specs.select! { |s| s.instance_of?(::Gem::Specification) }
159
163
  ::Gem::Specification.dirs = []
160
164
  ::Gem::Specification.all = specs
161
165
 
@@ -178,22 +182,23 @@ module Gemirro
178
182
  #
179
183
  def map_gems_to_specs(gems)
180
184
  gems.map.with_index do |gemfile, index|
181
- # rubocop:disable Metrics/LineLength
182
185
  Utils.logger.info("[#{index + 1}/#{gems.size}]: Processing #{gemfile.split('/')[-1]}")
183
- # rubocop:enable Metrics/LineLength
184
-
185
186
  if File.size(gemfile).zero?
186
187
  Utils.logger.warn("Skipping zero-length gem: #{gemfile}")
187
188
  next
188
189
  end
189
190
 
190
191
  begin
191
- spec = if ::Gem::Package.respond_to? :open
192
- ::Gem::Package
193
- .open(File.open(gemfile, 'rb'), 'r', &:metadata)
194
- else
195
- ::Gem::Package.new(gemfile).spec
196
- end
192
+ begin
193
+ spec = if ::Gem::Package.respond_to? :open
194
+ ::Gem::Package
195
+ .open(File.open(gemfile, 'rb'), 'r', &:metadata)
196
+ else
197
+ ::Gem::Package.new(gemfile).spec
198
+ end
199
+ rescue NotImplementedError
200
+ next
201
+ end
197
202
 
198
203
  spec.loaded_from = gemfile
199
204
 
@@ -325,6 +330,7 @@ module Gemirro
325
330
  end
326
331
 
327
332
  return false if source_content.nil?
333
+
328
334
  new_content = source_content.concat(content).uniq
329
335
  create_zlib_file(dst_name, new_content)
330
336
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The MirrorDirectory is used for dealing with files and directories that are
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # Similar to {Gemirro::MirrorDirectory} the MirrorFile class is used to
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sinatra/base'
2
4
  require 'thin'
3
5
  require 'uri'
@@ -8,16 +10,16 @@ module Gemirro
8
10
  # Launch Sinatra server to easily download gems.
9
11
  #
10
12
  class Server < Sinatra::Base
11
- # rubocop:disable Metrics/LineLength
12
- URI_REGEXP = /^(.*)-(\d+(?:\.\d+){1,4}.*?)(?:-(x86-(?:(?:mswin|mingw)(?:32|64)).*?|java))?\.(gem(?:spec\.rz)?)$/
13
- GEMSPEC_TYPE = 'gemspec.rz'.freeze
14
- GEM_TYPE = 'gem'.freeze
13
+ # rubocop:disable Layout/LineLength
14
+ URI_REGEXP = /^(.*)-(\d+(?:\.\d+){1,4}.*?)(?:-(x86-(?:(?:mswin|mingw)(?:32|64)).*?|java))?\.(gem(?:spec\.rz)?)$/.freeze
15
+ # rubocop:enable Layout/LineLength
16
+ GEMSPEC_TYPE = 'gemspec.rz'
17
+ GEM_TYPE = 'gem'
15
18
 
16
19
  access_logger = Logger.new(Utils.configuration.server.access_log).tap do |logger|
17
- ::Logger.class_eval { alias_method :write, :'<<' }
20
+ ::Logger.class_eval { alias_method :write, :<< }
18
21
  logger.level = ::Logger::INFO
19
22
  end
20
- # rubocop:enable Metrics/LineLength
21
23
 
22
24
  error_logger = File.new(Utils.configuration.server.error_log, 'a+')
23
25
  error_logger.sync = true
@@ -128,6 +130,7 @@ module Gemirro
128
130
  #
129
131
  def fetch_gem(resource)
130
132
  return unless Utils.configuration.fetch_gem
133
+
131
134
  name = File.basename(resource)
132
135
  result = name.match(URI_REGEXP)
133
136
  return unless result
@@ -139,10 +142,8 @@ module Gemirro
139
142
  gem = Utils.stored_gem(gem_name, gem_version, gem_platform)
140
143
  gem.gemspec = true if gem_type == GEMSPEC_TYPE
141
144
 
142
- # rubocop:disable Metrics/LineLength
143
145
  return if Utils.gems_fetcher.gem_exists?(gem.filename(gem_version)) && gem_type == GEM_TYPE
144
146
  return if Utils.gems_fetcher.gemspec_exists?(gem.gemspec_filename(gem_version)) && gem_type == GEMSPEC_TYPE
145
- # rubocop:enable Metrics/LineLength
146
147
 
147
148
  Utils.logger
148
149
  .info("Try to download #{gem_name} with version #{gem_version}")
@@ -216,9 +217,7 @@ module Gemirro
216
217
  gem_collection = Parallel.map(gem_collection, in_threads: 4) do |gem|
217
218
  [gem, spec_for(gem.name, gem.number, gem.platform)]
218
219
  end
219
- gem_collection.reject! do |_, spec|
220
- spec.nil?
221
- end
220
+ gem_collection.compact!
222
221
 
223
222
  Parallel.map(gem_collection, in_threads: 4) do |gem, spec|
224
223
  dependencies = spec.dependencies.select do |d|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Source class is used for storing information about an external source
@@ -34,7 +36,7 @@ module Gemirro
34
36
  "Fetching #{Configuration.versions_file} on #{@name} (#{@host})"
35
37
  )
36
38
 
37
- Http.get(host + '/' + Configuration.versions_file).body
39
+ Http.get("#{host}/#{Configuration.versions_file}").body
38
40
  end
39
41
 
40
42
  ##
@@ -47,7 +49,7 @@ module Gemirro
47
49
  "Fetching #{Configuration.prerelease_versions_file}" \
48
50
  " on #{@name} (#{@host})"
49
51
  )
50
- Http.get(host + '/' + Configuration.prerelease_versions_file).body
52
+ Http.get("#{host}/#{Configuration.prerelease_versions_file}").body
51
53
  end
52
54
 
53
55
  ##
data/lib/gemirro/utils.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The Utils class is responsible for executing specific traitments
@@ -16,6 +18,7 @@ module Gemirro
16
18
  :gems_fetcher,
17
19
  :gems_collection,
18
20
  :stored_gems)
21
+
19
22
  ##
20
23
  # Cache class to store marshal and data into files
21
24
  #
@@ -44,6 +47,7 @@ module Gemirro
44
47
  Parallel.map(file_paths, in_threads: 4) do |file_path|
45
48
  next if data[:files].key?(file_path) &&
46
49
  data[:files][file_path] == File.mtime(file_path)
50
+
47
51
  has_file_changed = true
48
52
  end
49
53
 
@@ -53,6 +57,7 @@ module Gemirro
53
57
  gems = []
54
58
  Parallel.map(file_paths, in_threads: 4) do |file_path|
55
59
  next unless File.exist?(file_path)
60
+
56
61
  gems.concat(Marshal.load(Zlib::GzipReader.open(file_path).read))
57
62
  data[:files][file_path] = File.mtime(file_path)
58
63
  end
@@ -75,7 +80,7 @@ module Gemirro
75
80
  File.join(configuration.destination,
76
81
  [specs_file_type,
77
82
  marshal_version,
78
- 'gz' + (orig ? '.orig' : '')].join('.'))
83
+ "gz#{orig ? '.orig' : ''}"].join('.'))
79
84
  end
80
85
  end
81
86
 
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Gemirro Version
2
4
  module Gemirro
3
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.3.0'
4
6
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The VersionsFetcher class is used for retrieving the file that contains all
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gemirro
2
4
  ##
3
5
  # The VersionsFile class acts as a small Ruby wrapper around the RubyGems
@@ -72,6 +72,7 @@ module Gemirro
72
72
  expect(@config.ignore_gem('rake', '1.0.0', 'ruby')).to eq(['1.0.0'])
73
73
  expect(@config.ignored_gems).to eq('ruby' => {'rake' => ['1.0.0']})
74
74
  expect(@config.ignore_gem?('rake', '1.0.0', 'ruby')).to be_truthy
75
+ expect(@config.ignore_gem?('rake', '1.0.0', 'java')).to be_falsy
75
76
  end
76
77
 
77
78
  it 'should add and return source' do
@@ -37,6 +37,7 @@ module Gemirro
37
37
  expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'ruby')).to be_falsy
38
38
  Utils.configuration.ignore_gem('gemirro', '0.0.1', 'ruby')
39
39
  expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'ruby')).to be_truthy
40
+ expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'java')).to be_falsy
40
41
  end
41
42
 
42
43
  it 'should log error when fetch gem failed' do
@@ -125,7 +125,7 @@ module Gemirro
125
125
  end
126
126
 
127
127
  it 'should try to download gems.' do
128
- source = Gemirro::Source.new('test', 'http://rubygems.org')
128
+ source = Gemirro::Source.new('test', 'https://rubygems.org')
129
129
 
130
130
  versions_fetcher = Gemirro::VersionsFetcher.new(source)
131
131
  allow(versions_fetcher).to receive(:fetch).once.and_return(true)
@@ -166,7 +166,7 @@ module Gemirro
166
166
  end
167
167
 
168
168
  it 'should catch exceptions' do
169
- source = Gemirro::Source.new('test', 'http://rubygems.org')
169
+ source = Gemirro::Source.new('test', 'https://rubygems.org')
170
170
 
171
171
  versions_fetcher = Gemirro::VersionsFetcher.new(source)
172
172
  allow(versions_fetcher).to receive(:fetch).once.and_return(true)
data/template/config.rb CHANGED
@@ -35,7 +35,7 @@ Gemirro.configuration.configure do
35
35
  # You must define a source which where gems will be downloaded.
36
36
  # All gem in the block will be downloaded with the update command.
37
37
  # Other gems will be downloaded with the server.
38
- define_source 'rubygems', 'http://rubygems.org' do
38
+ define_source 'rubygems', 'https://rubygems.org' do
39
39
  gem 'rack', '>= 1.0.0'
40
40
  end
41
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemirro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.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: 2019-03-02 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.12'
89
+ version: '1.20'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.12'
96
+ version: '1.20'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sinatra
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -142,84 +142,84 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.11'
145
+ version: '1'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.11'
152
+ version: '1'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rack-test
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.7'
159
+ version: '1.1'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.7'
166
+ version: '1.1'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rake
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '12.1'
173
+ version: '13'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '12.1'
180
+ version: '13'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rspec
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '3.7'
187
+ version: '3.10'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '3.7'
194
+ version: '3.10'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rubocop
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '0.51'
201
+ version: '1'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '0.51'
208
+ version: '1'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: simplecov
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '0.15'
215
+ version: '0.21'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '0.15'
222
+ version: '0.21'
223
223
  description: Create your own gems mirror.
224
224
  email: pierre.rambaud86@gmail.com
225
225
  executables:
@@ -309,15 +309,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
309
  requirements:
310
310
  - - ">="
311
311
  - !ruby/object:Gem::Version
312
- version: '2.2'
312
+ version: '2.5'
313
313
  required_rubygems_version: !ruby/object:Gem::Requirement
314
314
  requirements:
315
315
  - - ">="
316
316
  - !ruby/object:Gem::Version
317
317
  version: '0'
318
318
  requirements: []
319
- rubyforge_project:
320
- rubygems_version: 2.7.5
319
+ rubygems_version: 3.1.2
321
320
  signing_key:
322
321
  specification_version: 4
323
322
  summary: Gem for easily creating your own gems mirror.