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,224 @@
1
+ .\" Automatically generated by Pandoc 1.16.0.2
2
+ .\"
3
+ .TH "gemstash\-customize" "7" "October 28, 2015" "" ""
4
+ .hy
5
+ .SH CUSTOMIZING THE SERVER
6
+ .PP
7
+ Although Gemstash is designed for as minimal setup as possible, there
8
+ may be times you will want to change some of the default configuration.
9
+ By the end of this guide, you will be able to customize some of the
10
+ Gemstash behavior, including where files are stored, what database
11
+ Gemstash uses, and how Gemstash caches certain requests.
12
+ .SS SETUP
13
+ .PP
14
+ Several customizable options are available via an interactive Gemstash
15
+ command.
16
+ Run \f[C]gemstash\ setup\f[] and answer the questions it provides (a
17
+ blank answer will use the default value):
18
+ .RS
19
+ .PP
20
+ $ gemstash setup
21
+ .PD 0
22
+ .P
23
+ .PD
24
+ Where should files go?
25
+ [~/.gemstash]
26
+ .PD 0
27
+ .P
28
+ .PD
29
+ Cache with what?
30
+ [MEMORY, memcached] \f[B]memcached\f[]
31
+ .PD 0
32
+ .P
33
+ .PD
34
+ What is the comma separated Memcached servers?
35
+ [localhost:11211]
36
+ .PD 0
37
+ .P
38
+ .PD
39
+ What database adapter?
40
+ [SQLITE3, postgres] \f[B]postgres\f[]
41
+ .PD 0
42
+ .P
43
+ .PD
44
+ Where is the database?
45
+ [postgres:///gemstash]
46
+ .PD 0
47
+ .P
48
+ .PD
49
+ Checking that the cache is available
50
+ .PD 0
51
+ .P
52
+ .PD
53
+ Checking that the database is available
54
+ .PD 0
55
+ .P
56
+ .PD
57
+ The database is not available
58
+ .RE
59
+ .PP
60
+ Once you\[aq]ve answered the questsions, some checks will be made to
61
+ ensure the configuration will work.
62
+ For example, the database didn\[aq]t exist in the previous example, so
63
+ the command failed and the configuration wasn\[aq]t saved.
64
+ If the command passes, you may provide the \f[C]\-\-redo\f[] option to
65
+ force configuration to be redone:
66
+ .RS
67
+ .PP
68
+ $ gemstash setup \-\-redo
69
+ .PD 0
70
+ .P
71
+ .PD
72
+ Where should files go?
73
+ [~/.gemstash]
74
+ .PD 0
75
+ .P
76
+ .PD
77
+ Cache with what?
78
+ [MEMORY, memcached] \f[B]memcached\f[]
79
+ .PD 0
80
+ .P
81
+ .PD
82
+ What is the comma separated Memcached servers?
83
+ [localhost:11211]
84
+ .PD 0
85
+ .P
86
+ .PD
87
+ What database adapter?
88
+ [SQLITE3, postgres]
89
+ .PD 0
90
+ .P
91
+ .PD
92
+ Checking that the cache is available
93
+ .PD 0
94
+ .P
95
+ .PD
96
+ Checking that the database is available
97
+ .PD 0
98
+ .P
99
+ .PD
100
+ You are all setup!
101
+ .RE
102
+ .PP
103
+ Once all checks have passed, Gemstash will store your answers in the
104
+ configuration file located at \f[C]~/.gemstash/config.yml\f[].
105
+ .SS FILES
106
+ .PP
107
+ Storage in Gemstash defaults to \f[C]~/.gemstash\f[] unless otherwise
108
+ specified.
109
+ You can change this in your config file via the \f[C]:base_path\f[] key:
110
+ .IP
111
+ .nf
112
+ \f[C]
113
+ #\ ~/.gemstash/config.yml
114
+ \-\-\-
115
+ :base_path:\ "/var/gemstash"
116
+ \f[]
117
+ .fi
118
+ .PP
119
+ When customizing the \f[C]base_path\f[], the directory must exist,
120
+ otherwise Gemstash will fail to run.
121
+ Thus, if you want to use \f[C]/var/gemstash\f[] like in the previous
122
+ example, make sure to \f[C]mkdir\ /var/gemstash\f[] and grant access to
123
+ the directory for the user you run Gemstash with.
124
+ .SS DATABASE
125
+ .PP
126
+ The \f[C]:db_adapter\f[] configuration key specifies what database you
127
+ will be using.
128
+ The default \f[C]:db_adapter\f[] is
129
+ \f[C]sqlite3\f[] (https://www.sqlite.org/), which will use a database
130
+ file located within your \f[C]:base_path\f[].
131
+ The database file will always be named \f[C]gemstash.db\f[].
132
+ .PP
133
+ You may also use \f[C]postgres\f[] (http://www.postgresql.org/) for your
134
+ \f[C]:db_adapter\f[].
135
+ When using PostgreSQL, you need to specify the \f[C]:db_url\f[] to point
136
+ to an existing database.
137
+ Here is an example configuration to use the \f[C]postgres\f[] adapter:
138
+ .IP
139
+ .nf
140
+ \f[C]
141
+ #\ ~/.gemstash/config.yml
142
+ \-\-\-
143
+ :db_adapter:\ postgres
144
+ :db_url:\ postgres:///gemstash
145
+ \f[]
146
+ .fi
147
+ .PP
148
+ Regardless of the adapter you choose, the database will automatically
149
+ migrate to your version of Gemstash whenever the database is needed.
150
+ Except for \f[C]sqlite3\f[], you only need to ensure the database exists
151
+ and Gemstash will do the rest.
152
+ .SS CACHE
153
+ .PP
154
+ Certain things (like dependencies) are cached in memory.
155
+ This avoids web calls to the gem source, and database calls for private
156
+ gems.
157
+ The memory cache can optionally be swapped out with a
158
+ Memcached (http://memcached.org/) server (or cluster of servers).
159
+ To use Memcached, you must update the \f[C]:cache_type\f[] configuration
160
+ key to be \f[C]memcached\f[], and provide the servers via the
161
+ \f[C]:memcached_servers\f[] configuration key:
162
+ .IP
163
+ .nf
164
+ \f[C]
165
+ #\ ~/.gemstash/config.yml
166
+ \-\-\-
167
+ :cache_type:\ memcached
168
+ :memcached_servers:\ memcached1.local:11211,memcached2.local:11211
169
+ \f[]
170
+ .fi
171
+ .PP
172
+ Note that the \f[C]:memcached_servers\f[] requires a comma separated
173
+ list of servers.
174
+ All caching lasts for 30 minutes.
175
+ .SS SERVER
176
+ .PP
177
+ Gemstash uses Puma (http://puma.io/) and Rack (http://rack.github.io/)
178
+ as the server.
179
+ Alternate server configurations are not currently supported, but you can
180
+ take a look at the Puma
181
+ configuration (https://github.com/bundler/gemstash/blob/master/lib/gemstash/puma.rb)
182
+ and the rackup
183
+ file (https://github.com/bundler/gemstash/blob/master/lib/gemstash/config.ru)
184
+ for inspiration.
185
+ .PP
186
+ While the server is not customizable, the way Gemstash binds the port
187
+ can be changed.
188
+ To change the binding, update the \f[C]:bind\f[] configuration key:
189
+ .IP
190
+ .nf
191
+ \f[C]
192
+ #\ ~/.gemstash/config.yml
193
+ \-\-\-
194
+ :bind:\ tcp://0.0.0.0:4242
195
+ \f[]
196
+ .fi
197
+ .PP
198
+ This maps directly to the Puma bind
199
+ flag (https://github.com/puma/puma#binding-tcp--sockets), and will
200
+ support anything valid for that flag.
201
+ .SS CONFIG FILE LOCATION
202
+ .PP
203
+ By default, configuration for Gemstash will be at
204
+ \f[C]~/.gemstash/config.yml\f[].
205
+ This can be changed by providing the \f[C]\-\-config\-file\f[] option to
206
+ the various Gemstash commands:
207
+ .IP
208
+ .nf
209
+ \f[C]
210
+ $\ gemstash\ setup\ \-\-config\-file\ ./gemstash\-config.yml
211
+ $\ gemstash\ authorize\ \-\-config\-file\ ./gemstash\-config.yml
212
+ $\ gemstash\ start\ \-\-config\-file\ ./gemstash\-config.yml
213
+ $\ gemstash\ stop\ \-\-config\-file\ ./gemstash\-config.yml
214
+ $\ gemstash\ status\ \-\-config\-file\ ./gemstash\-config.yml
215
+ \f[]
216
+ .fi
217
+ .PP
218
+ When providing \f[C]\-\-config\-file\f[] to \f[C]gemstash\ setup\f[],
219
+ the provided file will be output to with the provided configuration.
220
+ \f[B]This will overwrite\f[] any existing configuration.
221
+ If the file doesn\[aq]t exist when providing \f[C]\-\-config\-file\f[]
222
+ to \f[C]gemstash\ start\f[], \f[C]gemstash\ stop\f[],
223
+ \f[C]gemstash\ status\f[], and \f[C]gemstash\ authorize\f[], the default
224
+ configuration will be used.
@@ -0,0 +1,137 @@
1
+ gemstash-customize(7) gemstash-customize(7)
2
+
3
+
4
+
5
+ CUSTOMIZING THE SERVER
6
+ Although Gemstash is designed for as minimal setup as possible, there
7
+ may be times you will want to change some of the default configuration.
8
+ By the end of this guide, you will be able to customize some of the
9
+ Gemstash behavior, including where files are stored, what database Gem-
10
+ stash uses, and how Gemstash caches certain requests.
11
+
12
+ SETUP
13
+ Several customizable options are available via an interactive Gemstash
14
+ command. Run gemstash setup and answer the questions it provides (a
15
+ blank answer will use the default value):
16
+
17
+ $ gemstash setup
18
+ Where should files go? [~/.gemstash]
19
+ Cache with what? [MEMORY, memcached] memcached
20
+ What is the comma separated Memcached servers? [local-
21
+ host:11211]
22
+ What database adapter? [SQLITE3, postgres] postgres
23
+ Where is the database? [postgres:///gemstash]
24
+ Checking that the cache is available
25
+ Checking that the database is available
26
+ The database is not available
27
+
28
+ Once you've answered the questsions, some checks will be made to ensure
29
+ the configuration will work. For example, the database didn't exist in
30
+ the previous example, so the command failed and the configuration
31
+ wasn't saved. If the command passes, you may provide the --redo option
32
+ to force configuration to be redone:
33
+
34
+ $ gemstash setup --redo
35
+ Where should files go? [~/.gemstash]
36
+ Cache with what? [MEMORY, memcached] memcached
37
+ What is the comma separated Memcached servers? [local-
38
+ host:11211]
39
+ What database adapter? [SQLITE3, postgres]
40
+ Checking that the cache is available
41
+ Checking that the database is available
42
+ You are all setup!
43
+
44
+ Once all checks have passed, Gemstash will store your answers in the
45
+ configuration file located at ~/.gemstash/config.yml.
46
+
47
+ FILES
48
+ Storage in Gemstash defaults to ~/.gemstash unless otherwise specified.
49
+ You can change this in your config file via the :base_path key:
50
+
51
+ # ~/.gemstash/config.yml
52
+ ---
53
+ :base_path: "/var/gemstash"
54
+
55
+ When customizing the base_path, the directory must exist, otherwise
56
+ Gemstash will fail to run. Thus, if you want to use /var/gemstash like
57
+ in the previous example, make sure to mkdir /var/gemstash and grant ac-
58
+ cess to the directory for the user you run Gemstash with.
59
+
60
+ DATABASE
61
+ The :db_adapter configuration key specifies what database you will be
62
+ using. The default :db_adapter is sqlite3 (https://www.sqlite.org/),
63
+ which will use a database file located within your :base_path. The
64
+ database file will always be named gemstash.db.
65
+
66
+ You may also use postgres (http://www.postgresql.org/) for your
67
+ :db_adapter. When using PostgreSQL, you need to specify the :db_url to
68
+ point to an existing database. Here is an example configuration to use
69
+ the postgres adapter:
70
+
71
+ # ~/.gemstash/config.yml
72
+ ---
73
+ :db_adapter: postgres
74
+ :db_url: postgres:///gemstash
75
+
76
+ Regardless of the adapter you choose, the database will automatically
77
+ migrate to your version of Gemstash whenever the database is needed.
78
+ Except for sqlite3, you only need to ensure the database exists and
79
+ Gemstash will do the rest.
80
+
81
+ CACHE
82
+ Certain things (like dependencies) are cached in memory. This avoids
83
+ web calls to the gem source, and database calls for private gems. The
84
+ memory cache can optionally be swapped out with a Memcached
85
+ (http://memcached.org/) server (or cluster of servers). To use Mem-
86
+ cached, you must update the :cache_type configuration key to be mem-
87
+ cached, and provide the servers via the :memcached_servers configura-
88
+ tion key:
89
+
90
+ # ~/.gemstash/config.yml
91
+ ---
92
+ :cache_type: memcached
93
+ :memcached_servers: memcached1.local:11211,memcached2.local:11211
94
+
95
+ Note that the :memcached_servers requires a comma separated list of
96
+ servers. All caching lasts for 30 minutes.
97
+
98
+ SERVER
99
+ Gemstash uses Puma (http://puma.io/) and Rack (http://rack.github.io/)
100
+ as the server. Alternate server configurations are not currently sup-
101
+ ported, but you can take a look at the Puma configuration
102
+ (https://github.com/bundler/gemstash/blob/master/lib/gemstash/puma.rb)
103
+ and the rackup file (https://github.com/bundler/gemstash/blob/mas-
104
+ ter/lib/gemstash/config.ru) for inspiration.
105
+
106
+ While the server is not customizable, the way Gemstash binds the port
107
+ can be changed. To change the binding, update the :bind configuration
108
+ key:
109
+
110
+ # ~/.gemstash/config.yml
111
+ ---
112
+ :bind: tcp://0.0.0.0:4242
113
+
114
+ This maps directly to the Puma bind flag
115
+ (https://github.com/puma/puma#binding-tcp--sockets), and will support
116
+ anything valid for that flag.
117
+
118
+ CONFIG FILE LOCATION
119
+ By default, configuration for Gemstash will be at ~/.gemstash/con-
120
+ fig.yml. This can be changed by providing the --config-file option to
121
+ the various Gemstash commands:
122
+
123
+ $ gemstash setup --config-file ./gemstash-config.yml
124
+ $ gemstash authorize --config-file ./gemstash-config.yml
125
+ $ gemstash start --config-file ./gemstash-config.yml
126
+ $ gemstash stop --config-file ./gemstash-config.yml
127
+ $ gemstash status --config-file ./gemstash-config.yml
128
+
129
+ When providing --config-file to gemstash setup, the provided file will
130
+ be output to with the provided configuration. This will overwrite any
131
+ existing configuration. If the file doesn't exist when providing
132
+ --config-file to gemstash start, gemstash stop, gemstash status, and
133
+ gemstash authorize, the default configuration will be used.
134
+
135
+
136
+
137
+ October 28, 2015 gemstash-customize(7)
@@ -0,0 +1,34 @@
1
+ .\" Automatically generated by Pandoc 1.16.0.2
2
+ .\"
3
+ .TH "gemstash\-debugging" "7" "October 28, 2015" "" ""
4
+ .hy
5
+ .SH DEBUGGING GEMSTASH
6
+ .PP
7
+ If you are finding Gemstash isn\[aq]t behaving as you would expect, you
8
+ might want to start by looking at the server log.
9
+ You can find the log at \f[C]server.log\f[] within your base directory.
10
+ By default, this will be at \f[C]~/.gemstash/server.log\f[].
11
+ .PP
12
+ You might find it easier to view the log directly in your terminal.
13
+ If you run Gemstash in non\-daemonized form (gemstash help start.1), the
14
+ log will be output directly to standard out:
15
+ .IP
16
+ .nf
17
+ \f[C]
18
+ $\ gemstash\ start\ \-\-no\-daemonize
19
+ \f[]
20
+ .fi
21
+ .PP
22
+ You can also check the status (gemstash help status.1) of the server:
23
+ .IP
24
+ .nf
25
+ \f[C]
26
+ $\ gemstash\ status
27
+ \f[]
28
+ .fi
29
+ .PP
30
+ The server status is checked by passing through to
31
+ pumactl (https://github.com/puma/puma#pumactl).
32
+ .PP
33
+ If you find a bug, please don\[aq]t hesitate to open a bug
34
+ report (https://github.com/bundler/gemstash#contributing)!
@@ -0,0 +1,29 @@
1
+ gemstash-debugging(7) gemstash-debugging(7)
2
+
3
+
4
+
5
+ DEBUGGING GEMSTASH
6
+ If you are finding Gemstash isn't behaving as you would expect, you
7
+ might want to start by looking at the server log. You can find the log
8
+ at server.log within your base directory. By default, this will be at
9
+ ~/.gemstash/server.log.
10
+
11
+ You might find it easier to view the log directly in your terminal. If
12
+ you run Gemstash in non-daemonized form (gemstash help start.1), the
13
+ log will be output directly to standard out:
14
+
15
+ $ gemstash start --no-daemonize
16
+
17
+ You can also check the status (gemstash help status.1) of the server:
18
+
19
+ $ gemstash status
20
+
21
+ The server status is checked by passing through to pumactl
22
+ (https://github.com/puma/puma#pumactl).
23
+
24
+ If you find a bug, please don't hesitate to open a bug report
25
+ (https://github.com/bundler/gemstash#contributing)!
26
+
27
+
28
+
29
+ October 28, 2015 gemstash-debugging(7)
@@ -0,0 +1,40 @@
1
+ .\" Automatically generated by Pandoc 1.16.0.2
2
+ .\"
3
+ .TH "gemstash\-deploy" "7" "October 25, 2015" "" ""
4
+ .hy
5
+ .SH DEPLOYING GEMSTASH
6
+ .PP
7
+ Bundler is here for the rescue to keep Gemstash up to date! Create a
8
+ \f[C]Gemfile\f[] pointing to Gemstash:
9
+ .IP
10
+ .nf
11
+ \f[C]
12
+ #\ ./Gemfile
13
+ source\ "https://rubygems.org"
14
+ gem\ "gemstash"
15
+ \f[]
16
+ .fi
17
+ .PP
18
+ Then \f[C]bundle\f[] to create your \f[C]Gemfile.lock\f[].
19
+ When you are ready to upgrade, simply \f[C]bundle\ update\f[].
20
+ You may need to run \f[C]gemstash\f[] via \f[C]bundle\ exec\f[].
21
+ Alternatively, you can \f[C]gem\ uninstall\ gemstash\f[] and
22
+ \f[C]gem\ install\ gemstash\f[] when you want to upgrade.
23
+ .PP
24
+ Gemstash will automatically run any necessary migrations, so updating
25
+ the gem is all that needs to be done.
26
+ .PP
27
+ It is probably wise to stop Gemstash before upgrading, then starting
28
+ again once you are done:
29
+ .IP
30
+ .nf
31
+ \f[C]
32
+ $\ bundle\ exec\ gemstash\ stop
33
+ $\ bundle\ update
34
+ $\ bundle\ exec\ gemstash\ start
35
+ \f[]
36
+ .fi
37
+ .SS DOWNGRADING
38
+ .PP
39
+ It is not recommended to go backwards in Gemstash versions.
40
+ Migrations may have run that could leave the database in a bad state.