dweller 0.1.0.alpha → 0.1.0.alpha.2

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.
@@ -1,7 +1,14 @@
1
- = places
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')
@@ -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 load_country(name)
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
@@ -1,3 +1,3 @@
1
1
  module Dweller
2
- VERSION = '0.1.0.alpha'
2
+ VERSION = '0.1.0.alpha.2'
3
3
  end
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-06 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spreadsheet