perambulate 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectCodeStyleSettingsManager">
4
+ <option name="PER_PROJECT_SETTINGS">
5
+ <value />
6
+ </option>
7
+ </component>
8
+ </project>
9
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- perambulate (0.0.3)
4
+ perambulate (0.0.4)
5
5
  lexr (~> 0.3.1)
6
6
  rake (~> 0.9.2.2)
7
7
  whittle (~> 0.0.8)
data/README CHANGED
@@ -5,6 +5,8 @@ No more thousands of input boxes, drop-downs and annoying conversational logic.
5
5
  and run it through Perambulate.
6
6
 
7
7
  Usage
8
- -----
8
+ =====
9
9
 
10
- Perambulate.create_address(address_string)
10
+ require "perambulate"
11
+
12
+ Perambulate.create_address(address_string)
@@ -4,21 +4,19 @@ require "perambulate/lexer/aussie_lexer"
4
4
  require "perambulate/parser/parser"
5
5
  require "perambulate/designations"
6
6
 
7
+ module Perambulate
7
8
 
8
- module Perambulate
9
+ @@configuration = {:default_parser => "Australian"}
9
10
 
10
- @@configuration = {:default_parser => "Australian"}
11
-
12
- def self.config
13
- return @@configuration
14
- end
15
-
16
- def self.configure(&block)
17
- yield @@configuration
18
- end
11
+ def self.config
12
+ @@configuration
13
+ end
19
14
 
20
- def self.create_address(address_string)
21
- address = Perambulate::Parser.new().parse(address_string)
22
- end
15
+ def self.configure(&block)
16
+ yield @@configuration
23
17
  end
24
18
 
19
+ def self.create_address(address_string)
20
+ address = Perambulate::Parser.new().parse(address_string)
21
+ end
22
+ end
@@ -2,5 +2,6 @@ module Perambulate
2
2
  class Designations
3
3
  AVENUE = :avenue
4
4
 
5
+ PARSELIST = /Alley|Drive|Fairway|Lane|Terrace|Way|Court|Close|Place|Circle|Crescent|Esplanade|Parade|Park|Street|Avenue/
5
6
  end
6
7
  end
@@ -1,4 +1,5 @@
1
1
  require "whittle"
2
+ require "lib/perambulate/designations"
2
3
 
3
4
  module Perambulate
4
5
  class Parser < Whittle::Parser
@@ -9,7 +10,7 @@ module Perambulate
9
10
  rule(:unit_symbol => /Unit|Num|Number|No/i)
10
11
  rule(:unit_separator => /\/|-|,/)
11
12
  rule(:street_separator => /,/)
12
- rule(:designation => /Street/)
13
+ rule(:designation => Perambulate::Designations::PARSELIST)
13
14
 
14
15
  rule(:word => /[a-zA-Z]+/)
15
16
 
@@ -1,3 +1,3 @@
1
1
  module Perambulate
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perambulate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,6 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - .idea/codeStyleSettings.xml
118
119
  - CONTRIBUTING.md
119
120
  - Gemfile
120
121
  - Gemfile.lock