lcra_test 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
+ SHA256:
3
+ metadata.gz: e7c1bb028319f0a43d98b165f74c174c224390654011aaed8545c58b41be0541
4
+ data.tar.gz: daf375d0e981abbe5794441cc58409ba9c94d4dcb7371e909a0c7fedc86d86b5
5
+ SHA512:
6
+ metadata.gz: 153b7d3de90d81f8b171e6287da2639909044fca68008ef6754cde1fdef14a9074e32eb5c36b3aeee5dd19552b443780b4db319cc6c35affafcbd7b29eaa45b2
7
+ data.tar.gz: c5a19cd5b7611cd40161a03451bced44c47ccdb1d36ac17d6154c36bd1a35f7162eab0221c3b8e0bec2401910318b578788c3c303ce2861e1f9ee54de86ca9bb
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Translator
4
+ def initialize(language = "english")
5
+ @language = language
6
+ end
7
+
8
+ def hi
9
+ case @language
10
+ when "spanish"
11
+ "hola mundo"
12
+ when "korean"
13
+ "anyoung ha se yo"
14
+ else
15
+ "hello world"
16
+ end
17
+ end
18
+ end
data/lib/lcra_test.rb ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lcra_test/translator'
4
+
5
+ class LcraTest
6
+ # Say hi to the world!
7
+ #
8
+ # Example:
9
+ # >> LcraTest.hi("spanish")
10
+ # => hola mundo
11
+ #
12
+ # Arguments:
13
+ # language: (String)
14
+ def self.hi(language)
15
+ translator = Translator.new(language)
16
+ translator.hi
17
+ end
18
+ end
19
+
data/test/test_hola.rb ADDED
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'lcra_test'
3
+
4
+ class HolaTest < Test::Unit::TestCase
5
+ def test_english_hello
6
+ assert_equal "hello world", LcraTest.hi("english")
7
+ end
8
+
9
+ def test_any_hello
10
+ assert_equal "hello world", LcraTest.hi("ruby")
11
+ end
12
+
13
+ def test_spanish_hello
14
+ assert_equal "hola mundo", LcraTest.hi("spanish")
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lcra_test
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Filip Simek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple hello world gem
14
+ email: filip.simek01@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/lcra_test.rb
20
+ - lib/lcra_test/translator.rb
21
+ - test/test_hola.rb
22
+ homepage: https://github.com/SimekFilip/lcra_test
23
+ licenses:
24
+ - Nonstandard
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubygems_version: 3.3.5
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Lcra test
45
+ test_files:
46
+ - test/test_hola.rb