gemirro 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gemirro might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a17ffcad594827a8af375247a4b6b470cb042768
4
- data.tar.gz: c8edea98454503d5268eb2dfea42d60b83703cc5
3
+ metadata.gz: 4546e4ecf735f60e1aad1d47afddbe9a2538355b
4
+ data.tar.gz: b5f0b6f5bb9e017c251a9843faa6492b8f510505
5
5
  SHA512:
6
- metadata.gz: 2965d1f853352b9260c5f527717451670e6275f468aadd9da8fdbe8ec0f1ab821f86e55d2ea395b78da183ff15871ec8e91f2088cd4bf19c5511003e5bc3dd9f
7
- data.tar.gz: f1406d3162f48966520ca16dabcb4d355a45e0fcf40b163f3a304a05d82015782d5dc45558098ea32d0b7fb72261b046ce7aded3d072f6fa8fa9435300055445
6
+ metadata.gz: 3fc2c772a2f5e4ac9c75106503d646ad1225855fd0547bbae0515a6b507f0603f323674715c5a02c6634fc1111cc3c6afe83801ee6c8089edb7e3a68f337f129
7
+ data.tar.gz: 8ce9b6f65744607f5f4b704283e790a8966f4de2ce9c2a2728c95bb6ab5ed634dabbd9d7a6ab008556f43777d65d50747ef333d293ca58289eb457651c1695e5
@@ -83,7 +83,8 @@ module Gemirro
83
83
  #
84
84
  def install_indicies
85
85
  verbose = ::Gem.configuration.really_verbose
86
- say "Downloading index into production dir #{@dest_directory}" if verbose
86
+ Gemirro.configuration.logger
87
+ .debug("Downloading index into production dir #{@dest_directory}")
87
88
 
88
89
  files = @files
89
90
  files.delete @quick_marshal_dir if files.include? @quick_dir
@@ -139,32 +140,14 @@ module Gemirro
139
140
  resp.body
140
141
  end
141
142
 
142
- def update_gemspecs
143
- make_temp_directories
144
-
145
- specs_mtime = File.stat(@dest_specs_index).mtime
146
- newest_mtime = Time.at 0
147
-
148
- updated_gems = gem_file_list.select do |gem|
149
- gem_mtime = File.stat(gem).mtime
150
- newest_mtime = gem_mtime if gem_mtime > newest_mtime
151
- gem_mtime >= specs_mtime
152
- end
153
-
154
- terminate_interaction(0) if updated_gems.empty?
155
-
156
- specs = map_gems_to_specs updated_gems
143
+ def build_indicies
157
144
  ::Gem::Specification.dirs = []
158
- ::Gem::Specification.add_specs(*specs)
159
- files = build_marshal_gemspecs
145
+ ::Gem::Specification.all = *map_gems_to_specs(gem_file_list)
160
146
 
161
- files.each do |path|
162
- file = path.sub(%r{^#{Regexp.escape @directory}/?}, '')
163
- src_name = File.join @directory, file
164
- dst_name = File.join @dest_directory, file
165
- FileUtils.mv(src_name, dst_name)
166
- File.utime newest_mtime, newest_mtime, dst_name
167
- end
147
+ build_marshal_gemspecs
148
+ build_modern_indicies if @build_modern
149
+
150
+ compress_indicies
168
151
  end
169
152
  end
170
153
  end
@@ -128,7 +128,9 @@ module Gemirro
128
128
  #
129
129
  def fetch_gem(resource)
130
130
  name = File.basename(resource)
131
- regexp = /^(.*)-(\d+(?:\.\d+){,4})\.gem(?:spec\.rz)?$/
131
+ # rubocop:disable Metrics/LineLength
132
+ regexp = /^(.*)-(\d+(?:\.\d+){,4})(-x86-((mswin|mingw)(32|64))*)\.gem(?:spec\.rz)?$/
133
+ # rubocop:enable Metrics/LineLength
132
134
  result = name.match(regexp)
133
135
  return unless result
134
136
 
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Gemirro Version
3
3
  module Gemirro
4
- VERSION = '0.9.1'
4
+ VERSION = '0.10.0'
5
5
  end
@@ -19,8 +19,6 @@ module Gemirro
19
19
  .once.and_return(true)
20
20
 
21
21
  indexer = Indexer.new('/tmp/test')
22
- allow(indexer).to receive(:say)
23
- .once.with('Downloading index into production dir /tmp/test')
24
22
  indexer.quick_marshal_dir = '/tmp/gem_generate_index/quick/Marshal.4.8'
25
23
  indexer.dest_directory = '/tmp/test'
26
24
  indexer.directory = '/tmp/gem_generate_index'
@@ -85,20 +83,17 @@ module Gemirro
85
83
 
86
84
  indexer = Indexer.new('./')
87
85
  allow(indexer).to receive(:make_temp_directories).and_return(true)
88
-
89
- expect { indexer.update_gemspecs }.to raise_error SystemExit
90
86
  end
91
87
 
92
- it 'should update gemspecs files' do
88
+ it 'should build indicies' do
89
+ indexer = Indexer.new('/')
93
90
  dir = MirrorDirectory.new('/')
94
91
  dir.add_directory('gems')
95
92
  dir.add_directory('quick')
96
93
  dir.add_directory('tmp')
97
-
98
- indexer = Indexer.new('/')
99
-
100
94
  dir.add_directory("#{indexer.directory.gsub(%r{^/}, '')}/gems")
101
95
  dir.add_directory("#{indexer.directory.gsub(%r{^/}, '')}/quick")
96
+
102
97
  MirrorFile.new('/specs.4.8').write('')
103
98
  MirrorFile.new("#{indexer.directory}/gems/gemirro-0.1.0.gem").write('')
104
99
  MirrorFile.new('gems/gemirro-0.1.0.gem').write('')
@@ -107,13 +102,11 @@ module Gemirro
107
102
 
108
103
  allow(indexer).to receive(:gem_file_list)
109
104
  .and_return(['gems/gemirro-0.1.0.gem'])
110
- allow(indexer).to receive(:make_temp_directories).once.and_return(true)
111
105
  allow(indexer).to receive(:build_marshal_gemspecs).once.and_return([
112
106
  "#{indexer.directory}/quick/gemirro-0.1.0.gemspec.rz"])
107
+ allow(indexer).to receive(:compress_indicies).once.and_return(true)
113
108
 
114
- indexer.update_gemspecs
115
- expect(File.read('/quick/gemirro-0.1.0.gemspec.rz'))
116
- .to eq('test')
109
+ indexer.build_indicies
117
110
  end
118
111
  end
119
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemirro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Rambaud
@@ -269,8 +269,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  version: '0'
270
270
  requirements: []
271
271
  rubyforge_project:
272
- rubygems_version: 2.4.5
272
+ rubygems_version: 2.4.8
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: Gem for easily creating your own RubyGems mirror.
276
276
  test_files: []
277
+ has_rdoc: