thaitoan 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bc34856fddb61ad784938903ea2ae0c3538fb1e3
4
+ data.tar.gz: 0f8683761043841f23b90e32118e248bf75e9d23
5
+ SHA512:
6
+ metadata.gz: 15259979a469a2be5550580edfeaefd5e6b8ca0cfa568157dfdf8316524735bc535f16bad96f0932f40f5c13bc840fdc40cfa7623222b1f3627f5486058c3146
7
+ data.tar.gz: 3e754f55bd0b5a704489792e8fdb9528dc16d5abf316476e839f5fef8f7cd51d609f1e8bcc247c5de14bea4e2df2fb75c7a944dc73354f3d9d77de3b47e943bb
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.libs << 'test'
5
+ end
6
+
7
+ desc "Run tests"
8
+ task :default => :test
data/bin/thaitoan ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'thaitoan'
4
+ puts Thaitoan.hi(ARGV[0])
@@ -0,0 +1,16 @@
1
+ class Thaitoan::Translator
2
+ def initialize(language = "english")
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when "spanish"
9
+ "hola mundo"
10
+ when "korean"
11
+ "anyoung ha se yo"
12
+ else
13
+ "hello world"
14
+ end
15
+ end
16
+ end
data/lib/thaitoan.rb ADDED
@@ -0,0 +1,8 @@
1
+ class Thaitoan
2
+ def self.hi(language)
3
+ translator = Translator.new(language)
4
+ translator.hi
5
+ end
6
+ end
7
+
8
+ require 'thaitoan/translator'
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'thaitoan'
3
+
4
+ class ThaitoanTest < Test::Unit::TestCase
5
+ def test_english_hello
6
+ assert_equal "hello world", Hola.hi("english")
7
+ end
8
+
9
+ def test_any_hello
10
+ assert_equal "hello world", Hola.hi("ruby")
11
+ end
12
+
13
+ def test_spanish_hello
14
+ assert_equal "hola mundo", Hola.hi("spanish")
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thaitoan
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Thai Toan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple hello world gem
14
+ email: itthaitoan@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - Rakefile
20
+ - bin/thaitoan
21
+ - lib/thaitoan.rb
22
+ - lib/thaitoan/translator.rb
23
+ - test/test_thaitoan.rb
24
+ homepage: http://rubygems.org/gems/thaitoan
25
+ licenses: []
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.5.1
44
+ signing_key:
45
+ specification_version: 3
46
+ summary: ThaiToan!
47
+ test_files:
48
+ - test/test_thaitoan.rb