tottori-opendata-catalog 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +39 -0
- data/Rakefile +7 -0
- data/bin/tottori-opendata-catalog +18 -0
- data/lib/tottori-opendata-catalog.rb +13 -0
- data/lib/tottori-opendata-catalog/command.rb +57 -0
- data/lib/tottori-opendata-catalog/net.rb +32 -0
- data/lib/tottori-opendata-catalog/parser.rb +136 -0
- data/lib/tottori-opendata-catalog/proxy.rb +28 -0
- data/lib/tottori-opendata-catalog/version.rb +3 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/tottori-opendata-catalog/command_spec.rb +25 -0
- data/spec/tottori-opendata-catalog/parser_spec.rb +82 -0
- data/spec/tottori-opendata-catalog/proxy_spec.rb +15 -0
- data/tottori-opendata-catalog.gemspec +26 -0
- metadata +139 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 22a6e0f965e1ee16d9b023d34ac2054505c68e19
|
4
|
+
data.tar.gz: 90e44e14b33eefa0709e9c85ccf4cdab923e74ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0a9b699b1b35cd0c81d3f55b5d4d757a95aa6d5a79a884416f641a97bd897915633c0e770e272269e47ce2560c900ff3571b6d57dd4e60d3727c0085791c295c
|
7
|
+
data.tar.gz: 0b8e2da856bf8a45e8cb2a6ae218f3fe047cc844c6c6f2b9420bbc4a7c11f6048041cfd04a99c72c669f46e21dcfd4cb789e54ec2a912e2e54ea37f5d0984777
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Masayuki Higashino
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
[![Version](https://img.shields.io/gem/v/cardamon.svg)](https://rubygems.org/gems/tottori-opendata-catalog)
|
2
|
+
|
3
|
+
## TottoriOpenDataCatalog
|
4
|
+
|
5
|
+
This gem provides an API and a CLI of Open Data Catalog of Tottori Prefecture http://db.pref.tottori.jp/opendataResearch.nsf to generate a machine-readable catalog.
|
6
|
+
|
7
|
+
### Installation
|
8
|
+
|
9
|
+
$ gem install cardamon
|
10
|
+
|
11
|
+
### Synopsis
|
12
|
+
|
13
|
+
#### API
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
require 'tottori-opendata-catalog'
|
17
|
+
# TottoriOpenDataCatalog.get returns a nested ruby's object.
|
18
|
+
puts TottoriOpenDataCatalog.get
|
19
|
+
```
|
20
|
+
|
21
|
+
``` ruby
|
22
|
+
require 'tottori-opendata-catalog'
|
23
|
+
# without caching using a local strage (/tmp).
|
24
|
+
puts TottoriOpenDataCatalog.get(cache:false)
|
25
|
+
```
|
26
|
+
|
27
|
+
#### CLI
|
28
|
+
|
29
|
+
``` sh
|
30
|
+
$ tottori-opendata-catalog csv > catalog.csv
|
31
|
+
```
|
32
|
+
|
33
|
+
``` sh
|
34
|
+
$ tottori-opendata-catalog json > catalog.json
|
35
|
+
```
|
36
|
+
|
37
|
+
``` sh
|
38
|
+
$ tottori-opendata-catalog json --no-cache > catalog.json
|
39
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'tottori-opendata-catalog'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
class CLI < Thor
|
7
|
+
option :cache, {type: :boolean, default:true}
|
8
|
+
desc 'csv', 'print a csv file'
|
9
|
+
def csv
|
10
|
+
puts TottoriOpenDataCatalog::Command.to_csv(cache:options[:cache])
|
11
|
+
end
|
12
|
+
desc 'json', 'print a json file'
|
13
|
+
def json
|
14
|
+
puts TottoriOpenDataCatalog::Command.to_json(cache:options[:cache])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
CLI.start(ARGV)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'tottori-opendata-catalog/version'
|
2
|
+
require 'tottori-opendata-catalog/parser'
|
3
|
+
require 'tottori-opendata-catalog/net'
|
4
|
+
require 'tottori-opendata-catalog/proxy'
|
5
|
+
require 'tottori-opendata-catalog/command'
|
6
|
+
|
7
|
+
module TottoriOpenDataCatalog
|
8
|
+
|
9
|
+
def self.get(cache:true)
|
10
|
+
TottoriOpenDataCatalog::Proxy.get(cache:cache)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'tottori-opendata-catalog/proxy'
|
2
|
+
|
3
|
+
module TottoriOpenDataCatalog
|
4
|
+
|
5
|
+
module Command
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def to_json(cache:true)
|
10
|
+
require 'json'
|
11
|
+
JSON.pretty_generate(TottoriOpenDataCatalog::Proxy.get(cache:cache))
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_csv(cache:true)
|
15
|
+
require 'csv'
|
16
|
+
CSV(csv = '') do |line|
|
17
|
+
data = TottoriOpenDataCatalog::Proxy.get(cache:cache)
|
18
|
+
line << %w{
|
19
|
+
category_name
|
20
|
+
resource_name formats department division tags
|
21
|
+
redistribution_allowed commercial_use_allowed
|
22
|
+
provider tel description comment
|
23
|
+
year month day
|
24
|
+
repeat_rule_frequency repeat_rule_interval repeat_rule_description
|
25
|
+
}
|
26
|
+
data[:categories].each do |category|
|
27
|
+
category[:resources].each do |resource|
|
28
|
+
row = []
|
29
|
+
row << category[:name]
|
30
|
+
row << resource[:name]
|
31
|
+
row << resource[:formats].join(' ')
|
32
|
+
row << resource[:department]
|
33
|
+
row << resource[:division]
|
34
|
+
row << resource[:tags].join(' ')
|
35
|
+
row << resource[:redistribution_allowed]
|
36
|
+
row << resource[:commercial_use_allowed]
|
37
|
+
row << resource[:provider]
|
38
|
+
row << resource[:tel]
|
39
|
+
row << resource[:description]
|
40
|
+
row << resource[:comment]
|
41
|
+
row << resource[:year]
|
42
|
+
row << resource[:month]
|
43
|
+
row << resource[:day]
|
44
|
+
row << resource[:repeat_rule][:frequency]
|
45
|
+
row << resource[:repeat_rule][:interval]
|
46
|
+
row << resource[:repeat_rule][:description]
|
47
|
+
line << row
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
return csv
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'digest/sha1'
|
3
|
+
require 'tmpdir'
|
4
|
+
|
5
|
+
module TottoriOpenDataCatalog
|
6
|
+
|
7
|
+
module Net
|
8
|
+
|
9
|
+
class << self
|
10
|
+
|
11
|
+
def get(url, cache:true)
|
12
|
+
return open(url, &:read) unless cache
|
13
|
+
path = File.join(Dir.tmpdir, Digest::SHA1.hexdigest(url))
|
14
|
+
@memo ||= {}
|
15
|
+
if @memo.include?(path)
|
16
|
+
@memo[path]
|
17
|
+
else
|
18
|
+
if File.exists?(path)
|
19
|
+
@memo[path] ||= open(path, &:read)
|
20
|
+
else
|
21
|
+
content = open(url, &:read)
|
22
|
+
open(path, 'w'){ |io| io.write(content) }
|
23
|
+
@memo[path] ||= content
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module TottoriOpenDataCatalog
|
4
|
+
|
5
|
+
module Parser
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
def parse_index(string)
|
10
|
+
doc = Nokogiri::HTML(string, nil, 'Shift_JIS')
|
11
|
+
# collect
|
12
|
+
name = doc.xpath('//title').text.strip
|
13
|
+
anchors = doc.xpath('//a')
|
14
|
+
categories = anchors.select{ |a|
|
15
|
+
a[:href].include?('forweb_bunrui')
|
16
|
+
}.map{ |a|
|
17
|
+
{name:a.text.strip, link:a[:href].strip}
|
18
|
+
}
|
19
|
+
items = {
|
20
|
+
name:name,
|
21
|
+
categories:categories,
|
22
|
+
}
|
23
|
+
return items
|
24
|
+
end
|
25
|
+
|
26
|
+
def parse_list(string)
|
27
|
+
doc = Nokogiri::HTML(string, nil, 'Shift_JIS')
|
28
|
+
# collect
|
29
|
+
items = doc.xpath('//table[@id="contentslist"]/tr[position() > 1]').map{ |tr|
|
30
|
+
tds = tr.children
|
31
|
+
item = {
|
32
|
+
name:tds[0].text.strip,
|
33
|
+
link:tds[0].children[0][:href],
|
34
|
+
formats:tds[1].text.strip,
|
35
|
+
url:tds[2].children[0][:href],
|
36
|
+
department:tds[3].text.strip,
|
37
|
+
division:tds[4].text.strip,
|
38
|
+
}
|
39
|
+
}
|
40
|
+
# trim
|
41
|
+
items.each{ |item|
|
42
|
+
if item[:formats]
|
43
|
+
item[:formats].upcase!
|
44
|
+
item[:formats] = item[:formats].split
|
45
|
+
end
|
46
|
+
}
|
47
|
+
# HACK change format from Notes to PDF.
|
48
|
+
target = items.select{ |item|
|
49
|
+
item[:link] == 'list1_forweb/10EE759AAD20B54749257C68000A2845?OpenDocument'
|
50
|
+
}.first
|
51
|
+
target[:formats] = ['PDF'] if target
|
52
|
+
return items
|
53
|
+
end
|
54
|
+
|
55
|
+
def parse_record(string)
|
56
|
+
doc = Nokogiri::HTML(string, nil, 'Shift_JIS')
|
57
|
+
# collect
|
58
|
+
item = doc.xpath('//form/div[@id="all"]').children.map{ |e|
|
59
|
+
case e.text.strip
|
60
|
+
when /データ年次.*?:(.*)$/
|
61
|
+
{updated_at:$1.strip}
|
62
|
+
when /情報.*?:(.*)/
|
63
|
+
{tags:$1.strip}
|
64
|
+
when /再配布可否.*?:(.*)$/
|
65
|
+
{redistribution_allowed:$1.strip}
|
66
|
+
when /商用利用可否.*?:(.*)$/
|
67
|
+
{commercial_use_allowed:$1.strip}
|
68
|
+
when /テータ提供.*?:(.*)$/
|
69
|
+
{provider:$1.strip}
|
70
|
+
when /問い合わせ先電話番号.*?:(.*)$/
|
71
|
+
{tel:$1.strip}
|
72
|
+
when /内容.*?:(.*)$/
|
73
|
+
{description:$1.strip}
|
74
|
+
when /コメント.*?:(.*)$/
|
75
|
+
{comment:$1.strip}
|
76
|
+
end
|
77
|
+
}.compact.inject(&:merge)
|
78
|
+
# trim
|
79
|
+
if item[:redistribution_allowed] == '○'
|
80
|
+
item[:redistribution_allowed] = true
|
81
|
+
end
|
82
|
+
if item[:commercial_use_allowed] == '○'
|
83
|
+
item[:commercial_use_allowed] = true
|
84
|
+
end
|
85
|
+
updated_at = item.delete(:updated_at)
|
86
|
+
if updated_at
|
87
|
+
updated_at.gsub!(' ', ' ')
|
88
|
+
updated_at.tr!('0-9', '0-9')
|
89
|
+
end
|
90
|
+
date, repeat_rule_description = updated_at.split
|
91
|
+
year, month, day = date.split('.')
|
92
|
+
item[:year] = (year ? year.to_i : nil)
|
93
|
+
item[:month] = (month ? month.to_i : nil)
|
94
|
+
item[:day] = (day ? day.to_i : nil)
|
95
|
+
item[:repeat_rule] = {}
|
96
|
+
item[:repeat_rule].merge!(
|
97
|
+
case repeat_rule_description
|
98
|
+
when /毎年度/
|
99
|
+
{frequency:'fiscal_yearly', interval:nil}
|
100
|
+
when /毎年/
|
101
|
+
{frequency:'yearly', interval:nil}
|
102
|
+
when /毎月/
|
103
|
+
{frequency:'monthly', interval:nil}
|
104
|
+
when /毎週/
|
105
|
+
{frequency:'weekly', interval:nil}
|
106
|
+
when /(\d)年度毎/
|
107
|
+
{frequency:'fiscal_yearly', interval:$1.to_i}
|
108
|
+
when /(\d)年毎/
|
109
|
+
{frequency:'yearly', interval:$1.to_i}
|
110
|
+
when /(\d)月毎/, /(\d)ヶ月毎/
|
111
|
+
{frequency:'monthly', interval:$1.to_i}
|
112
|
+
when /(\d)週毎/
|
113
|
+
{frequency:'weekly', interval:$1.to_i}
|
114
|
+
when /随時/
|
115
|
+
{frequency:'as_needed', interval:nil}
|
116
|
+
when /不定期/
|
117
|
+
{frequency:'unscheduled', interval:nil}
|
118
|
+
else
|
119
|
+
{frequency:nil, interval:nil}
|
120
|
+
end)
|
121
|
+
item[:repeat_rule].merge!(description:repeat_rule_description)
|
122
|
+
# 繰り返しルールの説明が有るのに周期が無い場合は例外をスロー
|
123
|
+
if !item[:repeat_rule][:description].nil? && item[:repeat_rule][:frequency].nil?
|
124
|
+
raise
|
125
|
+
end
|
126
|
+
if item.include?(:tags)
|
127
|
+
item[:tags] = item[:tags].split
|
128
|
+
end
|
129
|
+
return item
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
module TottoriOpenDataCatalog
|
3
|
+
|
4
|
+
module Proxy
|
5
|
+
|
6
|
+
INDEX_URL = 'http://db.pref.tottori.jp/opendataResearch.nsf/index.html'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
|
10
|
+
def get(cache:true)
|
11
|
+
index = Parser.parse_index(Net.get(INDEX_URL, cache:cache))
|
12
|
+
index[:categories].each do |category|
|
13
|
+
category[:link] = File.join(File.dirname(INDEX_URL), category[:link])
|
14
|
+
category[:resources] ||= []
|
15
|
+
Parser.parse_list(Net.get(category[:link], cache:cache)).each do |resource|
|
16
|
+
resource[:link] = File.join(File.dirname(INDEX_URL), resource[:link])
|
17
|
+
resource.merge!(Parser.parse_record(Net.get(resource[:link], cache:cache)))
|
18
|
+
category[:resources] << resource
|
19
|
+
end
|
20
|
+
end
|
21
|
+
return index
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe TottoriOpenDataCatalog::Command do
|
4
|
+
|
5
|
+
describe '#to_csv' do
|
6
|
+
|
7
|
+
it 'does not raise errors.' do
|
8
|
+
expect do
|
9
|
+
TottoriOpenDataCatalog::Command.to_csv
|
10
|
+
end.not_to raise_error
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#to_json' do
|
16
|
+
|
17
|
+
it 'does not raise errors.' do
|
18
|
+
expect do
|
19
|
+
TottoriOpenDataCatalog::Command.to_json
|
20
|
+
end.not_to raise_error
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
include TottoriOpenDataCatalog
|
3
|
+
include TottoriOpenDataCatalog::Proxy
|
4
|
+
|
5
|
+
describe TottoriOpenDataCatalog::Parser do
|
6
|
+
|
7
|
+
def parse_index
|
8
|
+
@index ||= Parser.parse_index(Net.get(INDEX_URL))
|
9
|
+
end
|
10
|
+
|
11
|
+
def parse_list(path)
|
12
|
+
url = File.join(File.dirname(INDEX_URL), path)
|
13
|
+
@lists ||= {}
|
14
|
+
@lists[url] ||= Parser.parse_list(Net.get(url))
|
15
|
+
end
|
16
|
+
|
17
|
+
def parse_record(path)
|
18
|
+
url = File.join(File.dirname(INDEX_URL), path)
|
19
|
+
@records ||= {}
|
20
|
+
@records[url] ||= Parser.parse_record(Net.get(url))
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#parse_index' do
|
24
|
+
|
25
|
+
it 'does not raise errors.' do
|
26
|
+
expect do
|
27
|
+
parse_index
|
28
|
+
end.not_to raise_error
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'returns valid data.' do
|
32
|
+
index = parse_index
|
33
|
+
expect(index[:name].blank?).to be false
|
34
|
+
expect(index[:categories].blank?).to be false
|
35
|
+
index[:categories].each do |category|
|
36
|
+
expect(category[:name].blank?).to be false
|
37
|
+
expect(category[:link].blank?).to be false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#parse_list' do
|
44
|
+
|
45
|
+
it 'does not raise errors.' do
|
46
|
+
parse_index[:categories].each do |list|
|
47
|
+
expect do
|
48
|
+
parse_list(list[:link])
|
49
|
+
end.not_to raise_error
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'returns valid data.' do
|
54
|
+
parse_index[:categories].each do |list|
|
55
|
+
parse_list(list[:link]).each do |table|
|
56
|
+
expect(table[:name].blank?).to be false
|
57
|
+
expect(table[:link].blank?).to be false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '#parse_record' do
|
65
|
+
|
66
|
+
it 'does not raise errors.' do
|
67
|
+
parse_index[:categories].each do |list|
|
68
|
+
parse_list(list[:link]).each do |record|
|
69
|
+
expect do
|
70
|
+
parse_record(record[:link])
|
71
|
+
end.not_to raise_error
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'returns valid data.' do
|
77
|
+
# TODO ;)
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tottori-opendata-catalog/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tottori-opendata-catalog"
|
8
|
+
spec.version = TottoriOpenDataCatalog::VERSION
|
9
|
+
spec.authors = ["Masayuki Higashino"]
|
10
|
+
spec.email = ["mh.on.web@gmail.com"]
|
11
|
+
spec.summary = %q{An API and a CLI for Open Data Catalog of Tottori Prefecture.}
|
12
|
+
spec.description = %q{An API and a CLI for Open Data Catalog of Tottori Prefecture.}
|
13
|
+
spec.homepage = "https://github.com/mh61503891/tottori-opendata-catalog"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "thor", "~> 0.19.1"
|
22
|
+
spec.add_dependency "nokogiri", "~> 1.6.1"
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tottori-opendata-catalog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Masayuki Higashino
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.19.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.19.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nokogiri
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.6.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.6.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: An API and a CLI for Open Data Catalog of Tottori Prefecture.
|
84
|
+
email:
|
85
|
+
- mh.on.web@gmail.com
|
86
|
+
executables:
|
87
|
+
- tottori-opendata-catalog
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- .gitignore
|
92
|
+
- .rspec
|
93
|
+
- .travis.yml
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/tottori-opendata-catalog
|
99
|
+
- lib/tottori-opendata-catalog.rb
|
100
|
+
- lib/tottori-opendata-catalog/command.rb
|
101
|
+
- lib/tottori-opendata-catalog/net.rb
|
102
|
+
- lib/tottori-opendata-catalog/parser.rb
|
103
|
+
- lib/tottori-opendata-catalog/proxy.rb
|
104
|
+
- lib/tottori-opendata-catalog/version.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- spec/tottori-opendata-catalog/command_spec.rb
|
107
|
+
- spec/tottori-opendata-catalog/parser_spec.rb
|
108
|
+
- spec/tottori-opendata-catalog/proxy_spec.rb
|
109
|
+
- tottori-opendata-catalog.gemspec
|
110
|
+
homepage: https://github.com/mh61503891/tottori-opendata-catalog
|
111
|
+
licenses:
|
112
|
+
- MIT
|
113
|
+
metadata: {}
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
requirements: []
|
129
|
+
rubyforge_project:
|
130
|
+
rubygems_version: 2.0.3
|
131
|
+
signing_key:
|
132
|
+
specification_version: 4
|
133
|
+
summary: An API and a CLI for Open Data Catalog of Tottori Prefecture.
|
134
|
+
test_files:
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
- spec/tottori-opendata-catalog/command_spec.rb
|
137
|
+
- spec/tottori-opendata-catalog/parser_spec.rb
|
138
|
+
- spec/tottori-opendata-catalog/proxy_spec.rb
|
139
|
+
has_rdoc:
|