bone_hola 0.0.3 → 0.0.5
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 +4 -4
- data/.gitignore +17 -17
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -22
- data/README.md +33 -31
- data/Rakefile +9 -9
- data/bin/bone_hola +4 -4
- data/bone_hola.gemspec +25 -25
- data/lib/bone_hola/translator.rb +18 -15
- data/lib/bone_hola/version.rb +3 -3
- data/lib/bone_hola.rb +10 -10
- data/test/test_hola.rb +15 -15
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 913c7a70ef9c6b61c30db3b761e4c5747facff8e
|
|
4
|
+
data.tar.gz: 0d7c45273d02c1c55817a974ff534cb9891b672f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3ae7a677e700791b2723562c08dd3deafc4de1016ccb363a004a4e2ff571185f15018bf581ee91dddcdac6273e4a96771760d25253076a543670404f550398e
|
|
7
|
+
data.tar.gz: 653c009e0e623b036cf0602da43bb9243d9e266056e1bbda08322937eb0f846ff4a2041ca9cbacd7874565aa516a99322329afd9e60d59d242d6e41c83df95c1
|
data/.gitignore
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/.bundle/
|
|
2
|
-
/.yardoc
|
|
3
|
-
/Gemfile.lock
|
|
4
|
-
/_yardoc/
|
|
5
|
-
/coverage/
|
|
6
|
-
/doc/
|
|
7
|
-
/pkg/
|
|
8
|
-
/spec/reports/
|
|
9
|
-
/tmp/
|
|
10
|
-
/.idea/
|
|
11
|
-
*.bundle
|
|
12
|
-
*.so
|
|
13
|
-
*.o
|
|
14
|
-
*.a
|
|
15
|
-
*.gem
|
|
16
|
-
mkmf.log
|
|
17
|
-
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/Gemfile.lock
|
|
4
|
+
/_yardoc/
|
|
5
|
+
/coverage/
|
|
6
|
+
/doc/
|
|
7
|
+
/pkg/
|
|
8
|
+
/spec/reports/
|
|
9
|
+
/tmp/
|
|
10
|
+
/.idea/
|
|
11
|
+
*.bundle
|
|
12
|
+
*.so
|
|
13
|
+
*.o
|
|
14
|
+
*.a
|
|
15
|
+
*.gem
|
|
16
|
+
mkmf.log
|
|
17
|
+
|
data/Gemfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# Specify your gem's dependencies in bone_hola.gemspec
|
|
4
|
-
gemspec
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Specify your gem's dependencies in bone_hola.gemspec
|
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Copyright (c) 2015 xiao_dli
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2015 xiao_dli
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
# BoneHola
|
|
2
|
-
|
|
3
|
-
TODO: Write a gem description
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Add this line to your application's Gemfile:
|
|
8
|
-
|
|
9
|
-
```ruby
|
|
10
|
-
gem 'bone_hola'
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
And then execute:
|
|
14
|
-
|
|
15
|
-
$ bundle
|
|
16
|
-
|
|
17
|
-
Or install it yourself as:
|
|
18
|
-
|
|
19
|
-
$ gem install bone_hola
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
# BoneHola
|
|
2
|
+
|
|
3
|
+
TODO: Write a gem description
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'bone_hola'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install bone_hola
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
$ bone_hola
|
|
24
|
+
$ bone_hola english
|
|
25
|
+
$ bone_hola spanish
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
|
|
29
|
+
1. Fork it ( https://github.com/ietjxdl/bone_hola/fork )
|
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
33
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require "rake/testtask"
|
|
2
|
-
|
|
3
|
-
Rake::TestTask.new do |t|
|
|
4
|
-
t.libs << 'test'
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
desc "Run hola tests"
|
|
8
|
-
task :default=>:test
|
|
9
|
-
|
|
1
|
+
require "rake/testtask"
|
|
2
|
+
|
|
3
|
+
Rake::TestTask.new do |t|
|
|
4
|
+
t.libs << 'test'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
desc "Run hola tests"
|
|
8
|
+
task :default=>:test
|
|
9
|
+
|
data/bin/bone_hola
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#! /usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require 'bone_hola'
|
|
4
|
-
language = ARGV.length == 0? nil : ARGV[0]
|
|
1
|
+
#! /usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'bone_hola'
|
|
4
|
+
language = ARGV.length == 0? nil : ARGV[0]
|
|
5
5
|
puts(BoneHola.hi(language))
|
data/bone_hola.gemspec
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'bone_hola/version'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = "bone_hola"
|
|
8
|
-
spec.version = BoneHola::VERSION
|
|
9
|
-
spec.authors = ["xiao_dli"]
|
|
10
|
-
spec.email = ["ietjxdl@gmail.com"]
|
|
11
|
-
spec.summary = %q{My first gem.}
|
|
12
|
-
spec.description = %q{Support Chinese's hola.}
|
|
13
|
-
spec.homepage = "http://rubygems.org/gems/bone_hola"
|
|
14
|
-
spec.license = "MIT"
|
|
15
|
-
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
|
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.7"
|
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
|
-
spec.add_development_dependency "test-unit", "~> 0"
|
|
24
|
-
|
|
25
|
-
end
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'bone_hola/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "bone_hola"
|
|
8
|
+
spec.version = BoneHola::VERSION
|
|
9
|
+
spec.authors = ["xiao_dli"]
|
|
10
|
+
spec.email = ["ietjxdl@gmail.com"]
|
|
11
|
+
spec.summary = %q{My first gem.}
|
|
12
|
+
spec.description = %q{Support Chinese's hola.}
|
|
13
|
+
spec.homepage = "http://rubygems.org/gems/bone_hola"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
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.7"
|
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
|
+
spec.add_development_dependency "test-unit", "~> 0"
|
|
24
|
+
|
|
25
|
+
end
|
data/lib/bone_hola/translator.rb
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
# translater content by language
|
|
2
|
+
class BoneHola::Translator
|
|
3
|
+
# init say language
|
|
4
|
+
def initialize(language)
|
|
5
|
+
@language = language
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# Say hi to the world through tree languanges
|
|
9
|
+
def hi
|
|
10
|
+
case @language
|
|
11
|
+
when "english"
|
|
12
|
+
"Hello World!"
|
|
13
|
+
when "spanish"
|
|
14
|
+
"hola mundo!"
|
|
15
|
+
else
|
|
16
|
+
"你好,世界!"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
16
19
|
end
|
data/lib/bone_hola/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module BoneHola
|
|
2
|
-
VERSION = "0.0.
|
|
3
|
-
end
|
|
1
|
+
module BoneHola
|
|
2
|
+
VERSION = "0.0.5"
|
|
3
|
+
end
|
data/lib/bone_hola.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require "bone_hola/version"
|
|
2
|
-
require "bone_hola/translator"
|
|
3
|
-
|
|
4
|
-
module BoneHola
|
|
5
|
-
#
|
|
6
|
-
def self.hi(language = nil)
|
|
7
|
-
translator = Translator.new(language)
|
|
8
|
-
translator.hi
|
|
9
|
-
end
|
|
10
|
-
end
|
|
1
|
+
require "bone_hola/version"
|
|
2
|
+
require "bone_hola/translator"
|
|
3
|
+
|
|
4
|
+
module BoneHola
|
|
5
|
+
# Say hi to the world!.
|
|
6
|
+
def self.hi(language = nil)
|
|
7
|
+
translator = Translator.new(language)
|
|
8
|
+
translator.hi
|
|
9
|
+
end
|
|
10
|
+
end
|
data/test/test_hola.rb
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
require 'test/unit'
|
|
2
|
-
require 'bone_hola'
|
|
3
|
-
|
|
4
|
-
class BoneHolaTest < Test::Unit::TestCase
|
|
5
|
-
def test_chinese_hola
|
|
6
|
-
assert_equal("你好,世界!", BoneHola.hi())
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def test_spanish_hola
|
|
10
|
-
assert_equal("hola mundo!", BoneHola.hi("spanish"))
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def test_other_hola
|
|
14
|
-
assert_equal("Hello World!", BoneHola.hi("english"))
|
|
15
|
-
end
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'bone_hola'
|
|
3
|
+
|
|
4
|
+
class BoneHolaTest < Test::Unit::TestCase
|
|
5
|
+
def test_chinese_hola
|
|
6
|
+
assert_equal("你好,世界!", BoneHola.hi())
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def test_spanish_hola
|
|
10
|
+
assert_equal("hola mundo!", BoneHola.hi("spanish"))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def test_other_hola
|
|
14
|
+
assert_equal("Hello World!", BoneHola.hi("english"))
|
|
15
|
+
end
|
|
16
16
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bone_hola
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- xiao_dli
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-05-
|
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
91
91
|
version: '0'
|
|
92
92
|
requirements: []
|
|
93
93
|
rubyforge_project:
|
|
94
|
-
rubygems_version: 2.4.
|
|
94
|
+
rubygems_version: 2.4.6
|
|
95
95
|
signing_key:
|
|
96
96
|
specification_version: 4
|
|
97
97
|
summary: My first gem.
|