hola_nicholas 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/hola_nicholas ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'hola_nicholas'
4
+
5
+ puts HolaNicholas.hi(ARGV[0])
6
+
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ class Translator
4
+ def initialize(language)
5
+ @language = language
6
+ end
7
+
8
+ def hi
9
+ case @language
10
+ when "portuguese"
11
+ "E aí Nicholas!"
12
+ else
13
+ "Hi Nicholas!"
14
+ end
15
+ end
16
+ end
data/lib/hola_nicholas.rb CHANGED
@@ -1,5 +1,10 @@
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path("../hola_nicholas/translator",__FILE__)
4
+
1
5
  class HolaNicholas
2
- def self.hi
3
- puts "Hello world!"
6
+ def self.hi(language = "english")
7
+ translator = Translator.new(language)
8
+ puts translator.hi
4
9
  end
5
- end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_nicholas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,11 +13,14 @@ date: 2011-11-29 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Say hi to Nicholas gem.
15
15
  email: niko.pufal@blabla.test
16
- executables: []
16
+ executables:
17
+ - hola_nicholas
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - lib/hola_nicholas/translator.rb
20
22
  - lib/hola_nicholas.rb
23
+ - bin/hola_nicholas
21
24
  homepage: http://rubygems.org/gems/hola_nicholas
22
25
  licenses: []
23
26
  post_install_message: