sy 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sy/dimension.rb +1 -1
- data/lib/sy/imperial.rb +29 -0
- data/lib/sy/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d88c762bd0213f80109ee3e5a0d0933bf12f549
|
4
|
+
data.tar.gz: 646ac812104bf811a3051026a6e23ad31543661b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3dd9d587b08b99061cfa03665a0e42c8e84875d78295b72e1bdc83ca3de88c111ede513e050608a22aebd4daed048cc3001a08e1e176f1dc0f96a1b59144857
|
7
|
+
data.tar.gz: 8bc75e028d837a64a807d8957d533326a838588392b3338ce2b61878b3aaa49639286d03d7056b9322266bc32c6756c14f31d048d320cec4d5aa8debc2e8c766
|
data/lib/sy/dimension.rb
CHANGED
data/lib/sy/imperial.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'sy'
|
3
|
+
|
4
|
+
# Imperial units.
|
5
|
+
#
|
6
|
+
module SY
|
7
|
+
# === Length
|
8
|
+
INCH = Unit.of Length, amount: 25.4.mm # short: 'in' would be ambiguous
|
9
|
+
FOOT = Unit.of Length, short: 'ft', amount: 12.inch
|
10
|
+
YARD = Unit.of Length, short: 'yd', amount: 3.ft
|
11
|
+
# forget CHAIN and FURLONG
|
12
|
+
MILE = Unit.of Length, short: 'mi', amount: 5_280.ft
|
13
|
+
FATHOM = Unit.of Length, short: 'ftm', amount: 1.853184.m
|
14
|
+
NAUTICAL_MILE = Unit.of Length, amount: 1000.fathom
|
15
|
+
|
16
|
+
# === Area
|
17
|
+
ACRE = Unit.of Area, amount: ( 1.0 / 640 ).mile²
|
18
|
+
|
19
|
+
# === Volume
|
20
|
+
PINT = Unit.of Volume, amount: 568.26125.ml
|
21
|
+
QUART = Unit.of Volume, amount: 2.pint
|
22
|
+
GALLON = Unit.of Volume, short: 'gal', amount: 8.pint
|
23
|
+
|
24
|
+
# === Mass
|
25
|
+
POUND = Unit.of Mass, short: 'lb', amount: 453.59237.g
|
26
|
+
OUNCE = Unit.of Mass, short: 'oz', amount: ( 1.0 / 16 ).lb
|
27
|
+
STONE = Unit.of Mass, amount: 14.lb
|
28
|
+
IMPERIAL_TON = Unit.of Mass, amount: 2240.lb
|
29
|
+
end
|
data/lib/sy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/sy/dimension.rb
|
43
43
|
- lib/sy/expressible_in_units.rb
|
44
44
|
- lib/sy/fixed_assets_of_the_module.rb
|
45
|
+
- lib/sy/imperial.rb
|
45
46
|
- lib/sy/magnitude.rb
|
46
47
|
- lib/sy/mapping.rb
|
47
48
|
- lib/sy/matrix.rb
|
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
version: '0'
|
72
73
|
requirements: []
|
73
74
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.0.
|
75
|
+
rubygems_version: 2.0.3
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
78
|
summary: Simple and concise way to express physical units.
|