gemsurance 0.2.0 → 0.3.0

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: b1bc4eb78cfaa346bb8b5e3c1396227e9db62a28
4
- data.tar.gz: 7e5f0ea26909a7789226282822c80cf79bb32f6c
3
+ metadata.gz: 1ee2672cc1563ec2e54f5b0a8590779a6f55bcf9
4
+ data.tar.gz: 9b730d7c1fc07965f21769a88b0bcd68d2d6f3c0
5
5
  SHA512:
6
- metadata.gz: 60e4ae40728a4dae3f06dcf71d8e6528251af1861bf34ca9695ad8b494827deecee34c5c3089f13e01e99972e6331c7d4c8da0b94182bbb0cb6e44d3622ecf30
7
- data.tar.gz: 8678ca329cdaf138d632dfbbcb80be6ec68f6ab66bf33de02cc0c961c76df013b04af4b5416df51df7b3f58a95df9cbbf45abfb3a5b84c2b5e12bbee2145799f
6
+ metadata.gz: d68e312799a4d3bb2fc3cd4c1c443359d759fb0ccad01eb3c04d2eeddccec54132e0edb6e57f841c6d5fc28b2bf53dd0c13e2e1c1c73b1a6a31213399e3410c1
7
+ data.tar.gz: 914ef9403fc129fa7f39e26bc1d0e32ba2fccc3898d228249f54b55e979c0f8c968b93c1a2ea9ca8376db69c8104f7cbafac5fe80577faccbccb04715872a215
@@ -5,13 +5,14 @@ module Gemsurance
5
5
  STATUS_CURRENT = 'current'
6
6
  STATUS_VULNERABLE = 'vulnerable'
7
7
 
8
- attr_reader :name, :current_version, :newest_version, :vulnerabilities,
8
+ attr_reader :name, :current_version, :newest_version, :in_gem_file, :vulnerabilities,
9
9
  :homepage_uri, :source_code_uri, :documentation_uri
10
10
 
11
- def initialize(name, current_version, newest_version, homepage_uri, source_code_uri, documentation_uri, status = STATUS_CURRENT)
11
+ def initialize(name, current_version, newest_version, in_gem_file, homepage_uri, source_code_uri, documentation_uri, status = STATUS_CURRENT)
12
12
  @name = name
13
13
  @current_version = current_version
14
14
  @newest_version = newest_version
15
+ @in_gem_file = in_gem_file
15
16
  @homepage_uri = homepage_uri
16
17
  @documentation_uri = documentation_uri
17
18
  @source_code_uri = source_code_uri
@@ -46,8 +47,9 @@ module Gemsurance
46
47
  end
47
48
  end
48
49
 
49
- def initialize(specs, bundle_definition)
50
+ def initialize(specs, dependencies, bundle_definition)
50
51
  @specs = specs
52
+ @dependencies = dependencies
51
53
  @bundle_definition = bundle_definition
52
54
  end
53
55
 
@@ -75,10 +77,11 @@ module Gemsurance
75
77
  # TODO: handle git versions
76
78
  # spec_version = "#{active_spec.version}#{active_spec.git_version}"
77
79
  # current_version = "#{current_spec.version}#{current_spec.git_version}"
80
+ in_gem_file = @dependencies.any?{|d| d.name == active_spec.name}
78
81
  if gem_outdated || git_outdated
79
- gem_infos << GemInfo.new(active_spec.name, current_spec.version, active_spec.version, homepage_uri, documentation_uri, source_code_uri, GemInfo::STATUS_OUTDATED)
82
+ gem_infos << GemInfo.new(active_spec.name, current_spec.version, active_spec.version, in_gem_file, homepage_uri, documentation_uri, source_code_uri, GemInfo::STATUS_OUTDATED)
80
83
  else
81
- gem_infos << GemInfo.new(active_spec.name, current_spec.version, current_spec.version, homepage_uri, documentation_uri, source_code_uri)
84
+ gem_infos << GemInfo.new(active_spec.name, current_spec.version, current_spec.version, in_gem_file, homepage_uri, documentation_uri, source_code_uri)
82
85
  end
83
86
  end
84
87
  gem_infos
@@ -23,11 +23,13 @@ module Gemsurance
23
23
  def retrieve_bundled_gem_infos
24
24
  puts "Retrieving gem version information..."
25
25
 
26
- current_specs = Bundler.load.specs
26
+ bundler = Bundler.load
27
+ current_specs = bundler.specs
28
+ dependencies = bundler.dependencies
27
29
  definition = Bundler.definition(true)
28
30
  definition.resolve_remotely!
29
31
 
30
- GemInfoRetriever.new(current_specs, definition).retrieve(:pre => @options[:pre])
32
+ GemInfoRetriever.new(current_specs, dependencies, definition).retrieve(:pre => @options[:pre])
31
33
  end
32
34
 
33
35
  def retrieve_vulnerability_data
@@ -751,6 +751,7 @@
751
751
  <body>
752
752
  <div class="wrapper">
753
753
  <h1>Gemsurance Report</h1>
754
+ <p>Gems in bold appear in the Gemfile. Other gems appear in Gemfile.lock.</p>
754
755
  <table class="table">
755
756
  <thead>
756
757
  <tr>
@@ -776,7 +777,13 @@
776
777
  end
777
778
  %>
778
779
  <tr class="<%= row_class %>">
779
- <td><%= gem_info.name %></td>
780
+ <td>
781
+ <% if gem_info.in_gem_file %>
782
+ <strong><%= gem_info.name %></strong>
783
+ <% else %>
784
+ <%= gem_info.name %>
785
+ <% end %>
786
+ </td>
780
787
  <td><%= gem_info.current_version %></td>
781
788
  <td><%= gem_info.newest_version %></td>
782
789
  <td>
@@ -1,3 +1,3 @@
1
1
  module Gemsurance
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemsurance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: git
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gems
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.8'
55
55
  - !ruby/object:Gem::Dependency
@@ -120,17 +120,17 @@ require_paths:
120
120
  - lib
121
121
  required_ruby_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.1.11
133
+ rubygems_version: 2.2.2
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Your Gem Insurance Policy