gemstash 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/lib/gemstash/cli.rb +46 -0
  4. data/lib/gemstash/cli/setup.rb +1 -1
  5. data/lib/gemstash/env.rb +5 -0
  6. data/lib/gemstash/man/gemstash-authorize.1 +50 -0
  7. data/lib/gemstash/man/gemstash-authorize.1.txt +45 -0
  8. data/lib/gemstash/man/gemstash-configuration.5 +133 -0
  9. data/lib/gemstash/man/gemstash-configuration.5.txt +121 -0
  10. data/lib/gemstash/man/gemstash-customize.7 +224 -0
  11. data/lib/gemstash/man/gemstash-customize.7.txt +137 -0
  12. data/lib/gemstash/man/gemstash-debugging.7 +34 -0
  13. data/lib/gemstash/man/gemstash-debugging.7.txt +29 -0
  14. data/lib/gemstash/man/gemstash-deploy.7 +40 -0
  15. data/lib/gemstash/man/gemstash-deploy.7.txt +34 -0
  16. data/lib/gemstash/man/gemstash-mirror.7 +40 -0
  17. data/lib/gemstash/man/gemstash-mirror.7.txt +33 -0
  18. data/lib/gemstash/man/gemstash-multiple-sources.7 +89 -0
  19. data/lib/gemstash/man/gemstash-multiple-sources.7.txt +71 -0
  20. data/lib/gemstash/man/gemstash-private-gems.7 +195 -0
  21. data/lib/gemstash/man/gemstash-private-gems.7.txt +133 -0
  22. data/lib/gemstash/man/gemstash-readme.7 +204 -0
  23. data/lib/gemstash/man/gemstash-readme.7.txt +160 -0
  24. data/lib/gemstash/man/gemstash-setup.1 +41 -0
  25. data/lib/gemstash/man/gemstash-setup.1.txt +38 -0
  26. data/lib/gemstash/man/gemstash-start.1 +25 -0
  27. data/lib/gemstash/man/gemstash-start.1.txt +25 -0
  28. data/lib/gemstash/man/gemstash-status.1 +19 -0
  29. data/lib/gemstash/man/gemstash-status.1.txt +21 -0
  30. data/lib/gemstash/man/gemstash-stop.1 +19 -0
  31. data/lib/gemstash/man/gemstash-stop.1.txt +21 -0
  32. data/lib/gemstash/man/gemstash-version.1 +22 -0
  33. data/lib/gemstash/man/gemstash-version.1.txt +21 -0
  34. data/lib/gemstash/storage.rb +7 -4
  35. data/lib/gemstash/version.rb +1 -1
  36. metadata +79 -48
  37. data/Gemfile +0 -4
  38. data/README.md +0 -161
  39. data/Rakefile +0 -25
  40. data/bin/console +0 -14
  41. data/bin/gemstash +0 -3
  42. data/bin/setup +0 -5
  43. data/docs/config.md +0 -136
  44. data/docs/debug.md +0 -24
  45. data/docs/deploy.md +0 -30
  46. data/docs/mirror.md +0 -30
  47. data/docs/multiple_sources.md +0 -68
  48. data/docs/private_gems.md +0 -140
  49. data/docs/reference.md +0 -323
  50. data/gemstash.gemspec +0 -49
  51. data/gemstash.png +0 -0
  52. data/rake/changelog.citrus +0 -157
  53. data/rake/changelog.rb +0 -201
  54. data/rake/table_of_contents.rb +0 -36
@@ -0,0 +1,133 @@
1
+ gemstash-private-gems(7) gemstash-private-gems(7)
2
+
3
+
4
+
5
+ PRIVATE GEMS
6
+ Stashing private gems in your Gemstash server requires a bit of addi-
7
+ tional setup. If you haven't read through the Quickstart Guide (gem-
8
+ stash help readme.7), you should do that first. By the end of this
9
+ guide, you will be able to interact with your Gemstash server to store
10
+ and retrieve your private gems.
11
+
12
+ AUTHORIZING
13
+ IMPORTANT NOTE: Do not use the actual key value in this document, oth-
14
+ erwise your Gemstash server will be vulnerable to anyone who wants to
15
+ try to use the key against your server. Instead of the key value here,
16
+ use whatever key is generated from running the commands.
17
+
18
+ In order to push a gem to your Gemstash server, you need to first cre-
19
+ ate an API key. Utilize the gemstash authorize command to create the
20
+ API key:
21
+
22
+ $ gemstash authorize
23
+ Your new key is: e374e237fdf5fa5718d2a21bd63dc911
24
+
25
+ This new key can push, yank, and unyank gems from your Gemstash server.
26
+ Run gemstash authorize with just the permissions you want to limit what
27
+ the key will be allowed to do. You can similarly update a specific key
28
+ by providing it via the --key option:
29
+
30
+ $ gemstash authorize push yank --key e374e237fdf5fa5718d2a21bd63dc911
31
+
32
+ When no permissions are provided (like the first example), the key will
33
+ be authorized for all permissions. Leave the key authorized with ev-
34
+ erything if you want to use it to try all private gem interactions:
35
+
36
+ $ gemstash authorize --key e374e237fdf5fa5718d2a21bd63dc911
37
+
38
+ With the key generated, you'll need to tell Rubygems about your new
39
+ key. If you've pushed a gem to https://rubygems.org, then you will al-
40
+ ready have a credentials file to add the key to. If not, run the fol-
41
+ lowing commands before modifying the credentials file:
42
+
43
+ $ mkdir -p ~/.gem
44
+ $ touch ~/.gem/credentials
45
+ $ chmod 0600 ~/.gem/credentials
46
+
47
+ Add your new key to credentials such that it looks something like this
48
+ (but make sure not to remove any existing keys):
49
+
50
+ # ~/.gem/credentials
51
+ ---
52
+ :test_key: e374e237fdf5fa5718d2a21bd63dc911
53
+
54
+ The name test_key can be anything you want, but you will need to remem-
55
+ ber it and use it again later in this guide for the --key option.
56
+
57
+ CREATING A TEST GEM
58
+ You'll need a test gem before you can play with private gems on your
59
+ Gemstash server. If you have a gem you can use, move along to the next
60
+ section. You can start by instantiating a test gem via Bundler:
61
+
62
+ $ bundle gem private-example
63
+
64
+ You'll need to add a summary and description to the new gem's gemspec
65
+ file in order to successfully build it. Once you've built the gem, you
66
+ will be ready to push the new gem.
67
+
68
+ $ cd private-example
69
+ $ rake build
70
+
71
+ You will now have a gem at private-example/pkg/private-exam-
72
+ ple-0.1.0.gem.
73
+
74
+ PUSHING
75
+ If your Gemstash server isn't running, go ahead and start it:
76
+
77
+ $ gemstash start
78
+
79
+ Push your test gem using Rubygems:
80
+
81
+ $ gem push --key test_key --host http://localhost:9292/private pkg/private-example-0.1.0.gem
82
+
83
+ The /private portion of the --host option tells Gemstash you are inter-
84
+ acting with the private gems. Gemstash will not let you push, yank, or
85
+ unyank from anything except /private.
86
+
87
+ BUNDLING
88
+ Once your gem is pushed to your Gemstash server, you are ready to bun-
89
+ dle it. Create a Gemfile and specify the gem. You will probably want
90
+ to wrap the private gem in a source block, and let the rest of Gemstash
91
+ handle all other gems:
92
+
93
+ # ./Gemfile
94
+ source "http://localhost:9292"
95
+ gem "rubywarrior"
96
+
97
+ source "http://localhost:9292/private" do
98
+ gem "private-example"
99
+ end
100
+
101
+ Notice that the Gemstash server points to /private again when in-
102
+ stalling your private gem. Go ahead and bundle to install your new
103
+ private gem:
104
+
105
+ $ bundle
106
+
107
+ YANKING
108
+ If you push a private gem by accident, you can yank the gem with
109
+ Rubygems:
110
+
111
+ $ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0
112
+
113
+ Like with pushing, the /private portion of the host option tells Gem-
114
+ stash you are interacting with private gems. Gemstash will only let
115
+ you yank from /private. Unlike pushing, Rubygems doesn't support
116
+ --host for yank and unyank (yet), so you need to specify the host via
117
+ the RUBYGEMS_HOST environment variable.
118
+
119
+ UNYANKING
120
+ If you yank a private gem by accident, you can unyank the gem with
121
+ Rubygems:
122
+
123
+ $ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0 --undo
124
+
125
+ Like with pushing and yanking, the /private portion of the host option
126
+ tells Gemstash you are interacting with private gems. Gemstash will
127
+ only let you unyank from /private. Unlike pushing, Rubygems doesn't
128
+ support --host for unyank and yank (yet), so you need to specify the
129
+ host via the RUBYGEMS_HOST environment variable.
130
+
131
+
132
+
133
+ October 8, 2015 gemstash-private-gems(7)
@@ -0,0 +1,204 @@
1
+ .\" Automatically generated by Pandoc 1.16.0.2
2
+ .\"
3
+ .TH "gemstash\-readme" "7" "November 30, 2015" "" ""
4
+ .hy
5
+ .SH GEMSTASH
6
+ .SS WHAT IS GEMSTASH?
7
+ .PP
8
+ Gemstash is both a cache for remote servers such as
9
+ https://rubygems.org, and a private gem source.
10
+ .PP
11
+ If you are using bundler (http://bundler.io/) across many machines that
12
+ have access to a server within your control, you might want to use
13
+ Gemstash.
14
+ .PP
15
+ If you produce gems that you don\[aq]t want everyone in the world to
16
+ have access to, you might want to use Gemstash.
17
+ .PP
18
+ If you frequently bundle the same set of gems across multiple projects,
19
+ you might want to use Gemstash.
20
+ .PP
21
+ Are you only using gems from https://rubygems.org, and don\[aq]t bundle
22
+ the same gems frequently?
23
+ Well, maybe you don\[aq]t need Gemstash...
24
+ yet.
25
+ .SS QUICKSTART GUIDE
26
+ .SS SETUP
27
+ .PP
28
+ Gemstash is designed to be quick and painless to get set up.
29
+ By the end of this Quickstart Guide, you will be able to bundle stashed
30
+ gems from public sources against a Gemstash server running on your
31
+ machine.
32
+ .PP
33
+ Install Gemstash to get started:
34
+ .IP
35
+ .nf
36
+ \f[C]
37
+ $\ gem\ install\ gemstash
38
+ \f[]
39
+ .fi
40
+ .PP
41
+ After it is installed, starting Gemstash requires no additional steps.
42
+ Simply start the Gemstash server with the \f[C]gemstash\f[] command:
43
+ .IP
44
+ .nf
45
+ \f[C]
46
+ $\ gemstash\ start
47
+ \f[]
48
+ .fi
49
+ .PP
50
+ You may have noticed that the command finished quickly.
51
+ This is because Gemstash will run the server in the background by
52
+ default.
53
+ The server runs on port 9292.
54
+ .SS BUNDLING
55
+ .PP
56
+ With the server running, you can bundle against it.
57
+ Tell Bundler that you want to use Gemstash to find gems from
58
+ RubyGems.org:
59
+ .IP
60
+ .nf
61
+ \f[C]
62
+ $\ bundle\ config\ mirror.https://rubygems.org\ http://localhost:9292
63
+ \f[]
64
+ .fi
65
+ .PP
66
+ Now you can create a Gemfile and install gems through Gemstash:
67
+ .IP
68
+ .nf
69
+ \f[C]
70
+ #\ ./Gemfile
71
+ source\ "https://rubygems.org"
72
+ gem\ "rubywarrior"
73
+ \f[]
74
+ .fi
75
+ .PP
76
+ The gems you include should be gems you don\[aq]t yet have installed,
77
+ otherwise Gemstash will have nothing to stash.
78
+ Now bundle:
79
+ .IP
80
+ .nf
81
+ \f[C]
82
+ $\ bundle\ install\ \-\-path\ .bundle
83
+ \f[]
84
+ .fi
85
+ .PP
86
+ Your Gemstash server has fetched the gems from https://rubygems.org and
87
+ cached them for you! To prove this, you can disable your Internet
88
+ connection and try again.
89
+ The gem dependencies from https://rubygems.org are cached for 30
90
+ minutes, so if you bundle again before that, you can successfully bundle
91
+ without an Internet connection:
92
+ .IP
93
+ .nf
94
+ \f[C]
95
+ $\ #\ Disable\ your\ Internet\ first!
96
+ $\ rm\ \-rf\ Gemfile.lock\ .bundle
97
+ $\ bundle
98
+ \f[]
99
+ .fi
100
+ .SS STOPPING THE SERVER
101
+ .PP
102
+ Once you\[aq]ve finish using your Gemstash server, you can stop it just
103
+ as easily as you started it:
104
+ .IP
105
+ .nf
106
+ \f[C]
107
+ $\ gemstash\ stop
108
+ \f[]
109
+ .fi
110
+ .PP
111
+ You\[aq]ll also want to tell Bundler that it can go back to getting gems
112
+ from RubyGems.org directly, instead of going through Gemstash:
113
+ .IP
114
+ .nf
115
+ \f[C]
116
+ $\ bundle\ config\ \-\-delete\ mirror.https://rubygems.org
117
+ \f[]
118
+ .fi
119
+ .SS UNDER THE HOOD
120
+ .PP
121
+ You might wonder where the gems are stored.
122
+ After running the commands above, you will find a new directory at
123
+ \f[C]~/.gemstash\f[].
124
+ This directory holds all the cached and private gems.
125
+ It also has a server log, the database, and configuration for Gemstash.
126
+ If you prefer, you can point to a different
127
+ directory (gemstash help customize.7).
128
+ .PP
129
+ Gemstash uses SQLite (https://www.sqlite.org/) to store details about
130
+ private gems.
131
+ The database will be located in \f[C]~/.gemstash\f[], however you
132
+ won\[aq]t see the database appear until you start using private gems.
133
+ If you prefer, you can use a different
134
+ database (gemstash help customize.7).
135
+ .PP
136
+ Gemstash temporarily caches things like gem dependencies in memory.
137
+ Anything cached in memory will last for 30 minutes before being
138
+ retrieved again.
139
+ You can use memcached (gemstash help customize.7) instead of caching in
140
+ memory.
141
+ Gem files are always cached permanently, so bundling with a
142
+ \f[C]Gemfile.lock\f[] with all gems cached will never call out to
143
+ https://rubygems.org.
144
+ .PP
145
+ The server you ran is provided via Puma (http://puma.io/) and
146
+ Rack (http://rack.github.io/), however they are not customizable at this
147
+ point.
148
+ .SS DEEP DIVE
149
+ .PP
150
+ Deep dive into more subjects:
151
+ .IP \[bu] 2
152
+ Private gems (gemstash help private-gems.7)
153
+ .IP \[bu] 2
154
+ Multiple gem sources (gemstash help multiple-sources.7)
155
+ .IP \[bu] 2
156
+ Using Gemstash as a mirror (gemstash help mirror.7)
157
+ .IP \[bu] 2
158
+ Customizing the server (database, storage, caching, and
159
+ more) (gemstash help customize.7)
160
+ .IP \[bu] 2
161
+ Deploying Gemstash (gemstash help deploy.7)
162
+ .IP \[bu] 2
163
+ Debugging Gemstash (gemstash help debugging.7)
164
+ .SS REFERENCE
165
+ .PP
166
+ An anatomy of various configuration and commands:
167
+ .IP \[bu] 2
168
+ Configuration (gemstash help configuration.5)
169
+ .IP \[bu] 2
170
+ Authorize (gemstash help authorize.1)
171
+ .IP \[bu] 2
172
+ Start (gemstash help start.1)
173
+ .IP \[bu] 2
174
+ Stop (gemstash help stop.1)
175
+ .IP \[bu] 2
176
+ Status (gemstash help status.1)
177
+ .IP \[bu] 2
178
+ Setup (gemstash help setup.1)
179
+ .IP \[bu] 2
180
+ Version (gemstash help version.1)
181
+ .PP
182
+ To see what has changed in recent versions of Gemstash, see the
183
+ CHANGELOG (https://github.com/bundler/gemstash/blob/master/CHANGELOG.md).
184
+ .SS DEVELOPMENT
185
+ .PP
186
+ After checking out the repo, run \f[C]bin/setup\f[] to install
187
+ dependencies.
188
+ Then, run \f[C]rake\f[] to run RuboCop and the tests.
189
+ While developing, you can run \f[C]bin/gemstash\f[] to run Gemstash.
190
+ You can also run \f[C]bin/console\f[] for an interactive prompt that
191
+ will allow you to experiment.
192
+ .SS CONTRIBUTING
193
+ .PP
194
+ Bug reports and pull requests are welcome on GitHub at
195
+ https://github.com/bundler/gemstash.
196
+ This project is intended to be a safe, welcoming space for
197
+ collaboration, and contributors are expected to adhere to the
198
+ Contributor
199
+ Covenant (https://github.com/bundler/gemstash/blob/master/CODE_OF_CONDUCT.md)
200
+ code of conduct.
201
+ .SS LICENSE
202
+ .PP
203
+ The gem is available as open source under the terms of the MIT
204
+ License (http://opensource.org/licenses/MIT).
@@ -0,0 +1,160 @@
1
+ gemstash-readme(7) gemstash-readme(7)
2
+
3
+
4
+
5
+ GEMSTASH
6
+ WHAT IS GEMSTASH?
7
+ Gemstash is both a cache for remote servers such as
8
+ https://rubygems.org, and a private gem source.
9
+
10
+ If you are using bundler (http://bundler.io/) across many machines that
11
+ have access to a server within your control, you might want to use Gem-
12
+ stash.
13
+
14
+ If you produce gems that you don't want everyone in the world to have
15
+ access to, you might want to use Gemstash.
16
+
17
+ If you frequently bundle the same set of gems across multiple projects,
18
+ you might want to use Gemstash.
19
+
20
+ Are you only using gems from https://rubygems.org, and don't bundle the
21
+ same gems frequently? Well, maybe you don't need Gemstash... yet.
22
+
23
+ QUICKSTART GUIDE
24
+ SETUP
25
+ Gemstash is designed to be quick and painless to get set up. By the
26
+ end of this Quickstart Guide, you will be able to bundle stashed gems
27
+ from public sources against a Gemstash server running on your machine.
28
+
29
+ Install Gemstash to get started:
30
+
31
+ $ gem install gemstash
32
+
33
+ After it is installed, starting Gemstash requires no additional steps.
34
+ Simply start the Gemstash server with the gemstash command:
35
+
36
+ $ gemstash start
37
+
38
+ You may have noticed that the command finished quickly. This is be-
39
+ cause Gemstash will run the server in the background by default. The
40
+ server runs on port 9292.
41
+
42
+ BUNDLING
43
+ With the server running, you can bundle against it. Tell Bundler that
44
+ you want to use Gemstash to find gems from RubyGems.org:
45
+
46
+ $ bundle config mirror.https://rubygems.org http://localhost:9292
47
+
48
+ Now you can create a Gemfile and install gems through Gemstash:
49
+
50
+ # ./Gemfile
51
+ source "https://rubygems.org"
52
+ gem "rubywarrior"
53
+
54
+ The gems you include should be gems you don't yet have installed, oth-
55
+ erwise Gemstash will have nothing to stash. Now bundle:
56
+
57
+ $ bundle install --path .bundle
58
+
59
+ Your Gemstash server has fetched the gems from https://rubygems.org and
60
+ cached them for you! To prove this, you can disable your Internet con-
61
+ nection and try again. The gem dependencies from https://rubygems.org
62
+ are cached for 30 minutes, so if you bundle again before that, you can
63
+ successfully bundle without an Internet connection:
64
+
65
+ $ # Disable your Internet first!
66
+ $ rm -rf Gemfile.lock .bundle
67
+ $ bundle
68
+
69
+ STOPPING THE SERVER
70
+ Once you've finish using your Gemstash server, you can stop it just as
71
+ easily as you started it:
72
+
73
+ $ gemstash stop
74
+
75
+ You'll also want to tell Bundler that it can go back to getting gems
76
+ from RubyGems.org directly, instead of going through Gemstash:
77
+
78
+ $ bundle config --delete mirror.https://rubygems.org
79
+
80
+ UNDER THE HOOD
81
+ You might wonder where the gems are stored. After running the commands
82
+ above, you will find a new directory at ~/.gemstash. This directory
83
+ holds all the cached and private gems. It also has a server log, the
84
+ database, and configuration for Gemstash. If you prefer, you can point
85
+ to a different directory (gemstash help customize.7).
86
+
87
+ Gemstash uses SQLite (https://www.sqlite.org/) to store details about
88
+ private gems. The database will be located in ~/.gemstash, however you
89
+ won't see the database appear until you start using private gems. If
90
+ you prefer, you can use a different database (gemstash help custom-
91
+ ize.7).
92
+
93
+ Gemstash temporarily caches things like gem dependencies in memory.
94
+ Anything cached in memory will last for 30 minutes before being re-
95
+ trieved again. You can use memcached (gemstash help customize.7) in-
96
+ stead of caching in memory. Gem files are always cached permanently,
97
+ so bundling with a Gemfile.lock with all gems cached will never call
98
+ out to https://rubygems.org.
99
+
100
+ The server you ran is provided via Puma (http://puma.io/) and Rack
101
+ (http://rack.github.io/), however they are not customizable at this
102
+ point.
103
+
104
+ DEEP DIVE
105
+ Deep dive into more subjects:
106
+
107
+ o Private gems (gemstash help private-gems.7)
108
+
109
+ o Multiple gem sources (gemstash help multiple-sources.7)
110
+
111
+ o Using Gemstash as a mirror (gemstash help mirror.7)
112
+
113
+ o Customizing the server (database, storage, caching, and more) (gem-
114
+ stash help customize.7)
115
+
116
+ o Deploying Gemstash (gemstash help deploy.7)
117
+
118
+ o Debugging Gemstash (gemstash help debugging.7)
119
+
120
+ REFERENCE
121
+ An anatomy of various configuration and commands:
122
+
123
+ o Configuration (gemstash help configuration.5)
124
+
125
+ o Authorize (gemstash help authorize.1)
126
+
127
+ o Start (gemstash help start.1)
128
+
129
+ o Stop (gemstash help stop.1)
130
+
131
+ o Status (gemstash help status.1)
132
+
133
+ o Setup (gemstash help setup.1)
134
+
135
+ o Version (gemstash help version.1)
136
+
137
+ To see what has changed in recent versions of Gemstash, see the
138
+ CHANGELOG (https://github.com/bundler/gemstash/blob/master/CHANGEL-
139
+ OG.md).
140
+
141
+ DEVELOPMENT
142
+ After checking out the repo, run bin/setup to install dependencies.
143
+ Then, run rake to run RuboCop and the tests. While developing, you can
144
+ run bin/gemstash to run Gemstash. You can also run bin/console for an
145
+ interactive prompt that will allow you to experiment.
146
+
147
+ CONTRIBUTING
148
+ Bug reports and pull requests are welcome on GitHub at
149
+ https://github.com/bundler/gemstash. This project is intended to be a
150
+ safe, welcoming space for collaboration, and contributors are expected
151
+ to adhere to the Contributor Covenant (https://github.com/bundler/gem-
152
+ stash/blob/master/CODE_OF_CONDUCT.md) code of conduct.
153
+
154
+ LICENSE
155
+ The gem is available as open source under the terms of the MIT License
156
+ (http://opensource.org/licenses/MIT).
157
+
158
+
159
+
160
+ November 30, 2015 gemstash-readme(7)