gems-status 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module GemsStatusMetadata
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
@@ -20,4 +20,8 @@ private
20
20
  return g.log
21
21
  end
22
22
 
23
+ def commit_key(commit)
24
+ return commit.sha
25
+ end
26
+
23
27
  end
@@ -23,5 +23,10 @@ private
23
23
  repo.pull
24
24
  return repo.commits
25
25
  end
26
+
27
+ def commit_key(commit)
28
+ return commit.hash_id
29
+ end
30
+
26
31
  end
27
32
 
@@ -80,12 +80,12 @@ class NotASecurityAlertChecker < GemChecker
80
80
  @emails.each do |listname, emails|
81
81
  emails.each do |email|
82
82
  if listname.include?(gem.name)
83
- @security_messages[Utils::next_key(gem.name)] = email.subject
83
+ @security_messages["email_#{listname}_#{gem.name}_#{email.uid}"] = email.subject
84
84
  Utils::log_debug "looking for security emails: listname matches gem #{gem.name}: #{listname}"
85
85
  next
86
86
  end
87
87
  if email.subject.include?(gem.name)
88
- @security_messages[Utils::next_key(gem.name)] = email.subject
88
+ @security_messages["email_#{listname}_#{gem.name}_#{email.uid}"] = email.subject
89
89
  Utils::log_debug "looking for security emails: subject matches gem #{gem.name}: #{email.subject}"
90
90
  next
91
91
  end
@@ -114,6 +114,7 @@ class NotASecurityAlertChecker < GemChecker
114
114
 
115
115
  def filter_security_messages_already_fixed(version)
116
116
  #TODO: let's use a database instead of having the info in yaml file
117
+ #TODO: can we know which commits are in a particular version? by date?
117
118
  @security_messages.delete_if do |k,v|
118
119
  @fixed[k] && Gem::Version.new(@fixed[k]) <= version
119
120
  end
@@ -23,7 +23,11 @@ private
23
23
  commits.each do |commit|
24
24
  if message_checker.check_message?(message(commit))
25
25
  Utils::log_debug "#{message(commit)}"
26
- key = next_key(name)
26
+ key = commit_key(commit)
27
+ if !key
28
+ Utils::log_error "no key for #{name}"
29
+ next
30
+ end
27
31
  Utils::log_debug "security key: #{key}"
28
32
  results[key] = message(commit)
29
33
  end
@@ -31,8 +35,8 @@ private
31
35
  return results
32
36
  end
33
37
 
34
- def next_key(name)
35
- return Utils::next_key(name)
38
+ def commit_key(commit)
39
+ raise NotImplementedError
36
40
  end
37
41
 
38
42
  def message(commit)
@@ -15,10 +15,18 @@ private
15
15
  Dir.chdir(svn_dir(source_repo)) do
16
16
  `svn update`
17
17
  log_messages = `svn log`
18
- return log_messages.split("\n")
18
+ return log_messages.split("------------------------------------------------------------------------")
19
19
  end
20
20
  end
21
21
 
22
+ def commit_key(commit)
23
+ if commit.split("|").length == 0
24
+ Utils::log_error("no key for commit #{commit}")
25
+ return nil
26
+ end
27
+ return commit.split("|")[0].strip
28
+ end
29
+
22
30
  def svn_dir(source_repo)
23
31
  source_repo_splitted = URI.parse(source_repo).path.split("/")
24
32
  return source_repo_splitted[-1]
@@ -11,13 +11,6 @@ class Utils
11
11
  return @@errors
12
12
  end
13
13
 
14
- def Utils.next_key(name)
15
- @@keys[name] = 0 unless @@keys[name]
16
- key = name + @@keys[name].to_s
17
- @@keys[name] = @@keys[name] + 1
18
- return key
19
- end
20
-
21
14
  def Utils.check_parameters(classname, conf, parameters)
22
15
  if !conf['classname'] then
23
16
  raise "trying to initialize #{classname} when parameter classname does not exists"
@@ -255,6 +255,7 @@ class ViewResults
255
255
  self.print_hash("errors", Utils::errors, "errors")
256
256
  self.print_summary
257
257
  self.print_hash("checks", checker_results, "summary", true)
258
+ puts "<a href='error.txt'>Check log</a>"
258
259
  date = Time.now.strftime('%a %b %d %H:%M:%S %Z %Y')
259
260
  puts "<p class='footer'>run by <a href=\"https://github.com/jordimassaguerpla/gems-status\">gems-status</a> - #{date} - version: #{GemsStatusMetadata::VERSION}</p>
260
261
  </body>
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: 51
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 11
8
+ - 12
9
9
  - 0
10
- version: 0.11.0
10
+ version: 0.12.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-06-27 00:00:00 Z
18
+ date: 2012-06-28 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: xml-simple
@@ -45,6 +45,62 @@ dependencies:
45
45
  version: "0"
46
46
  type: :runtime
47
47
  version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: gmail
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: git
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: mercurial-ruby
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :runtime
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: json
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
101
+ version: "0"
102
+ type: :runtime
103
+ version_requirements: *id006
48
104
  description: gem-status compares rubygems information from different sources as for reporting which gems are outdated. Sources can be opensuse build service, rubygems.org or a gemfile.lock. Data compared is version and md5sum
49
105
  email: jmassaguerpla@suse.de
50
106
  executables: