gems-license-finder 0.0.8 → 0.0.9

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: f24622267d82c32a72bf410472550cfedee46c72
4
- data.tar.gz: f63ead7eabb922ec6de5e8f5623b67366789c2b9
3
+ metadata.gz: 03c98880e76df17e93ea9530abbc891b3c4f9f30
4
+ data.tar.gz: 5b7c68491b7d8c3c841ed9652eab6f75580e4508
5
5
  SHA512:
6
- metadata.gz: 840b18a430c3f4a8ac7eeb2cdc309ba331f665f5416db65634486b3247dafb2ba4d1bd4f95a19a67c0ea986e77f1a41d0c52c0b1b8a0dcb8c9cd700bd370e4cf
7
- data.tar.gz: 082b39f2780df416a8270310b0a869d2c24bebc82d16e01f6d41be3ac15eeb2f3fa140bca36b0d516b651e3c5d2f07c94956db0b71822f83e57c3c066e8d6f35
6
+ metadata.gz: ffbfe5c7c79e5745104c4a1b14e52d78590895a1e7c0cfe970f8b78eb52a9e1ccb6b80dc4bc9339422caa0d8e4ea1526a45865a39f7840f495ea2c44ac816fde
7
+ data.tar.gz: 0399d1f8c81c4a6f8d86a438b0747e347ecd0986ee2dd60ccbb6583872d122a6f679b65fc06338f99567aac579a81761b4ae4e199cff2c82a6719d09ff2a2cd3
@@ -45,7 +45,7 @@ module GemsLicenseFinder
45
45
  end
46
46
 
47
47
  def find name
48
- normalize(github_info name, rubygems_info( name ))
48
+ normalize github_info(name , rubygems_info(name))
49
49
  end
50
50
 
51
51
  private
@@ -57,18 +57,18 @@ module GemsLicenseFinder
57
57
  raise e.io.status.first == "404" ? GemNotFound.new(e) : e
58
58
  end
59
59
 
60
- info = Hash[content.scan(/<a href="(.*?)" rel.*>(.*?)</)].invert
60
+ info = Hash[content.scan(/<a rel=\"nofollow\".*?href=\"(.*?)\".*?>(.*?)</)].invert
61
61
  type, url = normalize_licence(
62
62
  (utf8_match(content,'<h5>Licenses<\/h5>.*?<p>(.*?)<')[1] rescue ""))
63
63
  description = (CGI.unescapeHTML utf8_match(content,'gem__desc.*?<p>(.*?)<')[1].
64
64
  strip.squeeze(" ").gsub(/\n/,"") rescue nil)
65
65
 
66
- info.merge({ license_type: type, license_url: url, description: description })
66
+ info.merge license_type: type, license_url: url, description: description
67
67
  end
68
68
 
69
69
  def github_info name, rubygems
70
70
  url = rubygems["Source Code"] || rubygems["Homepage"]
71
- if url.to_s =~ /\/\/github\.com/
71
+ if url.to_s =~ /github\.com/
72
72
  # Sometimes the homepage in rubygems.org is old, e.g:
73
73
  # carlhuda/bundler => bundler/bundler
74
74
  open(url.sub("http:","https:")) { |o| url = o.base_uri.to_s } # follow redirects
@@ -1,3 +1,3 @@
1
1
  module GemsLicenseFinder
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gems-license-finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eran Barak Levi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-16 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest