xinchao 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 153280015342ab55b46ee813e995c8172ca2d04e
4
- data.tar.gz: e250323e60ef5002eadfcbc0dfed183c145165f3
3
+ metadata.gz: 2edc0f38d754ec2c37b53006db5cc11ec942b491
4
+ data.tar.gz: 15011459ab893ffa45d7525856e9966c4f4a2c45
5
5
  SHA512:
6
- metadata.gz: 665c41b2103758c671d37c4fc5b6405ef5ad34fbecf00354130ac3928d932561e19f1339bcb22295e8bdd4beb13a5c52bf915a47c11d481babc11862215d98f5
7
- data.tar.gz: 0653f17d5478736408ed3e77ed15e69bdeeb205fa82994c7eba8ef1367c258ff708a2df0b0fb5feff82e49c99f53b8d424cfa4fbf29146c7d0b9fa77cf31591f
6
+ metadata.gz: 79f98fe083ed40b7f88617b0e0243e77068d1984d213f69b55fd1beb7a5606a576d5f4e53a4e40070f76c1281b1b84546c0fa9e2aaa1696c259e6dd2c7be674d
7
+ data.tar.gz: 4123c18b943a0f7889ffda149203ef1f63e3e2d62327f08622e89f80fb32b2b214cdc397abaa49997358a20db17e95ba3f529e001bec6445b16d8f02f872a6b2
data/bin/xinchao ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'xinchao'
4
+ puts Xinchao.hi(ARGV[0])
data/lib/xinchao.rb CHANGED
@@ -1,7 +1,19 @@
1
1
  class Xinchao
2
2
  class << self
3
- def hi
4
- puts "Hell world!"
3
+ # Say hi to the world!
4
+ #
5
+ # Example:
6
+ # >> Hola.hi("spanish")
7
+ # => hola mundo
8
+ #
9
+ # Arguments:
10
+ # language: (String)
11
+
12
+ def hi language = 'english'
13
+ translator = Translator.new language
14
+ translator.hi
5
15
  end
6
16
  end
7
17
  end
18
+
19
+ require 'xinchao/translator'
@@ -0,0 +1,14 @@
1
+ class Xinchao::Translator
2
+ def initialize language
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when 'vietnam'
9
+ 'Xin chao em!'
10
+ else
11
+ 'Hello world!'
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xinchao
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
  - Dieu Pham
@@ -12,11 +12,14 @@ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple hello world gem
14
14
  email: dieupv@topica.edu.vn
15
- executables: []
15
+ executables:
16
+ - xinchao
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
20
+ - bin/xinchao
19
21
  - lib/xinchao.rb
22
+ - lib/xinchao/translator.rb
20
23
  homepage: http://rubygems.org/gems/xinchao
21
24
  licenses:
22
25
  - MIT