data_kitten 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/data_kitten/agent.rb +5 -1
- data/lib/data_kitten/publishing_formats/ckan.rb +24 -8
- data/lib/data_kitten/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDc5ZTUwMDA5OGJjMjg3YzI4MThmZWYzNTQ1NTkyNTNlN2JhZWU5Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTkzNGQxYWIwOWU5NjliZThmZjE0Y2FkMWE1NmFhYTkwMTY2MGJhOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGM1NjQ2ZDUzYzJiYjY5NzY1OTk1YzI0ZDZhZDQ3ZGIwZjdhNDVmYzRjNzM4
|
10
|
+
ODc2MTUyYzFiOGNmNmNjNzExZjFmMTllZmFiNDMyZThiY2VmYjEyYThkZWMz
|
11
|
+
ZmU2NjUyMDQ2MjVkYTNlYmNhNDBhOGYzYzE2Nzk3NjFmYTAyMTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWJhOTU2YTNkMmY3MzhiZjllNTY4YmY1MDFjNGZlZmY1MjIwODQ4ZDA5OGIz
|
14
|
+
N2YwMjk4YzM5ZWUyM2VhODJjZjgzM2QzY2JjYjA5ZDFhMTUzM2U0MGU4ZDYz
|
15
|
+
NjUxN2ExYTg0MTJlZTJkN2U2MTc1ZDZjMjBjOWQ5NzU3MWI1MGY=
|
data/lib/data_kitten/agent.rb
CHANGED
@@ -76,21 +76,27 @@ module DataKitten
|
|
76
76
|
[]
|
77
77
|
end
|
78
78
|
|
79
|
+
def maintainers
|
80
|
+
extract_agent('maintainer', 'maintainer_email')
|
81
|
+
end
|
82
|
+
|
83
|
+
def contributors
|
84
|
+
extract_agent('author', 'author_email')
|
85
|
+
end
|
86
|
+
|
79
87
|
# A list of licenses.
|
80
88
|
#
|
81
89
|
# @see Dataset#licenses
|
82
90
|
def licenses
|
83
91
|
extras = metadata["extras"] || {}
|
92
|
+
id = metadata["license_id"]
|
84
93
|
uri = metadata["license_url"] || extras["licence_url"]
|
85
94
|
name = metadata["license_title"] || extras["licence_url_title"]
|
86
|
-
[
|
87
|
-
License.new(:id =>
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
]
|
92
|
-
rescue
|
93
|
-
[]
|
95
|
+
if [id, uri, name].any?
|
96
|
+
[License.new(:id => id, :uri => uri, :name => name)]
|
97
|
+
else
|
98
|
+
[]
|
99
|
+
end
|
94
100
|
end
|
95
101
|
|
96
102
|
# A list of distributions, referred to as +resources+ by Datapackage.
|
@@ -183,6 +189,16 @@ module DataKitten
|
|
183
189
|
URI(self.uri)
|
184
190
|
end
|
185
191
|
|
192
|
+
def extract_agent(name_field, email_field)
|
193
|
+
name = metadata[name_field]
|
194
|
+
email = metadata[email_field]
|
195
|
+
if [name, email].any?
|
196
|
+
[Agent.new(name: name, mbox: email)]
|
197
|
+
else
|
198
|
+
[]
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
186
202
|
end
|
187
203
|
end
|
188
204
|
end
|
data/lib/data_kitten/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_kitten
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|