stickler 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e0d0d6ef2c500168f844e051452173e22c4e1bd
4
- data.tar.gz: da8a24b4c389ed71cc4d50d9cc2771275682f92c
3
+ metadata.gz: eca06c2dc9ce087e0c22c4d2a3651097d9672a24
4
+ data.tar.gz: e4e52e3a119a3bbe11c12edef99fbfcf4beff589
5
5
  SHA512:
6
- metadata.gz: 167b8138cccd4ab189288417f8499a9474304c1f7124d8018aa8ba023d07a756bdee45d3422a03c2042b3c83f85c7e3adb660574aea94fbf623a798b1e902b12
7
- data.tar.gz: c33eb450f6af74db9d9df8392f225c4fc958c3a003772d70ba445cbc6f971c4b9beb4f54cbaf666db363a2906b94004b02d702f7a1293cadf74f4b2c4e1cc2fe
6
+ metadata.gz: fd6d208cb1e233cf592d33f53a75a260823d8760208d8968475980994c00fca1705518026a46eac5f56ae33f3dab451c74af4feab3a2ad562f15fa585c0bd663
7
+ data.tar.gz: 3655d2b3817257f3c4e78517eef59ca55f239415395679fdbd02d4ac104f32fe0b0deff61b9078cf7f96e5baa89ea35de95f99183d204c5516cc36d4101be2ad
@@ -40,6 +40,8 @@ easiest way to contribute.
40
40
  * [Philip Roberts](https://github.com/latentflip)
41
41
  * [Alan Gardner](https://github.com/urfolomeus)
42
42
  * [tiago.nobre](https://github.com/macwadu)
43
+ * [Michael Smith](https://github.com/MikaelSmith)
44
+ * [Shenil Dodhia](https://github.com/shenil)
43
45
 
44
46
  [GitHub Account]: https://github.com/signup/free "GitHub Signup"
45
47
  [GitHub Issues]: https://github.com/copiousfreetime/stickler/issues "Stickler Issues"
data/HISTORY.md CHANGED
@@ -2,6 +2,13 @@ Stickler Changelog
2
2
  ==================
3
3
  Jeremy Hinegardner <jeremy@copiousfreetime.org>
4
4
 
5
+ Version 2.4.2 - 2015-03-12
6
+ --------------------------
7
+ * Drop support for ruby 1.8
8
+ * Update dependencies
9
+ * Fix mirror errors when no gem-version supplied <https://github.com/copiousfreetime/stickler/issues/42>
10
+ * Fix yank/unank of non-ruby platform gems <https://github.com/copiousfreetime/stickler/issues/45>
11
+
5
12
  Version 2.4.1 - 2014-06-11
6
13
  --------------------------
7
14
  * Fix daemonization bug <https://github.com/copiousfreetime/stickler/issues/38>
data/Rakefile CHANGED
@@ -11,16 +11,18 @@ This.ruby_gemspec do |spec|
11
11
  spec.add_runtime_dependency( 'sinatra' , '~> 1.4' )
12
12
  spec.add_runtime_dependency( 'addressable', '~> 2.3' )
13
13
  spec.add_runtime_dependency( 'excon' , '~> 0.37' )
14
- spec.add_runtime_dependency( 'trollop' , '~> 2.0' )
14
+ spec.add_runtime_dependency( 'trollop' , '~> 2.1' )
15
15
  spec.add_runtime_dependency( 'logging' , '~> 1.8' )
16
16
 
17
17
  # The Development Dependencies
18
- spec.add_development_dependency( 'rake' , '~> 10.1' )
18
+ spec.add_development_dependency( 'rake' , '~> 10.4' )
19
19
  spec.add_development_dependency( 'rack-test' , '~> 0.6' )
20
20
  spec.add_development_dependency( 'builder' , '~> 3.2' )
21
21
  spec.add_development_dependency( 'minitest' , '~> 5.0' )
22
- spec.add_development_dependency( 'rdoc' , '~> 4.0' )
22
+ spec.add_development_dependency( 'rdoc' , '~> 4.2' )
23
23
  spec.add_development_dependency( 'ronn' , '~> 0.7' )
24
+ spec.add_development_dependency( 'mustache' , '~> 0.99' )
25
+ spec.add_development_dependency( 'simplecov' , '~> 0.9' )
24
26
 
25
27
  spec.required_rubygems_version = '~> 2.2'
26
28
 
@@ -1,6 +1,6 @@
1
1
  module Stickler
2
2
  # The Current Version of the library
3
- VERSION = "2.4.1"
3
+ VERSION = "2.4.2"
4
4
  end
5
5
  require 'sinatra/base'
6
6
 
@@ -34,7 +34,7 @@ _
34
34
  gem_name = p.leftovers.shift
35
35
  else
36
36
  gemfile_lock = p.leftovers.shift
37
- raise Trollop::CommandlineError, "#{lock} must be readable" unless File.readable?( gemfile_lock )
37
+ raise Trollop::CommandlineError, "#{gemfile_lock} must be readable" unless File.readable?( gemfile_lock )
38
38
  end
39
39
  end
40
40
  opts[:gem_name] = gem_name
@@ -33,7 +33,7 @@ module Stickler
33
33
  Gem::Format.from_file_by_path( path )
34
34
  end
35
35
  rescue LoadError
36
- abort "FAilure to load rubygems/format"
36
+ abort "Failure to load rubygems/format"
37
37
  end
38
38
  end
39
39
  end
@@ -40,7 +40,8 @@ module Stickler::Middleware
40
40
  # gemcutter unyank
41
41
  post '/api/v1/gems/unyank' do
42
42
  begin
43
- spec = Stickler::SpecLite.new( params[:spec_name], params[:version] )
43
+ platform = params.fetch("platform", "ruby")
44
+ spec = Stickler::SpecLite.new( params[:spec_name], params[:version], platform )
44
45
  @repo.unyank( spec )
45
46
  logger.info( "Unyanked #{spec.full_name}" )
46
47
  return spec.to_s
@@ -52,7 +53,8 @@ module Stickler::Middleware
52
53
 
53
54
  # gemcutter yank
54
55
  delete '/api/v1/gems/yank' do
55
- spec = Stickler::SpecLite.new( params[:gem_name], params[:version] )
56
+ platform = params.fetch("platform", "ruby")
57
+ spec = Stickler::SpecLite.new( params[:gem_name], params[:version], platform )
56
58
  if @repo.yank( spec ) then
57
59
  logger.info( "Yanked #{spec.full_name}" )
58
60
  return "Yanked #{spec.full_name}"
@@ -93,7 +93,7 @@ module ::Stickler::Repository
93
93
  #
94
94
  def yank( spec )
95
95
  return nil unless remote_gem_file_exist?( spec )
96
- query = { :gem_name => spec.name, :version => spec.version.to_s }
96
+ query = { :gem_name => spec.name, :version => spec.version.to_s, :platform => spec.platform.to_s }
97
97
  resource_request( yank_resource, :query => query )
98
98
  return full_uri_to_gem( spec )
99
99
  rescue Excon::Errors::Error => e
@@ -105,7 +105,7 @@ module ::Stickler::Repository
105
105
  #
106
106
  def unyank( spec )
107
107
  if remote_gem_file_exist?( spec ) && search_for( spec ).empty? then
108
- query = { :spec_name => spec.name, :version => spec.version.to_s }
108
+ query = { :spec_name => spec.name, :version => spec.version.to_s, :platform => spec.platform.to_s }
109
109
  resource_request( unyank_resource, :query => query )
110
110
  return true
111
111
  else
@@ -10,21 +10,12 @@ namespace :develop do
10
10
 
11
11
  # Install all the development and runtime dependencies of this gem using the
12
12
  # gemspec.
13
- task :default do
13
+ task :default => 'Gemfile' do
14
14
  require 'rubygems/dependency_installer'
15
15
  installer = ::Gem::DependencyInstaller.new
16
-
17
- This.set_coverage_gem
18
-
19
- puts "Installing gem depedencies needed for development"
20
- This.platform_gemspec.dependencies.each do |dep|
21
- if dep.matching_specs.empty? then
22
- puts "Installing : #{dep}"
23
- installer.install dep
24
- else
25
- puts "Skipping : #{dep} -> already installed #{dep.matching_specs.first.full_name}"
26
- end
27
- end
16
+ puts "Installing bundler..."
17
+ installer.install 'bundler'
18
+ sh 'bundle install'
28
19
  puts "\n\nNow run 'rake test'"
29
20
  end
30
21
 
@@ -37,16 +28,8 @@ namespace :develop do
37
28
  f.puts 'gemspec'
38
29
  end
39
30
  end
40
-
41
- desc "Create a bundler Gemfile"
42
- task :using_bundler => 'Gemfile' do
43
- puts "Now you can 'bundle'"
44
- end
45
-
46
- # Gemfiles are build artifacts
47
- CLOBBER << FileList['Gemfile*']
48
31
  end
49
- desc "Boostrap development"
32
+ desc "Bootstrap development"
50
33
  task :develop => "develop:default"
51
34
 
52
35
  #------------------------------------------------------------------------------
@@ -90,31 +73,16 @@ end
90
73
  # Coverage - optional code coverage, rcov for 1.8 and simplecov for 1.9, so
91
74
  # for the moment only rcov is listed.
92
75
  #------------------------------------------------------------------------------
93
- if RUBY_VERSION < "1.9.0"
94
- begin
95
- require 'rcov/rcovtask'
96
- Rcov::RcovTask.new( 'coverage' ) do |t|
97
- t.libs << 'spec'
98
- t.pattern = 'spec/**/*_spec.rb'
99
- t.verbose = true
100
- t.rcov_opts << "-x ^/" # remove all the global files
101
- t.rcov_opts << "--sort coverage" # so we see the worst files at the top
102
- end
103
- rescue LoadError
104
- This.task_warning( 'rcov' )
105
- end
106
- else
107
- begin
108
- require 'simplecov'
109
- desc 'Run tests with code coverage'
110
- task :coverage do
111
- ENV['COVERAGE'] = 'true'
112
- Rake::Task[:test].execute
113
- end
114
- CLOBBER << FileList["coverage"]
115
- rescue LoadError
116
- This.task_warning( 'simplecov' )
76
+ begin
77
+ require 'simplecov'
78
+ desc 'Run tests with code coverage'
79
+ task :coverage do
80
+ ENV['COVERAGE'] = 'true'
81
+ Rake::Task[:test].execute
117
82
  end
83
+ CLOBBER << 'coverage' if File.directory?( 'coverage' )
84
+ rescue LoadError
85
+ This.task_warning( 'simplecov' )
118
86
  end
119
87
 
120
88
  #------------------------------------------------------------------------------
@@ -179,9 +147,10 @@ namespace :fixme do
179
147
  end
180
148
 
181
149
  def outdated_fixme_files
182
- local_fixme_files.reject do |local|
150
+ local_fixme_files.select do |local|
183
151
  upstream = fixme_project_path( local )
184
- Digest::SHA256.file( local ) == Digest::SHA256.file( upstream )
152
+ upstream.exist? &&
153
+ ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
185
154
  end
186
155
  end
187
156
 
@@ -231,9 +200,6 @@ task :gemspec do
231
200
  end
232
201
  end
233
202
 
234
- # the gemspec is also a dev artifact and should not be kept around.
235
- CLOBBER << This.gemspec_file.to_s
236
-
237
203
  # .rbc files from ruby 2.0
238
204
  CLOBBER << FileList["**/*.rbc"]
239
205
 
@@ -13,7 +13,7 @@ class ThisProject
13
13
  attr_accessor :email
14
14
 
15
15
  # The homepage of this project
16
- attr_accessor :homepage
16
+ attr_accessor :homepage
17
17
 
18
18
  # The regex of files to exclude from the manifest
19
19
  attr_accessor :exclude_from_manifest
@@ -25,7 +25,11 @@ class ThisProject
25
25
  #
26
26
  # Yields self
27
27
  def initialize(&block)
28
- @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
28
+ @exclude_from_manifest = Regexp.union(/\.(git|DS_Store)/,
29
+ /^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)/,
30
+ /^[^\/]+\.gemspec/,
31
+ /\.(swp|jar|bundle|so|rvmrc|travis.yml)$/,
32
+ /~$/)
29
33
  @gemspecs = Hash.new
30
34
  yield self if block_given?
31
35
  end
@@ -119,7 +123,7 @@ class ThisProject
119
123
 
120
124
  # Internal: Returns the gemspace associated with the current ruby platform
121
125
  def platform_gemspec
122
- gemspecs[platform]
126
+ gemspecs.fetch(platform) { This.ruby_gemspec }
123
127
  end
124
128
 
125
129
  def core_gemspec
@@ -141,6 +145,8 @@ class ThisProject
141
145
  spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
142
146
  spec.rdoc_options = [ "--main" , 'README.md',
143
147
  "--markup", "tomdoc" ]
148
+
149
+ spec.required_ruby_version = '>= 1.9.3'
144
150
  end
145
151
  end
146
152
 
@@ -167,20 +173,6 @@ class ThisProject
167
173
  return spec
168
174
  end
169
175
 
170
- # Internal: Set the recovery gem development dependency
171
- #
172
- # These are dynamically set since they cannot be hard coded as there is
173
- # no way to ship them correctly in the gemspec
174
- #
175
- # Returns nothing.
176
- def set_coverage_gem
177
- if RUBY_VERSION < "1.9.0"
178
- platform_gemspec.add_development_dependency( 'rcov', '~> 1.0.0' )
179
- else
180
- platform_gemspec.add_development_dependency( 'simplecov', '~> 0.8.2' )
181
- end
182
- end
183
-
184
176
  # Internal: Return the platform of ThisProject at the current moment in time.
185
177
  def platform
186
178
  (RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
@@ -190,13 +182,13 @@ class ThisProject
190
182
  def description_section
191
183
  section_of( 'README.md', 'DESCRIPTION')
192
184
  end
193
-
194
- # Internal: Return the summary text from the README
185
+
186
+ # Internal: Return the summary text from the README
195
187
  def summary
196
188
  description_section.first
197
189
  end
198
190
 
199
- # Internal: Return the full description text from the READEM
191
+ # Internal: Return the full description text from the README
200
192
  def description
201
193
  description_section.join(" ").tr("\n", ' ').gsub(/[{}]/,'').gsub(/\[[^\]]+\]/,'') # strip rdoc
202
194
  end
@@ -8,8 +8,11 @@ module Stickler
8
8
  def setup
9
9
  super
10
10
  @foo_gem_local_path = File.join( gems_dir, "foo-1.0.0.gem" )
11
+ @baz_gem_local_path = File.join( gems_dir, "baz-3.1.4-java.gem" )
11
12
  @foo_spec = Stickler::SpecLite.new( 'foo', '1.0.0' )
13
+ @baz_java_spec = Stickler::SpecLite.new( 'baz', '3.1.4', 'java')
12
14
  assert File.readable?( @foo_gem_local_path ), "#{@foo_gem_local_path} is missing"
15
+ assert File.readable?( @baz_gem_local_path ), "#{@baz_gem_local_path} is missing"
13
16
  @foo_digest = Digest::SHA1.hexdigest( IO.read( @foo_gem_local_path ) )
14
17
  @missing_spec = Stickler::SpecLite.new( "does_not_exist", "0.1.0" )
15
18
  end
@@ -83,6 +86,13 @@ module Stickler
83
86
  assert_includes [ ::URI, ::Addressable::URI ], @response_uri.class
84
87
  end
85
88
 
89
+ def test_yank_works_with_nondefault_platform
90
+ assert_empty repo.search_for( @baz_java_spec )
91
+ repo.push( @baz_gem_local_path )
92
+ @response_uri = repo.yank( @baz_java_spec )
93
+ assert_includes [ ::URI, ::Addressable::URI ], @response_uri.class
94
+ end
95
+
86
96
  def test_yank_returns_nil_for_non_existent_gem
87
97
  assert_nil repo.yank( @missing_spec )
88
98
  end
@@ -120,6 +130,14 @@ module Stickler
120
130
  assert_nil repo.unyank( non_existing_gem )
121
131
  end
122
132
 
133
+ def test_unyank_works_with_nondefault_platform
134
+ assert_empty repo.search_for( @baz_java_spec )
135
+ repo.push( @baz_gem_local_path )
136
+ repo.yank( @baz_java_spec )
137
+ assert_empty repo.search_for( @baz_java_spec )
138
+ repo.unyank( @baz_java_spec )
139
+ assert_equal 1, repo.search_for( @baz_java_spec ).size
140
+ end
123
141
 
124
142
  # Do we even care about this?
125
143
  def test_unyank_returns_nil_for_not_yet_yanked_gem
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stickler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-12 00:00:00.000000000 Z
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.0'
61
+ version: '2.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.0'
68
+ version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: logging
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '10.1'
89
+ version: '10.4'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '10.1'
96
+ version: '10.4'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack-test
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '4.0'
145
+ version: '4.2'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '4.0'
152
+ version: '4.2'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: ronn
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,34 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.7'
167
+ - !ruby/object:Gem::Dependency
168
+ name: mustache
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.99'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.99'
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.9'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.9'
167
195
  description: 'Stickler is a tool to organize and maintain an internal gem repository.
168
196
  Primarily, you would want to use Stickler if: 1. You have proprietary gems that
169
197
  you want to have available via a gem server so you may `gem install` them. 2.
@@ -297,7 +325,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
325
  requirements:
298
326
  - - ">="
299
327
  - !ruby/object:Gem::Version
300
- version: '0'
328
+ version: 1.9.3
301
329
  required_rubygems_version: !ruby/object:Gem::Requirement
302
330
  requirements:
303
331
  - - "~>"
@@ -305,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
333
  version: '2.2'
306
334
  requirements: []
307
335
  rubyforge_project:
308
- rubygems_version: 2.2.2
336
+ rubygems_version: 2.4.6
309
337
  signing_key:
310
338
  specification_version: 4
311
339
  summary: 'Stickler is a tool to organize and maintain an internal gem repository.