phys-units 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +30 -0
- data/COPYING +674 -0
- data/Gemfile +4 -0
- data/README.md +51 -0
- data/Rakefile +1 -0
- data/lib/phys/units.rb +7 -0
- data/lib/phys/units/Makefile +37 -0
- data/lib/phys/units/load_units.rb +5406 -0
- data/lib/phys/units/mixin.rb +12 -0
- data/lib/phys/units/parse.rb +777 -0
- data/lib/phys/units/parse.y +123 -0
- data/lib/phys/units/quantity.rb +252 -0
- data/lib/phys/units/unit.rb +446 -0
- data/lib/phys/units/unit_class.rb +185 -0
- data/lib/phys/units/utils.rb +91 -0
- data/lib/phys/units/version.rb +5 -0
- data/phys-units.gemspec +23 -0
- data/spec/helper.rb +4 -0
- data/spec/quantity_spec.rb +111 -0
- data/spec/unit_spec.rb +234 -0
- data/spec/utils_spec.rb +16 -0
- metadata +97 -0
data/spec/utils_spec.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$LOAD_PATH.unshift File.dirname(__FILE__)
|
2
|
+
require "helper"
|
3
|
+
|
4
|
+
Utils = Phys::Unit::Utils
|
5
|
+
|
6
|
+
describe "UnitUtils test" do
|
7
|
+
|
8
|
+
describe Utils.num_inspect(Rational(1609344,1000)) do
|
9
|
+
it {should == "1609.344"}
|
10
|
+
end
|
11
|
+
|
12
|
+
describe Utils.num_inspect(Rational(1000,1609344)) do
|
13
|
+
it {should == "(1/1609.344)"}
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: phys-units
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Masahiro TANAKA
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-27 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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: GNU Units-compatible library for Ruby, formarly 'Quanty' class library.
|
42
|
+
email:
|
43
|
+
- masa16.tanaka@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- COPYING
|
50
|
+
- Gemfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/phys/units.rb
|
54
|
+
- lib/phys/units/Makefile
|
55
|
+
- lib/phys/units/load_units.rb
|
56
|
+
- lib/phys/units/mixin.rb
|
57
|
+
- lib/phys/units/parse.rb
|
58
|
+
- lib/phys/units/parse.y
|
59
|
+
- lib/phys/units/quantity.rb
|
60
|
+
- lib/phys/units/unit.rb
|
61
|
+
- lib/phys/units/unit_class.rb
|
62
|
+
- lib/phys/units/utils.rb
|
63
|
+
- lib/phys/units/version.rb
|
64
|
+
- phys-units.gemspec
|
65
|
+
- spec/helper.rb
|
66
|
+
- spec/quantity_spec.rb
|
67
|
+
- spec/unit_spec.rb
|
68
|
+
- spec/utils_spec.rb
|
69
|
+
homepage: https://github.com/masa16/phys-units
|
70
|
+
licenses:
|
71
|
+
- GPL
|
72
|
+
metadata: {}
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 2.0.0
|
90
|
+
signing_key:
|
91
|
+
specification_version: 4
|
92
|
+
summary: GNU Units-compatible library for Ruby, formarly 'Quanty' class library.
|
93
|
+
test_files:
|
94
|
+
- spec/helper.rb
|
95
|
+
- spec/quantity_spec.rb
|
96
|
+
- spec/unit_spec.rb
|
97
|
+
- spec/utils_spec.rb
|