hola_walliby 1.0 → 1.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
  SHA256:
3
- metadata.gz: 723bba1daa6d18b02054f729f3fd0d8c5687a4b39f526b2424ab460c1187ad02
4
- data.tar.gz: 68a1d11cd0afeb2c61ae53862a1ff3e6922374a4cd15de058a046a4e386f9540
3
+ metadata.gz: 7c95d10d6780ba8f669bed05430d30dab9ed9e7fc21b40b5cefbe9560e952bbd
4
+ data.tar.gz: 154b0fa7658286fc104627e50c50ca89b8791608ff14ac274d241d69630e370a
5
5
  SHA512:
6
- metadata.gz: 7c915e4bae6fd487b8aec919740d63c2c9731a6932d5adbdcf94d68792e244c3f5a4706f31f0ea3e6ac8a6e0dfe9e19efa38f49106f71f9b9f6798196dacbb82
7
- data.tar.gz: 1dcc812575d2137614c9b4bbcfb660e27c6ffa0a0be28603c20457419f61d312d0d8d1199e68f39ffd00993efbbc0e41866a50f1a02b24fd44d373f79f81dc17
6
+ metadata.gz: f940f20985cbc67e3c12575fefb84fec270ae3df8e0abfe9d960cb72ef6aa2f07708c20ccc5fe2b3f4163c25bc40f4e29385793630d425755fc49369a1705e65
7
+ data.tar.gz: 678e098ced09ab3f02aeb6b5bf71ad21e6363669869a4523021c394def7e5cb603b78d16ed3e226b610a265be94f0a65b1d65dd0afbd7c3266951caf6acbeb21
data/bin/hola_walliby ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'hola_walliby'
4
+ puts Hola.hi(ARGV[0])
@@ -0,0 +1,14 @@
1
+ class Hola::Translator
2
+ def initialize(language)
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when "spanish"
9
+ "hola mundo"
10
+ else
11
+ "hello world"
12
+ end
13
+ end
14
+ end
data/lib/hola_walliby.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  class Hola
2
- def self.hi
3
- phrase = "Hello world!"
4
- puts phrase
5
- return phrase
2
+ def self.hi(language = "english")
3
+ translator = Translator.new(language)
4
+ translator.hi
6
5
  end
7
6
  end
7
+
8
+ require 'hola_walliby/translator'
@@ -1,10 +1,19 @@
1
- require "./lib/hola_walliby.rb"
2
- require "test/unit"
1
+ require "minitest/autorun"
2
+ require "hola_walliby"
3
3
 
4
- class TestNAME < Test::Unit::TestCase
4
+ class HolaTest < Minitest::Test
5
+ def test_english_hello
6
+ assert_equal "hello world",
7
+ Hola.hi("english")
8
+ end
5
9
 
6
- def test_hola_walliby
7
- assert_equal(Hola.hi, "Hello world!")
10
+ def test_any_hello
11
+ assert_equal "hello world",
12
+ Hola.hi("ruby")
8
13
  end
9
14
 
15
+ def test_spanish_hello
16
+ assert_equal "hola mundo",
17
+ Hola.hi("spanish")
18
+ end
10
19
  end
metadata CHANGED
@@ -1,23 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_walliby
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Wallace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-09 00:00:00.000000000 Z
11
+ date: 2023-12-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple hello world gem
14
14
  email:
15
15
  - walliby84@gmail.com
16
- executables: []
16
+ executables:
17
+ - hola_walliby
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/hola_walliby
20
22
  - lib/hola_walliby.rb
23
+ - lib/hola_walliby/translator.rb
21
24
  - tests/test_hola_walliby.rb
22
25
  homepage: http://domainforproject.com/
23
26
  licenses: