hola_fiabane 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: d4f1194af6d8bd0d218714ac67a197a8ec3cb16b
4
- data.tar.gz: d1bfe60acf888f17ae65970bb7c0aa80d6939a86
3
+ metadata.gz: a4ab3abcb37d012a7fa70550f824dde25ab78395
4
+ data.tar.gz: 96e624c396839042d26dd4c6671f4112abe63d57
5
5
  SHA512:
6
- metadata.gz: 5b4ad6164db2d849a86cb5be1445a5ade8b3acb1d77f4390658b186729f73a211f17805484427cf4631dc19fe690499801b0e12c6006dda259626329130861be
7
- data.tar.gz: f074bc1ed57d5dacf4272c3c4de9cc17cacfabc602c1cb7304f522919ecb7cc12ef8717b800245d6b28d5a19e6bc7252d00f72f1d0b6cf09ce97d76b64cdd797
6
+ metadata.gz: ba875618974c0f238490eda7f88d747311f858dae8aa22ce5c43b5c813f270b22daa362805fc1d9a7879a9c8543b30cec2a1d4d8edb9d5e8480a0e449df0c852
7
+ data.tar.gz: de207f58d2cfa57d15c9f18e29bafe30d09538713062348672922d9242f4c689ebc5e1d3b4128c9db21af8eeb8b299731925a1da68c5a4d9076a7060dc89a43a
@@ -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])
@@ -1,5 +1,8 @@
1
1
  class Hola
2
- def self.hi
3
- puts "hello, world."
2
+ def self.hi(language = "english")
3
+ translator = Translator.new(language)
4
+ translator.hi
4
5
  end
5
6
  end
7
+
8
+ require 'hola/translator'
@@ -0,0 +1,14 @@
1
+ class Translator
2
+ def initialize(language)
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when "swahili"
9
+ "hujambo dunia"
10
+ else
11
+ "hello world"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ require 'test/unit'
2
+ require 'hola'
3
+
4
+ class HolaTest < Test::Unit::TestCase
5
+ def test_english_hello
6
+ assert_equal "hello world",
7
+ Hola.hi("english")
8
+ end
9
+
10
+ def test_any_hello
11
+ assert_equal "hello world",
12
+ Hola.hi("ruby")
13
+ end
14
+
15
+ def test_swahili_hellp
16
+ assert_equal "hujambo dunia",
17
+ Hola.hi("swahili")
18
+ end
19
+
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_fiabane
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
  - Jason Fiabane
@@ -12,11 +12,16 @@ date: 2013-11-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple hello world gem
14
14
  email: jason@fiabane.com
15
- executables: []
15
+ executables:
16
+ - hola
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
20
+ - Rakefile
19
21
  - lib/hola.rb
22
+ - lib/hola/translator.rb
23
+ - test/test_hola.rb
24
+ - bin/hola
20
25
  homepage: http://fiabane.com
21
26
  licenses:
22
27
  - MIT
@@ -41,5 +46,6 @@ rubygems_version: 2.0.3
41
46
  signing_key:
42
47
  specification_version: 4
43
48
  summary: Hola!
44
- test_files: []
49
+ test_files:
50
+ - test/test_hola.rb
45
51
  has_rdoc: