stickler 2.3.0 → 2.4.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.
- checksums.yaml +15 -0
- data/CONTRIBUTING.md +5 -4
- data/HISTORY.md +16 -9
- data/LICENSE +1 -1
- data/Manifest.txt +34 -20
- data/README.md +128 -0
- data/Rakefile +10 -9
- data/bin/stickler +9 -6
- data/bin/stickler-passenger-config +8 -8
- data/bin/stickler-server +12 -12
- data/examples/as_middleware.ru +14 -0
- data/examples/auth_repo.ru +1 -1
- data/examples/gemcutter_repo.ru +1 -1
- data/examples/local_repo.ru +1 -1
- data/lib/stickler.rb +3 -1
- data/lib/stickler/client.rb +2 -1
- data/lib/stickler/client/delete.rb +1 -1
- data/lib/stickler/client/latest-version.rb +40 -0
- data/lib/stickler/client/mirror.rb +47 -15
- data/lib/stickler/client/push.rb +1 -1
- data/lib/stickler/client/unyank.rb +1 -1
- data/lib/stickler/client/yank.rb +1 -1
- data/lib/stickler/gem_container.rb +40 -0
- data/lib/stickler/gemfile_lock_parser.rb +47 -0
- data/lib/stickler/middleware.rb +1 -0
- data/lib/stickler/middleware/server.rb +37 -0
- data/lib/stickler/repository/api.rb +16 -0
- data/lib/stickler/repository/index.rb +0 -3
- data/lib/stickler/repository/local.rb +6 -8
- data/lib/stickler/repository/remote.rb +29 -7
- data/lib/stickler/server.rb +2 -6
- data/man/stickler-passenger-config.1 +2 -22
- data/man/stickler-server.1 +9 -99
- data/man/stickler.1 +15 -173
- data/man/stickler.1.ronn +6 -0
- data/tasks/default.rake +16 -18
- data/tasks/man.rake +7 -0
- data/tasks/this.rb +5 -5
- data/test/data/Gemfile.lock.example +56 -0
- data/{spec → test}/data/gemcutter/gems/foo-1.0.0.gem +0 -0
- data/{spec → test}/data/gems/bar-1.0.0.gem +0 -0
- data/{spec → test}/data/gems/baz-3.1.4-java.gem +0 -0
- data/{spec → test}/data/gems/baz-3.1.4.gem +0 -0
- data/{spec → test}/data/gems/foo-1.0.0.gem +0 -0
- data/{spec → test}/data/gems/foo-2.0.0a.gem +0 -0
- data/test/data/specifications/bar-1.0.0.gemspec +31 -0
- data/test/data/specifications/baz-3.1.4-java.gemspec +32 -0
- data/test/data/specifications/baz-3.1.4.gemspec +31 -0
- data/test/data/specifications/foo-1.0.0.gemspec +31 -0
- data/test/data/specifications/foo-2.0.0a.gemspec +32 -0
- data/test/index_test_helpers.rb +75 -0
- data/test/middleware/test_local.rb +75 -0
- data/test/middleware/test_not_found.rb +26 -0
- data/test/repository/test_api.rb +49 -0
- data/test/repository/test_api_behavior.rb +208 -0
- data/test/repository/test_index.rb +48 -0
- data/test/repository/test_local.rb +59 -0
- data/test/repository/test_null.rb +15 -0
- data/test/repository/test_remote.rb +26 -0
- data/test/repository/test_remote_authenticated.rb +39 -0
- data/test/stickler_test_server.rb +35 -0
- data/test/test_gemfile_lock_parser.rb +28 -0
- data/test/test_paths.rb +22 -0
- data/test/test_spec_lite.rb +90 -0
- data/test/test_stickler.rb +49 -0
- metadata +58 -85
- data/README.rdoc +0 -156
- data/spec/index_spec_helpers.rb +0 -73
- data/spec/middleware/local_spec.rb +0 -72
- data/spec/middleware/not_found_spec.rb +0 -25
- data/spec/paths_spec.rb +0 -11
- data/spec/repository/api_behavior.rb +0 -192
- data/spec/repository/api_spec.rb +0 -37
- data/spec/repository/index_spec.rb +0 -46
- data/spec/repository/local_spec.rb +0 -49
- data/spec/repository/null_spec.rb +0 -14
- data/spec/repository/remote_spec.rb +0 -86
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -24
- data/spec/spec_lite_spec.rb +0 -96
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjZmM2E2ZmQyN2JmMTQ3YjFjZGMyMjg5ODc1MzgyMWY5MDE5NmRlMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZDdiZTVmZGQyNzNhNzBmYWZhYjg1MGQ1NTZlMGE5MjIyMjg3YzM1Ng==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OWM1ZWJjMzc0ZWUyYzlhYWJlOGI0OWUxYTM0YTJmNmUzYjg4NWE5NGM5MGY1
|
10
|
+
YjEyYjk2OWY1OTBlYWIwZDFiNDFkZDAyZWUyNjlmZThkYTgyZjU0Mzc5M2Fk
|
11
|
+
ZDY3Mzc2ZGY1MmJhMDNmMWFhZGM5ZWY0Yzc3ZWY2Yzg4ZGMwNWI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzMxNjczN2I2NTY5ZTZiZWIxNzI4NjM4MTM3OGJlNDk1Nzg2MDcwYWQ2YjAz
|
14
|
+
OWUzNWVjMmVkMDA4NWI2YjJkN2ZmYjcwOThmZGFlNDM2OTU1MjBkODQ1ZmY3
|
15
|
+
YjA3ODNmNTQ1YWY2NDEyNjhkOTk5ZjQyN2VhMjAyNTY4OTk5YzQ=
|
data/CONTRIBUTING.md
CHANGED
@@ -35,10 +35,11 @@ easiest way to contribute.
|
|
35
35
|
|
36
36
|
# Contributors
|
37
37
|
|
38
|
-
* [Jeremy Hinegardner]
|
39
|
-
* [Kevin Barnes]
|
40
|
-
* [Philip Roberts]
|
41
|
-
* [Alan Gardner]
|
38
|
+
* [Jeremy Hinegardner](https://github.com/copiousfreetime)
|
39
|
+
* [Kevin Barnes](https://github.com/vinbarnes)
|
40
|
+
* [Philip Roberts](https://github.com/latentflip)
|
41
|
+
* [Alan Gardner](https://github.com/urfolomeus)
|
42
|
+
* [tiago.nobre](https://github.com/macwadu)
|
42
43
|
|
43
44
|
[GitHub Account]: https://github.com/signup/free "GitHub Signup"
|
44
45
|
[GitHub Issues]: https://github.com/copiousfreetime/stickler/issues "Stickler Issues"
|
data/HISTORY.md
CHANGED
@@ -2,23 +2,30 @@ Stickler Changelog
|
|
2
2
|
==================
|
3
3
|
Jeremy Hinegardner <jeremy@copiousfreetime.org>
|
4
4
|
|
5
|
+
Version 2.4.0 - 2013-11-13
|
6
|
+
--------------------------
|
7
|
+
* Ruby 2.0 compatibility <http://github.com/copiousfreetime/stickler/issues/28>
|
8
|
+
* Implement latest-version command <http://github.com/copiousfreetime/stickler/issues/29>
|
9
|
+
* Extract Server functionality to Middleware <http://github.com/copiousfreetime/stickler/issues/33>
|
10
|
+
* Updated dependencies to latest versions
|
11
|
+
|
5
12
|
Version 2.3.0 - 2013-03-09
|
6
13
|
--------------------------
|
7
|
-
* Expose deleting a gem via the stickler commandline
|
8
|
-
* Update dependencies for Excon so http proxy works
|
9
|
-
* Implement unyank for local and remote repositories
|
14
|
+
* Expose deleting a gem via the stickler commandline <http://github.com/copiousfreetime/stickler/issues/10>
|
15
|
+
* Update dependencies for Excon so http proxy works http://github.com/copiousfreetime/stickler/issues/24>
|
16
|
+
* Implement unyank for local and remote repositories <http://github.com/copiousfreetime/stickler/issues/26>
|
10
17
|
* Updated dependencies to latest versions
|
11
18
|
|
12
19
|
Version 2.2.4 - 2012-02-26
|
13
20
|
--------------------------
|
14
|
-
* Fixed authentication failing on mirror command
|
21
|
+
* Fixed authentication failing on mirror command <http://github.com/copiousfreetime/stickler/issues/12>
|
15
22
|
* Fixed 'list' command not working when no flags where given
|
16
|
-
* Fixed latest_specs not having all platforms in it
|
23
|
+
* Fixed latest_specs not having all platforms in it <http://github.com/copiousfreetime/stickler/issues/21>
|
17
24
|
|
18
25
|
Version 2.2.2 - 2012-02-13
|
19
26
|
--------------------------
|
20
27
|
* Updated dependencies to latest versions
|
21
|
-
* Added supoort for
|
28
|
+
* Added supoort for <http Basic Auth in the client
|
22
29
|
|
23
30
|
Version 2.1.4 - 2011-09-09
|
24
31
|
--------------------------
|
@@ -26,9 +33,9 @@ Version 2.1.4 - 2011-09-09
|
|
26
33
|
|
27
34
|
Version 2.1.3 - 2011-07-24
|
28
35
|
--------------------------
|
29
|
-
* Do not feed ARGV strings directly into Gem::Version
|
30
|
-
* In web page, display gems in sort order, not lexical order
|
31
|
-
* Make sure Rack body's respond to #each
|
36
|
+
* Do not feed ARGV strings directly into Gem::Version <http://github.com/copiousfreetime/stickler/issues/4>
|
37
|
+
* In web page, display gems in sort order, not lexical order <http://github.com/copiousfreetime/stickler/issues/16>
|
38
|
+
* Make sure Rack body's respond to #each <http://github.com/copiousfreetime/stickler/issues/17>
|
32
39
|
|
33
40
|
Version 2.1.2 - 2011-03-31
|
34
41
|
--------------------------
|
data/LICENSE
CHANGED
data/Manifest.txt
CHANGED
@@ -2,11 +2,12 @@ CONTRIBUTING.md
|
|
2
2
|
HISTORY.md
|
3
3
|
LICENSE
|
4
4
|
Manifest.txt
|
5
|
-
README.
|
5
|
+
README.md
|
6
6
|
Rakefile
|
7
7
|
bin/stickler
|
8
8
|
bin/stickler-passenger-config
|
9
9
|
bin/stickler-server
|
10
|
+
examples/as_middleware.ru
|
10
11
|
examples/auth_repo.ru
|
11
12
|
examples/config.ru
|
12
13
|
examples/fetch-a-gem
|
@@ -20,12 +21,15 @@ lib/stickler/client.rb
|
|
20
21
|
lib/stickler/client/config.rb
|
21
22
|
lib/stickler/client/config_file.rb
|
22
23
|
lib/stickler/client/delete.rb
|
24
|
+
lib/stickler/client/latest-version.rb
|
23
25
|
lib/stickler/client/list.rb
|
24
26
|
lib/stickler/client/mirror.rb
|
25
27
|
lib/stickler/client/push.rb
|
26
28
|
lib/stickler/client/unyank.rb
|
27
29
|
lib/stickler/client/yank.rb
|
28
30
|
lib/stickler/error.rb
|
31
|
+
lib/stickler/gem_container.rb
|
32
|
+
lib/stickler/gemfile_lock_parser.rb
|
29
33
|
lib/stickler/logable.rb
|
30
34
|
lib/stickler/middleware.rb
|
31
35
|
lib/stickler/middleware/compression.rb
|
@@ -35,6 +39,7 @@ lib/stickler/middleware/index.rb
|
|
35
39
|
lib/stickler/middleware/local.rb
|
36
40
|
lib/stickler/middleware/mirror.rb
|
37
41
|
lib/stickler/middleware/not_found.rb
|
42
|
+
lib/stickler/middleware/server.rb
|
38
43
|
lib/stickler/paths.rb
|
39
44
|
lib/stickler/repository.rb
|
40
45
|
lib/stickler/repository/api.rb
|
@@ -63,24 +68,33 @@ man/stickler-server.1
|
|
63
68
|
man/stickler-server.1.ronn
|
64
69
|
man/stickler.1
|
65
70
|
man/stickler.1.ronn
|
66
|
-
spec/data/gemcutter/gems/foo-1.0.0.gem
|
67
|
-
spec/data/gems/bar-1.0.0.gem
|
68
|
-
spec/data/gems/baz-3.1.4-java.gem
|
69
|
-
spec/data/gems/baz-3.1.4.gem
|
70
|
-
spec/data/gems/foo-1.0.0.gem
|
71
|
-
spec/data/gems/foo-2.0.0a.gem
|
72
|
-
spec/index_spec_helpers.rb
|
73
|
-
spec/middleware/local_spec.rb
|
74
|
-
spec/middleware/not_found_spec.rb
|
75
|
-
spec/paths_spec.rb
|
76
|
-
spec/repository/api_behavior.rb
|
77
|
-
spec/repository/api_spec.rb
|
78
|
-
spec/repository/index_spec.rb
|
79
|
-
spec/repository/local_spec.rb
|
80
|
-
spec/repository/null_spec.rb
|
81
|
-
spec/repository/remote_spec.rb
|
82
|
-
spec/spec.opts
|
83
|
-
spec/spec_helper.rb
|
84
|
-
spec/spec_lite_spec.rb
|
85
71
|
tasks/default.rake
|
72
|
+
tasks/man.rake
|
86
73
|
tasks/this.rb
|
74
|
+
test/data/Gemfile.lock.example
|
75
|
+
test/data/gemcutter/gems/foo-1.0.0.gem
|
76
|
+
test/data/gems/bar-1.0.0.gem
|
77
|
+
test/data/gems/baz-3.1.4-java.gem
|
78
|
+
test/data/gems/baz-3.1.4.gem
|
79
|
+
test/data/gems/foo-1.0.0.gem
|
80
|
+
test/data/gems/foo-2.0.0a.gem
|
81
|
+
test/data/specifications/bar-1.0.0.gemspec
|
82
|
+
test/data/specifications/baz-3.1.4-java.gemspec
|
83
|
+
test/data/specifications/baz-3.1.4.gemspec
|
84
|
+
test/data/specifications/foo-1.0.0.gemspec
|
85
|
+
test/data/specifications/foo-2.0.0a.gemspec
|
86
|
+
test/index_test_helpers.rb
|
87
|
+
test/middleware/test_local.rb
|
88
|
+
test/middleware/test_not_found.rb
|
89
|
+
test/repository/test_api.rb
|
90
|
+
test/repository/test_api_behavior.rb
|
91
|
+
test/repository/test_index.rb
|
92
|
+
test/repository/test_local.rb
|
93
|
+
test/repository/test_null.rb
|
94
|
+
test/repository/test_remote.rb
|
95
|
+
test/repository/test_remote_authenticated.rb
|
96
|
+
test/stickler_test_server.rb
|
97
|
+
test/test_gemfile_lock_parser.rb
|
98
|
+
test/test_paths.rb
|
99
|
+
test/test_spec_lite.rb
|
100
|
+
test/test_stickler.rb
|
data/README.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
# Stickler
|
2
|
+
|
3
|
+
* [Homepage](http://github.com/copiousfreetime/stickler)
|
4
|
+
* [GitHub](http://github.com/copiousfreetime/stickler)
|
5
|
+
* email jeremy at copiousfreetime dot org
|
6
|
+
* `git clone git://github.com/copiousfreetime/stickler.git`
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
Stickler is a tool to organize and maintain an internal gem repository.
|
11
|
+
Primarily, you would want to use Stickler if:
|
12
|
+
|
13
|
+
1. You have proprietary gems that you want to have available via a gem server so
|
14
|
+
you may `gem install` them.
|
15
|
+
2. You would like to have a local mirror of third party gems from either
|
16
|
+
http://rubygems.org or some other gem server.
|
17
|
+
3. You want both (1) and (2) in the same server.
|
18
|
+
|
19
|
+
|
20
|
+
## INSTALLATION
|
21
|
+
|
22
|
+
Installing stickler may be done via the standard gem installation
|
23
|
+
|
24
|
+
gem install stickler
|
25
|
+
|
26
|
+
Or downloaded from http://github.com/copiousfreetime/stickler/downloads
|
27
|
+
|
28
|
+
|
29
|
+
## USAGE
|
30
|
+
|
31
|
+
Stickler is broken up into a few commandline programs.
|
32
|
+
|
33
|
+
* **stickler** - Used to mainpulate gems that are in a stickler-server.
|
34
|
+
* **stickler-server** - The server process that manages gems.
|
35
|
+
* **stickler-passenger-config** - A helper process to generate Passenger configurations for
|
36
|
+
|
37
|
+
The easiest way to get up and running with stickler is to run the standalone
|
38
|
+
server `stickler-server` and then use `stickler` to interact with it.
|
39
|
+
|
40
|
+
### Start up a standalone stickler server
|
41
|
+
|
42
|
+
% mkdir -p /tmp/stickler-test
|
43
|
+
% stickler-server start --daemonize /tmp/stickler-test
|
44
|
+
|
45
|
+
### Set some sane defaults
|
46
|
+
|
47
|
+
% stickler config --add --server http://localhost:6789 --upstream https://rubygems.org
|
48
|
+
server : http://localhost:6789
|
49
|
+
upstream : https://rubygems.org
|
50
|
+
|
51
|
+
% cat ~/.gem/stickler
|
52
|
+
---
|
53
|
+
:server: http://localhost:6789
|
54
|
+
:upstream: https://rubygems.org
|
55
|
+
|
56
|
+
### Take a few gems and push them to the server
|
57
|
+
|
58
|
+
% ls -1
|
59
|
+
heel-2.0.0.gem
|
60
|
+
hitimes-1.1.1.gem
|
61
|
+
launchy-0.3.5.gem
|
62
|
+
stickler-2.0.0.gem
|
63
|
+
|
64
|
+
% stickler push *.gem
|
65
|
+
Pushing gem(s) to http://localhost:6789/ ...
|
66
|
+
/Users/jeremy/tmp/gems/heel-2.0.0.gem -> OK http://localhost:6789/gems/heel-2.0.0.gem
|
67
|
+
/Users/jeremy/tmp/gems/hitimes-1.1.1.gem -> OK http://localhost:6789/gems/hitimes-1.1.1.gem
|
68
|
+
/Users/jeremy/tmp/gems/launchy-0.3.5.gem -> OK http://localhost:6789/gems/launchy-0.3.5.gem
|
69
|
+
/Users/jeremy/tmp/gems/stickler-2.0.0.gem -> OK http://localhost:6789/gems/stickler-2.0.0.gem
|
70
|
+
|
71
|
+
### Mirror a gem from upstream
|
72
|
+
|
73
|
+
% stickler mirror --gem-version 1.4.3 logging
|
74
|
+
Asking http://localhost:6789/ to mirror logging-1.4.3 from rubygems.org : OK -> http://localhost:6789/gems/logging-1.4.3.gem
|
75
|
+
% stickler mirror --gem-version 1.16.2 trollop
|
76
|
+
Asking http://localhost:6789/ to mirror trollop-1.16.2 from rubygems.org : OK -> http://localhost:6789/gems/trollop-1.16.2.gem
|
77
|
+
|
78
|
+
### Look at all the gems installed in your stickler server
|
79
|
+
|
80
|
+
Open your browser to http://localhost:6789
|
81
|
+
|
82
|
+
% launchy http://localhost:6789
|
83
|
+
|
84
|
+
### Install a gem from your new stickler gem server
|
85
|
+
|
86
|
+
% gem install hitimes --source http://localhost:6789/
|
87
|
+
|
88
|
+
### Configure your servers to globally use your internal stickler gem server
|
89
|
+
|
90
|
+
% cat /etc/gemrc
|
91
|
+
---
|
92
|
+
:benchmark: false
|
93
|
+
:verbose: false
|
94
|
+
:update_sources: true
|
95
|
+
:bulk_threshold: 1000
|
96
|
+
:backtrace: false
|
97
|
+
:sources:
|
98
|
+
- http://stickler.example.com
|
99
|
+
gem: --no-rdoc --no-ri
|
100
|
+
|
101
|
+
## See Also
|
102
|
+
|
103
|
+
The man pages that ship with the gem. They may be viewed if you also install
|
104
|
+
the [gem-man](http://defunkt.github.com/gem-man/) gem.
|
105
|
+
|
106
|
+
% gem install gem-man
|
107
|
+
% gem man stickler
|
108
|
+
View which manual?
|
109
|
+
1. stickler-passenger-config(1)
|
110
|
+
2. stickler-server(1)
|
111
|
+
3. stickler(1)
|
112
|
+
>
|
113
|
+
|
114
|
+
## DEVELOPMENT
|
115
|
+
|
116
|
+
If you want to do development on stickler, please see
|
117
|
+
[CONTRIBUTING.md](./CONTRIBUTING.md)
|
118
|
+
|
119
|
+
|
120
|
+
## CREDITS
|
121
|
+
|
122
|
+
* [The Rubygems Team](https://github.com/rubygems/rubygems)
|
123
|
+
|
124
|
+
|
125
|
+
## LICENSE
|
126
|
+
|
127
|
+
Copyright (C) 2008-2013 Jeremy Hinegardner ISC License, See [LICENSE](./LICENSE) for details.
|
128
|
+
|
data/Rakefile
CHANGED
@@ -8,20 +8,21 @@ This.homepage = "http://github.com/copiousfreetime/#{ This.name }"
|
|
8
8
|
|
9
9
|
|
10
10
|
This.ruby_gemspec do |spec|
|
11
|
-
spec.add_runtime_dependency( 'sinatra' , '~> 1.
|
12
|
-
spec.add_runtime_dependency( 'addressable', '~> 2.3
|
13
|
-
spec.add_runtime_dependency( 'excon' , '~> 0.
|
11
|
+
spec.add_runtime_dependency( 'sinatra' , '~> 1.4' )
|
12
|
+
spec.add_runtime_dependency( 'addressable', '~> 2.3' )
|
13
|
+
spec.add_runtime_dependency( 'excon' , '~> 0.29' )
|
14
14
|
spec.add_runtime_dependency( 'trollop' , '~> 2.0' )
|
15
15
|
spec.add_runtime_dependency( 'logging' , '~> 1.8.1' )
|
16
16
|
|
17
17
|
# The Development Dependencies
|
18
|
-
spec.add_development_dependency( 'rake' , '~> 10.
|
19
|
-
spec.add_development_dependency( 'rack-test' , '~> 0.6.2'
|
20
|
-
spec.add_development_dependency( 'builder' , '~> 3.2
|
21
|
-
spec.add_development_dependency( '
|
22
|
-
spec.add_development_dependency( 'rdoc' , '~> 4.0'
|
23
|
-
spec.add_development_dependency( 'ronn' , '~> 0.7.3'
|
18
|
+
spec.add_development_dependency( 'rake' , '~> 10.1' )
|
19
|
+
spec.add_development_dependency( 'rack-test' , '~> 0.6.2' )
|
20
|
+
spec.add_development_dependency( 'builder' , '~> 3.2' )
|
21
|
+
spec.add_development_dependency( 'minitest' , '~> 5.0' )
|
22
|
+
spec.add_development_dependency( 'rdoc' , '~> 4.0' )
|
23
|
+
spec.add_development_dependency( 'ronn' , '~> 0.7.3' )
|
24
24
|
|
25
25
|
end
|
26
26
|
|
27
27
|
load 'tasks/default.rake'
|
28
|
+
load 'tasks/man.rake'
|
data/bin/stickler
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
require 'stickler'
|
4
4
|
require 'stickler/client'
|
5
5
|
|
6
|
-
SUB_COMMANDS = %w[ push yank mirror config list delete unyank ].sort
|
6
|
+
SUB_COMMANDS = %w[ push yank mirror config list delete unyank latest-version ].sort
|
7
7
|
exec_name = File.basename( $0 )
|
8
8
|
|
9
|
-
|
9
|
+
# ---------------------------------------------------------------------
|
10
10
|
# parse through the top level global options, this is intercept
|
11
11
|
# --version and --help
|
12
|
-
|
12
|
+
# ---------------------------------------------------------------------
|
13
13
|
global_options = Trollop::options do
|
14
14
|
version "Stickler #{Stickler::VERSION}"
|
15
15
|
banner <<-_
|
@@ -25,7 +25,8 @@ Stickler server interaction
|
|
25
25
|
#{exec_name} mirror --help
|
26
26
|
#{exec_name} config --server http://stickler.example.com --upstream http://rubygems.org/
|
27
27
|
#{exec_name} list --server http://stickler.example.com
|
28
|
-
#{exec_name} delete my_gem --gem-version 1.2.3 --server
|
28
|
+
#{exec_name} delete my_gem --gem-version 1.2.3 --server http://stickler.example.com/
|
29
|
+
#{exec_name} latest-version my_gem --server http://stickler.example.com
|
29
30
|
|
30
31
|
Options:
|
31
32
|
_
|
@@ -33,9 +34,9 @@ _
|
|
33
34
|
stop_on SUB_COMMANDS
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
+
# ---------------------------------------------------------------------
|
37
38
|
# sub command processing
|
38
|
-
|
39
|
+
# ---------------------------------------------------------------------
|
39
40
|
cmd = ARGV.shift
|
40
41
|
Trollop::die "No sub command given" unless cmd
|
41
42
|
Trollop::die "Unknown sub command #{cmd.inspect}" unless SUB_COMMANDS.include?( cmd )
|
@@ -56,5 +57,7 @@ when "config"
|
|
56
57
|
::Stickler::Client::Config.new( ARGV ).run
|
57
58
|
when "list"
|
58
59
|
::Stickler::Client::List.new( ARGV ).run
|
60
|
+
when "latest-version"
|
61
|
+
::Stickler::Client::LatestVersion.new( ARGV ).run
|
59
62
|
end
|
60
63
|
|
@@ -7,10 +7,10 @@ require 'stickler'
|
|
7
7
|
SUB_COMMANDS = %w[ apache2 nginx ]
|
8
8
|
exec_name = File.basename( $0 )
|
9
9
|
|
10
|
-
|
10
|
+
# ---------------------------------------------------------------------
|
11
11
|
# parse through the top level global options, this is intercept
|
12
12
|
# --version and --help
|
13
|
-
|
13
|
+
# ---------------------------------------------------------------------
|
14
14
|
global_options = Trollop::options do
|
15
15
|
version "Stickler #{::Stickler::VERSION}"
|
16
16
|
banner <<-_
|
@@ -27,15 +27,15 @@ _
|
|
27
27
|
stop_on SUB_COMMANDS
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
# ---------------------------------------------------------------------
|
31
31
|
# sub command processing
|
32
|
-
|
32
|
+
# ---------------------------------------------------------------------
|
33
33
|
cmd = ARGV.shift
|
34
34
|
Trollop::die "unknown sub command #{cmd.inspect}" unless SUB_COMMANDS.include?( cmd )
|
35
35
|
|
36
|
-
|
36
|
+
# ---------------------------------------------------------------------
|
37
37
|
# validate the sole argument, the stickler root directory
|
38
|
-
|
38
|
+
# ---------------------------------------------------------------------
|
39
39
|
stickler_root = ARGV.shift
|
40
40
|
Trollop::die "Stickler root argument required" unless stickler_root
|
41
41
|
stickler_root = File.expand_path( stickler_root )
|
@@ -55,9 +55,9 @@ begin
|
|
55
55
|
config_ru = File.join( stickler_root, "config.ru" )
|
56
56
|
File.open( config_ru, "w+" ) do |f|
|
57
57
|
f.puts <<-__config_ru__
|
58
|
-
|
58
|
+
# ----------------------------------------------------------------------
|
59
59
|
# config.ru for use with passenger deployed Stickler
|
60
|
-
|
60
|
+
# ----------------------------------------------------------------------
|
61
61
|
require 'rubygems' if RUBY_VERSION < "1.9"
|
62
62
|
require 'stickler'
|
63
63
|
run ::Stickler::Server.new( "#{stickler_root}" ).app
|
data/bin/stickler-server
CHANGED
@@ -6,10 +6,10 @@ require 'trollop'
|
|
6
6
|
SUB_COMMANDS = %w[ start stop ]
|
7
7
|
exec_name = File.basename( $0 )
|
8
8
|
|
9
|
-
|
9
|
+
# ---------------------------------------------------------------------
|
10
10
|
# parse through the top level global options, this is intercept
|
11
11
|
# --version and --help
|
12
|
-
|
12
|
+
# ---------------------------------------------------------------------
|
13
13
|
global_options = Trollop::options do
|
14
14
|
version "Stickler #{Stickler::VERSION}"
|
15
15
|
banner <<-_
|
@@ -26,15 +26,15 @@ _
|
|
26
26
|
stop_on SUB_COMMANDS
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
# ---------------------------------------------------------------------
|
30
30
|
# sub command processing
|
31
|
-
|
31
|
+
# ---------------------------------------------------------------------
|
32
32
|
cmd = ARGV.shift
|
33
33
|
Trollop::die "unknown sub command #{cmd.inspect}" unless SUB_COMMANDS.include?( cmd )
|
34
34
|
|
35
|
-
|
35
|
+
# ---------------------------------------------------------------------
|
36
36
|
# All for the display of a default
|
37
|
-
|
37
|
+
# ---------------------------------------------------------------------
|
38
38
|
DEFAULT_HANDLERS = %w[ thin mongrel webrick ]
|
39
39
|
def rack_handler( handlers = DEFAULT_HANDLERS )
|
40
40
|
handlers = Array( handlers )
|
@@ -49,10 +49,10 @@ def rack_handler( handlers = DEFAULT_HANDLERS )
|
|
49
49
|
Trollop::die "No Server handler (#{handlers.join(",")}) found."
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
# ---------------------------------------------------------------------
|
53
53
|
# option parsing of the sub command, all subcommands have the same
|
54
54
|
# options
|
55
|
-
|
55
|
+
# ---------------------------------------------------------------------
|
56
56
|
rack_options = Trollop::options do
|
57
57
|
banner <<-_
|
58
58
|
Usage: #{exec_name} #{cmd} [options] /path/to/stickler/root
|
@@ -60,8 +60,8 @@ Usage: #{exec_name} #{cmd} [options] /path/to/stickler/root
|
|
60
60
|
Options:
|
61
61
|
_
|
62
62
|
opt :daemonize, "Daemonize the server", :default => false
|
63
|
-
opt :host, "The host address to bind to", :type =>
|
64
|
-
opt :pid, "Path to write a pid file to after daemonizing", :type => :
|
63
|
+
opt :host, "The host address to bind to", :type => String, :default =>'0.0.0.0'
|
64
|
+
opt :pid, "Path to write a pid file to after daemonizing", :type => String, :default => 'stickler-server.pid'
|
65
65
|
opt :port, "The port to bind to", :type => :int, :default => 6789
|
66
66
|
opt :server, "The rack handler: thin, mongrel, webrick, etc", :type => String, :default => rack_handler
|
67
67
|
end
|
@@ -71,9 +71,9 @@ end
|
|
71
71
|
rack_options[:Host] = rack_options.delete(:host)
|
72
72
|
rack_options[:Port] = rack_options.delete(:port)
|
73
73
|
|
74
|
-
|
74
|
+
# ---------------------------------------------------------------------
|
75
75
|
# validate the sole argument, the stickler root directory
|
76
|
-
|
76
|
+
# ---------------------------------------------------------------------
|
77
77
|
stickler_root = ARGV.shift
|
78
78
|
Trollop::die "Stickler root argument required" unless stickler_root
|
79
79
|
|