gems-status 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,8 +36,15 @@ class GemsCompositeCommand < GemsCommand
36
36
  @results[command.ident] = command.result
37
37
  end
38
38
  @checkers.each do |check_class|
39
- @results[@target].sort.each do |k, gem|
40
- @checker_results[gem.name].each { |g| check_class::description + gem.name unless check_class::check?(g) }
39
+ Utils::log_debug "checking #{check_class::description}"
40
+ @results[@target].sort.each do |k, gems|
41
+ @checker_results[k] = ""
42
+ gems.each do |gem|
43
+ if !check_class::check?(gem)
44
+ @checker_results[gem.name] << " #{check_class::description}
45
+ #{gem.name} #{gem.version} #{gem.origin} "
46
+ end
47
+ end
41
48
  end
42
49
  end
43
50
  end
data/lib/gems_status.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/ruby
2
- #TODO: implement a nicer interface
3
- #
4
2
 
5
3
 
6
4
 
@@ -1,3 +1,3 @@
1
1
  module GemsStatusMetadata
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/lockfile_gems.rb CHANGED
@@ -18,12 +18,13 @@ class LockfileGems < GemsCommand
18
18
  end
19
19
 
20
20
  def get_data(dirname, filename)
21
- Dir.chdir(dirname)
22
21
  data = ""
23
- begin
24
- data = File.open(filename).read
25
- rescue
26
- Utils::log_error("?", "There was a problem opening file #{filename} ")
22
+ Dir.chdir(dirname) do
23
+ begin
24
+ data = File.open(filename).read
25
+ rescue
26
+ Utils::log_error("?", "There was a problem opening file #{filename} ")
27
+ end
27
28
  end
28
29
  return data
29
30
  end
@@ -6,10 +6,21 @@ require 'gem_checker'
6
6
  class NotNativeGemChecker < GemChecker
7
7
  def NotNativeGemChecker.check?(gem)
8
8
  result = nil
9
- gem_uri = "#{gem.gems_url}/#{gem.name}-#{gem.version}.gem"
9
+ gem_uri = URI.parse("#{gem.gems_url}/#{gem.name}-#{gem.version}.gem" )
10
+ uri_debug = gem_uri.clone
11
+ uri_debug.password = "********" if uri_debug.password
12
+ Utils::log_debug "download #{@name} from #{uri_debug}"
10
13
  begin
11
- source = open(gem_uri, Gem.binary_mode) do |io|
12
- result = Gem::Format.from_io io
14
+ if gem_uri.user && gem_uri.password
15
+ source = open(gem_uri.scheme + "://" + gem_uri.host + "/" + gem_uri.path,
16
+ Gem.binary_mode,
17
+ :http_basic_authentication=>[gem_uri.user, gem_uri.password]) do |io|
18
+ result = Gem::Format.from_io io
19
+ end
20
+ else
21
+ source = open(gem_uri, Gem.binary_mode) do |io|
22
+ result = Gem::Format.from_io io
23
+ end
13
24
  end
14
25
  rescue IOError
15
26
  #bug on open-uri:137 on closing strings
data/lib/view_results.rb CHANGED
@@ -199,7 +199,7 @@ class ViewResults
199
199
  self.print_hash("checks", checker_results, "check")
200
200
  self.print_hash("comments", comments, "comment")
201
201
  self.print_hash("errors", Utils::errors, "errors")
202
- date = Time.now.strftime('%F0')
202
+ date = Time.now.strftime('%a %b %d %H:%M:%S %Z %Y')
203
203
  puts "<p class='footer'>run by <a href=\"https://github.com/jordimassaguerpla/gems-status\">gems-status</a> - #{date} - version: #{GemsStatusMetadata::VERSION}</p>
204
204
  </body>
205
205
  </html>"
@@ -6,8 +6,9 @@ require 'rubygems/dependency'
6
6
  class LockfileGemsTest < LockfileGems
7
7
  attr_accessor :result
8
8
  def initialize
9
- #TODO: this won't work in other development machines!
10
- @filenames = ["/home/jordi/work/suse/gems-status/test/Gemfile.lock.test"]
9
+ dir=File.expand_path(File.dirname(__FILE__))
10
+ puts "DEBUG: dir : #{dir} #{dir.class.name}"
11
+ @filenames = ["#{dir}/Gemfile.lock.test"]
11
12
  @gems_url = ""
12
13
  @result = {}
13
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gems-status
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordi Massaguer Pla
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-01 00:00:00 Z
18
+ date: 2012-04-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: xml-simple
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  requirements: []
111
111
 
112
112
  rubyforge_project:
113
- rubygems_version: 1.8.11
113
+ rubygems_version: 1.8.15
114
114
  signing_key:
115
115
  specification_version: 3
116
116
  summary: compares rubygems from different sources