bone_hola 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 67fe59f15e55b69159ca4f88a8a516303f429079
4
+ data.tar.gz: 446772b9877e959fe18890de52f0f6d6ed969124
5
+ SHA512:
6
+ metadata.gz: 048ec537ac761df4c3e35e9cf2810b310740c2c9ef7aa690e81a8533ef4727c46404de186b6ebe67fe2e0b07cbfa9ea647d17eba8c974a996b8ccfa8aab63dbe
7
+ data.tar.gz: 2aa44de5707a7f7d95f0785dcedc63ac948b4bb45170ed9dda80a0fb5b74de6646764fa6eba22aa7f33ce588fef08d091868892d783654e8279f1a7aa9d0d54d
data/.gitignore ADDED
@@ -0,0 +1,15 @@
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
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bone_hola.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +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.
data/README.md ADDED
@@ -0,0 +1,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
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/ietjxdl/bone_hola/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +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
+
data/bin/bone_hola ADDED
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'bone_hola'
4
+ language = ARGV.length == 0? "english" : ARGV[0]
5
+ puts(BoneHola.hi(language))
data/bone_hola.gemspec ADDED
@@ -0,0 +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{Support Chinese's hola.}
12
+ spec.description = %q{My first gem.}
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
@@ -0,0 +1,16 @@
1
+ class BoneHola::Translator
2
+ def initialize(language)
3
+ @language = language
4
+ end
5
+
6
+ def hi
7
+ case @language
8
+ when "chinese"
9
+ "你好,世界!"
10
+ when "spanish"
11
+ "hola mundo!"
12
+ else
13
+ "Hello World!"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module BoneHola
2
+ VERSION = "0.0.2"
3
+ end
data/lib/bone_hola.rb ADDED
@@ -0,0 +1,10 @@
1
+ require "bone_hola/version"
2
+ require "bone_hola/translator"
3
+
4
+ module BoneHola
5
+ # Your code goes here...
6
+ def self.hi(language)
7
+ translator = Translator.new(language)
8
+ translator.hi
9
+ end
10
+ end
data/test/test_hola.rb ADDED
@@ -0,0 +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("chinese"))
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
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bone_hola
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - xiao_dli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: My first gem.
56
+ email:
57
+ - ietjxdl@gmail.com
58
+ executables:
59
+ - bone_hola
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/bone_hola
69
+ - bone_hola.gemspec
70
+ - lib/bone_hola.rb
71
+ - lib/bone_hola/translator.rb
72
+ - lib/bone_hola/version.rb
73
+ - test/test_hola.rb
74
+ homepage: http://rubygems.org/gems/bone_hola
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.4.5
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Support Chinese's hola.
98
+ test_files:
99
+ - test/test_hola.rb