geminabox 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10ddfa01a1de69668505dc20d43a6fd597ef35a66a46c7fe85d6196c743182ef
4
- data.tar.gz: a27916b2ce8ebe5f80a81f1b86de685dce6cd4b52b23a664f5fa1cf804c83424
3
+ metadata.gz: 77b89503a829fdd9920415b1ef7a814ed83c7c41c00bbb2923abb5b906d5bbff
4
+ data.tar.gz: a4a597b442efdb2b33dc4cc85f99465e8d23092bdd0775b75a634d8cca3912ef
5
5
  SHA512:
6
- metadata.gz: c5a5ed58e2168f47472d98f4b4ea27d9cd1bb56c74bcf44ff7f717113086ad61891727810817b76b748be5870a0802c7514f000aac0a1670b5177f6f89f3ad6b
7
- data.tar.gz: 1cde2c7b05c8d4ff12666eb86d801f3087fb16bf22e28544e1802bd5bdd72c97d195d4f4f0f5a8aebb77f39d038ce656aa1a1442cc9410c8ea83ea48ff17784c
6
+ metadata.gz: 9a29e0c9c9d7f60bb39c961a0c040451c709eab18bc676d1e7bb4bc8349ecd2e90b794bba87d948079eda2726aca20ec4a295d32a66cc0696bfece508bc46a8b
7
+ data.tar.gz: 2f818ce266be7f996ab7cd8094df2bc4a0d14f5e1d3aa9d7bca581a89aaa3a94e3ab1aa1e50b3e833da418cf8572b60f4cd1c6c3e470c58f881b0c2150997362
data/README.md CHANGED
@@ -122,6 +122,10 @@ You can also use the gem plugin:
122
122
 
123
123
  gem inabox pkg/my-awesome-gem-1.0.gem
124
124
 
125
+ And since version 1.2.0, Geminabox supports the standard gemcutter yank API:
126
+
127
+ gem yank my-awesome-gem -v 1.0 --host HOST
128
+
125
129
  Configure Gem in a box (interactive prompt to specify where to upload to):
126
130
 
127
131
  gem inabox -c
@@ -1,5 +1,6 @@
1
1
  require 'tempfile'
2
2
  require 'fileutils'
3
+ require 'rubygems/util'
3
4
 
4
5
  module Geminabox
5
6
  module Proxy
@@ -65,11 +66,11 @@ module Geminabox
65
66
  end
66
67
 
67
68
  def unpackage(content)
68
- Marshal.load(Gem.gunzip(content))
69
+ Marshal.load(Gem::Util.gunzip(content))
69
70
  end
70
71
 
71
72
  def package(content)
72
- Gem.gzip(Marshal.dump(content))
73
+ Gem::Util.gzip(Marshal.dump(content))
73
74
  end
74
75
 
75
76
  def merge_text_content
@@ -1,4 +1,5 @@
1
1
  require 'reentrant_flock'
2
+ require 'rubygems/util'
2
3
 
3
4
  module Geminabox
4
5
 
@@ -148,6 +149,27 @@ module Geminabox
148
149
 
149
150
  end
150
151
 
152
+ delete '/api/v1/gems/yank' do
153
+ unless self.class.allow_delete?
154
+ error_response(403, 'Gem deletion is disabled')
155
+ end
156
+
157
+ halt 400 unless request.form_data?
158
+
159
+ serialize_update do
160
+ gems = load_gems.select { |gem| request['gem_name'] == gem.name and
161
+ request['version'] == gem.number.version }
162
+ halt 404, 'Gem not found' if gems.size == 0
163
+ gems.each do |gem|
164
+ gem_path = File.expand_path(File.join(Geminabox.data, 'gems',
165
+ "#{gem.gemfile_name}.gem"))
166
+ File.delete gem_path if File.exists? gem_path
167
+ end
168
+ self.class.reindex(:force_rebuild)
169
+ return 200, 'Yanked gem and reindexed'
170
+ end
171
+ end
172
+
151
173
  post '/upload' do
152
174
  unless self.class.allow_upload?
153
175
  error_response(403, 'Gem uploading is disabled')
@@ -1,3 +1,3 @@
1
1
  module Geminabox
2
- VERSION = '1.1.1' unless defined? VERSION
2
+ VERSION = '1.2.0' unless defined? VERSION
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminabox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lea
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-11-07 00:00:00.000000000 Z
14
+ date: 2020-03-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sinatra
@@ -166,8 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 2.7.6
169
+ rubygems_version: 3.0.3
171
170
  signing_key:
172
171
  specification_version: 4
173
172
  summary: Really simple rubygem hosting