hola_AnansiRafa 0.0.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 314366b859663e591f58848b9435c05fef481744fcab353976ece11ae21fc976
4
+ data.tar.gz: 0a6245b2e485c032e7142a5f5893949133a720e961b4e777c20179fc5f2d5859
5
+ SHA512:
6
+ metadata.gz: 9c48dfd173c49de6cb178543703f07f3eca76ab302d33a7953ac332d74d28cf345c3af62557c8c61d38c791e858cd255e6b81a78b2499f2a0dd6e6dfebdb260e
7
+ data.tar.gz: d750d2bc052a8e3085d8522ae992435841f10c8069ca012daaf28311af48cc513f013be75896b76c6841958fb282d32f873f0bb232a93b8582a1222a7f55ab21
@@ -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
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'hola'
4
+ puts Hola.hi(ARGV[0])
@@ -0,0 +1,8 @@
1
+ class Hola
2
+ def self.hi(language)
3
+ translator = Translator.new(language)
4
+ translator.hi
5
+ end
6
+ end
7
+
8
+ require 'hola_AnansiRafa/translations'
@@ -0,0 +1,24 @@
1
+ class Hola::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
+ when "japanese"
13
+ "Kon'nichiwa sekai"
14
+ when "swahili"
15
+ "salamu dunia"
16
+ when "german"
17
+ "hallo welt"
18
+ when "esperanto"
19
+ "saluton mondo"
20
+ else
21
+ "hello world"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'hola'
3
+
4
+ class HolaTest < 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,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hola_AnansiRafa
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Anthony Cook
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple hello world gem that also includes Japanese, Swahili, German,
14
+ and Esperanto
15
+ email: antrafcook@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Rakefile
21
+ - bin/hola_AnansiRafa
22
+ - lib/hola_AnansiRafa.rb
23
+ - lib/hola_AnansiRafa/translations.rb
24
+ - test/test_hola_AnansiRafa.rb
25
+ homepage: http://rubygems.org/gems/hola_AnansiRafa
26
+ licenses: []
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.7.4
45
+ signing_key:
46
+ specification_version: 3
47
+ summary: Hola!
48
+ test_files:
49
+ - test/test_hola_AnansiRafa.rb