bcardarella-decoder 0.5.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = Usage
4
4
 
5
- >> Decoder.i18n = :eng
5
+ >> Decoder.i18n = :en
6
6
  >> country = Decoder::Countries[:US]
7
7
  >> country.to_s
8
8
  => "United States"
@@ -13,7 +13,7 @@
13
13
  Currently the yaml files are still quite incomplete. Please fork and populate!
14
14
 
15
15
  = i18n
16
- When adding a new language please use the ISO 639-2 Code 3-letter standard.
16
+ When adding a new language please use the ISO 639-1 Code 2-letter standard.
17
17
  You can find the appropriate code for a given language here:
18
18
  http://www.loc.gov/standards/iso639-2/php/code_list.php
19
19
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.1
data/decoder.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{decoder}
8
- s.version = "0.5.1"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Cardarella"]
12
- s.date = %q{2009-09-01}
12
+ s.date = %q{2009-09-04}
13
13
  s.description = %q{Decoder}
14
14
  s.email = %q{bcardarella@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -28,10 +28,7 @@ Gem::Specification.new do |s|
28
28
  "lib/countries/countries.rb",
29
29
  "lib/countries/country.rb",
30
30
  "lib/decoder.rb",
31
- "lib/i18n/countries/eng.yml",
32
- "lib/i18n/states/au/eng.yml",
33
- "lib/i18n/states/ca/eng.yml",
34
- "lib/i18n/states/us/eng.yml",
31
+ "lib/locales/en.yml",
35
32
  "lib/states/state.rb",
36
33
  "test/common_methods_test.rb",
37
34
  "test/countries/countries_test.rb",
@@ -7,17 +7,17 @@ module Decoder
7
7
  end
8
8
 
9
9
  def load_yaml
10
- self.countries = YAML.load_file(yaml_file_name)
10
+ self.countries = YAML.load_file(yaml_file_name)[Decoder.i18n]
11
11
  end
12
12
 
13
13
  def yaml_file_name
14
- "#{File.dirname(__FILE__)}/../i18n/countries/#{Decoder.i18n}.yml"
14
+ "#{File.dirname(__FILE__)}/../locales/#{Decoder.i18n}.yml"
15
15
  end
16
16
 
17
17
  def [](_code)
18
18
  _code = _code.to_s.upcase
19
19
  country = countries[_code]
20
- Decoder::Country.new(:code => _code, :name => country)
20
+ Decoder::Country.new(:code => _code, :name => country[:name])
21
21
  end
22
22
 
23
23
  def self.[](_code)
@@ -13,11 +13,11 @@ module Decoder
13
13
  end
14
14
 
15
15
  def load_yaml
16
- self.states = YAML.load_file(yaml_file_name)
16
+ self.states = YAML.load_file(yaml_file_name)[Decoder.i18n][self.code][:states]
17
17
  end
18
18
 
19
19
  def yaml_file_name
20
- "#{File.dirname(__FILE__)}/../i18n/states/#{code.downcase}/#{Decoder.i18n}.yml"
20
+ "#{File.dirname(__FILE__)}/../locales/#{Decoder.i18n}.yml"
21
21
  end
22
22
 
23
23
  def [](_code)
data/lib/decoder.rb CHANGED
@@ -5,7 +5,7 @@ require 'states/state'
5
5
 
6
6
  module Decoder
7
7
  def self.i18n
8
- @i18n ||= :eng
8
+ @i18n ||= :en
9
9
  end
10
10
 
11
11
  def self.i18n=(code)