deriving_license 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,4 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake", ">= 0.8.7"
5
+ gem "rake", ">= 0.8.7"
6
+ gem "safe_yaml"
data/Gemfile.lock CHANGED
@@ -1,14 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deriving_license (0.1.2)
4
+ deriving_license (0.1.3)
5
5
  gemnasium-parser
6
+ safe_yaml
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  gemnasium-parser (0.1.9)
11
12
  rake (10.0.4)
13
+ safe_yaml (0.9.1)
12
14
 
13
15
  PLATFORMS
14
16
  ruby
@@ -16,3 +18,4 @@ PLATFORMS
16
18
  DEPENDENCIES
17
19
  deriving_license!
18
20
  rake (>= 0.8.7)
21
+ safe_yaml
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'deriving_license'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.summary = "Deriving Licence finds the license agreements for all gems in your Gemfile"
5
5
  s.description = "Deriving Licence finds the license agreements for all gems in your Gemfile if included in your project, or in a Gemfile passed to the included binary"
6
6
  s.authors = ["Tom Allen"]
@@ -12,5 +12,6 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split($\)
13
13
  s.test_files = s.files.grep(/^test\//)
14
14
 
15
- s.add_dependency "gemnasium-parser"
15
+ s.add_runtime_dependency "gemnasium-parser"
16
+ s.add_runtime_dependency "safe_yaml"
16
17
  end
@@ -1,5 +1,6 @@
1
1
  require "gemnasium/parser"
2
2
  require "bundler"
3
+ require "safe_yaml"
3
4
 
4
5
  class DerivingLicense
5
6
 
@@ -43,10 +44,11 @@ class DerivingLicense
43
44
  Bundler.with_clean_env do # This gets out of the bundler context.
44
45
  remote = /#{d.name}/.match( `BUNDLE_GEMFILE=#{path}; gem list #{d.name}` ) ? "" : "-r "
45
46
  print "Determining license for #{d.name}#{remote.empty? ? "" : " (remote call required)"}..."
46
- @spec = eval `gem specification #{remote}#{d.name} --ruby`
47
+ yaml = `gem specification #{remote}#{d.name} --yaml`
48
+ @spec = YAML.load(yaml, :safe => true)
47
49
  end
48
- print "#{@spec.licenses.empty? ? "UNKNOWN" : "SUCCESS"}\n"
49
- @spec.licenses.each{ |l| licenses[l]+=1 }
50
+ print "#{@spec["licenses"].empty? ? "UNKNOWN" : "SUCCESS"}\n"
51
+ @spec["licenses"].each{ |l| licenses[l]+=1 }
50
52
  end
51
53
  licenses
52
54
  end
@@ -30,7 +30,7 @@ class DerivingLicenseTest < Test::Unit::TestCase
30
30
  assert_nothing_raised do
31
31
  DerivingLicense.run("Gemfile")
32
32
  end
33
- assert_equal( {"MIT"=>1}, DerivingLicense.run("Gemfile") )
33
+ assert_equal( {"MIT"=>2}, DerivingLicense.run("Gemfile") )
34
34
  end
35
35
 
36
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deriving_license
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: safe_yaml
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  description: Deriving Licence finds the license agreements for all gems in your Gemfile
31
47
  if included in your project, or in a Gemfile passed to the included binary
32
48
  email: tom@jugglethis.net