jp_address 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ead45d996257ef2b4ea006939d9a59e48a9ebc3d
4
- data.tar.gz: 5afdefee5bb5bcdab1026eb18de77a7ac6e5322a
3
+ metadata.gz: 3bc473b124d9ac9c7fcd90abbb1ada6b743a25f5
4
+ data.tar.gz: c8fd47825e82697541a2172d367bdbfac01a8792
5
5
  SHA512:
6
- metadata.gz: 7cc94f8a5a58651ed510fcccbca84bdc0ea712e51bfab855e693894d0c0b2c8cdff70cf9f50c7ff59e46ab7f65e087498a440315f0053c3ba99dc662f129c0b3
7
- data.tar.gz: c0ab974fee8d3ace303bf8053cafff639e78236890fe840f9000c81c0c7a4a1381cd83abdce8d4ee380967705cb73fba3fc41be150ff0c303e414add21e750a0
6
+ metadata.gz: 0de979d76a8c0ff5701b770e81f96ccec3e21b41bcb22f51d4d8f40a586d3b47897b4d0fd3110168b18b1d8c45da49d068850ebd2967469744cae344d9b7d288
7
+ data.tar.gz: 8a733fff3bb50ab1b73c6e5bdf3b0554d7b331247bc2d989f13ea78a95f4f15a5d2ab7a5a69315b4875fb338a43b99f86a9cf6249a0e253171f2688d07f665f8
data/README.rdoc CHANGED
@@ -2,11 +2,14 @@
2
2
 
3
3
  == JpAddressとは
4
4
  日本郵便の「郵便番号データ」を Rails 4.0 で使用するためのプラグインです。
5
- 以下の機能を備えます。
5
+ 以下の機能を提供します。
6
6
 
7
- * 郵便局提供の郵便番号データをダウンロードしてDBにロード
7
+ * 郵便局提供の郵便番号データをダウンロードしてDBにロードするメソッド。
8
8
  * 郵便番号をキーに住所情報を返却するAPI(コントローラ)。
9
9
 
10
+ 要するに、「郵便番号検索 ruby gem」でググった人向けの gem です。
11
+ お使いのRailsアプリケーションにマウントして使えますので、後必要なのは戻ってくるJSONを加工する手順だけです。
12
+
10
13
  == インストール
11
14
  % gem install jp_address
12
15
 
@@ -26,6 +29,7 @@ GemFileに追記
26
29
  環境にもよりますが、1~3分ぐらいかかると思います。
27
30
 
28
31
  ※ APP_ROOT/tmp/ を作業ディレクトリに使用しています。
32
+ ※ 最初にテーブルをトランケートしますので、毎回「全件insert」になります。
29
33
 
30
34
  == APIのマウント
31
35
  マウントしたいRailsアプリの config/routes.rb に追記。
@@ -1,3 +1,3 @@
1
1
  module JpAddress
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
Binary file
@@ -337,3 +337,39 @@ Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.1ms)
337
337
  values ('0640820', '北海道', '札幌市中央区', '大通西')
338
338
   (0.2ms) SELECT COUNT(*) FROM "jp_address_zipcodes"
339
339
  JpAddress::Zipcode Load (0.1ms) SELECT "jp_address_zipcodes".* FROM "jp_address_zipcodes" ORDER BY "jp_address_zipcodes"."id" DESC LIMIT 1
340
+ Processing by JpAddress::ZipcodesController#search as HTML
341
+ JpAddress::Zipcode Load (2.7ms) SELECT "jp_address_zipcodes".* FROM "jp_address_zipcodes" WHERE "jp_address_zipcodes"."zip" IS NULL LIMIT ? [["LIMIT", 1]]
342
+ Rendering text template
343
+ Rendered text template (0.0ms)
344
+ Completed 200 OK in 32ms (Views: 7.0ms | ActiveRecord: 3.3ms)
345
+  (0.1ms) begin transaction
346
+ SQL (1.2ms) INSERT INTO "jp_address_zipcodes" ("zip", "prefecture", "city", "town") VALUES (?, ?, ?, ?) [["zip", "5330033"], ["prefecture", "大阪府"], ["city", "大阪市東淀川区"], ["town", "東中島"]]
347
+  (3.3ms) commit transaction
348
+ Processing by JpAddress::ZipcodesController#search as HTML
349
+ Parameters: {"zip"=>"5330033"}
350
+ JpAddress::Zipcode Load (0.4ms) SELECT "jp_address_zipcodes".* FROM "jp_address_zipcodes" WHERE "jp_address_zipcodes"."zip" = ? LIMIT ? [["zip", "5330033"], ["LIMIT", 1]]
351
+ Rendering text template
352
+ Rendered text template (0.0ms)
353
+ Completed 200 OK in 6ms (Views: 0.5ms | ActiveRecord: 0.4ms)
354
+  (0.1ms) begin transaction
355
+ SQL (0.9ms) INSERT INTO "jp_address_zipcodes" ("zip", "prefecture", "city", "town") VALUES (?, ?, ?, ?) [["zip", "5330033"], ["prefecture", "大阪府"], ["city", "大阪市東淀川区"], ["town", "東中島"]]
356
+  (3.0ms) commit transaction
357
+ Processing by JpAddress::ZipcodesController#search as HTML
358
+ Parameters: {"zip"=>"9999999"}
359
+ JpAddress::Zipcode Load (0.2ms) SELECT "jp_address_zipcodes".* FROM "jp_address_zipcodes" WHERE "jp_address_zipcodes"."zip" = ? LIMIT ? [["zip", "9999999"], ["LIMIT", 1]]
360
+ Rendering text template
361
+ Rendered text template (0.0ms)
362
+ Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.2ms)
363
+  (3.7ms) delete from jp_address_zipcodes
364
+  (3.5ms) insert into jp_address_zipcodes (zip, prefecture, city, town)
365
+ values ('0600000', '北海道', '札幌市中央区', '')
366
+  (3.5ms) insert into jp_address_zipcodes (zip, prefecture, city, town)
367
+ values ('0640941', '北海道', '札幌市中央区', '旭ケ丘')
368
+  (4.0ms) insert into jp_address_zipcodes (zip, prefecture, city, town)
369
+ values ('0600041', '北海道', '札幌市中央区', '大通東')
370
+  (3.7ms) insert into jp_address_zipcodes (zip, prefecture, city, town)
371
+ values ('0600042', '北海道', '札幌市中央区', '大通西')
372
+  (3.4ms) insert into jp_address_zipcodes (zip, prefecture, city, town)
373
+ values ('0640820', '北海道', '札幌市中央区', '大通西')
374
+  (0.2ms) SELECT COUNT(*) FROM "jp_address_zipcodes"
375
+ JpAddress::Zipcode Load (0.2ms) SELECT "jp_address_zipcodes".* FROM "jp_address_zipcodes" ORDER BY "jp_address_zipcodes"."id" DESC LIMIT ? [["LIMIT", 1]]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jp_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tadashi K
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
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
- version: '4.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  requirements: []
238
238
  rubyforge_project:
239
- rubygems_version: 2.2.2
239
+ rubygems_version: 2.6.8
240
240
  signing_key:
241
241
  specification_version: 4
242
242
  summary: Simple japan-zipcode-addresses API