hola_oleiman 0.0.0 → 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.
Files changed (4) hide show
  1. data/bin/hola +5 -0
  2. data/lib/hola/translator.rb +14 -0
  3. data/lib/hola.rb +6 -2
  4. metadata +5 -2
data/bin/hola ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'hola'
4
+ arg = ARGV[0] ? ARGV[0].to_sym : ARGV[0]
5
+ puts Hola.hi(arg)
@@ -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.rb CHANGED
@@ -1,5 +1,9 @@
1
+
2
+
1
3
  class Hola
2
- def self.hi
3
- puts "Hello, World!"
4
+ def self.hi(lang = "english")
5
+ translator = Translator.new(lang)
6
+ puts translator.hi
4
7
  end
5
8
  end
9
+ require 'hola/translator'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_oleiman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,11 +13,14 @@ date: 2012-12-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple hello world gem
15
15
  email: mumblemumble777@gmail.com
16
- executables: []
16
+ executables:
17
+ - hola
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - lib/hola.rb
22
+ - lib/hola/translator.rb
23
+ - bin/hola
21
24
  homepage: http://rubygems.org/gems/hola_oleiman
22
25
  licenses: []
23
26
  post_install_message: