gemstash 2.7.1 → 2.8.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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gemstash/cache.rb +2 -1
  3. data/lib/gemstash/cli/info.rb +29 -0
  4. data/lib/gemstash/cli/setup.rb +11 -3
  5. data/lib/gemstash/cli.rb +6 -0
  6. data/lib/gemstash/config.ru +2 -1
  7. data/lib/gemstash/configuration.rb +5 -0
  8. data/lib/gemstash/db/version.rb +0 -5
  9. data/lib/gemstash/env.rb +5 -2
  10. data/lib/gemstash/http_client.rb +2 -1
  11. data/lib/gemstash/logging.rb +4 -1
  12. data/lib/gemstash/man/gemstash-authorize.1 +36 -17
  13. data/lib/gemstash/man/gemstash-authorize.1.txt +15 -17
  14. data/lib/gemstash/man/gemstash-configuration.5 +136 -63
  15. data/lib/gemstash/man/gemstash-configuration.5.txt +80 -64
  16. data/lib/gemstash/man/gemstash-customize.7 +114 -61
  17. data/lib/gemstash/man/gemstash-customize.7.txt +56 -51
  18. data/lib/gemstash/man/gemstash-debugging.7 +27 -9
  19. data/lib/gemstash/man/gemstash-debugging.7.txt +6 -8
  20. data/lib/gemstash/man/gemstash-deploy.7 +39 -16
  21. data/lib/gemstash/man/gemstash-deploy.7.txt +19 -21
  22. data/lib/gemstash/man/gemstash-mirror.7 +31 -11
  23. data/lib/gemstash/man/gemstash-mirror.7.txt +6 -8
  24. data/lib/gemstash/man/gemstash-multiple-sources.7 +68 -35
  25. data/lib/gemstash/man/gemstash-multiple-sources.7.txt +20 -22
  26. data/lib/gemstash/man/gemstash-private-gems.7 +102 -52
  27. data/lib/gemstash/man/gemstash-private-gems.7.txt +31 -33
  28. data/lib/gemstash/man/gemstash-readme.7 +75 -30
  29. data/lib/gemstash/man/gemstash-readme.7.txt +24 -26
  30. data/lib/gemstash/man/gemstash-setup.1 +33 -14
  31. data/lib/gemstash/man/gemstash-setup.1.txt +12 -14
  32. data/lib/gemstash/man/gemstash-start.1 +23 -6
  33. data/lib/gemstash/man/gemstash-start.1.txt +5 -7
  34. data/lib/gemstash/man/gemstash-status.1 +23 -6
  35. data/lib/gemstash/man/gemstash-status.1.txt +6 -8
  36. data/lib/gemstash/man/gemstash-stop.1 +23 -6
  37. data/lib/gemstash/man/gemstash-stop.1.txt +5 -7
  38. data/lib/gemstash/man/gemstash-version.1 +24 -5
  39. data/lib/gemstash/man/gemstash-version.1.txt +1 -3
  40. data/lib/gemstash/puma.rb +2 -0
  41. data/lib/gemstash/specs_builder.rb +16 -2
  42. data/lib/gemstash/upstream.rb +1 -1
  43. data/lib/gemstash/version.rb +1 -1
  44. metadata +37 -21
@@ -1,22 +1,39 @@
1
- <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.8
1
+ .\" Automatically generated by Pandoc 3.1.3
3
2
  .\"
3
+ .\" Define V font for inline verbatim, using C font in formats
4
+ .\" that render this, and otherwise B font.
5
+ .ie "\f[CB]x\f[]"x" \{\
6
+ . ftr V B
7
+ . ftr VI BI
8
+ . ftr VB B
9
+ . ftr VBI BI
10
+ .\}
11
+ .el \{\
12
+ . ftr V CR
13
+ . ftr VI CI
14
+ . ftr VB CB
15
+ . ftr VBI CBI
16
+ .\}
4
17
  .TH "gemstash-deploy" "7" "October 25, 2015" "" ""
18
+ .hy
5
19
  .SH Deploying Gemstash
20
+ .PP
6
21
  Bundler is here for the rescue to keep Gemstash up to date!
7
- Create a \f[CR]Gemfile\f[R] pointing to Gemstash:
22
+ Create a \f[V]Gemfile\f[R] pointing to Gemstash:
8
23
  .IP
9
- .EX
24
+ .nf
25
+ \f[C]
10
26
  # ./Gemfile
11
27
  source \[dq]https://rubygems.org\[dq]
12
28
  gem \[dq]gemstash\[dq]
13
- .EE
29
+ \f[R]
30
+ .fi
14
31
  .PP
15
- Then \f[CR]bundle\f[R] to create your \f[CR]Gemfile.lock\f[R].
16
- When you are ready to upgrade, simply \f[CR]bundle update\f[R].
17
- You may need to run \f[CR]gemstash\f[R] via \f[CR]bundle exec\f[R].
18
- Alternatively, you can \f[CR]gem uninstall gemstash\f[R] and
19
- \f[CR]gem install gemstash\f[R] when you want to upgrade.
32
+ Then \f[V]bundle\f[R] to create your \f[V]Gemfile.lock\f[R].
33
+ When you are ready to upgrade, simply \f[V]bundle update\f[R].
34
+ You may need to run \f[V]gemstash\f[R] via \f[V]bundle exec\f[R].
35
+ Alternatively, you can \f[V]gem uninstall gemstash\f[R] and
36
+ \f[V]gem install gemstash\f[R] when you want to upgrade.
20
37
  .PP
21
38
  Gemstash will automatically run any necessary migrations, so updating
22
39
  the gem is all that needs to be done.
@@ -24,21 +41,25 @@ the gem is all that needs to be done.
24
41
  It is probably wise to stop Gemstash before upgrading, then starting
25
42
  again once you are done:
26
43
  .IP
27
- .EX
44
+ .nf
45
+ \f[C]
28
46
  $ bundle exec gemstash stop
29
47
  $ bundle update
30
48
  $ bundle exec gemstash start
31
- .EE
49
+ \f[R]
50
+ .fi
32
51
  .SS Monitoring
52
+ .PP
33
53
  Health monitoring is built in to Gemstash using the
34
54
  server_health_check-rack (https://github.com/on-site/server_health_check-rack)
35
55
  gem.
36
- If you request \f[CR]/health\f[R] from your Gemstash instance, you will
56
+ If you request \f[V]/health\f[R] from your Gemstash instance, you will
37
57
  get a JSON response along with an HTTP status code indicating success or
38
58
  failure.
39
59
  The JSON response will look something like this for a success case:
40
60
  .IP
41
- .EX
61
+ .nf
62
+ \f[C]
42
63
  {
43
64
  \[dq]status\[dq]: {
44
65
  \[dq]heartbeat\[dq]: \[dq]OK\[dq],
@@ -48,16 +69,18 @@ The JSON response will look something like this for a success case:
48
69
  \[dq]db_write\[dq]: \[dq]OK\[dq]
49
70
  }
50
71
  }
51
- .EE
72
+ \f[R]
73
+ .fi
52
74
  .PP
53
75
  This request will test storage and database access and report on the
54
76
  result.
55
77
  Each key in the status can be requested alone to just report on that
56
78
  status.
57
79
  For example, if you would like a health check that doesn\[cq]t interact
58
- with storage or the database, you can use \f[CR]/health/heartbeat\f[R]
80
+ with storage or the database, you can use \f[V]/health/heartbeat\f[R]
59
81
  which will always respond with a success while your Gemstash server is
60
82
  running.
61
83
  .SS Downgrading
84
+ .PP
62
85
  It is not recommended to go backwards in Gemstash versions.
63
86
  Migrations may have run that could leave the database in a bad state.
@@ -1,21 +1,19 @@
1
- 4mgemstash-deploy24m(7) 4mgemstash-deploy24m(7)
2
-
3
- <!-- Automatically generated by Pandoc -->
1
+ 4mgemstash-deploy24m(7) 4mgemstash-deploy24m(7)
4
2
 
5
3
  1mDeploying Gemstash0m
6
4
  Bundler is here for the rescue to keep Gemstash up to date! Create a
7
- Gemfile pointing to Gemstash:
5
+ 1mGemfile 22mpointing to Gemstash:
8
6
 
9
7
  # ./Gemfile
10
8
  source "https://rubygems.org"
11
9
  gem "gemstash"
12
10
 
13
- Then bundle to create your Gemfile.lock. When you are ready to up-
14
- grade, simply bundle update. You may need to run gemstash via bundle
15
- exec. Alternatively, you can gem uninstall gemstash and gem install
16
- gemstash when you want to upgrade.
11
+ Then 1mbundle 22mto create your 1mGemfile.lock22m. When you are ready to up-
12
+ grade, simply 1mbundle update22m. You may need to run 1mgemstash 22mvia 1mbundle0m
13
+ 1mexec22m. Alternatively, you can 1mgem uninstall gemstash 22mand 1mgem install0m
14
+ 1mgemstash 22mwhen you want to upgrade.
17
15
 
18
- Gemstash will automatically run any necessary migrations, so updating
16
+ Gemstash will automatically run any necessary migrations, so updating
19
17
  the gem is all that needs to be done.
20
18
 
21
19
  It is probably wise to stop Gemstash before upgrading, then starting
@@ -26,12 +24,12 @@
26
24
  $ bundle exec gemstash start
27
25
 
28
26
  1mMonitoring0m
29
- Health monitoring is built in to Gemstash using the
30
- server_health_check-rack (https://github.com/on-
31
- site/server_health_check-rack) gem. If you request /health from your
32
- Gemstash instance, you will get a JSON response along with an HTTP sta-
33
- tus code indicating success or failure. The JSON response will look
34
- something like this for a success case:
27
+ Health monitoring is built in to Gemstash using the serv-
28
+ er_health_check-rack (https://github.com/on-site/server_health_check-
29
+ rack) gem. If you request 1m/health 22mfrom your Gemstash instance, you
30
+ will get a JSON response along with an HTTP status code indicating suc-
31
+ cess or failure. The JSON response will look something like this for a
32
+ success case:
35
33
 
36
34
  {
37
35
  "status": {
@@ -43,15 +41,15 @@
43
41
  }
44
42
  }
45
43
 
46
- This request will test storage and database access and report on the
47
- result. Each key in the status can be requested alone to just report
48
- on that status. For example, if you would like a health check that
49
- doesn't interact with storage or the database, you can use
50
- /health/heartbeat which will always respond with a success while your
44
+ This request will test storage and database access and report on the
45
+ result. Each key in the status can be requested alone to just report
46
+ on that status. For example, if you would like a health check that
47
+ doesn't interact with storage or the database, you can use
48
+ 1m/health/heartbeat 22mwhich will always respond with a success while your
51
49
  Gemstash server is running.
52
50
 
53
51
  1mDowngrading0m
54
52
  It is not recommended to go backwards in Gemstash versions. Migrations
55
53
  may have run that could leave the database in a bad state.
56
54
 
57
- October 25, 2015 4mgemstash-deploy24m(7)
55
+ October 25, 2015 4mgemstash-deploy24m(7)
@@ -1,34 +1,54 @@
1
- <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.8
1
+ .\" Automatically generated by Pandoc 3.1.3
3
2
  .\"
3
+ .\" Define V font for inline verbatim, using C font in formats
4
+ .\" that render this, and otherwise B font.
5
+ .ie "\f[CB]x\f[]"x" \{\
6
+ . ftr V B
7
+ . ftr VI BI
8
+ . ftr VB B
9
+ . ftr VBI BI
10
+ .\}
11
+ .el \{\
12
+ . ftr V CR
13
+ . ftr VI CI
14
+ . ftr VB CB
15
+ . ftr VBI CBI
16
+ .\}
4
17
  .TH "gemstash-mirror" "7" "October 25, 2015" "" ""
18
+ .hy
5
19
  .SH Using Gemstash as a Mirror
6
- If you don\[cq]t have control over your \f[CR]Gemfile\f[R], or you
20
+ .PP
21
+ If you don\[cq]t have control over your \f[V]Gemfile\f[R], or you
7
22
  don\[cq]t want to force everyone on your team to go through the Gemstash
8
23
  server, you can use Bundler mirroring to bundle against your Gemstash
9
24
  server.
10
25
  .PP
11
- For each source in your \f[CR]Gemfile\f[R], add a mirror pointing to
12
- your Gemstash server:
26
+ For each source in your \f[V]Gemfile\f[R], add a mirror pointing to your
27
+ Gemstash server:
13
28
  .IP
14
- .EX
29
+ .nf
30
+ \f[C]
15
31
  $ bundle config mirror.http://rubygems.org http://localhost:9292
16
32
  $ bundle config mirror.https://my.gem-source.local http://localhost:9292/upstream/$(ruby -rcgi -e \[aq]puts CGI.escape(\[dq]https://my.gem-source.local\[dq])\[aq])
17
- .EE
33
+ \f[R]
34
+ .fi
18
35
  .PP
19
36
  From now on, bundler will fetch gems from those sources via your
20
37
  Gemstash server.
21
38
  .SH Simpler Gemstash Mirrors
39
+ .PP
22
40
  \f[B]This feature requires Bundler to be at least version
23
- \f[CB]1.11.0\f[B].\f[R]
41
+ \f[VB]1.11.0\f[B].\f[R]
24
42
  .PP
25
- If you are using Bundler version \f[CR]1.11.0\f[R] or greater, the
43
+ If you are using Bundler version \f[V]1.11.0\f[R] or greater, the
26
44
  mirroring becomes a bit easier:
27
45
  .IP
28
- .EX
46
+ .nf
47
+ \f[C]
29
48
  $ bundle config mirror.http://rubygems.org http://localhost:9292
30
49
  $ bundle config mirror.https://my.gem-source.local http://localhost:9292
31
- .EE
50
+ \f[R]
51
+ .fi
32
52
  .PP
33
53
  Bundler will then send headers to Gemstash to indicate the correct
34
54
  upstream.
@@ -1,13 +1,11 @@
1
- 4mgemstash-mirror24m(7) 4mgemstash-mirror24m(7)
2
-
3
- <!-- Automatically generated by Pandoc -->
1
+ 4mgemstash-mirror24m(7) 4mgemstash-mirror24m(7)
4
2
 
5
3
  1mUsing Gemstash as a Mirror0m
6
- If you don't have control over your Gemfile, or you don't want to force
7
- everyone on your team to go through the Gemstash server, you can use
4
+ If you don't have control over your 1mGemfile22m, or you don't want to force
5
+ everyone on your team to go through the Gemstash server, you can use
8
6
  Bundler mirroring to bundle against your Gemstash server.
9
7
 
10
- For each source in your Gemfile, add a mirror pointing to your Gemstash
8
+ For each source in your 1mGemfile22m, add a mirror pointing to your Gemstash
11
9
  server:
12
10
 
13
11
  $ bundle config mirror.http://rubygems.org http://localhost:9292
@@ -19,7 +17,7 @@
19
17
  1mSimpler Gemstash Mirrors0m
20
18
  1mThis feature requires Bundler to be at least version 1.11.0.0m
21
19
 
22
- If you are using Bundler version 1.11.0 or greater, the mirroring be-
20
+ If you are using Bundler version 1m1.11.0 22mor greater, the mirroring be-
23
21
  comes a bit easier:
24
22
 
25
23
  $ bundle config mirror.http://rubygems.org http://localhost:9292
@@ -28,4 +26,4 @@
28
26
  Bundler will then send headers to Gemstash to indicate the correct up-
29
27
  stream.
30
28
 
31
- October 25, 2015 4mgemstash-mirror24m(7)
29
+ October 25, 2015 4mgemstash-mirror24m(7)
@@ -1,46 +1,68 @@
1
- <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.8
1
+ .\" Automatically generated by Pandoc 3.1.3
3
2
  .\"
3
+ .\" Define V font for inline verbatim, using C font in formats
4
+ .\" that render this, and otherwise B font.
5
+ .ie "\f[CB]x\f[]"x" \{\
6
+ . ftr V B
7
+ . ftr VI BI
8
+ . ftr VB B
9
+ . ftr VBI BI
10
+ .\}
11
+ .el \{\
12
+ . ftr V CR
13
+ . ftr VI CI
14
+ . ftr VB CB
15
+ . ftr VBI CBI
16
+ .\}
4
17
  .TH "gemstash-multiple-sources" "7" "October 8, 2015" "" ""
18
+ .hy
5
19
  .SH Multiple Gem Sources
20
+ .PP
6
21
  Gemstash will stash from any amount of gem sources.
7
22
  By the end of this guide, you will be able to bundle using multiple gem
8
23
  sources, all stashed within your Gemstash server.
9
24
  .SS Default Source
25
+ .PP
10
26
  When you don\[cq]t provide an explicit source (as with the Quickstart
11
27
  Guide), your gems will be fetched from https://rubygems.org.
12
28
  This default source is not set in stone.
13
29
  To change it, you need only edit the Gemstash configuration found at
14
- \f[CR]\[ti]/.gemstash/config.yml\f[R]:
30
+ \f[V]\[ti]/.gemstash/config.yml\f[R]:
15
31
  .IP
16
- .EX
32
+ .nf
33
+ \f[C]
17
34
  # \[ti]/.gemstash/config.yml
18
35
  ---
19
36
  :rubygems_url: https://my.gem-source.local
20
- .EE
37
+ \f[R]
38
+ .fi
21
39
  .PP
22
40
  Make sure to restart your Gemstash server after changing the config:
23
41
  .IP
24
- .EX
42
+ .nf
43
+ \f[C]
25
44
  $ gemstash stop
26
45
  $ gemstash start
27
- .EE
46
+ \f[R]
47
+ .fi
28
48
  .PP
29
- Once restarted, bundling against \f[CR]http://localhost:9292\f[R] will
30
- fetch gems from \f[CR]https://my.gem-source.local\f[R].
49
+ Once restarted, bundling against \f[V]http://localhost:9292\f[R] will
50
+ fetch gems from \f[V]https://my.gem-source.local\f[R].
31
51
  If you had bundled before making these changes, fear not; bundling with
32
52
  a different default gem source will store gems in a separate location,
33
53
  ensuring different sources won\[cq]t leak between each other.
34
54
  .SS Bundling with Multiple Sources
55
+ .PP
35
56
  Changing the default source won\[cq]t help you if you need to bundle
36
57
  against https://rubygems.org along with additional sources.
37
58
  If you need to bundle with multiple gem sources, Gemstash doesn\[cq]t
38
59
  need to be specially configured.
39
60
  Your Gemstash server will honor any gem source specified via a
40
61
  specialized URL.
41
- Consider the following \f[CR]Gemfile\f[R]:
62
+ Consider the following \f[V]Gemfile\f[R]:
42
63
  .IP
43
- .EX
64
+ .nf
65
+ \f[C]
44
66
  # ./Gemfile
45
67
  require \[dq]cgi\[dq]
46
68
  source \[dq]http://localhost:9292\[dq]
@@ -53,26 +75,29 @@ end
53
75
  source \[dq]http://localhost:9292/upstream/my-other.gem-source.local\[dq] do
54
76
  gem \[dq]my-other-gem\[dq]
55
77
  end
56
- .EE
78
+ \f[R]
79
+ .fi
57
80
  .PP
58
- Notice the \f[CR]CGI.escape\f[R] call in the second source.
81
+ Notice the \f[V]CGI.escape\f[R] call in the second source.
59
82
  This is important, as it properly URL escapes the source URL so Gemstash
60
83
  knows what gem source you want.
61
- The \f[CR]/upstream\f[R] prefix tells Gemstash to use a gem source other
84
+ The \f[V]/upstream\f[R] prefix tells Gemstash to use a gem source other
62
85
  than the default source.
63
86
  You can now bundle with the additional source.
64
87
  .PP
65
88
  Notice that the third source doesn\[cq]t need to be escaped.
66
- This is because the \f[CR]https://\f[R] is used by default when no
67
- scheme is set, and the source URL does not contain any characters that
68
- need to be escaped.
89
+ This is because the \f[V]https://\f[R] is used by default when no scheme
90
+ is set, and the source URL does not contain any characters that need to
91
+ be escaped.
69
92
  .SS Authentication with Multiple Sources
93
+ .PP
70
94
  You can use basic authentication or API keys on sources directly in
71
95
  Gemfile or using ENV variables on the Gemstash instance.
72
96
  .PP
73
- Example \f[CR]Gemfile\f[R]:
97
+ Example \f[V]Gemfile\f[R]:
74
98
  .IP
75
- .EX
99
+ .nf
100
+ \f[C]
76
101
  # ./Gemfile
77
102
  require \[dq]cgi\[dq]
78
103
  source \[dq]http://localhost:9292\[dq]
@@ -84,47 +109,55 @@ end
84
109
  source \[dq]http://localhost:9292/upstream/#{CGI.escape(\[dq]api_key\[at]my-other.gem-source.local\[dq])}\[dq] do
85
110
  gem \[dq]my-other-gem\[dq]
86
111
  end
87
- .EE
112
+ \f[R]
113
+ .fi
88
114
  .PP
89
- If you set \f[CR]GEMSTASH_<HOST>\f[R] ENV variable with your
90
- authentication information, you can omit it from the \f[CR]Gemfile\f[R]:
115
+ If you set \f[V]GEMSTASH_<HOST>\f[R] ENV variable with your
116
+ authentication information, you can omit it from the \f[V]Gemfile\f[R]:
91
117
  .IP
92
- .EX
118
+ .nf
119
+ \f[C]
93
120
  # ./Gemfile
94
121
  source \[dq]http://localhost:9292\[dq]
95
122
 
96
123
  source \[dq]http://localhost:9292/upstream/my.gem-source.local\[dq] do
97
124
  gem \[dq]my-gem\[dq]
98
125
  end
99
- .EE
126
+ \f[R]
127
+ .fi
100
128
  .PP
101
129
  And run the Gemstash with the credentials set in an ENV variable:
102
130
  .IP
103
- .EX
131
+ .nf
132
+ \f[C]
104
133
  GEMSTASH_MY__GEM___SOURCE__LOCAL=user:password gemstash start --config-file config.yml.erb
105
- .EE
134
+ \f[R]
135
+ .fi
106
136
  .PP
107
137
  The name of the ENV variable is the uppercase version of the host name,
108
- with all \f[CR].\f[R] characters replaced with \f[CR]__\f[R], all
109
- \f[CR]-\f[R] with \f[CR]___\f[R] and a \f[CR]GEMSTASH_\f[R] prefix (it
110
- uses the same syntax as
138
+ with all \f[V].\f[R] characters replaced with \f[V]__\f[R], all
139
+ \f[V]-\f[R] with \f[V]___\f[R] and a \f[V]GEMSTASH_\f[R] prefix (it uses
140
+ the same syntax as
111
141
  Bundler (https://bundler.io/v2.4/man/bundle-config.1.html#CREDENTIALS-FOR-GEM-SOURCES)).
112
142
  .PP
113
- Example: \f[CR]my.gem-source.local\f[R] =>
114
- \f[CR]GEMSTASH_MY__GEM___SOURCE__LOCAL\f[R]
143
+ Example: \f[V]my.gem-source.local\f[R] =>
144
+ \f[V]GEMSTASH_MY__GEM___SOURCE__LOCAL\f[R]
115
145
  .SS Redirecting
146
+ .PP
116
147
  Gemstash supports an alternate mode of specifying your gem sources.
117
148
  If you want Gemstash to redirect Bundler to your given gem sources, then
118
- you can specify your \f[CR]Gemfile\f[R] like so:
149
+ you can specify your \f[V]Gemfile\f[R] like so:
119
150
  .IP
120
- .EX
151
+ .nf
152
+ \f[C]
121
153
  # ./Gemfile
122
154
  require \[dq]cgi\[dq]
123
155
  source \[dq]http://localhost:9292/redirect/#{CGI.escape(\[dq]https://rubygems.org\[dq])}\[dq]
124
156
  gem \[dq]rubywarrior\[dq]
125
- .EE
157
+ \f[R]
158
+ .fi
126
159
  .PP
127
- Notice the \f[CR]/redirect\f[R] prefix.
160
+ Notice the \f[V]/redirect\f[R] prefix.
128
161
  This prefix tells Gemstash to redirect API calls to the provided URL.
129
162
  Redirected calls like this will not be cached by Gemstash, and gem files
130
163
  will not be stashed, even if they were previously cached or stashed from
@@ -1,17 +1,15 @@
1
1
  4mgemstash-multiple-sources24m(7) 4mgemstash-multiple-sources24m(7)
2
2
 
3
- <!-- Automatically generated by Pandoc -->
4
-
5
3
  1mMultiple Gem Sources0m
6
4
  Gemstash will stash from any amount of gem sources. By the end of this
7
5
  guide, you will be able to bundle using multiple gem sources, all
8
6
  stashed within your Gemstash server.
9
7
 
10
8
  1mDefault Source0m
11
- When you don't provide an explicit source (as with the Quickstart
9
+ When you don't provide an explicit source (as with the Quickstart
12
10
  Guide), your gems will be fetched from https://rubygems.org. This de-
13
11
  fault source is not set in stone. To change it, you need only edit the
14
- Gemstash configuration found at ~/.gemstash/config.yml:
12
+ Gemstash configuration found at 1m~/.gemstash/config.yml22m:
15
13
 
16
14
  # ~/.gemstash/config.yml
17
15
  ---
@@ -22,18 +20,18 @@
22
20
  $ gemstash stop
23
21
  $ gemstash start
24
22
 
25
- Once restarted, bundling against http://localhost:9292 will fetch gems
26
- from https://my.gem-source.local. If you had bundled before making
23
+ Once restarted, bundling against 1mhttp://localhost:9292 22mwill fetch gems
24
+ from 1mhttps://my.gem-source.local22m. If you had bundled before making
27
25
  these changes, fear not; bundling with a different default gem source
28
- will store gems in a separate location, ensuring different sources
26
+ will store gems in a separate location, ensuring different sources
29
27
  won't leak between each other.
30
28
 
31
29
  1mBundling with Multiple Sources0m
32
- Changing the default source won't help you if you need to bundle
30
+ Changing the default source won't help you if you need to bundle
33
31
  against https://rubygems.org along with additional sources. If you
34
32
  need to bundle with multiple gem sources, Gemstash doesn't need to be
35
33
  specially configured. Your Gemstash server will honor any gem source
36
- specified via a specialized URL. Consider the following Gemfile:
34
+ specified via a specialized URL. Consider the following 1mGemfile22m:
37
35
 
38
36
  # ./Gemfile
39
37
  require "cgi"
@@ -48,21 +46,21 @@
48
46
  gem "my-other-gem"
49
47
  end
50
48
 
51
- Notice the CGI.escape call in the second source. This is important, as
49
+ Notice the 1mCGI.escape 22mcall in the second source. This is important, as
52
50
  it properly URL escapes the source URL so Gemstash knows what gem
53
- source you want. The /upstream prefix tells Gemstash to use a gem
51
+ source you want. The 1m/upstream 22mprefix tells Gemstash to use a gem
54
52
  source other than the default source. You can now bundle with the ad-
55
53
  ditional source.
56
54
 
57
55
  Notice that the third source doesn't need to be escaped. This is be-
58
- cause the https:// is used by default when no scheme is set, and the
56
+ cause the 1mhttps:// 22mis used by default when no scheme is set, and the
59
57
  source URL does not contain any characters that need to be escaped.
60
58
 
61
59
  1mAuthentication with Multiple Sources0m
62
- You can use basic authentication or API keys on sources directly in
60
+ You can use basic authentication or API keys on sources directly in
63
61
  Gemfile or using ENV variables on the Gemstash instance.
64
62
 
65
- Example Gemfile:
63
+ Example 1mGemfile22m:
66
64
 
67
65
  # ./Gemfile
68
66
  require "cgi"
@@ -76,8 +74,8 @@
76
74
  gem "my-other-gem"
77
75
  end
78
76
 
79
- If you set GEMSTASH_<HOST> ENV variable with your authentication infor-
80
- mation, you can omit it from the Gemfile:
77
+ If you set 1mGEMSTASH_<HOST> 22mENV variable with your authentication infor-
78
+ mation, you can omit it from the 1mGemfile22m:
81
79
 
82
80
  # ./Gemfile
83
81
  source "http://localhost:9292"
@@ -91,26 +89,26 @@
91
89
  GEMSTASH_MY__GEM___SOURCE__LOCAL=user:password gemstash start --config-file config.yml.erb
92
90
 
93
91
  The name of the ENV variable is the uppercase version of the host name,
94
- with all . characters replaced with __, all - with ___ and a GEMSTASH_
95
- prefix (it uses the same syntax as Bundler
92
+ with all 1m. 22mcharacters replaced with 1m__22m, all 1m- 22mwith 1m___ 22mand a 1mGEMSTASH_0m
93
+ prefix (it uses the same syntax as Bundler
96
94
  (https://bundler.io/v2.4/man/bundle-config.1.html#CREDENTIALS-FOR-GEM-
97
95
  SOURCES)).
98
96
 
99
- Example: my.gem-source.local => GEMSTASH_MY__GEM___SOURCE__LOCAL
97
+ Example: 1mmy.gem-source.local 22m=> 1mGEMSTASH_MY__GEM___SOURCE__LOCAL0m
100
98
 
101
99
  1mRedirecting0m
102
100
  Gemstash supports an alternate mode of specifying your gem sources. If
103
101
  you want Gemstash to redirect Bundler to your given gem sources, then
104
- you can specify your Gemfile like so:
102
+ you can specify your 1mGemfile 22mlike so:
105
103
 
106
104
  # ./Gemfile
107
105
  require "cgi"
108
106
  source "http://localhost:9292/redirect/#{CGI.escape("https://rubygems.org")}"
109
107
  gem "rubywarrior"
110
108
 
111
- Notice the /redirect prefix. This prefix tells Gemstash to redirect
109
+ Notice the 1m/redirect 22mprefix. This prefix tells Gemstash to redirect
112
110
  API calls to the provided URL. Redirected calls like this will not be
113
111
  cached by Gemstash, and gem files will not be stashed, even if they
114
112
  were previously cached or stashed from the same gem source.
115
113
 
116
- October 8, 2015 4mgemstash-multiple-sources24m(7)
114
+ October 8, 2015 4mgemstash-multiple-sources24m(7)