doko 0.1.3 → 0.1.4

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 (5) hide show
  1. data/VERSION +1 -1
  2. data/doko.gemspec +1 -1
  3. data/lib/doko.rb +4 -1
  4. data/spec/doko_spec.rb +4 -0
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/doko.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "doko"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Masaki Sawamura"]
data/lib/doko.rb CHANGED
@@ -24,8 +24,11 @@ class Doko
24
24
  body.tr!("()","()")
25
25
  body.tr!("、",",")
26
26
  body.tr!(" "," ")
27
+ body.tr!(".",".")
27
28
 
28
- addrs = body.scan(/\b([^\s,()]{2,3}(都|道|府|県)[^\s,()]{1,8}(市|区|町|村).+)/).map{ |m|
29
+ blackchars = ",()\n"
30
+
31
+ addrs = body.scan(/\b([^\s,()]{2,3}(都|道|府|県)[^\s,()]{1,8}(市|区|町|村)[^#{blackchars}]+)/).map{ |m|
29
32
  line = m[0]
30
33
  line.gsub!(/住所(\s|\n)?/,"")
31
34
  line.gsub!(/〒\d{3}-\d{4} ?/,"")
data/spec/doko_spec.rb CHANGED
@@ -42,4 +42,8 @@ describe "Doko" do
42
42
  it do
43
43
  Doko.parse("http://www.nissan-stadium.jp/").first.should == "横浜市港北区小机町3300"
44
44
  end
45
+
46
+ it do
47
+ Doko.parse("http://atnd.org/events/28384").first.should == "東京都千代田区神田駿河台2-3 DH2001Bldg."
48
+ end
45
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: 2731141338955462870
145
+ hash: 3311531486027720188
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements: