engineer_calculator 0.1.0

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
+ SHA256:
3
+ metadata.gz: b2b0612f2cadd005395fd986365d1bee9370f029c09874877cc3baa78b51efe6
4
+ data.tar.gz: 955c4be6d22877c540d14b78dde05760cdfa229bfd96376e7e190024a07e129d
5
+ SHA512:
6
+ metadata.gz: fbd3a237c6ea49b494249347d9b746269ae02fe76935be653a211d584f4d669f2bc2ebf9400833269a59bfc3cf72f098b362a666415851412efb736e49f8869d
7
+ data.tar.gz: c08773d52d01039cfc81787c1d2ec2e8f40b8e6f1239f01cca52a282af1bad96bd5a84f095a26012aa44100194a14efdd699183e80c5fb4232c7206c28776450
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.0
7
+ before_install: gem install bundler -v 1.16.6
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at eastazy@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in engineering_calculator.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ engineering_calculator (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ minitest (5.11.3)
10
+ rake (10.5.0)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ bundler (~> 1.16)
17
+ engineering_calculator!
18
+ minitest (~> 5.0)
19
+ rake (~> 10.0)
20
+
21
+ BUNDLED WITH
22
+ 1.16.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Azeroyear
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,101 @@
1
+ # EngineeringCalculator
2
+
3
+ ### a. 使い方
4
+ calc = EngineeringCalculator.new("100kgg / 20mm2")
5
+ calc.result #=> ["5Mpa","100kgg/20mm2"]
6
+ calc.calc("10mpa + 20psi")
7
+ calc.result #=> ["30Mpa","10Mpa+20Mpa"]
8
+ calc.evaluate("100mpa +10m") #=> fail
9
+
10
+ ### b. 実装計画
11
+ #### 1) 数式を取り出す
12
+ 1. (), \*, / を評価して配列に代入
13
+ ~~~
14
+ 100kg / 20mm2 + 10psi #=> [100kg/20mm2,+,10psi,=]
15
+
16
+ ex: (100kgg + 10pondg) / 20kg/mm2 + 10psi #=> [100kgg+ 10pondg,/,20mm2,+,10psi,=]
17
+ ~~~
18
+ 2.
19
+ 2. 配列に変換
20
+ ~~~
21
+ [[数式,数値,単位]]
22
+ ~~~
23
+ #### 2) Validate?メソッドで単位の並びを評価
24
+ 1. 単位評価
25
+ +, - で同じカテゴリーに属していない単位が選択されていたらFailを返して終了。
26
+ ~~~
27
+ Mpa + psi => true
28
+ Mpa * Mpa/s => true
29
+ Mpa + m => fail
30
+ Mpa + kg => fail
31
+ ~~~
32
+
33
+ 2. 計算式評価
34
+ ()の数が間違っている。一番最後の)抜きはOK。
35
+ ~~~
36
+ ((100kg/20m2 + 20psi) + 20 => true
37
+ (20+10) * 100mpa) => fail
38
+ ~~~
39
+ //, ** など計算式が連続している。
40
+
41
+ 3. 単位抜き
42
+
43
+
44
+ #### 3) 単位換算
45
+ 1. メモ書き
46
+ \*,/は単位無しの倍数とみなす。
47
+ ~~~
48
+ 100 * 20mpa #=> 20000Mpa
49
+ ~~~
50
+ +,-並びに記載されているもので単位が一つしかない時は、その単位とする。
51
+ ~~~
52
+ 100 + 20psi => 100Mpa + 20psi
53
+ ~~~
54
+ 2. 単位換算表(yml形式)
55
+
56
+
57
+ #### 4) 数値計算
58
+ 1. 数式だけを取り出す
59
+ 2. evalを使用して計算する
60
+
61
+ #### 5) 単位計算
62
+ 1. 単位を計算するメソッドの用意
63
+
64
+
65
+ ## Installation
66
+
67
+ Add this line to your application's Gemfile:
68
+
69
+ ```ruby
70
+ gem 'engineering_calculator'
71
+ ```
72
+
73
+ And then execute:
74
+
75
+ $ bundle
76
+
77
+ Or install it yourself as:
78
+
79
+ $ gem install engineering_calculator
80
+
81
+ ## Usage
82
+
83
+ TODO: Write usage instructions here
84
+
85
+ ## Development
86
+
87
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
88
+
89
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
90
+
91
+ ## Contributing
92
+
93
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/engineering_calculator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
94
+
95
+ ## License
96
+
97
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
98
+
99
+ ## Code of Conduct
100
+
101
+ Everyone interacting in the EngineeringCalculator project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/engineering_calculator/blob/master/CODE_OF_CONDUCT.md).
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
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "engineering_calculator"
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(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,42 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "engineering_calculator/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "engineer_calculator"
8
+ spec.version = EngineeringCalculator::VERSION
9
+ spec.authors = ["Azeroyear"]
10
+ spec.email = ["eastazy@gmail.com"]
11
+
12
+ spec.summary = %q{This gem can calculate the calculation which included unit.}
13
+ spec.description = %q{This gem can calculate the calculation which included unit.}
14
+ spec.homepage = "https://github.com/AZeroyear/engineering_calculator"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata["allowed_push_host"] = "Set to 'http://mygemserver.com'"
21
+ #
22
+ # spec.metadata["homepage_uri"] = spec.homepage
23
+ # spec.metadata["source_code_uri"] = "https://github.com/AZeroyear/engineering_calculator"
24
+ # spec.metadata["changelog_uri"] = "https://github.com/AZeroyear/engineering_calculator"
25
+ # else
26
+ # raise "RubyGems 2.0 or newer is required to protect against " \
27
+ # "public gem pushes."
28
+ # end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ spec.bindir = "exe"
36
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.require_paths = ["lib"]
38
+
39
+ spec.add_development_dependency "bundler", "~> 1.16"
40
+ spec.add_development_dependency "rake", "~> 10.0"
41
+ spec.add_development_dependency "minitest", "~> 5.0"
42
+ end
@@ -0,0 +1,3 @@
1
+ module EngineeringCalculator
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,72 @@
1
+ require "engineering_calculator/version"
2
+ require 'yaml'
3
+
4
+ module EngineeringCalculator
5
+ class Calculator
6
+ attr_accessor :result
7
+ def initialize(keisan="")
8
+ @arithmetic = /(\^\(?[\+\-]?\d+\/?\d*\)?)|([\(\)\+\-\*\/])/
9
+ @numeric = /\d+(?:\.\d*)?(?:e[+-]?\d+)?/
10
+ @result = split_each_calc(keisan)
11
+ end
12
+
13
+ def split_each_calc(keisan)
14
+ keisan.delete!(" ")
15
+ result = keisan.split(/(#{@numeric}(?:[a-z]+\/?[a-z]?\d*)?)|#{@arithmetic}/i)
16
+ result.reject!{ |c| c.empty? }
17
+
18
+ result.map! do |elem|
19
+ original = split_unit(elem)
20
+ conv = split_unit(conversion(elem))
21
+ [conv["value"], conv["unit"], original["value"], original["unit"]]
22
+ end
23
+
24
+ result
25
+ formula = String.new
26
+ result.each do |elem|
27
+ formula << elem[0].to_s + elem[1].to_s
28
+ end
29
+ kekka = [formula.sub(/(\*\*)/,"^"), calc(result)]
30
+ end
31
+
32
+ def calc(result)
33
+ formula = String.new
34
+ result.each { |elem| formula << elem[0] }
35
+ eval(formula)
36
+ end
37
+
38
+ def unit_calc(unit = ["m", "+", "m"])
39
+ unit_formula = String.new
40
+ unit.each_with_index do |elem, id|
41
+ if id == 0
42
+ unit_formula << elem
43
+ elsif elem == "+"
44
+ unit_formula
45
+
46
+ end
47
+ end
48
+ unit_formula
49
+ end
50
+
51
+ def conversion(keisan)
52
+ #SI単位を返す
53
+ vu = split_unit(keisan)
54
+
55
+ all_unit = YAML.load_file("lib/unit.yml")
56
+ all_unit.each_value { |type| keisan = (vu["value"].to_f / type[vu["unit"]].to_f ).to_s + type.key(1) if type.key?(vu["unit"]) }
57
+ if keisan =~ /^\^/
58
+ keisan.sub!(/(\/\d+)/) { |match| match + ".0" }
59
+ keisan.sub!(/^\^/, "**")
60
+ end
61
+ keisan
62
+ end
63
+
64
+ def split_unit(keisan)
65
+ keisan =~ /(^\*+\(?[\+\-]?\d+.*\)?)|(#{@numeric})|#{@arithmetic}/i
66
+ value = $&
67
+ unit = $'
68
+ hash = Hash.new
69
+ hash = {"value" => value, "unit" => unit}
70
+ end
71
+ end
72
+ end
data/lib/unit.yml ADDED
@@ -0,0 +1,215 @@
1
+ length:
2
+ Å: 10000000000
3
+ nm: 1000000000
4
+ μm: 1000000
5
+ mm: 1000
6
+ cm: 100
7
+ m: 1
8
+ km: 0.001
9
+ mil: 39370.078740158
10
+ in: 39.370078740158
11
+ ft: 3.2808398950131
12
+ yd: 1.0936132983377
13
+ mi: 6.2137119223733E-4
14
+ 寸: 33
15
+ 尺: 3.3
16
+ 鯨尺: 2.64
17
+ 丈: 0.33
18
+ 間: 0.55
19
+ 町: 0.0091666666666667
20
+ 里: 2.5462962962963E-4
21
+ AU: 6.6845871222685E-12
22
+ 光年: 1.0570008340246E-16
23
+ pc: 3.2407790389471E-17
24
+ 海里: 5.3995680345572E-4
25
+ fath: 0.54680664916885
26
+
27
+ area:
28
+ mm2: 1000000
29
+ cm2: 10000
30
+ m2: 1
31
+ a: 0.01
32
+ ha: 1.E-4
33
+ km2: 1.E-6
34
+ sq in: 1550.0031000062000124000248000496000992001984003968
35
+ sq ft: 10.763910416709722308333505555900000688890266669422
36
+ sq yd: 1.1959900463010802564815006173222222987655851854914
37
+ ro: 9.8842152586866136899297571679522504030213651693501E-4
38
+ ac: 2.4710538146716534224824392919880626007553412923375E-4
39
+ sq mi: 3.8610215854244584726288113937313478136802207692774E-7
40
+ 坪: 0.3025
41
+ 畝: 0.010083333333333333333333333333333333333333333333333
42
+ 反: 0.0010083333333333333333333333333333333333333333333333
43
+ 町: 1.0083333333333333333333333333333333333333333333333E-4
44
+
45
+ volume:
46
+ ml: 1000000
47
+ cl: 100000
48
+ dl: 10000
49
+ l: 1000
50
+ mm3: 1000000000
51
+ cm3: 1000000
52
+ cc: 1000000
53
+ m3: 1
54
+ cu in: 61023.744094732
55
+ cu ft: 35.314666721489
56
+ ac ft: 8.1071319378991E-4
57
+ fl oz: 35195.079727854
58
+ gi: 7039.0159455708
59
+ pt: 1759.7539863927
60
+ qt: 879.87699319635
61
+ gal: 219.96924829909
62
+ bl: 6.1102568971969
63
+ fl oz: 33814.022701843
64
+ gi: 8453.5056754608
65
+ pt: 2113.3764188652
66
+ qt: 1056.6882094326
67
+ gal: 264.17205235815
68
+ bl: 8.3864143605761
69
+ pt: 1816.1659685377
70
+ qt: 908.08298426886
71
+ gal: 227.02074606721
72
+ bl: 8.6484093739891
73
+ bbl: 6.2898107704321
74
+ 勺: 55435.235318617
75
+ 合: 5543.5235318617
76
+ 升: 554.35235318617
77
+ 斗: 55.435235318617
78
+ 石: 5.5435235318617
79
+
80
+ weight:
81
+ mg: 1000000
82
+ g: 1000
83
+ kg: 1
84
+ t: 0.001
85
+ gr: 15432.358352941
86
+ dr: 564.38339119329
87
+ oz: 35.27396194958
88
+ lb: 2.2046226218488
89
+ stone: 0.15747304441777
90
+ ton: 9.8420652761106E-4
91
+ sh tn: 0.0011023113109244
92
+ 分: 2666.6666666667
93
+ 匁: 266.66666666667
94
+ 百目: 2.6666666666667
95
+ 斤: 1.6666666666667
96
+
97
+ power:
98
+ dyn: 100,000
99
+ N: 1
100
+ kgf: 0.10197162129779
101
+ lbf: 0.22480894309971
102
+ tnf: 1.1240447154986E-4
103
+ pdl: 7.2330138512099
104
+
105
+ pressure:
106
+ Pa: 1
107
+ N/m2: 1
108
+ hPa: 0.01
109
+ kPa: 0.001
110
+ MPa: 1E-06
111
+ N/mm2: 1E-06
112
+ bar: 1E-05
113
+ atm: 9.8692326671601E-06
114
+ at: 1.0197162129779E-05
115
+ kgf/cm2: 1.0197162129779E-05
116
+ mmH2O: 0.10197162129779
117
+ cmH2O: 0.010197162129779
118
+ mmH2O (3.98℃): 0.10197442889221
119
+ cmH2O (3.98℃): 0.010197442889221
120
+ mmHg: 0.0075006157584566
121
+ inHg: 2.952998330101E-04
122
+ torr: 0.0075006168270417
123
+ psi: 1.4503773773021E-04
124
+
125
+ Electric power:
126
+ mW: 1000000
127
+ W: 1000
128
+ kW: 1
129
+ dBm: 60
130
+ kgfm/s: 101.97162129779
131
+ PS: 1.3596216173039
132
+ HP: 1.341022089595
133
+ ft.lbf/s: 737.56214927727
134
+ cal/s: 238.8458966275
135
+ kcal/s: 0.2388458966275
136
+ BTU/s: 0.94781712031332
137
+
138
+ energy:
139
+ erg: 10000000
140
+ J: 1
141
+ kWh: 2.7777777777778E-07
142
+ calth: 0.23900573613767
143
+ kcalth: 2.3900573613767E-04
144
+ calIT: 0.2388458966275
145
+ kcalIT: 2.388458966275E-04
146
+ eV: 6.2415094796077E+18
147
+ BTU: 9.4781712031332E-04
148
+ ftlbf: 0.73756214945755
149
+ ftpdl: 23.730360457056
150
+ atm: 0.0098692326671601
151
+
152
+ Speed:
153
+ m/s: 1
154
+ km/h: 3.6
155
+ fps: 3.2808398950131
156
+ fpm: 196.85039370079
157
+ fph: 11811.023622047
158
+ mps: 6.2137119223733E-04
159
+ mpm: 0.03728227153424
160
+ mph: 2.2369362920544
161
+ kn: 1.9438444924406
162
+ M: 0.0030211480362538
163
+ s: 0.0029069767441861
164
+ c: 3.3356409519815E-09
165
+
166
+ acceleration:
167
+ m/s2: 1
168
+ km/h/s: 3.6
169
+ Gal: 100
170
+ fps2: 3.2808398950131
171
+ fpm/s: 196.85039370079
172
+ fph/s: 11811.023622047
173
+ mps2: 6.2137119223733E-04
174
+ mpm/s: 0.03728227153424
175
+ mph/s: 2.2369362920544
176
+ kn/s: 1.9438444924406
177
+ g: 0.10197162129779
178
+
179
+ tempreture:
180
+ K: 1
181
+ °C: -272.15
182
+ degree: -272.15
183
+ °F: -457.87
184
+ Fahrenheit: -457.87
185
+ °R: 1.8
186
+ Rankine scale: 1.8
187
+
188
+ angle:
189
+ °: 1
190
+ rad: 1
191
+ ′: 60
192
+ ″: 3,600
193
+ grad: 1.1111111111111
194
+ rad: 0.017453292519943
195
+ mil: 17.777777777778
196
+ /%: 1.7455064928218
197
+ ‰: 17.455064928218
198
+
199
+ time:
200
+ tp: 1.8548608483392E+43
201
+ au: 4.1341373345192E+16
202
+ ns: 1000000000
203
+ μs: 1000000
204
+ ms: 1000
205
+ s: 1
206
+ min: 0.016666666666667
207
+ hour: 2.7777777777778E-04
208
+ day: 1.1574074074074E-05
209
+ week: 1.6534391534392E-06
210
+ month: 3.858024691358E-07
211
+ y (Calendar): 3.1709791983765E-08
212
+ y (Gregorian): 3.1688738506811E-08
213
+ y (Julian): 3.1688087814029E-08
214
+ y (sidereal): 3.1687535787225E-08
215
+ C: 3.1688087814029E-10
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: engineer_calculator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Azeroyear
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-11-25 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.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
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: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: This gem can calculate the calculation which included unit.
56
+ email:
57
+ - eastazy@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - Gemfile.lock
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/setup
72
+ - engineering_calculator.gemspec
73
+ - lib/engineering_calculator.rb
74
+ - lib/engineering_calculator/version.rb
75
+ - lib/unit.yml
76
+ homepage: https://github.com/AZeroyear/engineering_calculator
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.7.3
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: This gem can calculate the calculation which included unit.
100
+ test_files: []