odlifier 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +13 -5
  2. data/lib/odlifier.rb +10 -2
  3. data/lib/odlifier/version.rb +1 -1
  4. metadata +21 -21
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 634ab239c836b776514d2c56b0c9c4efeead831f
4
- data.tar.gz: bf11a97d0f6d6a5597cdc1d957b588e995291206
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzlhNDQyMWRkMmIzODZjOWY4NzVjNWQwNzQ1MmE2ZDU3ZjY0YTUwMw==
5
+ data.tar.gz: !binary |-
6
+ ZWNjYmZkMWVkMjM1NjRkOTc3YmRkNjE0MzY5MmU1NjM4YjE4YjkwYQ==
5
7
  SHA512:
6
- metadata.gz: d3ab4a4bfb98e9115fe1b1df484d9707f8edeb98e33768819ecc7358da71f659c00da85d296761e71f2e10fd6501b56f628d5429f92a3909114233dad27a89c1
7
- data.tar.gz: e1cc676d743a1beaf54802391b8095c59788d5843e20dea41555063d71406076bb54f5a3f133ffc1384e5e936097db22588c2afef5fe35cc4d57d438692f7d18
8
+ metadata.gz: !binary |-
9
+ NTM3NjFiNDBmYzdiOWQwNzM1OWZkMzRlYzcyZjg4MTZlNmQzMzk1MDRhN2Y2
10
+ ZWZlNGY0MGU2YjEzMjYyZjU1ZWNmNDdlN2ViZDM2YWJiNTAxNzQ2NDFlNTVj
11
+ N2VkYzkwYzM0ODdkNGM1NDVlMmYyYjFiNTdlZDIwN2UxMzBlM2Q=
12
+ data.tar.gz: !binary |-
13
+ NmNiOTJiNDVkNDI4NTYyMzY3NjBmNjRjYjAyMDRmOTk4OWUwZTM1MWMzMDM0
14
+ YjVjZDZkZGEyMmQzNWU4ZDBlZDQ4NzNlYjYwMzg5YjQyNGE1YWNmMTA0NDQw
15
+ NTliYWZjNGM4MDkyMTRjZjExNDAzNTI0MGEwMGNiZWQwYTE1ZmY=
data/lib/odlifier.rb CHANGED
@@ -11,7 +11,7 @@ module Odlifier
11
11
  end
12
12
 
13
13
  def self.define(id)
14
- response = self.get("http://licenses.opendefinition.org/licenses/#{id.upcase}.json")
14
+ response = self.get("http://licenses.opendefinition.org/licenses/#{id}.json")
15
15
  unless response.header.code == "404"
16
16
  License.new(response.parsed_response)
17
17
  else
@@ -29,11 +29,19 @@ module Odlifier
29
29
  candidates = []
30
30
  response = self.get("http://licenses.opendefinition.org/licenses/groups/all.json")
31
31
  response.parsed_response.each do |key, val|
32
- candidates << val if key.match /#{id}-[0-9]+\.[0-9]+/i
32
+ candidates << val if license_id_matches(id, key)
33
33
  end
34
34
  candidates
35
35
  end
36
36
 
37
+ def self.license_id_matches(id, key)
38
+ if id.match /[0-9]+\.[0-9]+$/
39
+ key.match /#{id}/i
40
+ else
41
+ key.match /#{id}-[0-9]+\.[0-9]+/i
42
+ end
43
+ end
44
+
37
45
  end
38
46
 
39
47
  # List a load of content license IDs
@@ -1,3 +1,3 @@
1
1
  module Odlifier
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odlifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Harrison
@@ -14,84 +14,84 @@ dependencies:
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
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: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
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: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
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'
55
55
  - !ruby/object:Gem::Dependency
56
- name: fakeweb
56
+ name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.15.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 1.15.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: vcr
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coveralls
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description:
@@ -100,10 +100,10 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
- - lib/odlifier/version.rb
104
- - lib/odlifier.rb
105
103
  - LICENSE.md
106
104
  - README.md
105
+ - lib/odlifier.rb
106
+ - lib/odlifier/version.rb
107
107
  homepage: http://github.com/odlifier
108
108
  licenses:
109
109
  - MIT
@@ -114,17 +114,17 @@ require_paths:
114
114
  - lib
115
115
  required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - '>='
117
+ - - ! '>='
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.0.3
127
+ rubygems_version: 2.4.2
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Get information about an open licence using a simple identifier