ahoj 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/ahoj +4 -0
  2. data/lib/ahoj.rb +6 -3
  3. data/lib/ahoj/translator.rb +16 -0
  4. metadata +21 -9
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ahoj'
4
+ puts Ahoj.hi(ARGV[0])
@@ -1,5 +1,8 @@
1
1
  class Ahoj
2
- def self.hi
3
- puts "Hello world!"
2
+ def self.hi (language="english")
3
+ translator = Translator.new(language)
4
+ puts translator.hi
4
5
  end
5
- end
6
+ end
7
+
8
+ require 'ahoj/translator'
@@ -0,0 +1,16 @@
1
+ class Ahoj::Translator
2
+ def initialize(language)
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when "cesky"
9
+ "ahoj svete"
10
+ when "spanish"
11
+ "hola mundo"
12
+ else
13
+ "hello world"
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Jan Sirl
@@ -9,21 +15,21 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2011-11-24 00:00:00 +01:00
13
- default_executable:
18
+ date: 2011-11-24 00:00:00 Z
14
19
  dependencies: []
15
20
 
16
21
  description: A simple hello world gem
17
22
  email: jan.sirl@seznam.cz
18
- executables: []
19
-
23
+ executables:
24
+ - ahoj
20
25
  extensions: []
21
26
 
22
27
  extra_rdoc_files: []
23
28
 
24
29
  files:
25
30
  - lib/ahoj.rb
26
- has_rdoc: true
31
+ - lib/ahoj/translator.rb
32
+ - bin/ahoj
27
33
  homepage: ""
28
34
  licenses: []
29
35
 
@@ -33,21 +39,27 @@ rdoc_options: []
33
39
  require_paths:
34
40
  - lib
35
41
  required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
36
43
  requirements:
37
44
  - - ">="
38
45
  - !ruby/object:Gem::Version
46
+ hash: 3
47
+ segments:
48
+ - 0
39
49
  version: "0"
40
- version:
41
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
42
52
  requirements:
43
53
  - - ">="
44
54
  - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
45
58
  version: "0"
46
- version:
47
59
  requirements: []
48
60
 
49
61
  rubyforge_project:
50
- rubygems_version: 1.3.5
62
+ rubygems_version: 1.8.11
51
63
  signing_key:
52
64
  specification_version: 3
53
65
  summary: Ahoj!