stickler 2.2.4 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/CONTRIBUTING.md +48 -0
  2. data/{HISTORY.asciidoc → HISTORY.md} +8 -2
  3. data/Manifest.txt +86 -0
  4. data/{README.asciidoc → README.rdoc} +18 -20
  5. data/Rakefile +25 -59
  6. data/bin/stickler +10 -3
  7. data/examples/gemcutter_repo.ru +1 -2
  8. data/lib/stickler.rb +6 -2
  9. data/lib/stickler/client.rb +5 -4
  10. data/lib/stickler/client/delete.rb +50 -0
  11. data/lib/stickler/client/unyank.rb +50 -0
  12. data/lib/stickler/middleware.rb +7 -0
  13. data/lib/stickler/middleware/compression.rb +0 -2
  14. data/lib/stickler/middleware/gemcutter.rb +16 -7
  15. data/lib/stickler/middleware/helpers.rb +1 -3
  16. data/lib/stickler/middleware/index.rb +0 -8
  17. data/lib/stickler/middleware/local.rb +1 -5
  18. data/lib/stickler/middleware/mirror.rb +0 -4
  19. data/lib/stickler/middleware/not_found.rb +0 -1
  20. data/lib/stickler/repository.rb +9 -5
  21. data/lib/stickler/repository/index.rb +0 -1
  22. data/lib/stickler/repository/local.rb +12 -4
  23. data/lib/stickler/repository/null.rb +0 -1
  24. data/lib/stickler/repository/remote.rb +40 -20
  25. data/lib/stickler/repository/remote_mirror.rb +1 -1
  26. data/lib/stickler/server.rb +1 -9
  27. data/lib/stickler/server/public/css/blueprint/ie.css +35 -0
  28. data/lib/stickler/server/public/css/blueprint/screen.css +266 -0
  29. data/lib/stickler/server/public/css/style.css +19 -0
  30. data/man/stickler-passenger-config.1 +83 -0
  31. data/man/stickler-passenger-config.1.ronn +70 -0
  32. data/man/stickler-server.1 +168 -0
  33. data/man/stickler-server.1.ronn +84 -0
  34. data/man/stickler.1 +321 -0
  35. data/man/stickler.1.ronn +144 -0
  36. data/spec/data/gemcutter/gems/foo-1.0.0.gem +0 -0
  37. data/spec/middleware/local_spec.rb +1 -4
  38. data/spec/middleware/not_found_spec.rb +1 -2
  39. data/spec/paths_spec.rb +1 -3
  40. data/spec/repository/api_behavior.rb +34 -4
  41. data/spec/repository/api_spec.rb +2 -3
  42. data/spec/repository/index_spec.rb +10 -11
  43. data/spec/repository/local_spec.rb +10 -12
  44. data/spec/repository/null_spec.rb +2 -5
  45. data/spec/repository/remote_spec.rb +3 -5
  46. data/spec/spec_helper.rb +7 -2
  47. data/spec/spec_lite_spec.rb +1 -3
  48. data/tasks/default.rake +274 -0
  49. data/tasks/this.rb +209 -0
  50. metadata +142 -85
  51. data/.bnsignore +0 -14
  52. data/.gitignore +0 -23
  53. data/TODO.asciidoc +0 -6
  54. data/lib/stickler/version.rb +0 -36
  55. data/man/asciidoc.conf +0 -25
  56. data/man/stickler-passenger-config.asciidoc +0 -74
  57. data/man/stickler-server.asciidoc +0 -87
  58. data/man/stickler.asciidoc +0 -150
  59. data/tasks/asciidoc.rake +0 -32
  60. data/tasks/bundler.rake +0 -13
  61. data/tasks/contribute.rake +0 -36
  62. data/tasks/man.rake +0 -19
@@ -0,0 +1,48 @@
1
+ # Hi there!
2
+
3
+ I see you are interested in contributing. That is wonderful. I love
4
+ contributions.
5
+
6
+ I guarantee that there are bugs in this software. And I guarantee that there is
7
+ a feature you want that is not in here yet. As such, any and all bugs reports
8
+ are gratefully accepted, bugfixes even more so. Helping out with bugs is the
9
+ easiest way to contribute.
10
+
11
+
12
+ ## The Quick Version
13
+
14
+ * Have a [GitHub Account][].
15
+ * Search the [GitHub Issues][] and see if your issue already present. If so
16
+ add your comments, :thumbsup:, etc.
17
+ * Issue not there? Not a problem, open up a [new issue][].
18
+ * **Bug reports** please be as detailed as possible. Include:
19
+ * full ruby engine and version: `ruby -e 'puts RUBY_DESCRIPTION'`
20
+ * operating system and version
21
+ * version of stickler `ruby -rubygems -e "require 'stickler'; puts Stickler::VERSION"`
22
+ * as much detail about the bug as possible so I can replicate it. Feel free
23
+ to link in a [gist][]
24
+ * **New Feature**
25
+ * What the new feature should do.
26
+ * What benefit the new feature brings to the project.
27
+ * Fork the [repo][].
28
+ * Create a new branch for your issue: `git checkout -b issue/my-issue`
29
+ * Lovingly craft your contribution:
30
+ * `rake develop` to get started, or if you prefer bundler `rake develop:using_bundler && bundle`.
31
+ * `rake test` to run tests
32
+ * Make sure that `rake test` passes. It's important, I said it twice.
33
+ * Add yourself to the contributors section below.
34
+ * Submit your [pull request][].
35
+
36
+ # Contributors
37
+
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
+
43
+ [GitHub Account]: https://github.com/signup/free "GitHub Signup"
44
+ [GitHub Issues]: https://github.com/copiousfreetime/stickler/issues "Stickler Issues"
45
+ [new issue]: https://github.com/copiousfreetime/stickler/issues/new "New Stickler Issue"
46
+ [gist]: https://gist.github.com/ "New Gist"
47
+ [repo]: https://github.com/copiousfreetime/stickler "Stickler Repo"
48
+ [pull request]: https://help.github.com/articles/using-pull-requests "Using Pull Requests"
@@ -1,7 +1,13 @@
1
1
  Stickler Changelog
2
2
  ==================
3
- Jeremy Hinegardner <jeremy@hinegardner.org>
3
+ Jeremy Hinegardner <jeremy@copiousfreetime.org>
4
4
 
5
+ Version 2.3.0 - 2013-03-09
6
+ --------------------------
7
+ * Expose deleting a gem via the stickler commandline (copiousfreetime/stickler/#10)
8
+ * Update dependencies for Excon so http proxy works (copiousfreetime/stickler/#24)
9
+ * Implement unyank for local and remote repositories (copiousfreetime/stickler/#26)
10
+ * Updated dependencies to latest versions
5
11
 
6
12
  Version 2.2.4 - 2012-02-26
7
13
  --------------------------
@@ -55,5 +61,5 @@ Version 0.1.1 - 2008-10-12
55
61
 
56
62
  Version 0.1.0 - 2008-10-10
57
63
  --------------------------
58
- * http://copiousfreetime.org/articles/2008/10/09/managing-a-gem-repository-with-stickler.html[Managing a Gem Repository with Stickler]
64
+ * [Managing a Gem Repository with Stickler](http://copiousfreetime.org/articles/2008/10/09/managing-a-gem-repository-with-stickler.html)
59
65
  * Initial public release
@@ -0,0 +1,86 @@
1
+ CONTRIBUTING.md
2
+ HISTORY.md
3
+ LICENSE
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ bin/stickler
8
+ bin/stickler-passenger-config
9
+ bin/stickler-server
10
+ examples/auth_repo.ru
11
+ examples/config.ru
12
+ examples/fetch-a-gem
13
+ examples/gemcutter_repo.ru
14
+ examples/index_repo.ru
15
+ examples/local_repo.ru
16
+ examples/mirror_repo.ru
17
+ examples/not_found.ru
18
+ lib/stickler.rb
19
+ lib/stickler/client.rb
20
+ lib/stickler/client/config.rb
21
+ lib/stickler/client/config_file.rb
22
+ lib/stickler/client/delete.rb
23
+ lib/stickler/client/list.rb
24
+ lib/stickler/client/mirror.rb
25
+ lib/stickler/client/push.rb
26
+ lib/stickler/client/unyank.rb
27
+ lib/stickler/client/yank.rb
28
+ lib/stickler/error.rb
29
+ lib/stickler/logable.rb
30
+ lib/stickler/middleware.rb
31
+ lib/stickler/middleware/compression.rb
32
+ lib/stickler/middleware/gemcutter.rb
33
+ lib/stickler/middleware/helpers.rb
34
+ lib/stickler/middleware/index.rb
35
+ lib/stickler/middleware/local.rb
36
+ lib/stickler/middleware/mirror.rb
37
+ lib/stickler/middleware/not_found.rb
38
+ lib/stickler/paths.rb
39
+ lib/stickler/repository.rb
40
+ lib/stickler/repository/api.rb
41
+ lib/stickler/repository/basic_authenticator.rb
42
+ lib/stickler/repository/index.rb
43
+ lib/stickler/repository/local.rb
44
+ lib/stickler/repository/mirror.rb
45
+ lib/stickler/repository/null.rb
46
+ lib/stickler/repository/remote.rb
47
+ lib/stickler/repository/remote_mirror.rb
48
+ lib/stickler/repository/rubygems_authenticator.rb
49
+ lib/stickler/server.rb
50
+ lib/stickler/server/public/css/blueprint/LICENSE
51
+ lib/stickler/server/public/css/blueprint/ie.css
52
+ lib/stickler/server/public/css/blueprint/screen.css
53
+ lib/stickler/server/public/css/style.css
54
+ lib/stickler/server/public/images/apple-touch-icon.png
55
+ lib/stickler/server/public/images/favicon.ico
56
+ lib/stickler/server/public/js/modernizr-1.5.min.js
57
+ lib/stickler/server/views/index.erb
58
+ lib/stickler/server/views/layout.erb
59
+ lib/stickler/spec_lite.rb
60
+ man/stickler-passenger-config.1
61
+ man/stickler-passenger-config.1.ronn
62
+ man/stickler-server.1
63
+ man/stickler-server.1.ronn
64
+ man/stickler.1
65
+ 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
+ tasks/default.rake
86
+ tasks/this.rb
@@ -1,10 +1,10 @@
1
- Stickler
2
- ========
3
- Jeremy Hinegardner <jeremy@hinegardner.org>
1
+ = Stickler
4
2
 
3
+ * Jeremy Hinegardner <jeremy@hinegardner.org>
4
+ * http://github.com/copiousfreetime/qup
5
+
6
+ == DESCRIPTION
5
7
 
6
- Overview
7
- --------
8
8
  Stickler is a tool to organize and maintain an internal gem repository.
9
9
  Primarily, you would want to use Stickler if:
10
10
 
@@ -15,19 +15,17 @@ Primarily, you would want to use Stickler if:
15
15
  3. You want both (1) and (2) in the same server.
16
16
 
17
17
 
18
- Installation
19
- ------------
18
+ == INSTALLATION
19
+
20
20
  Installing stickler may be done via the standard gem installation
21
21
 
22
- --------------------
23
- gem install stickler
24
- --------------------
22
+ gem install stickler
25
23
 
26
24
  Or downloaded from http://github.com/copiousfreetime/stickler/downloads
27
25
 
28
26
 
29
- Usage
30
- -----
27
+ == USAGE
28
+
31
29
  Stickler is broken up into a few commandline programs.
32
30
 
33
31
  .Command line programs
@@ -132,27 +130,27 @@ View which manual?
132
130
  >
133
131
  ---------------------------------
134
132
 
135
- Development
136
- -----------
133
+ == DEVELOPMENT
134
+
137
135
  If you want to do development on stickler, I suggest using
138
136
  https://rvm.beginrescueend.com/[RVM] and creating a gemset for stickler.
139
137
 
140
138
  Then run 'rake how_to_contribute'
141
139
 
142
140
 
143
- Credits
144
- -------
141
+ == CREDITS
142
+
145
143
  * http://rubyforge.org/projects/rubygems/[The Rubygems Team]
146
144
 
147
145
 
148
- License
149
- -------
146
+ == LICENSE
147
+
150
148
  Copyright (C) 2008-2010 Jeremy Hinegardner
151
149
  ISC License, See LICENSE for details
152
150
 
153
151
 
154
- Appendix
155
- --------
152
+ == APPENDIX
153
+
156
154
  * http://github.com/copiousfreetime/stickler[Github Project]
157
155
  * link:HISTORY.html[History]
158
156
  * http://www.copiousfreetime.org/projects/stickler/
data/Rakefile CHANGED
@@ -1,61 +1,27 @@
1
- begin
2
- USING_BONES_VERSION = '3.7.3'
3
- require 'bones'
4
- rescue LoadError
5
- load 'tasks/contribute.rake'
6
- Rake.application.invoke_task( :help )
7
- end
8
-
9
- task :default => 'spec:run'
10
- task 'gem:release' => 'spec:run'
11
-
12
- $: << "lib"
13
- require 'stickler/version'
14
-
15
- Bones {
16
- name 'stickler'
17
- authors 'Jeremy Hinegardner'
18
- email 'jeremy@hinegardner.org'
19
- url 'http://www.copiousfreetime.org/projects/stickler'
20
- version Stickler::VERSION
21
-
22
- ruby_opts %w[-w -rubygems]
23
- readme_file 'README.asciidoc'
24
- ignore_file '.bnsignore'
25
- history_file 'HISTORY.asciidoc'
26
-
27
- spec.opts << "--color" << "--format documentation"
28
-
29
- summary 'Stickler is a tool to organize and maintain an internal gem repository.'
30
- description <<_
31
- Stickler is a tool to organize and maintain an internal gem repository.
32
- Primarily, you would want to use Stickler if:
1
+ # vim: syntax=ruby
2
+ load 'tasks/this.rb'
3
+
4
+ This.name = "stickler"
5
+ This.author = "Jeremy Hinegardner"
6
+ This.email = "jeremy@copiousfreetime.org"
7
+ This.homepage = "http://github.com/copiousfreetime/#{ This.name }"
8
+
9
+
10
+ This.ruby_gemspec do |spec|
11
+ spec.add_runtime_dependency( 'sinatra' , '~> 1.3.5' )
12
+ spec.add_runtime_dependency( 'addressable', '~> 2.3.3' )
13
+ spec.add_runtime_dependency( 'excon' , '~> 0.20.0' )
14
+ spec.add_runtime_dependency( 'trollop' , '~> 2.0' )
15
+ spec.add_runtime_dependency( 'logging' , '~> 1.8.1' )
16
+
17
+ # The Development Dependencies
18
+ spec.add_development_dependency( 'rake' , '~> 10.0.3' )
19
+ spec.add_development_dependency( 'rack-test' , '~> 0.6.2' )
20
+ spec.add_development_dependency( 'builder' , '~> 3.2.0' )
21
+ spec.add_development_dependency( 'rspec' , '~> 2.13.0' )
22
+ spec.add_development_dependency( 'rdoc' , '~> 4.0' )
23
+ spec.add_development_dependency( 'ronn' , '~> 0.7.3' )
33
24
 
34
- 1. You have proprietary gems that you want to have available via a gem server so
35
- you may +gem install+ them.
36
- 2. You would like to have a local mirror of third party gems from either
37
- http://rubygems.org or some other gem server.
38
- 3. You want both (1) and (2) in the same server.
39
- _
40
-
41
- # I'm explicitly controlling the version of bones.
42
-
43
-
44
- depend_on 'sinatra' , '~> 1.3.2'
45
- depend_on 'addressable', '~> 2.2.6'
46
- depend_on 'excon' , '~> 0.9.5'
47
- depend_on 'trollop' , '~> 1.16.2'
48
- depend_on 'logging' , '~> 1.6.2'
49
-
50
- depend_on 'rake' , '~> 0.9.2.2', :development => true
51
- depend_on 'bones' , "~> #{USING_BONES_VERSION}", :development => true
52
- depend_on 'rack-test' , '~> 0.6.1', :development => true
53
- depend_on 'bones-extras', '~> 1.3.0', :development => true
54
- depend_on 'builder' , '~> 3.0.0', :development => true
55
- depend_on 'rspec' , '~> 2.8.0', :development => true
56
- }
57
-
58
- # Sorry Tim, I need to manage my own bones version
59
- ::Bones.config.gem._spec.dependencies.delete_if do |d|
60
- d.name == 'bones' and d.requirement.to_s =~ /^>=/
61
25
  end
26
+
27
+ load 'tasks/default.rake'
@@ -3,7 +3,7 @@
3
3
  require 'stickler'
4
4
  require 'stickler/client'
5
5
 
6
- SUB_COMMANDS = %w[ push yank mirror config list ].sort
6
+ SUB_COMMANDS = %w[ push yank mirror config list delete unyank ].sort
7
7
  exec_name = File.basename( $0 )
8
8
 
9
9
  #----------------------------------------------------------------------
@@ -19,11 +19,13 @@ Stickler server interaction
19
19
 
20
20
  Examples:
21
21
  #{exec_name} push ./my_gem-1.0.0.gem --server http://stickler.example.com/
22
- #{exec_name} yank my_gem --version 1.0.0 --server http://stickler.example.com/
22
+ #{exec_name} yank my_gem --gem-version 1.0.0 --server http://stickler.example.com/
23
+ #{exec_name} unyank my_gem --gem-version 1.0.0 --server http://stickler.example.com/
23
24
  #{exec_name} mirror third_party_gem --gem-version 0.4.2 --upstream http://rubygems.org/ --server http://stickler.example.com/
24
25
  #{exec_name} mirror --help
25
26
  #{exec_name} config --server http://stickler.example.com --upstream http://rubygems.org/
26
27
  #{exec_name} list --server http://stickler.example.com
28
+ #{exec_name} delete my_gem --gem-version 1.2.3 --server #http://stickler.example.com/
27
29
 
28
30
  Options:
29
31
  _
@@ -35,7 +37,8 @@ end
35
37
  # sub command processing
36
38
  #----------------------------------------------------------------------
37
39
  cmd = ARGV.shift
38
- Trollop::die "unknown sub command #{cmd.inspect}" unless SUB_COMMANDS.include?( cmd )
40
+ Trollop::die "No sub command given" unless cmd
41
+ Trollop::die "Unknown sub command #{cmd.inspect}" unless SUB_COMMANDS.include?( cmd )
39
42
 
40
43
 
41
44
  case cmd
@@ -43,6 +46,10 @@ when "push"
43
46
  ::Stickler::Client::Push.new( ARGV ).run
44
47
  when "yank"
45
48
  ::Stickler::Client::Yank.new( ARGV ).run
49
+ when "unyank"
50
+ ::Stickler::Client::Unyank.new( ARGV ).run
51
+ when "delete"
52
+ ::Stickler::Client::Delete.new( ARGV ).run
46
53
  when "mirror"
47
54
  ::Stickler::Client::Mirror.new( ARGV ).run
48
55
  when "config"
@@ -10,8 +10,7 @@
10
10
  #-----------------------------------------------------------------------
11
11
  $:.unshift File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
12
12
 
13
- require 'stickler/middleware/gemcutter'
14
- require 'stickler/middleware/compression'
13
+ require 'stickler'
15
14
 
16
15
  gem_dir = File.expand_path( "../spec/tmp", File.dirname( __FILE__ ) )
17
16
 
@@ -1,10 +1,14 @@
1
1
  module Stickler
2
+ # The Current Version of the library
3
+ VERSION = "2.3.0"
2
4
  end
5
+ require 'sinatra/base'
3
6
 
7
+ require 'stickler/logable'
4
8
  require 'stickler/error'
5
9
  require 'stickler/paths'
10
+ require 'stickler/spec_lite'
11
+
6
12
  require 'stickler/repository'
7
13
  require 'stickler/middleware'
8
- require 'stickler/spec_lite'
9
- require 'stickler/version'
10
14
  require 'stickler/server'
@@ -1,5 +1,4 @@
1
1
  require 'trollop'
2
- require 'rubygems'
3
2
  require 'stickler/client/config_file'
4
3
 
5
4
  module Stickler
@@ -43,8 +42,10 @@ module Stickler
43
42
  end
44
43
  end
45
44
 
46
- require 'stickler/client/push'
47
- require 'stickler/client/yank'
48
- require 'stickler/client/mirror'
49
45
  require 'stickler/client/config'
46
+ require 'stickler/client/delete'
50
47
  require 'stickler/client/list'
48
+ require 'stickler/client/mirror'
49
+ require 'stickler/client/push'
50
+ require 'stickler/client/unyank'
51
+ require 'stickler/client/yank'
@@ -0,0 +1,50 @@
1
+ module Stickler
2
+ class Client
3
+ class Delete < Stickler::Client
4
+ def self.banner
5
+ <<-_
6
+ Completely Remove a gem from the gemserver's index.
7
+
8
+ Usage: stickler delete [options] --gem-version x.y.z gem
9
+
10
+ Options:
11
+ _
12
+ end
13
+
14
+ def parser
15
+ unless @parser then
16
+ @parser = super
17
+ @parser.opt( :gem_version, "The version of the gem to delete (required)", :type => :string, :required => true )
18
+ @parser.opt( :platform, "The platform of the gem to delete ", :type => :string, :default => ::Gem::Platform::RUBY )
19
+ end
20
+ return @parser
21
+ end
22
+
23
+ def parse( argv )
24
+ gem_name = nil
25
+ opts = super( argv ) do |p|
26
+ raise Trollop::CommandlineError, "At least one gem is required to delete" if p.leftovers.empty?
27
+ gem_name = p.leftovers.shift
28
+ end
29
+ opts[:gem_name] = gem_name
30
+ return opts
31
+ end
32
+
33
+ def run
34
+ opts = parse( self.argv )
35
+ repo = remote_repo_for( opts )
36
+ spec = Stickler::SpecLite.new( opts[:gem_name], opts[:gem_version], opts[:platform] )
37
+
38
+ $stdout.write "Deleting gem #{spec.full_name} from #{repo.uri} : "
39
+ $stdout.flush
40
+ if spec = repo.delete( spec ) then
41
+ $stdout.puts "OK"
42
+ else
43
+ $stdout.puts "FAILURE"
44
+ end
45
+ rescue Stickler::Repository::Error => e
46
+ $stdout.puts "ERROR: #{e.message}"
47
+ end
48
+ end
49
+ end
50
+ end