cheerio 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fb20a39a875b0f0e35fe6c02f8663ec1891896b
4
- data.tar.gz: 1ab5f656cd4330ee0ccf13d980d4bcf1f73bd622
3
+ metadata.gz: b3cfbb7797ee7dec38d1244aa172c50783c9b872
4
+ data.tar.gz: 0f3d5e89e90ef94c3c68eac37a0c6fba7b5b4e87
5
5
  SHA512:
6
- metadata.gz: d32f828e6266b77e989cfab4c9ad86a1d213a78babb2f62dbdc2f19abe5c2bc8d4ff9aa42a88d47b257e7b9e8f44c7acb94a1120d7e38f39bc72e0c7c43d6084
7
- data.tar.gz: 77c46aa6c36b1d8fd347fec15c29923ccd64533343f1108ab8883e51a0b6d79038ea62addf5dbc518da3c9b21fe37b7bd3b7fc620af5031f5dee5ee80bbe442c
6
+ metadata.gz: 043fcc4d9770423b40cfe3ce39d9d9101807e48d103ca3bcb0276e5adb5a0ca690d67763c7ef608601c472a3349ac07349872df6c044edb134588e5af446ada8
7
+ data.tar.gz: 1ccac2ea0e6e874118cf9fa404f2ff3a4181b1b5c92fe44d8cbe1054e5a11f9631f1b75ca7150fc2d563ad2569e8451f4347938ad73d88d99459a18152be8506
@@ -4,11 +4,25 @@ require "i18n"
4
4
  I18n.load_path = Dir[File.dirname(__FILE__) + '/locales/*.{rb,yml}']
5
5
 
6
6
  module Cheerio
7
+ @locale = :en
8
+
9
+ class << self
10
+ attr_accessor :locale
11
+ end
12
+
7
13
  def self.hello
8
- I18n.t('salutations').sample
14
+ I18n.t('salutations', self.I18n_options).sample
9
15
  end
10
16
 
11
17
  def self.goodbye
12
- I18n.t('valedictations').sample
18
+ I18n.t('valedictations', self.I18n_options).sample
19
+ end
20
+
21
+ private
22
+
23
+ def self.I18n_options
24
+ {
25
+ locale: @locale
26
+ }
13
27
  end
14
28
  end
@@ -1,3 +1,3 @@
1
1
  module Cheerio
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,14 +1,31 @@
1
1
  en:
2
2
  compliments:
3
+ - "Good to see you."
4
+ - "Nice to see you."
3
5
  - "You look nice today."
4
- - "Nice work."
5
6
  - "You're swell."
7
+ - "You've done well."
8
+ - "We're impressed by you."
6
9
  salutations:
7
- - "Hey there!"
10
+ - "Greetings"
11
+ - "Welcome."
8
12
  - "Hello."
9
- - "Greetings. Welcome."
13
+ - "Hey there!"
14
+ - "Hey!"
15
+ - "How's it going?"
16
+ - "Howdy."
17
+ - "Look who it is!"
18
+ - "Well hello!"
19
+ - "What's up?"
20
+ - "Why hello there."
10
21
  valedictations:
11
- - "Goodbye"
22
+ - "Bye!"
12
23
  - "Farewell"
13
- - "Until next time."
14
- - "See you soon!"
24
+ - "Goodbye"
25
+ - "Have a great day."
26
+ - "Have a good day."
27
+ - "Later!"
28
+ - "See you later."
29
+ - "See you soon!"
30
+ - "Take care."
31
+ - "Until next time."
@@ -0,0 +1,7 @@
1
+ es:
2
+ compliments:
3
+ - "Me alegro de verte."
4
+ salutations:
5
+ - "Hola."
6
+ valedictations:
7
+ - "Adios"
@@ -10,4 +10,10 @@ describe Cheerio do
10
10
  valedication = Cheerio.goodbye
11
11
  valedication.should_not be_nil
12
12
  end
13
+
14
+ it "supports multiple language locales" do
15
+ Cheerio.locale = :es
16
+ salutation_in_spanish = Cheerio.hello
17
+ salutation_in_spanish.should_not be_nil
18
+ end
13
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheerio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Rocher
@@ -82,6 +82,7 @@ files:
82
82
  - lib/cheerio.rb
83
83
  - lib/cheerio/version.rb
84
84
  - lib/locales/en.yml
85
+ - lib/locales/es.yml
85
86
  - spec/lib/cheerio_spec.rb
86
87
  - spec/spec_helper.rb
87
88
  homepage: https://github.com/rochers/cheerio