gemstash 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 9f8e00734475c4c0595f454b66b51e73ff7849a2
4
- data.tar.gz: 8d1c6e0529760867d971639cd8b975c58066b961
3
+ metadata.gz: fe7e58da58c18944e118fc19063e7f4c730b8d9d
4
+ data.tar.gz: ed5e51504ea2fe809bbc01a6305351d9e73a6811
5
5
  SHA512:
6
- metadata.gz: 2a20cb02a68ff45c9692416ac8f6722b3c6f3fe668d9349062d4fce1f77f6b30fdb6e9dc5cb48c859141ea8bf54f7b7fb7cc835d6c6cdec3397b483b248f58f6
7
- data.tar.gz: 7eefc0b5bed7915a71f2f4f26a7f481ae489b1fb0cef6aad594861c414dc737b662ae72d543f87d81f40d3759dc6885c67a65b389e52f08c9195aea9bc7b0ef9
6
+ metadata.gz: 87f204c3e9f05fc452889a42a16063553c77abe937fed20a71646e3eea3740c960ecb3949c634e181ad5709b7288664f80db7f72d9ba9e41f4fcc6c6c1097f25
7
+ data.tar.gz: 305da0681b3c5b7bfd6be10534c490a7dfde10f55ac30add6cbdfd816c66f6cc49ae1c897cd42a53aa863fd4141300510e988ad28a52f99fb8c4029dc13be1ee
@@ -1,3 +1,11 @@
1
+ ## 1.0.2 (2016-07-07)
2
+
3
+ ### Bugfixes
4
+
5
+ - Fix broken JRuby build ([#91](https://github.com/bundler/gemstash/pull/91), [@smellsblue](https://github.com/smellsblue))
6
+ - Drop www.rubygems.org in favor of rubygems.org ([#101](https://github.com/bundler/gemstash/pull/101), [@smellsblue](https://github.com/smellsblue))
7
+ - Redirect /versions and /info/* to index.rubygems.org ([#102](https://github.com/bundler/gemstash/pull/102), [@smellsblue](https://github.com/smellsblue))
8
+
1
9
  ## 1.0.1 (2016-02-23)
2
10
 
3
11
  ### Bugfixes
data/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## What is Gemstash?
6
6
 
7
- Gemstash is both a cache for remote servers such as https://www.rubygems.org,
8
- and a private gem source.
7
+ Gemstash is both a cache for remote servers such as https://rubygems.org, and a
8
+ private gem source.
9
9
 
10
10
  If you are using [bundler](http://bundler.io/) across many machines that have
11
11
  access to a server within your control, you might want to use Gemstash.
@@ -16,7 +16,7 @@ you might want to use Gemstash.
16
16
  If you frequently bundle the same set of gems across multiple projects, you
17
17
  might want to use Gemstash.
18
18
 
19
- Are you only using gems from https://www.rubygems.org, and don't bundle the same
19
+ Are you only using gems from https://rubygems.org, and don't bundle the same
20
20
  gems frequently? Well, maybe you don't need Gemstash... yet.
21
21
 
22
22
  ## Quickstart Guide
@@ -67,11 +67,11 @@ otherwise Gemstash will have nothing to stash. Now bundle:
67
67
  $ bundle install --path .bundle
68
68
  ```
69
69
 
70
- Your Gemstash server has fetched the gems from https://www.rubygems.org and
71
- cached them for you! To prove this, you can disable your Internet connection and
72
- try again. The gem dependencies from https://www.rubygems.org are cached for 30
73
- minutes, so if you bundle again before that, you can successfully bundle without
74
- an Internet connection:
70
+ Your Gemstash server has fetched the gems from https://rubygems.org and cached
71
+ them for you! To prove this, you can disable your Internet connection and try
72
+ again. The gem dependencies from https://rubygems.org are cached for 30 minutes,
73
+ so if you bundle again before that, you can successfully bundle without an
74
+ Internet connection:
75
75
 
76
76
  ```
77
77
  $ # Disable your Internet first!
@@ -112,7 +112,7 @@ Gemstash temporarily caches things like gem dependencies in memory. Anything
112
112
  cached in memory will last for 30 minutes before being retrieved again. You can
113
113
  [use memcached](docs/config.md#cache) instead of caching in memory. Gem files
114
114
  are always cached permanently, so bundling with a `Gemfile.lock` with all gems
115
- cached will never call out to https://www.rubygems.org.
115
+ cached will never call out to https://rubygems.org.
116
116
 
117
117
  The server you ran is provided via [Puma](http://puma.io/) and
118
118
  [Rack](http://rack.github.io/), however they are not customizable at this point.
@@ -4,7 +4,7 @@ Bundler is here for the rescue to keep Gemstash up to date! Create a `Gemfile`
4
4
  pointing to Gemstash:
5
5
  ```ruby
6
6
  # ./Gemfile
7
- source "https://www.rubygems.org"
7
+ source "https://rubygems.org"
8
8
  gem "gemstash"
9
9
  ```
10
10
 
@@ -8,8 +8,8 @@ Gemstash server.
8
8
 
9
9
  When you don't provide an explicit source (as with the [Quickstart
10
10
  Guide](../README.md#quickstart-guide)), your gems will be fetched from
11
- https://www.rubygems.org. This default source is not set in stone. To change it,
12
- you need only edit the Gemstash configuration found at `~/.gemstash/config.yml`:
11
+ https://rubygems.org. This default source is not set in stone. To change it, you
12
+ need only edit the Gemstash configuration found at `~/.gemstash/config.yml`:
13
13
  ```yaml
14
14
  # ~/.gemstash/config.yml
15
15
  ---
@@ -30,9 +30,9 @@ separate location, ensuring different sources won't leak between each other.
30
30
  ## Bundling with Multiple Sources
31
31
 
32
32
  Changing the default source won't help you if you need to bundle against
33
- https://www.rubygems.org along with additional sources. If you need to bundle
34
- with multiple gem sources, Gemstash doesn't need to be specially configured.
35
- Your Gemstash server will honor any gem source specified via a specialized URL.
33
+ https://rubygems.org along with additional sources. If you need to bundle with
34
+ multiple gem sources, Gemstash doesn't need to be specially configured. Your
35
+ Gemstash server will honor any gem source specified via a specialized URL.
36
36
  Consider the following `Gemfile`:
37
37
  ```ruby
38
38
  # ./Gemfile
@@ -58,7 +58,7 @@ your `Gemfile` like so:
58
58
  ```ruby
59
59
  # ./Gemfile
60
60
  require "cgi"
61
- source "http://localhost:9292/redirect/#{CGI.escape("https://www.rubygems.org")}"
61
+ source "http://localhost:9292/redirect/#{CGI.escape("https://rubygems.org")}"
62
62
  gem "rubywarrior"
63
63
  ```
64
64
 
@@ -36,7 +36,7 @@ $ gemstash authorize --key e374e237fdf5fa5718d2a21bd63dc911
36
36
  ```
37
37
 
38
38
  With the key generated, you'll need to tell Rubygems about your new key. If
39
- you've pushed a gem to https://www.rubygems.org, then you will already have a
39
+ you've pushed a gem to https://rubygems.org, then you will already have a
40
40
  credentials file to add the key to. If not, run the following commands before
41
41
  modifying the credentials file:
42
42
  ```
@@ -123,7 +123,7 @@ Specifies the database to connect to when using `postgres` for the
123
123
 
124
124
  ### :rubygems_url
125
125
 
126
- **Default value:** `https://www.rubygems.org`
126
+ **Default value:** `https://rubygems.org`
127
127
 
128
128
  **Valid values:** A valid gem source URL
129
129
 
@@ -4,11 +4,11 @@ module Gemstash
4
4
  #:nodoc:
5
5
  class Configuration
6
6
  DEFAULTS = {
7
- :cache_type => "memory",
8
- :base_path => File.expand_path("~/.gemstash"),
9
- :db_adapter => "sqlite3",
10
- :bind => "tcp://0.0.0.0:9292",
11
- :rubygems_url => "https://www.rubygems.org"
7
+ cache_type: "memory",
8
+ base_path: File.expand_path("~/.gemstash"),
9
+ db_adapter: "sqlite3",
10
+ bind: "tcp://0.0.0.0:9292",
11
+ rubygems_url: "https://rubygems.org"
12
12
  }.freeze
13
13
 
14
14
  DEFAULT_FILE = File.expand_path("~/.gemstash/config.yml").freeze
@@ -60,11 +60,11 @@ module Gemstash
60
60
  end
61
61
 
62
62
  def serve_versions
63
- redirect upstream.url("versions", request.query_string)
63
+ redirect index_upstream.url("versions", request.query_string)
64
64
  end
65
65
 
66
66
  def serve_info(name)
67
- redirect upstream.url("info/#{name}", request.query_string)
67
+ redirect index_upstream.url("info/#{name}", request.query_string)
68
68
  end
69
69
 
70
70
  def serve_marshal(id)
@@ -97,6 +97,17 @@ module Gemstash
97
97
  @upstream ||= Gemstash::Upstream.new(env["gemstash.upstream"],
98
98
  user_agent: env["gemstash.user-agent"])
99
99
  end
100
+
101
+ def index_upstream
102
+ @index_upstream ||=
103
+ if upstream.uri.host == "rubygems.org"
104
+ uri = upstream.uri.dup
105
+ uri.host = "index.rubygems.org"
106
+ Gemstash::Upstream.new(uri, user_agent: upstream.user_agent)
107
+ else
108
+ upstream
109
+ end
110
+ end
100
111
  end
101
112
 
102
113
  # GemSource for gems in an upstream server.
@@ -1,11 +1,12 @@
1
1
  require "digest"
2
+ require "uri"
2
3
 
3
4
  module Gemstash
4
5
  #:nodoc:
5
6
  class Upstream
6
7
  extend Forwardable
7
8
 
8
- attr_reader :user_agent
9
+ attr_reader :user_agent, :uri
9
10
 
10
11
  def_delegators :@uri, :scheme, :host, :user, :password, :to_s
11
12
 
@@ -1,4 +1,4 @@
1
1
  #:nodoc:
2
2
  module Gemstash
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemstash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Arko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dalli