sy 2.0.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb4d3d36c0c46510d428773864ea51158dd65560
4
- data.tar.gz: a2a5bef28bc4b83a956c5ea8b66f9e0a11d5c35a
3
+ metadata.gz: 0d88c762bd0213f80109ee3e5a0d0933bf12f549
4
+ data.tar.gz: 646ac812104bf811a3051026a6e23ad31543661b
5
5
  SHA512:
6
- metadata.gz: 88ee211ef61c7cebd7e3cacd1e0c2cd42d93328ae54280218f1b02fe2f2093db71dcad96cd41bcdca30e85d1b24ae8e9a40f3653fba7cf81a1650fdc196ddba5
7
- data.tar.gz: 9f5afe9aa5d06e7e64b25205a3fe143dc03c1a9730d48645deac63e00152fa609965848b2fce9993746379be3ed64caf247ad75e2e17460d1e9d0622f991d03d
6
+ metadata.gz: f3dd9d587b08b99061cfa03665a0e42c8e84875d78295b72e1bdc83ca3de88c111ede513e050608a22aebd4daed048cc3001a08e1e176f1dc0f96a1b59144857
7
+ data.tar.gz: 8bc75e028d837a64a807d8957d533326a838588392b3338ce2b61878b3aaa49639286d03d7056b9322266bc32c6756c14f31d048d320cec4d5aa8debc2e8c766
data/lib/sy/dimension.rb CHANGED
@@ -159,7 +159,7 @@ class SY::Dimension
159
159
  # Produces the inspect string of the dimension.
160
160
  #
161
161
  def inspect
162
- "#<Dimension: #{self} >"
162
+ "#<SY::Dimension: #{self} >"
163
163
  end
164
164
 
165
165
  # Returns dimension's standard quantity.
@@ -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
@@ -1,5 +1,5 @@
1
1
  module SY
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  DEBUG = false # debug mode switch - sometimes there are lines like
4
4
  # puts "something" if SY::DEBUG
5
5
  end
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.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-01 00:00:00.000000000 Z
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.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.