dweller 0.1.0.alpha → 0.1.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +8 -1
- data/lib/dweller/country.rb +7 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
=
|
1
|
+
= dweller
|
2
|
+
|
3
|
+
{<img src="https://secure.travis-ci.org/rodrigomanhaes/dweller.png"/>}[http://travis-ci.org/rodrigomanhaes/dweller]
|
2
4
|
|
3
5
|
Information about places: countries, states, cities etc.
|
4
6
|
|
5
7
|
Currently, at a very initial stage. Suggestions are welcome.
|
6
8
|
|
7
9
|
By now, only Brazil is supported.
|
10
|
+
|
11
|
+
Usage:
|
12
|
+
|
13
|
+
rio = Dweller::Country.named('brazil').state('RJ').
|
14
|
+
campos = rio.city('Campos dos Goytacazes')
|
data/lib/dweller/country.rb
CHANGED
@@ -6,8 +6,12 @@ module Dweller
|
|
6
6
|
base.send :extend, ClassMethods
|
7
7
|
end
|
8
8
|
|
9
|
+
def self.named(name)
|
10
|
+
DwellerCountry.named(name)
|
11
|
+
end
|
12
|
+
|
9
13
|
module ClassMethods
|
10
|
-
def
|
14
|
+
def named(name)
|
11
15
|
hash = YAML::load(File.read(File.expand_path(File.join(
|
12
16
|
File.dirname(__FILE__), '..', '..', 'data', "#{name}.yml"))))
|
13
17
|
country = self.new
|
@@ -42,6 +46,8 @@ module Dweller
|
|
42
46
|
|
43
47
|
private
|
44
48
|
|
49
|
+
class DwellerCountry; include Dweller::Country; end
|
50
|
+
|
45
51
|
class DwellerState; include Dweller::State; end
|
46
52
|
|
47
53
|
def country_hash
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dweller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.alpha
|
4
|
+
version: 0.1.0.alpha.2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spreadsheet
|