yuso 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +39 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/data/sagawa/chugoku.json +86 -0
  12. data/data/sagawa/hokkaido.json +86 -0
  13. data/data/sagawa/hokuriku.json +86 -0
  14. data/data/sagawa/kansai.json +86 -0
  15. data/data/sagawa/kanto.json +86 -0
  16. data/data/sagawa/kitakyushu.json +86 -0
  17. data/data/sagawa/kitatohoku.json +86 -0
  18. data/data/sagawa/mapping.json +49 -0
  19. data/data/sagawa/minamikyushu.json +158 -0
  20. data/data/sagawa/minamitohoku.json +86 -0
  21. data/data/sagawa/okinawa.json +1 -0
  22. data/data/sagawa/shikoku.json +86 -0
  23. data/data/sagawa/shinetsu.json +86 -0
  24. data/data/sagawa/tokai.json +86 -0
  25. data/data/yamato/chubu.json +98 -0
  26. data/data/yamato/chugoku.json +98 -0
  27. data/data/yamato/hokkaido.json +98 -0
  28. data/data/yamato/hokuriku.json +98 -0
  29. data/data/yamato/kansai.json +98 -0
  30. data/data/yamato/kanto.json +98 -0
  31. data/data/yamato/kitatohoku.json +98 -0
  32. data/data/yamato/kyushu.json +98 -0
  33. data/data/yamato/mapping.json +49 -0
  34. data/data/yamato/minamitohoku.json +98 -0
  35. data/data/yamato/okinawa.json +98 -0
  36. data/data/yamato/shikoku.json +98 -0
  37. data/data/yamato/shinetsu.json +98 -0
  38. data/data/yubin/chugoku.json +101 -0
  39. data/data/yubin/hokkaido.json +101 -0
  40. data/data/yubin/hokuriku.json +101 -0
  41. data/data/yubin/kanto.json +101 -0
  42. data/data/yubin/kinki.json +101 -0
  43. data/data/yubin/kyushu.json +101 -0
  44. data/data/yubin/mapping.json +49 -0
  45. data/data/yubin/okinawa.json +101 -0
  46. data/data/yubin/shikoku.json +101 -0
  47. data/data/yubin/shinetsu.json +101 -0
  48. data/data/yubin/tohoku.json +101 -0
  49. data/data/yubin/tokai.json +101 -0
  50. data/lib/yuso.rb +8 -0
  51. data/lib/yuso/sagawa/shipping_fee.rb +15 -0
  52. data/lib/yuso/version.rb +3 -0
  53. data/lib/yuso/yamato/shipping_fee.rb +15 -0
  54. data/lib/yuso/yubin/shipping_fee.rb +15 -0
  55. data/yuso.gemspec +27 -0
  56. metadata +142 -0
@@ -0,0 +1,101 @@
1
+ {
2
+ "hokkaido": {
3
+ "60": 1070,
4
+ "80": 1280,
5
+ "100": 1500,
6
+ "120": 1720,
7
+ "140": 1930,
8
+ "160": 2150,
9
+ "170": 2460
10
+ },
11
+ "tohoku": {
12
+ "60": 740,
13
+ "80": 970,
14
+ "100": 1180,
15
+ "120": 1400,
16
+ "140": 1610,
17
+ "160": 1830,
18
+ "170": 2140
19
+ },
20
+ "kanto": {
21
+ "60": 740,
22
+ "80": 970,
23
+ "100": 1180,
24
+ "120": 1400,
25
+ "140": 1610,
26
+ "160": 1830,
27
+ "170": 2140
28
+ },
29
+ "shinetsu": {
30
+ "60": 740,
31
+ "80": 970,
32
+ "100": 1180,
33
+ "120": 1400,
34
+ "140": 1610,
35
+ "160": 1830,
36
+ "170": 2140
37
+ },
38
+ "hokuriku": {
39
+ "60": 740,
40
+ "80": 970,
41
+ "100": 1180,
42
+ "120": 1400,
43
+ "140": 1610,
44
+ "160": 1830,
45
+ "170": 2140
46
+ },
47
+ "tokai": {
48
+ "60": 740,
49
+ "80": 970,
50
+ "100": 1180,
51
+ "120": 1400,
52
+ "140": 1610,
53
+ "160": 1830,
54
+ "170": 2140
55
+ },
56
+ "kinki": {
57
+ "60": 840,
58
+ "80": 1070,
59
+ "100": 1280,
60
+ "120": 1500,
61
+ "140": 1720,
62
+ "160": 1930,
63
+ "170": 2250
64
+ },
65
+ "chugoku": {
66
+ "60": 970,
67
+ "80": 1180,
68
+ "100": 1400,
69
+ "120": 1610,
70
+ "140": 1830,
71
+ "160": 2040,
72
+ "170": 2360
73
+ },
74
+ "shikoku": {
75
+ "60": 970,
76
+ "80": 1180,
77
+ "100": 1400,
78
+ "120": 1610,
79
+ "140": 1830,
80
+ "160": 2040,
81
+ "170": 2360
82
+ },
83
+ "kyushu": {
84
+ "60": 1170,
85
+ "80": 1390,
86
+ "100": 1600,
87
+ "120": 1820,
88
+ "140": 2030,
89
+ "160": 2250,
90
+ "170": 2570
91
+ },
92
+ "okinawa": {
93
+ "60": 1400,
94
+ "80": 1610,
95
+ "100": 1830,
96
+ "120": 2040,
97
+ "140": 2260,
98
+ "160": 2480,
99
+ "170": 2810
100
+ }
101
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "hokkaido": {
3
+ "60": 840,
4
+ "80": 1070,
5
+ "100": 1280,
6
+ "120": 1500,
7
+ "140": 1720,
8
+ "160": 1930,
9
+ "170": 2250
10
+ },
11
+ "tohoku": {
12
+ "60": 740,
13
+ "80": 970,
14
+ "100": 1180,
15
+ "120": 1400,
16
+ "140": 1610,
17
+ "160": 1830,
18
+ "170": 2140
19
+ },
20
+ "kanto": {
21
+ "60": 740,
22
+ "80": 970,
23
+ "100": 1180,
24
+ "120": 1400,
25
+ "140": 1610,
26
+ "160": 1830,
27
+ "170": 2140
28
+ },
29
+ "shinetsu": {
30
+ "60": 740,
31
+ "80": 970,
32
+ "100": 1180,
33
+ "120": 1400,
34
+ "140": 1610,
35
+ "160": 1830,
36
+ "170": 2140
37
+ },
38
+ "hokuriku": {
39
+ "60": 740,
40
+ "80": 970,
41
+ "100": 1180,
42
+ "120": 1400,
43
+ "140": 1610,
44
+ "160": 1830,
45
+ "170": 2140
46
+ },
47
+ "tokai": {
48
+ "60": 740,
49
+ "80": 970,
50
+ "100": 1180,
51
+ "120": 1400,
52
+ "140": 1610,
53
+ "160": 1830,
54
+ "170": 2140
55
+ },
56
+ "kinki": {
57
+ "60": 970,
58
+ "80": 1180,
59
+ "100": 1400,
60
+ "120": 1610,
61
+ "140": 1830,
62
+ "160": 2040,
63
+ "170": 2360
64
+ },
65
+ "chugoku": {
66
+ "60": 1070,
67
+ "80": 1280,
68
+ "100": 1500,
69
+ "120": 1720,
70
+ "140": 1930,
71
+ "160": 2150,
72
+ "170": 2460
73
+ },
74
+ "shikoku": {
75
+ "60": 1070,
76
+ "80": 1280,
77
+ "100": 1500,
78
+ "120": 1720,
79
+ "140": 1930,
80
+ "160": 2150,
81
+ "170": 2460
82
+ },
83
+ "kyushu": {
84
+ "60": 1290,
85
+ "80": 1510,
86
+ "100": 1730,
87
+ "120": 1940,
88
+ "140": 2160,
89
+ "160": 2370,
90
+ "170": 2710
91
+ },
92
+ "okinawa": {
93
+ "60": 1400,
94
+ "80": 1610,
95
+ "100": 1830,
96
+ "120": 2040,
97
+ "140": 2260,
98
+ "160": 2480,
99
+ "170": 2810
100
+ }
101
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "hokkaido": {
3
+ "60": 1170,
4
+ "80": 1390,
5
+ "100": 1600,
6
+ "120": 1820,
7
+ "140": 2030,
8
+ "160": 2250,
9
+ "170": 2570
10
+ },
11
+ "tohoku": {
12
+ "60": 840,
13
+ "80": 1070,
14
+ "100": 1280,
15
+ "120": 1500,
16
+ "140": 1720,
17
+ "160": 1930,
18
+ "170": 2250
19
+ },
20
+ "kanto": {
21
+ "60": 740,
22
+ "80": 970,
23
+ "100": 1180,
24
+ "120": 1400,
25
+ "140": 1610,
26
+ "160": 1830,
27
+ "170": 2140
28
+ },
29
+ "shinetsu": {
30
+ "60": 740,
31
+ "80": 970,
32
+ "100": 1180,
33
+ "120": 1400,
34
+ "140": 1610,
35
+ "160": 1830,
36
+ "170": 2140
37
+ },
38
+ "hokuriku": {
39
+ "60": 740,
40
+ "80": 970,
41
+ "100": 1180,
42
+ "120": 1400,
43
+ "140": 1610,
44
+ "160": 1830,
45
+ "170": 2140
46
+ },
47
+ "tokai": {
48
+ "60": 740,
49
+ "80": 970,
50
+ "100": 1180,
51
+ "120": 1400,
52
+ "140": 1610,
53
+ "160": 1830,
54
+ "170": 2140
55
+ },
56
+ "kinki": {
57
+ "60": 740,
58
+ "80": 970,
59
+ "100": 1180,
60
+ "120": 1400,
61
+ "140": 1610,
62
+ "160": 1830,
63
+ "170": 2140
64
+ },
65
+ "chugoku": {
66
+ "60": 840,
67
+ "80": 1070,
68
+ "100": 1280,
69
+ "120": 1500,
70
+ "140": 1720,
71
+ "160": 1930,
72
+ "170": 2250
73
+ },
74
+ "shikoku": {
75
+ "60": 840,
76
+ "80": 1070,
77
+ "100": 1280,
78
+ "120": 1500,
79
+ "140": 1720,
80
+ "160": 1930,
81
+ "170": 2250
82
+ },
83
+ "kyushu": {
84
+ "60": 970,
85
+ "80": 1180,
86
+ "100": 1400,
87
+ "120": 1610,
88
+ "140": 1830,
89
+ "160": 2040,
90
+ "170": 2360
91
+ },
92
+ "okinawa": {
93
+ "60": 1290,
94
+ "80": 1510,
95
+ "100": 1730,
96
+ "120": 1940,
97
+ "140": 2160,
98
+ "160": 2370,
99
+ "170": 2710
100
+ }
101
+ }
@@ -0,0 +1,8 @@
1
+ require "yuso/version"
2
+ require "yuso/yamato/shipping_fee"
3
+ require "yuso/sagawa/shipping_fee"
4
+ require "yuso/yubin/shipping_fee"
5
+
6
+ module Yuso
7
+ DATA_PATH = File.join(__dir__, '../data')
8
+ end
@@ -0,0 +1,15 @@
1
+ require "json"
2
+
3
+ module Yuso
4
+ class Sagawa
5
+ class ShippingFee
6
+ def self.load(prefecture_name)
7
+ mapping_path = Yuso::DATA_PATH + "/sagawa/mapping.json"
8
+ mapping = JSON.load(File.read(mapping_path))
9
+ area = mapping.fetch(prefecture_name) { raise ArgumentError, 'Prefecture name is not correct.' }
10
+ json_path = Yuso::DATA_PATH + "/sagawa/#{area}.json"
11
+ JSON.load(File.read(json_path))
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module Yuso
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,15 @@
1
+ require "json"
2
+
3
+ module Yuso
4
+ class Yamato
5
+ class ShippingFee
6
+ def self.load(prefecture_name)
7
+ mapping_path = Yuso::DATA_PATH + "/yamato/mapping.json"
8
+ mapping = JSON.load(File.read(mapping_path))
9
+ area = mapping.fetch(prefecture_name) { raise ArgumentError, 'Prefecture name is not correct.' }
10
+ json_path = Yuso::DATA_PATH + "/yamato/#{area}.json"
11
+ JSON.load(File.read(json_path))
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require "json"
2
+
3
+ module Yuso
4
+ class Yubin
5
+ class ShippingFee
6
+ def self.load(prefecture_name)
7
+ mapping_path = Yuso::DATA_PATH + "/yubin/mapping.json"
8
+ mapping = JSON.load(File.read(mapping_path))
9
+ area = mapping.fetch(prefecture_name) { raise ArgumentError, 'Prefecture name is not correct.' }
10
+ json_path = Yuso::DATA_PATH + "/yubin/#{area}.json"
11
+ JSON.load(File.read(json_path))
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "yuso/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "yuso"
8
+ spec.version = Yuso::VERSION
9
+ spec.authors = ["Okura Masafumi"]
10
+ spec.email = ["masafumi.o1988@gmail.com"]
11
+
12
+ spec.summary = %q{A library containing shipping fee data of three major shipping companies in Japan}
13
+ spec.description = %q{A library containing shipping fee data of three major shipping companies in Japan.}
14
+ spec.homepage = "https://github.com/okuramasafumi/yuso"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.15"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yuso
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Okura Masafumi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: A library containing shipping fee data of three major shipping companies
56
+ in Japan.
57
+ email:
58
+ - masafumi.o1988@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/setup
72
+ - data/sagawa/chugoku.json
73
+ - data/sagawa/hokkaido.json
74
+ - data/sagawa/hokuriku.json
75
+ - data/sagawa/kansai.json
76
+ - data/sagawa/kanto.json
77
+ - data/sagawa/kitakyushu.json
78
+ - data/sagawa/kitatohoku.json
79
+ - data/sagawa/mapping.json
80
+ - data/sagawa/minamikyushu.json
81
+ - data/sagawa/minamitohoku.json
82
+ - data/sagawa/okinawa.json
83
+ - data/sagawa/shikoku.json
84
+ - data/sagawa/shinetsu.json
85
+ - data/sagawa/tokai.json
86
+ - data/yamato/chubu.json
87
+ - data/yamato/chugoku.json
88
+ - data/yamato/hokkaido.json
89
+ - data/yamato/hokuriku.json
90
+ - data/yamato/kansai.json
91
+ - data/yamato/kanto.json
92
+ - data/yamato/kitatohoku.json
93
+ - data/yamato/kyushu.json
94
+ - data/yamato/mapping.json
95
+ - data/yamato/minamitohoku.json
96
+ - data/yamato/okinawa.json
97
+ - data/yamato/shikoku.json
98
+ - data/yamato/shinetsu.json
99
+ - data/yubin/chugoku.json
100
+ - data/yubin/hokkaido.json
101
+ - data/yubin/hokuriku.json
102
+ - data/yubin/kanto.json
103
+ - data/yubin/kinki.json
104
+ - data/yubin/kyushu.json
105
+ - data/yubin/mapping.json
106
+ - data/yubin/okinawa.json
107
+ - data/yubin/shikoku.json
108
+ - data/yubin/shinetsu.json
109
+ - data/yubin/tohoku.json
110
+ - data/yubin/tokai.json
111
+ - lib/yuso.rb
112
+ - lib/yuso/sagawa/shipping_fee.rb
113
+ - lib/yuso/version.rb
114
+ - lib/yuso/yamato/shipping_fee.rb
115
+ - lib/yuso/yubin/shipping_fee.rb
116
+ - yuso.gemspec
117
+ homepage: https://github.com/okuramasafumi/yuso
118
+ licenses:
119
+ - MIT
120
+ metadata: {}
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.6.11
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: A library containing shipping fee data of three major shipping companies
141
+ in Japan
142
+ test_files: []