hola-ianh 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.travis.yml +16 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +31 -0
- data/README.md +36 -0
- data/Rakefile +10 -0
- data/bin/hola +4 -0
- data/hola.gemspec +33 -0
- data/lib/hola.rb +11 -0
- data/lib/hola/translator.rb +22 -0
- data/lib/hola/version.rb +3 -0
- data/test/test_hola.rb +32 -0
- metadata +86 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 81820f7cfc2c87fcea4e475654328ea206359308
|
4
|
+
data.tar.gz: 226f8bcfec521074bd607665a591920e76300fdf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 06586dd5238e2a981c86ded4f795ffdb8a5c6520e21fb11da1e66fea4003eaa27a11b6e226c18909139c102e79f4552ff543189b01b0221cfdbeed3e935caa1e
|
7
|
+
data.tar.gz: 0d4dc71a9df5a20d0bc858640a2280da1541bf448aea17c23efd804f0969a1f3780be481ed6162702479c0ee0586c8aec41e45486c9e720f188e204c1d952eae
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
notifications:
|
3
|
+
email:
|
4
|
+
on_success: change
|
5
|
+
on_failure: always
|
6
|
+
rvm:
|
7
|
+
- 1.9.3
|
8
|
+
- 2.0.0
|
9
|
+
- 2.1.6
|
10
|
+
- 2.2.2
|
11
|
+
before_install:
|
12
|
+
- gem update --system $RUBYGEMS_VERSION
|
13
|
+
- gem --version
|
14
|
+
- gem install bundler
|
15
|
+
- bundle --version
|
16
|
+
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in hola.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
platforms :ruby_18 do
|
7
|
+
# mime-types 2.0 requires Ruby version >= 1.9.2
|
8
|
+
gem "mime-types", "< 2.0"
|
9
|
+
end
|
10
|
+
platforms :ruby_22 do
|
11
|
+
gem 'test-unit'
|
12
|
+
end
|
13
|
+
gem "coveralls", :require => false, :group => :development
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
No copyright clause was included with code on github.
|
2
|
+
|
3
|
+
Note https://help.github.com/articles/github-terms-of-service clause F.1 states:
|
4
|
+
|
5
|
+
We claim no intellectual property rights over the material you provide to the Service.
|
6
|
+
Your profile and materials uploaded remain yours.
|
7
|
+
However, by setting your pages to be viewed publicly, you agree to allow others to view your Content.
|
8
|
+
By setting your repositories to be viewed publicly, you agree to allow others to view and fork your repositories.
|
9
|
+
|
10
|
+
Code supplied by Ian Heggie is Copyright (C) 2014 Ian Heggie under MIT LICENCE
|
11
|
+
|
12
|
+
MIT License
|
13
|
+
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
15
|
+
a copy of this software and associated documentation files (the
|
16
|
+
"Software"), to deal in the Software without restriction, including
|
17
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
18
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
19
|
+
permit persons to whom the Software is furnished to do so, subject to
|
20
|
+
the following conditions:
|
21
|
+
|
22
|
+
The above copyright notice and this permission notice shall be
|
23
|
+
included in all copies or substantial portions of the Software.
|
24
|
+
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
26
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
27
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
28
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
29
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
30
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
31
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Hola
|
2
|
+
|
3
|
+
Expanded “hello world” gem, with tests and code coverage
|
4
|
+
|
5
|
+
[![Travis CI tests](https://travis-ci.org/ianheggie/hola-ianh.png)](https://travis-ci.org/ianheggie/hola-ianh)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/ianheggie/hola-ianh/badge.png)](https://coveralls.io/r/ianheggie/hola-ianh)
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
gem 'hola-ianh'
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install hola-ianh
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
See http://guides.rubygems.org/make-your-own-gem/
|
25
|
+
|
26
|
+
## Contributing
|
27
|
+
|
28
|
+
1. Fork it
|
29
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
30
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
32
|
+
5. Create new Pull Request
|
33
|
+
|
34
|
+
## Thanks
|
35
|
+
|
36
|
+
Forked with thanks to qrush from https://github.com/qrush/hola.
|
data/Rakefile
ADDED
data/bin/hola
ADDED
data/hola.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hola/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'hola-ianh'
|
8
|
+
spec.version = Hola::VERSION
|
9
|
+
spec.authors = ['Nick Quaranto', 'Ian Heggie']
|
10
|
+
spec.email = %q{nick@quaran.to ian@heggie.biz}
|
11
|
+
spec.description = %q{An expanded example of a simple hello world gem}
|
12
|
+
spec.summary = %q{Hola!}
|
13
|
+
spec.homepage = %q{http://rubygems.org/gems/hola-ianh}
|
14
|
+
spec.license = 'UNKNOWN+MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
|
24
|
+
spec.required_rubygems_version = Gem::Requirement.new('>= 0') if spec.respond_to? :required_rubygems_version=
|
25
|
+
if spec.respond_to? :specification_version then
|
26
|
+
spec.specification_version = 3
|
27
|
+
|
28
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
29
|
+
else
|
30
|
+
end
|
31
|
+
else
|
32
|
+
end
|
33
|
+
end
|
data/lib/hola.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
class Hola::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
|
+
when "dutch"
|
15
|
+
"hallo wereld"
|
16
|
+
when "polish"
|
17
|
+
"witaj świecie"
|
18
|
+
else
|
19
|
+
"hello world"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/hola/version.rb
ADDED
data/test/test_hola.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear!
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require 'hola'
|
7
|
+
|
8
|
+
class HolaTest < Test::Unit::TestCase
|
9
|
+
def test_english_hello
|
10
|
+
assert_equal "hello world", Hola.hi("english")
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_any_hello
|
14
|
+
assert_equal "hello world", Hola.hi("ruby")
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_spanish_hello
|
18
|
+
assert_equal "hola mundo", Hola.hi("spanish")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_dutch_hello
|
22
|
+
assert_equal "hallo wereld", Hola.hi("dutch")
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_korean_hello
|
26
|
+
assert_equal "anyoung ha se yo", Hola.hi("korean")
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_polish_hello
|
30
|
+
assert_equal "witaj świecie", Hola.hi("polish")
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hola-ianh
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Quaranto
|
8
|
+
- Ian Heggie
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.3'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.3'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
description: An expanded example of a simple hello world gem
|
43
|
+
email: nick@quaran.to ian@heggie.biz
|
44
|
+
executables:
|
45
|
+
- hola
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".travis.yml"
|
51
|
+
- Gemfile
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/hola
|
56
|
+
- hola.gemspec
|
57
|
+
- lib/hola.rb
|
58
|
+
- lib/hola/translator.rb
|
59
|
+
- lib/hola/version.rb
|
60
|
+
- test/test_hola.rb
|
61
|
+
homepage: http://rubygems.org/gems/hola-ianh
|
62
|
+
licenses:
|
63
|
+
- UNKNOWN+MIT
|
64
|
+
metadata: {}
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 2.4.5
|
82
|
+
signing_key:
|
83
|
+
specification_version: 3
|
84
|
+
summary: Hola!
|
85
|
+
test_files:
|
86
|
+
- test/test_hola.rb
|