ruby-hello 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1aa567987319788eb10dbbf63bbb4873b92dadb7007ff0ca6eb72ca46bc9b6ad
4
+ data.tar.gz: 949615752c00f64e886af4938db10f4b066e11af550977773f49eef3a37bcada
5
+ SHA512:
6
+ metadata.gz: 226c2bdc2a84d10daa6ae1646da1a0178387c13b5d2201891588c906d78fcca7a4e1f4ab9e8a0b1727b5579e3fd77a6d2e9d51dbc33d7f03dee192c1c9d2c5e9
7
+ data.tar.gz: '068c1a08c0e004c27ad3b7e9664f6c89e4a1544348c258a0dae7a2f7756879d78a17a25c0653099788e5b41bfc54d5cb2d3e5a7b9b4c4423c55d307af5aa6b43'
data/Rakefile ADDED
@@ -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
data/bin/hello ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'hello'
4
+ puts Hello.hi(ARGV[0])
data/lib/hello.rb ADDED
@@ -0,0 +1,10 @@
1
+ # encoding utf-8
2
+
3
+ class Hello
4
+ def self.hi(language)
5
+ translator = Translator.new(language)
6
+ translator.hi
7
+ end
8
+ end
9
+
10
+ require 'hello/translator'
@@ -0,0 +1,18 @@
1
+ # encoding utf-8
2
+
3
+ class Hello::Translator
4
+ def initialize(language = "english")
5
+ @language = language
6
+ end
7
+
8
+ def hi
9
+ case @language
10
+ when "spanish"
11
+ "hola mundo"
12
+ when "korean"
13
+ "anyoung ha se yo"
14
+ else
15
+ "hello world"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'hello'
3
+
4
+ class HelloTest < Test::Unit::TestCase
5
+ def test_english_hello
6
+ assert_equal "hello world", Hello.hi("english")
7
+ end
8
+
9
+ def test_any_hello
10
+ assert_equal "hello world", Hello.hi("ruby")
11
+ end
12
+
13
+ def test_spanish_hello
14
+ assert_equal "hola mundo", Hello.hi("spanish")
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-hello
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nick Quaranto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2010-04-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple hello world gem
14
+ email: nick@quaran.to
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - Rakefile
20
+ - bin/hello
21
+ - lib/hello.rb
22
+ - lib/hello/translator.rb
23
+ - test/test_hello.rb
24
+ homepage:
25
+ licenses: []
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.7.3
44
+ signing_key:
45
+ specification_version: 3
46
+ summary: Hello!
47
+ test_files:
48
+ - test/test_hello.rb