cm_conversion 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
+ SHA1:
3
+ metadata.gz: d3550a78f6cd995a115dc2811e5e1bc3b9eae03e
4
+ data.tar.gz: 2d545f1414275dbef60517469bbf2f7e7d327e08
5
+ SHA512:
6
+ metadata.gz: 1c6972a27067880117d5874f26489111de1fcdcac01348f1dd74d878c6a412f5ac856ddd621ee7cab3cfd03a0809ad84d208b4424e6f36ffc8dabd60e6339837
7
+ data.tar.gz: 5ecd38c0bac777a59a178f104386b67270f97f4fd92b4b79ae561ab8f047eabf9d6070bd8844b50b11d76a7621fc147a8bb6ab0b69baa202cebe5f5bb1478b01
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.5
5
+ branches:
6
+ only:
7
+ - master
8
+ bundler_args: "--without production --path=vendor/bundle"
9
+ cache:
10
+ directories:
11
+ - vendor/bundle
12
+ deploy:
13
+ provider: rubygems
14
+ api_key:
15
+ secure: VDNJFVROSQskCiVLjYddaY9ZwI8KEq6rOm5QZqgEd9Sue8nVT6yJV3MrjnxRLC4GJlZ7RKC1rDT30qxKJsVAp68A6xVwq+ntbrbE389bOHeIuIgW8mJApgqfge3IHHi2zvXXYs3xX7Qq4KIeFHv+Ea6CWSYslkgkMb3dN8NDe+PBeKZIhqfFs1TuDqXeCGSQjl1bfJESnRjA4aoLtTSVRonXlA4RCvvVxDeOx3plI+XGK3iY4oJyFQnQKTcRlTOBGZZabvqADdYS0D32Deo7OOWodoJyCdzfPfM0ocbk6+09vpERoogavhh9YrxjLOA2/h7WBp6oncgU3AheAyB+ZIR7uXOcRUt8YoV+DQ7JcD+qFgSbcoPmnsND9hcG6Pnn7XPOcrxsVTso0tznO2FikKSMkBRx0hnUOcp2ODodwYFNaRA3VNOpWlkosWgfqEO4WgwDETTwYmbQX+FIAwiYX14I+fs2roFNLU0GPrK2OqKfzJVMW7WQceTE2xgA0EoT0711SNKcMe3awehHBt+OY2ntjNvuYkyGb0tRURik8up8tiRchkeF0oKrfQi0X5qxuIXnRf7pwgPCgI8K22PqdAZKI2CQK5c9Tp3A1OFtgrT+MkfjRCL/FnaH16aD7r+ON7nzfya03qaF+w7VA/8nS2g6vAqK9Lq3spcPqF8iMxw=
16
+ on:
17
+ tags: true
18
+ all_branches: true
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cm_conversion.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,6 @@
1
+ guard :minitest do
2
+ watch(%r{^test/(.*)\/?(.*)_test\.rb$})
3
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
4
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
5
+ watch(%r{^lib/([^/]+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
6
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 z15026hy, a1427tn, e1501ta, a1519jk, z15021sn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # CM Conversion
2
+
3
+ [![Build Status](https://travis-ci.org/nkmrshn/cm_conversion.svg?branch=master)](https://travis-ci.org/nkmrshn/cm_conversion)
4
+
5
+ This is a study result at [AIIT](http://aiit.ac.jp). This gem is aimed to convert centimeters to following scales:
6
+
7
+ * inches
8
+ * yards
9
+ * [shaku](https://en.wikipedia.org/wiki/Shaku_(unit))
10
+ * feet
11
+ * mile
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'cm_conversion'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install cm_conversion
28
+
29
+ ## Usage
30
+
31
+ ```ruby
32
+ irb(main):001:0> require 'cm_conversion'
33
+ => true
34
+ irb(main):002:0> CmConversion::Converter.new.to_feet(1)
35
+ => 0.03280839895013123
36
+ ```
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cm_conversion/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cm_conversion"
8
+ spec.version = CmConversion::VERSION
9
+ spec.authors = ["z15021sn"]
10
+ spec.email = ["z15021sn@aiit.ac.jp"]
11
+
12
+ spec.summary = %q{This is a study result at AIIT.}
13
+ spec.description = %q{This gem is aimed to convert centimeters to other scales.}
14
+ spec.homepage = "https://github.com/nkmrshn/cm_conversion"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "minitest"
25
+ spec.add_development_dependency 'minitest-reporters'
26
+ spec.add_development_dependency 'mini_backtrace'
27
+ spec.add_development_dependency "guard"
28
+ spec.add_development_dependency "guard-minitest"
29
+ end
data/exe/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cm_conversion"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/exe/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,17 @@
1
+ require "cm_conversion/version"
2
+
3
+ module CmConversion
4
+ class Converter
5
+ def to_feet(value)
6
+ value.is_a?(Numeric) ? value / 30.48 : nil
7
+ end
8
+
9
+ def to_shaku(value)
10
+ value.is_a?(Numeric) ? value / 30.303 : nil
11
+ end
12
+
13
+ def to_mile(value)
14
+ value.is_a?(Numeric) ? (value * 100) / 1609.344 : nil
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module CmConversion
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cm_conversion
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - z15021sn
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-08-01 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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: minitest
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
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-reporters
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mini_backtrace
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: This gem is aimed to convert centimeters to other scales.
112
+ email:
113
+ - z15021sn@aiit.ac.jp
114
+ executables:
115
+ - console
116
+ - setup
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - ".gitignore"
121
+ - ".travis.yml"
122
+ - Gemfile
123
+ - Guardfile
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - cm_conversion.gemspec
128
+ - exe/console
129
+ - exe/setup
130
+ - lib/cm_conversion.rb
131
+ - lib/cm_conversion/version.rb
132
+ homepage: https://github.com/nkmrshn/cm_conversion
133
+ licenses:
134
+ - MIT
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options: []
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 2.4.5
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: This is a study result at AIIT.
156
+ test_files: []