8000 made hola an executable, changed to bundle template, added README, merged in dutch by ianheggie · Pull Request #4 · qrush/hola · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

made hola an executable, changed to bundle template, added README, merged in dutch #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f1b0b9b
Added Dutch translation
csrakowski Jan 14, 2013
812f703
flag hola as an executable
ianheggie Jun 18, 2013
8986e3b
Merge branch 'csrakowski-master'
ianheggie Jun 18, 2013
80b1644
Use template files from 'bundle gem' (has better defaults in gemspec)
ianheggie Jun 18, 2013
5053302
Add travis CI testing
ianheggie Jun 18, 2013
e6b3a38
Add travis email notification
ianheggie Jun 18, 2013
85aa09d
Correct version (bundle's template assumes the base module name is a …
ianheggie Jun 18, 2013
7906f30
Removed ruby-head from .travis.yml (failed due to missing bundler, bu…
ianheggie Jun 18, 2013
6240b05
Added ruby 2.0
ianheggie Jul 20, 2013
4a7f7e9
Add test for Korean hello
ciban Sep 19, 2013
f0364c2
Added coveralls test
ianheggie Oct 29, 2013
53873b9
Merge branch 'ciban-patch-1' into coveralls
ianheggie Oct 29, 2013
0eed2ff
add test and coverage links
ianheggie Oct 29, 2013
7c4f68b
Fix mime-types dependency
ianheggie Oct 29, 2013
9a1dc18
Ignore .ruby-version for testing
ianheggie Oct 29, 2013
fc9a619
Correct travis link in README.md
ianheggie Dec 22, 2013
ec7c8fb
Add German to the list of languages
rosetree Oct 9, 2014
d9ef9c1
Added brazilian portuguese language
renatogpires Dec 24, 2014
5c0d2d0
Merge pull request #1 from renatogpires/ptbr_language
rosetree Feb 9, 2015
3063741
add polish
N0zz Feb 11, 2015
92ecb9a
add test for polish
N0zz Feb 11, 2015
a2154e2
polish test fix
N0zz Feb 11, 2015
08a95a5
utf-8 encoding for polish
N0zz Feb 11, 2015
5ba5eff
Merge branch 'master' of https://github.com/N0zz/hola into N0zz-master
ianheggie May 12, 2015
3d92c12
Merge branch 'N0zz-master'
ianheggie May 12, 2015
0e4168e
Merge branch 'master' of https://github.com/rosetree/hola into rosetr…
ianheggie May 12, 2015
aedd2b4
Add test-unit gem for ruby 2.2
ianheggie May 12, 2015
c061a27
Update version, gemspec and licence
ianheggie May 12, 2015
cdfabaf
Update bundler to more recent version and add extra ruby versions
ianheggie May 12, 2015
8a97263
Adjusted README
ianheggie May 12, 2015
c26d2d9
Removed ruby 1.8.7 because some gems no longer support it
ianheggie May 12, 2015
5189bb1
Fix json version for ruby < 2.0
ianheggie Jul 8, 2016
5178dbc
Fix unit test require failing
ianheggie Jul 8, 2016
db8f4bc
Merge branch 'master' into rosetree-master
ianheggie Aug 30, 2016
84e5880
Add comment in readme
ianheggie Aug 30, 2016
c036905
Merge branch 'rosetree-master'
ianheggie Aug 30, 2016
144b440
Mark version
ianheggie Aug 30, 2016
0c72636
Restrict tins version for ruby 1.* compatibity
ianheggie Aug 30, 2016
5e32c60
Add 2.3.1 ruby
ianheggie Aug 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
.ruby-version
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: ruby
notifications:
email:
on_success: change
on_failure: always
rvm:
- 1.9.3
- 2.0.0
- 2.1.6
- 2.2.2
- 2.3.1
before_install:
- gem update --system $RUBYGEMS_VERSION
- gem --version
- gem install bundler
- bundle --version

19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in hola.gemspec
gemspec

platforms :ruby_18 do
# mime-types 2.0 requires Ruby version >= 1.9.2
gem 'mime-types', '< 2.0'
end
platforms :ruby_18, :ruby_19 do
# json 2.0.1 requires Ruby >= 2.0
gem 'json', '< 2.0'
end
platforms :ruby_22, :ruby_23 do
gem 'test-unit'
gem 'minitest'
end
gem 'coveralls', :require => false, :group => :development
gem 'tins', '<1.7.0' if RUBY_VERSION =~ /^1\./
31 changes: 31 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
No copyright clause was included with code on github.

Note https://help.github.com/articles/github-terms-of-service clause F.1 states:

We claim no intellectual property rights over the material you provide to the Service.
Your profile and materials uploaded remain yours.
However, by setting your pages to be viewed publicly, you agree to allow others to view your Content.
By setting your repositories to be viewed publicly, you agree to allow others to view and fork your repositories.

Code supplied by Ian Heggie is Copyright (C) 2014 Ian Heggie under MIT LICENCE

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Hola

Expanded “hello world” gem, with tests and code coverage

[![Travis CI tests](https://travis-ci.org/ianheggie/hola-ianh.png)](https://travis-ci.org/ianheggie/hola-ianh)
[![Coverage Status](https://coveralls.io/repos/ianheggie/hola-ianh/badge.png)](https://coveralls.io/r/ianheggie/hola-ianh)

## Installation

Add this line to your application's Gemfile:

gem 'hola-ianh'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hola-ianh

## Usage

See http://guides.rubygems.org/make-your-own-gem/

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Thanks

Forked with thanks to qrush from https://github.com/qrush/hola.
Thanks for contributions of extra languages from various people.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "bundler/gem_tasks"

require 'rake/testtask'

Rake::TestTask.new do |t|
Expand Down
42 changes: 24 additions & 18 deletions hola.gemspec
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
Gem::Specification.new do |s|
s.name = "hola"
s.version = "0.0.1"
s.default_executable = "hola"
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'hola/version'

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nick Quaranto"]
s.date = %q{2010-04-03}
s.description = %q{A simple hello world gem}
s.email = %q{nick@quaran.to}
s.files = ["Rakefile", "lib/hola.rb", "lib/hola/translator.rb", "bin/hola"]
s.test_files = ["test/test_hola.rb"]
s.homepage = %q{http://rubygems.org/gems/hola}
s.require_paths = ["lib"]
s.rubygems_version = %q{1.6.2}
s.summary = %q{Hola!}
Gem::Specification.new do |spec|
spec.name = 'hola-ianh'
spec.version = Hola::VERSION
spec.authors = ['Nick Quaranto', 'Ian Heggie']
spec.email = %q{nick@quaran.to ian@heggie.biz}
spec.description = %q{An expanded example of a simple hello world gem}
spec.summary = %q{Hola!}
spec.homepage = %q{http://rubygems.org/gems/hola-ianh}
spec.license = 'UNKNOWN+MIT'

if s.respond_to? :specification_version then
s.specification_version = 3
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'

spec.required_rubygems_version = Gem::Requirement.new('>= 0') if spec.respond_to? :required_rubygems_version=
if spec.respond_to? :specification_version then
spec.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
else
end
else
end
end

3 changes: 3 additions & 0 deletions lib/hola.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: UTF-8

class Hola
def self.hi(language)
translator = Translator.new(language)
Expand All @@ -6,3 +8,4 @@ def self.hi(language)
end

require 'hola/translator'
require 'hola/version'
10 changes: 10 additions & 0 deletions lib/hola/translator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# encoding: UTF-8

class Hola::Translator
def initialize(language = "english")
@language = language
Expand All @@ -9,6 +11,14 @@ def hi
"hola mundo"
when "korean"
"anyoung ha se yo"
when "dutch"
"hallo wereld"
when "polish"
"witaj świecie"
when "german"
"hallo welt"
when "brazilian portuguese"
"olá mundo"
else
"hello world"
end
Expand Down
3 changes: 3 additions & 0 deletions lib/hola/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Hola
VERSION = '0.1.0'
end
24 changes: 24 additions & 0 deletions test/test_hola.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# encoding: UTF-8
require 'coveralls'
Coveralls.wear!

require 'test/unit'
require 'hola'

Expand 6F70 All @@ -13,4 +17,24 @@ def test_any_hello
def test_spanish_hello
assert_equal "hola mundo", Hola.hi("spanish")
end

def test_dutch_hello
assert_equal "hallo wereld", Hola.hi("dutch")
end

def test_korean_hello
assert_equal "anyoung ha se yo", Hola.hi("korean")
end

def test_polish_hello
assert_equal "witaj świecie", Hola.hi("polish")
end

def test_german_hello
assert_equal "hallo welt", Hola.hi("german")
end

def test_brazilian_portuguese_hello
assert_equal "olá mundo", Hola.hi("brazilian portuguese")
end
end
0