gemstash 2.1.0 → 2.2.1
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 +4 -4
- data/CHANGELOG.md +57 -0
- data/lib/gemstash/cache.rb +37 -0
- data/lib/gemstash/cli/authorize.rb +2 -2
- data/lib/gemstash/cli/setup.rb +11 -3
- data/lib/gemstash/configuration.rb +1 -1
- data/lib/gemstash/dependencies.rb +2 -2
- data/lib/gemstash/env.rb +2 -0
- data/lib/gemstash/gem_fetcher.rb +2 -2
- data/lib/gemstash/gem_pusher.rb +2 -2
- data/lib/gemstash/gem_source/private_source.rb +3 -3
- data/lib/gemstash/gem_source.rb +2 -2
- data/lib/gemstash/http_client.rb +8 -3
- data/lib/gemstash/logging.rb +1 -1
- data/lib/gemstash/man/gemstash-authorize.1 +36 -21
- data/lib/gemstash/man/gemstash-authorize.1.txt +21 -19
- data/lib/gemstash/man/gemstash-configuration.5 +118 -106
- data/lib/gemstash/man/gemstash-configuration.5.txt +105 -103
- data/lib/gemstash/man/gemstash-customize.7 +83 -68
- data/lib/gemstash/man/gemstash-customize.7.txt +63 -62
- data/lib/gemstash/man/gemstash-debugging.7 +24 -9
- data/lib/gemstash/man/gemstash-debugging.7.txt +11 -9
- data/lib/gemstash/man/gemstash-deploy.7 +30 -15
- data/lib/gemstash/man/gemstash-deploy.7.txt +18 -16
- data/lib/gemstash/man/gemstash-mirror.7 +25 -10
- data/lib/gemstash/man/gemstash-mirror.7.txt +9 -7
- data/lib/gemstash/man/gemstash-multiple-sources.7 +34 -20
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +30 -29
- data/lib/gemstash/man/gemstash-private-gems.7 +55 -40
- data/lib/gemstash/man/gemstash-private-gems.7.txt +40 -38
- data/lib/gemstash/man/gemstash-readme.7 +61 -49
- data/lib/gemstash/man/gemstash-readme.7.txt +58 -58
- data/lib/gemstash/man/gemstash-setup.1 +36 -21
- data/lib/gemstash/man/gemstash-setup.1.txt +19 -17
- data/lib/gemstash/man/gemstash-start.1 +29 -14
- data/lib/gemstash/man/gemstash-start.1.txt +14 -12
- data/lib/gemstash/man/gemstash-status.1 +27 -12
- data/lib/gemstash/man/gemstash-status.1.txt +12 -10
- data/lib/gemstash/man/gemstash-stop.1 +27 -12
- data/lib/gemstash/man/gemstash-stop.1.txt +12 -10
- data/lib/gemstash/man/gemstash-version.1 +25 -10
- data/lib/gemstash/man/gemstash-version.1.txt +7 -5
- data/lib/gemstash/storage.rb +5 -4
- data/lib/gemstash/upstream.rb +6 -5
- data/lib/gemstash/version.rb +2 -2
- data/lib/gemstash/web.rb +6 -4
- data/lib/gemstash.rb +1 -1
- metadata +31 -157
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb52dab0226e577b3119d1eccead8bcb09bd66226832824e53a8511860996c13
|
4
|
+
data.tar.gz: b13d821c0d1baa930c4107fd455be21b735c72f480a151d57640de20b134073a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b91f27500a36a8f8e412c992b026c4419f1bb63493f9325e8b1743ff28becba13648b16cbe93250e07ee4d42a1081c224928ba6269bdf4955c13259f47c82a7
|
7
|
+
data.tar.gz: 51bf8238974a3963719f38388d73a0ac1a480d5de67d3948df692a5823af56f70c632563db8c46e60ed28eaa70e4debb646aa8bc73bb2f291a19e07175619cfd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,60 @@
|
|
1
|
+
## 2.1.0 (2020-02-26)
|
2
|
+
|
3
|
+
### Bugfixes
|
4
|
+
|
5
|
+
- Shebang should be the first thing in the file ([#222](https://github.com/rubygems/gemstash/pull/222), [@bronzdoc](https://github.com/bronzdoc))
|
6
|
+
|
7
|
+
### Changes
|
8
|
+
|
9
|
+
- Update rack-test requirement from ~> 0.6 to ~> 1.1 ([#199](https://github.com/rubygems/gemstash/pull/199), [@dependabot](https://github.com/dependabot))
|
10
|
+
- Update rake requirement from ~> 10.0 to ~> 12.3 ([#200](https://github.com/rubygems/gemstash/pull/200), [@dependabot](https://github.com/dependabot))
|
11
|
+
- CI matrix: Drop 2.0, 2.1, 2.2 ([#201](https://github.com/rubygems/gemstash/pull/201), [@olleolleolle](https://github.com/olleolleolle))
|
12
|
+
- Update rubocop version and update files to be inline with new cops ([#202](https://github.com/rubygems/gemstash/pull/202), [@bronzdoc](https://github.com/bronzdoc))
|
13
|
+
- Update rubocop requirement from = 0.60.0 to = 0.61.0 ([#208](https://github.com/rubygems/gemstash/pull/208), [@dependabot](https://github.com/dependabot))
|
14
|
+
- Update rubocop requirement from = 0.61.0 to = 0.61.1 ([#209](https://github.com/rubygems/gemstash/pull/209), [@dependabot](https://github.com/dependabot))
|
15
|
+
- Avoid Rubocop warnings ([#210](https://github.com/rubygems/gemstash/pull/210), [@olleolleolle](https://github.com/olleolleolle))
|
16
|
+
- RSpec: config.disable_monkey_patching! ([#211](https://github.com/rubygems/gemstash/pull/211), [@olleolleolle](https://github.com/olleolleolle))
|
17
|
+
- Travis: update JRuby to 9.2.5.0 ([#212](https://github.com/rubygems/gemstash/pull/212), [@olleolleolle](https://github.com/olleolleolle))
|
18
|
+
- Update rubocop requirement from = 0.61.1 to = 0.62.0 ([#213](https://github.com/rubygems/gemstash/pull/213), [@dependabot](https://github.com/dependabot))
|
19
|
+
- Update rubocop requirement from = 0.62.0 to = 0.63.0 ([#215](https://github.com/rubygems/gemstash/pull/215), [@dependabot](https://github.com/dependabot))
|
20
|
+
- gemspec: Allow Bundler 2 ([#217](https://github.com/rubygems/gemstash/pull/217), [@olleolleolle](https://github.com/olleolleolle))
|
21
|
+
- Update rubocop requirement from = 0.63.0 to = 0.63.1 ([#218](https://github.com/rubygems/gemstash/pull/218), [@dependabot](https://github.com/dependabot))
|
22
|
+
- Update rubocop requirement from = 0.63.1 to = 0.64.0 ([#220](https://github.com/rubygems/gemstash/pull/220), [@dependabot](https://github.com/dependabot))
|
23
|
+
- CI: matrix updates - update JRuby, add 2.6.1 ([#221](https://github.com/rubygems/gemstash/pull/221), [@olleolleolle](https://github.com/olleolleolle))
|
24
|
+
- Add a failing Aruba-based RSpec test for the CLI client output ([#223](https://github.com/rubygems/gemstash/pull/223), [@olleolleolle](https://github.com/olleolleolle))
|
25
|
+
- Update rubocop requirement from = 0.64.0 to = 0.65.0 ([#224](https://github.com/rubygems/gemstash/pull/224), [@dependabot](https://github.com/dependabot))
|
26
|
+
- CI: use 2.5.5, 2.6.2 ([#225](https://github.com/rubygems/gemstash/pull/225), [@olleolleolle](https://github.com/olleolleolle))
|
27
|
+
- Update rubocop requirement from = 0.65.0 to = 0.66.0 ([#226](https://github.com/rubygems/gemstash/pull/226), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle), [@bronzdoc](https://github.com/bronzdoc))
|
28
|
+
- CI: Use 2.4.6 ([#228](https://github.com/rubygems/gemstash/pull/228), [@olleolleolle](https://github.com/olleolleolle))
|
29
|
+
- Update rubocop requirement from = 0.66.0 to = 0.67.1 ([#229](https://github.com/rubygems/gemstash/pull/229), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle))
|
30
|
+
- CI: Drop 2.3.8 ([#230](https://github.com/rubygems/gemstash/pull/230), [@olleolleolle](https://github.com/olleolleolle))
|
31
|
+
- Update rubocop requirement from = 0.67.1 to = 0.67.2 ([#231](https://github.com/rubygems/gemstash/pull/231), [@dependabot](https://github.com/dependabot))
|
32
|
+
- CI: Use JRuby 9.2.7.0 ([#232](https://github.com/rubygems/gemstash/pull/232), [@olleolleolle](https://github.com/olleolleolle))
|
33
|
+
- Update rubocop requirement from = 0.67.2 to = 0.68.0 ([#233](https://github.com/rubygems/gemstash/pull/233), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle))
|
34
|
+
- Update rubocop requirement from = 0.68.1 to = 0.69.0 ([#234](https://github.com/rubygems/gemstash/pull/234), [@dependabot](https://github.com/dependabot))
|
35
|
+
- Update rubocop requirement from = 0.69.0 to = 0.70.0 ([#235](https://github.com/rubygems/gemstash/pull/235), [@dependabot](https://github.com/dependabot))
|
36
|
+
- Set Travis badge to /rubygems user ([#236](https://github.com/rubygems/gemstash/pull/236), [@olleolleolle](https://github.com/olleolleolle))
|
37
|
+
- Fix broken links ([#240](https://github.com/rubygems/gemstash/pull/240), [@Aliciawyse](https://github.com/Aliciawyse))
|
38
|
+
- Fix various rubocop/codeclimate issues ([#241](https://github.com/rubygems/gemstash/pull/241), [@tchia04](https://github.com/tchia04))
|
39
|
+
- Fix some broken links in readme ([#243](https://github.com/rubygems/gemstash/pull/243), [@Aliciawyse](https://github.com/Aliciawyse))
|
40
|
+
- Improve webspec tests ([#244](https://github.com/rubygems/gemstash/pull/244), [@Aliciawyse](https://github.com/Aliciawyse))
|
41
|
+
- CI: Use jruby-9.2.8.0 ([#245](https://github.com/rubygems/gemstash/pull/245), [@olleolleolle](https://github.com/olleolleolle))
|
42
|
+
- CI: Use ruby 2.4.7, 2.5.6, 2.6.4 ([#246](https://github.com/rubygems/gemstash/pull/246), [@olleolleolle](https://github.com/olleolleolle))
|
43
|
+
- Add puma server pidfile configuration option ([#248](https://github.com/rubygems/gemstash/pull/248), [@krists](https://github.com/krists))
|
44
|
+
- CI: Use jruby-9.2.9.0 ([#249](https://github.com/rubygems/gemstash/pull/249), [@olleolleolle](https://github.com/olleolleolle))
|
45
|
+
- Officially drop support for older rubies ([#250](https://github.com/rubygems/gemstash/pull/250), [@deivid-rodriguez](https://github.com/deivid-rodriguez))
|
46
|
+
- Add config to ignore Gemfile source ([#253](https://github.com/rubygems/gemstash/pull/253), [@zpdcodes](https://github.com/zpdcodes))
|
47
|
+
- Update Puma gem ([#255](https://github.com/rubygems/gemstash/pull/255), [@bronzdoc](https://github.com/bronzdoc))
|
48
|
+
- Spec failures might be due to a bundler version ([#256](https://github.com/rubygems/gemstash/pull/256), [@bronzdoc](https://github.com/bronzdoc))
|
49
|
+
- Update spec homepage ([#257](https://github.com/rubygems/gemstash/pull/257), [@bronzdoc](https://github.com/bronzdoc))
|
50
|
+
- Update README.md links ([#258](https://github.com/rubygems/gemstash/pull/258), [@bronzdoc](https://github.com/bronzdoc))
|
51
|
+
- Add PR template ([#259](https://github.com/rubygems/gemstash/pull/259), [@bronzdoc](https://github.com/bronzdoc))
|
52
|
+
- Update docs ([#260](https://github.com/rubygems/gemstash/pull/260), [@bronzdoc](https://github.com/bronzdoc))
|
53
|
+
|
54
|
+
### Features
|
55
|
+
|
56
|
+
- Add configuration options cache_expiration, cache_max_size ([#207](https://github.com/rubygems/gemstash/pull/207), [@optix2000](https://github.com/optix2000), [@olleolleolle](https://github.com/olleolleolle))
|
57
|
+
|
1
58
|
## 2.0.0 (2018-11-18)
|
2
59
|
|
3
60
|
### Changes
|
data/lib/gemstash/cache.rb
CHANGED
@@ -79,4 +79,41 @@ module Gemstash
|
|
79
79
|
@cache[key] = value
|
80
80
|
end
|
81
81
|
end
|
82
|
+
|
83
|
+
# Wrapper around the redis-rb gem to behave like a dalli Memcached client.
|
84
|
+
class RedisClient
|
85
|
+
extend Forwardable
|
86
|
+
|
87
|
+
def_delegator :@cache, :del, :delete
|
88
|
+
|
89
|
+
def initialize(redis_servers)
|
90
|
+
require "redis"
|
91
|
+
@cache = ::Redis.new(:url => redis_servers)
|
92
|
+
end
|
93
|
+
|
94
|
+
def alive!
|
95
|
+
@cache.ping == "PONG"
|
96
|
+
end
|
97
|
+
|
98
|
+
def get(key)
|
99
|
+
val = @cache.get(key)
|
100
|
+
YAML.load(val, permitted_classes: [Gemstash::Authorization, Set]) unless val.nil?
|
101
|
+
end
|
102
|
+
|
103
|
+
def get_multi(keys)
|
104
|
+
@cache.mget(*keys).each do |k, v|
|
105
|
+
next if v.nil?
|
106
|
+
|
107
|
+
yield(k, YAML.load(v))
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def set(key, value, expiry)
|
112
|
+
@cache.set(key, YAML.dump(value), :ex => expiry)
|
113
|
+
end
|
114
|
+
|
115
|
+
def flush
|
116
|
+
@cache.flushdb
|
117
|
+
end
|
118
|
+
end
|
82
119
|
end
|
@@ -30,7 +30,7 @@ module Gemstash
|
|
30
30
|
raise Gemstash::CLI::Error.new(@cli, "To remove individual permissions, you do not need --remove
|
31
31
|
Instead just authorize with the new set of permissions")
|
32
32
|
end
|
33
|
-
Gemstash::Authorization.remove(auth_key(false))
|
33
|
+
Gemstash::Authorization.remove(auth_key(allow_generate: false))
|
34
34
|
end
|
35
35
|
|
36
36
|
def save_authorization
|
@@ -46,7 +46,7 @@ Instead just authorize with the new set of permissions")
|
|
46
46
|
Gemstash::Authorization.authorize(auth_key, permissions)
|
47
47
|
end
|
48
48
|
|
49
|
-
def auth_key(allow_generate
|
49
|
+
def auth_key(allow_generate: true)
|
50
50
|
if @cli.options[:key]
|
51
51
|
@cli.options[:key]
|
52
52
|
elsif allow_generate
|
data/lib/gemstash/cli/setup.rb
CHANGED
@@ -76,8 +76,9 @@ module Gemstash
|
|
76
76
|
|
77
77
|
def ask_cache
|
78
78
|
say_current_config(:cache_type, "Current cache")
|
79
|
-
@config[:cache_type] = ask_with_default("Cache with what?", %w[memory memcached], "memory")
|
79
|
+
@config[:cache_type] = ask_with_default("Cache with what?", %w[memory memcached redis], "memory")
|
80
80
|
ask_memcached_details if @config[:cache_type] == "memcached"
|
81
|
+
ask_redis_details if @config[:cache_type] == "redis"
|
81
82
|
end
|
82
83
|
|
83
84
|
def ask_memcached_details
|
@@ -87,6 +88,13 @@ module Gemstash
|
|
87
88
|
@config[:memcached_servers] = servers
|
88
89
|
end
|
89
90
|
|
91
|
+
def ask_redis_details
|
92
|
+
say_current_config(:redis_servers, "Current Redis servers")
|
93
|
+
servers = @cli.ask "What is the comma-separated list of Redis servers? [localhost:6379]"
|
94
|
+
servers = "localhost:6379" if servers.empty?
|
95
|
+
@config[:redis_servers] = servers
|
96
|
+
end
|
97
|
+
|
90
98
|
def ask_database
|
91
99
|
say_current_config(:db_adapter, "Current database adapter")
|
92
100
|
@config[:db_adapter] = ask_with_default("What database adapter?", %w[sqlite3 postgres mysql mysql2], "sqlite3")
|
@@ -181,9 +189,9 @@ module Gemstash
|
|
181
189
|
gemstash_env.reset
|
182
190
|
end
|
183
191
|
|
184
|
-
def try(thing)
|
192
|
+
def try(thing, &block)
|
185
193
|
@cli.say "Checking that the #{thing} is available"
|
186
|
-
with_new_config
|
194
|
+
with_new_config(&block)
|
187
195
|
rescue StandardError => e
|
188
196
|
say_error "Error checking #{thing}", e
|
189
197
|
raise Gemstash::CLI::Error.new(@cli, "The #{thing} is not available")
|
@@ -4,7 +4,7 @@ require "cgi"
|
|
4
4
|
require "set"
|
5
5
|
|
6
6
|
module Gemstash
|
7
|
-
|
7
|
+
# :nodoc:
|
8
8
|
class Dependencies
|
9
9
|
def self.for_private
|
10
10
|
new(scope: "private", db_model: Gemstash::DB::Dependency)
|
@@ -24,7 +24,7 @@ module Gemstash
|
|
24
24
|
Fetcher.new(gems, @scope, @http_client, @db_model).fetch
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
# :nodoc:
|
28
28
|
class Fetcher
|
29
29
|
include Gemstash::Env::Helper
|
30
30
|
include Gemstash::Logging
|
data/lib/gemstash/env.rb
CHANGED
@@ -170,6 +170,8 @@ module Gemstash
|
|
170
170
|
Gemstash::LruReduxClient.new
|
171
171
|
when "memcached"
|
172
172
|
Dalli::Client.new(config[:memcached_servers])
|
173
|
+
when "redis"
|
174
|
+
Gemstash::RedisClient.new(config[:redis_servers])
|
173
175
|
else
|
174
176
|
raise "Invalid cache client: '#{config[:cache_type]}'"
|
175
177
|
end
|
data/lib/gemstash/gem_fetcher.rb
CHANGED
@@ -4,11 +4,11 @@ require "gemstash"
|
|
4
4
|
require "set"
|
5
5
|
|
6
6
|
module Gemstash
|
7
|
-
|
7
|
+
# :nodoc:
|
8
8
|
class GemFetcher
|
9
9
|
def initialize(http_client)
|
10
10
|
@http_client = http_client
|
11
|
-
@valid_headers = Set.new([
|
11
|
+
@valid_headers = Set.new(%w[etag content-type content-length last-modified])
|
12
12
|
end
|
13
13
|
|
14
14
|
def fetch(gem_id, type, &block)
|
data/lib/gemstash/gem_pusher.rb
CHANGED
@@ -4,7 +4,7 @@ require "gemstash"
|
|
4
4
|
require "rubygems/package"
|
5
5
|
require "stringio"
|
6
6
|
|
7
|
-
|
7
|
+
# :nodoc:
|
8
8
|
module Gemstash
|
9
9
|
# Class that supports pushing a new gem to the private repository of gems.
|
10
10
|
class GemPusher
|
@@ -127,6 +127,6 @@ module Gemstash
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
GemPusher.
|
130
|
+
GemPusher.include LegacyRubyGemsSupport
|
131
131
|
end
|
132
132
|
end
|
@@ -47,7 +47,7 @@ module Gemstash
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def serve_versions
|
50
|
-
halt
|
50
|
+
halt 404, "Not yet supported"
|
51
51
|
end
|
52
52
|
|
53
53
|
def serve_info(name)
|
@@ -57,7 +57,7 @@ module Gemstash
|
|
57
57
|
def serve_marshal(id)
|
58
58
|
authorization.protect(self) do
|
59
59
|
auth.check("fetch") if gemstash_env.config[:protected_fetch]
|
60
|
-
gem_full_name = id.
|
60
|
+
gem_full_name = id.delete_suffix(".gemspec.rz")
|
61
61
|
gem = fetch_gem(gem_full_name)
|
62
62
|
halt 404 unless gem.exist?(:spec)
|
63
63
|
content_type "application/octet-stream"
|
@@ -72,7 +72,7 @@ module Gemstash
|
|
72
72
|
def serve_gem(id)
|
73
73
|
authorization.protect(self) do
|
74
74
|
auth.check("fetch") if gemstash_env.config[:protected_fetch]
|
75
|
-
gem_full_name = id.
|
75
|
+
gem_full_name = id.delete_suffix(".gem")
|
76
76
|
gem = fetch_gem(gem_full_name)
|
77
77
|
content_type "application/octet-stream"
|
78
78
|
gem.content(:gem)
|
data/lib/gemstash/gem_source.rb
CHANGED
@@ -4,7 +4,7 @@ require "gemstash"
|
|
4
4
|
require "forwardable"
|
5
5
|
|
6
6
|
module Gemstash
|
7
|
-
|
7
|
+
# :nodoc:
|
8
8
|
module GemSource
|
9
9
|
autoload :DependencyCaching, "gemstash/gem_source/dependency_caching"
|
10
10
|
autoload :PrivateSource, "gemstash/gem_source/private_source"
|
@@ -29,7 +29,7 @@ module Gemstash
|
|
29
29
|
include Gemstash::Logging
|
30
30
|
|
31
31
|
def_delegators :@app, :cache_control, :content_type, :env, :halt,
|
32
|
-
|
32
|
+
:headers, :http_client_for, :params, :redirect, :request
|
33
33
|
|
34
34
|
def initialize(app)
|
35
35
|
@app = app
|
data/lib/gemstash/http_client.rb
CHANGED
@@ -5,7 +5,7 @@ require "faraday"
|
|
5
5
|
require "faraday_middleware"
|
6
6
|
|
7
7
|
module Gemstash
|
8
|
-
|
8
|
+
# :nodoc:
|
9
9
|
class WebError < StandardError
|
10
10
|
attr_reader :code
|
11
11
|
|
@@ -15,14 +15,14 @@ module Gemstash
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
# :nodoc:
|
19
19
|
class ConnectionError < WebError
|
20
20
|
def initialize(message)
|
21
21
|
super(message, 502) # Bad Gateway
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
# :nodoc:
|
26
26
|
class HTTPClient
|
27
27
|
extend Gemstash::Env::Helper
|
28
28
|
include Gemstash::Logging
|
@@ -35,12 +35,17 @@ module Gemstash
|
|
35
35
|
config.adapter :net_http
|
36
36
|
config.options.timeout = gemstash_env.config[:fetch_timeout]
|
37
37
|
end
|
38
|
+
|
39
|
+
client.basic_auth(upstream.user, upstream.password) if upstream.auth?
|
40
|
+
|
38
41
|
user_agent = "#{upstream.user_agent} " unless upstream.user_agent.to_s.empty?
|
39
42
|
user_agent = user_agent.to_s + DEFAULT_USER_AGENT
|
40
43
|
|
41
44
|
new(client, user_agent: user_agent)
|
42
45
|
end
|
43
46
|
|
47
|
+
attr_reader :client
|
48
|
+
|
44
49
|
def initialize(client = nil, user_agent: nil)
|
45
50
|
@client = client
|
46
51
|
@user_agent = user_agent || DEFAULT_USER_AGENT
|
data/lib/gemstash/logging.rb
CHANGED
@@ -1,51 +1,66 @@
|
|
1
|
-
|
1
|
+
<!-- Automatically generated by Pandoc -->
|
2
|
+
.\" Automatically generated by Pandoc 3.0.1
|
2
3
|
.\"
|
3
|
-
|
4
|
+
.\" Define V font for inline verbatim, using C font in formats
|
5
|
+
.\" that render this, and otherwise B font.
|
6
|
+
.ie "\f[CB]x\f[]"x" \{\
|
7
|
+
. ftr V B
|
8
|
+
. ftr VI BI
|
9
|
+
. ftr VB B
|
10
|
+
. ftr VBI BI
|
11
|
+
.\}
|
12
|
+
.el \{\
|
13
|
+
. ftr V CR
|
14
|
+
. ftr VI CI
|
15
|
+
. ftr VB CB
|
16
|
+
. ftr VBI CBI
|
17
|
+
.\}
|
18
|
+
.TH "gemstash-authorize" "1" "October 9, 2015" "" ""
|
4
19
|
.hy
|
5
|
-
.SH
|
20
|
+
.SH Name
|
6
21
|
.PP
|
7
|
-
gemstash
|
22
|
+
gemstash-authorize - Adds or removes authorization to interact with
|
8
23
|
privately stored gems
|
9
|
-
.SH
|
24
|
+
.SH Synopsis
|
10
25
|
.PP
|
11
|
-
\f[
|
12
|
-
.SH
|
26
|
+
\f[V]gemstash authorize [permissions] [--remove] [--key SECURE_KEY] [--config-file FILE]\f[R]
|
27
|
+
.SH Description
|
13
28
|
.PP
|
14
29
|
Adds or removes authorization to interact with privately stored gems.
|
15
30
|
.PP
|
16
31
|
Any arguments will be used as specific permissions.
|
17
|
-
Valid permissions include \f[
|
18
|
-
\f[
|
32
|
+
Valid permissions include \f[V]push\f[R], \f[V]yank\f[R], and
|
33
|
+
\f[V]fetch\f[R].
|
19
34
|
If no permissions are provided, then all permissions will be granted
|
20
35
|
(including any that may be added in future versions of Gemstash).
|
21
|
-
.SS
|
36
|
+
.SS Usage
|
22
37
|
.IP
|
23
38
|
.nf
|
24
39
|
\f[C]
|
25
40
|
gemstash authorize
|
26
41
|
gemstash authorize push yank
|
27
|
-
gemstash authorize yank
|
28
|
-
gemstash authorize
|
42
|
+
gemstash authorize yank --key <secure-key>
|
43
|
+
gemstash authorize --remove --key <secure-key>
|
29
44
|
\f[R]
|
30
45
|
.fi
|
31
|
-
.SH
|
46
|
+
.SH Options
|
32
47
|
.IP \[bu] 2
|
33
|
-
\f[
|
48
|
+
\f[V]--config-file FILE\f[R]: Specify the config file to use.
|
34
49
|
If you aren\[cq]t using the default config file at
|
35
|
-
\f[
|
36
|
-
\f[
|
37
|
-
|
50
|
+
\f[V]\[ti]/.gemstash/config.yml\f[R] or
|
51
|
+
\f[V]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
|
52
|
+
config file via this option.
|
38
53
|
.IP \[bu] 2
|
39
|
-
\f[
|
54
|
+
\f[V]--key SECURE_KEY\f[R]: Specify the API key to affect.
|
40
55
|
This should be the actual key value, not a name.
|
41
|
-
This option is required when using \f[
|
56
|
+
This option is required when using \f[V]--remove\f[R] but is optional
|
42
57
|
otherwise.
|
43
58
|
If adding an authorization, using this will either create or update the
|
44
59
|
permissions for the specified API key.
|
45
60
|
If missing, a new API key will always be generated.
|
46
61
|
Note that a key can only have a maximum length of 255 chars.
|
47
62
|
.IP \[bu] 2
|
48
|
-
\f[
|
63
|
+
\f[V]--remove\f[R]: Remove an authorization rather than add or update
|
49
64
|
one.
|
50
65
|
When removing, permission values are not allowed.
|
51
|
-
The \f[
|
66
|
+
The \f[V]--key <secure-key>\f[R] option is required.
|
@@ -2,45 +2,47 @@ gemstash-authorize(1) gemstash-authorize(1)
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
<!-- Automatically generated by Pandoc -->
|
6
|
+
|
7
|
+
1mName0m
|
6
8
|
gemstash-authorize - Adds or removes authorization to interact with
|
7
9
|
privately stored gems
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
1mSynopsis0m
|
12
|
+
1mgemstash authorize [permissions] [--remove] [--key SECURE_KEY] [--con-0m
|
13
|
+
1mfig-file FILE]0m
|
12
14
|
|
13
|
-
|
15
|
+
1mDescription0m
|
14
16
|
Adds or removes authorization to interact with privately stored gems.
|
15
17
|
|
16
18
|
Any arguments will be used as specific permissions. Valid permissions
|
17
|
-
include
|
19
|
+
include 1mpush22m, 1myank22m, and 1mfetch22m. If no permissions are provided, then
|
18
20
|
all permissions will be granted (including any that may be added in fu-
|
19
21
|
ture versions of Gemstash).
|
20
22
|
|
21
|
-
|
23
|
+
1mUsage0m
|
22
24
|
gemstash authorize
|
23
25
|
gemstash authorize push yank
|
24
26
|
gemstash authorize yank --key <secure-key>
|
25
27
|
gemstash authorize --remove --key <secure-key>
|
26
28
|
|
27
|
-
|
28
|
-
o --config-file
|
29
|
-
using the default config file at ~/.gemstash/config.yml
|
30
|
-
|
31
|
-
|
29
|
+
1mOptions0m
|
30
|
+
o 1m--config-file FILE22m: Specify the config file to use. If you aren't
|
31
|
+
using the default config file at 1m~/.gemstash/config.yml 22mor 1m~/.gem-0m
|
32
|
+
1mstash/config.yml.erb22m, then you must specify the config file via this
|
33
|
+
option.
|
32
34
|
|
33
|
-
o --key
|
34
|
-
actual key value, not a name. This option is
|
35
|
-
--remove
|
35
|
+
o 1m--key SECURE_KEY22m: Specify the API key to affect. This should be the
|
36
|
+
actual key value, not a name. This option is required when using
|
37
|
+
1m--remove 22mbut is optional otherwise. If adding an authorization, us-
|
36
38
|
ing this will either create or update the permissions for the speci-
|
37
39
|
fied API key. If missing, a new API key will always be generated.
|
38
40
|
Note that a key can only have a maximum length of 255 chars.
|
39
41
|
|
40
|
-
o --
|
41
|
-
When
|
42
|
-
|
42
|
+
o 1m--remove22m: Remove an authorization rather than add or update one.
|
43
|
+
When removing, permission values are not allowed. The 1m--key <secure-0m
|
44
|
+
1mkey> 22moption is required.
|
43
45
|
|
44
46
|
|
45
47
|
|
46
|
-
October 9, 2015
|
48
|
+
October 9, 2015 gemstash-authorize(1)
|