alchemist 0.0.4 → 0.0.5
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.
- data/Rakefile +1 -1
- data/lib/alchemist.rb +13 -12
- metadata +3 -3
data/Rakefile
CHANGED
|
@@ -6,7 +6,7 @@ PKG_FILES = %w(Rakefile) +
|
|
|
6
6
|
|
|
7
7
|
gem_spec = Gem::Specification.new do |gem_spec|
|
|
8
8
|
gem_spec.name = 'alchemist'
|
|
9
|
-
gem_spec.version = '0.0.
|
|
9
|
+
gem_spec.version = '0.0.5'
|
|
10
10
|
gem_spec.summary = 'Conversions... like you\'ve never seen them before!'
|
|
11
11
|
gem_spec.description = 'Conversions... like you\'ve never seen them before!!'
|
|
12
12
|
gem_spec.email = 'matt@toastyapps.com'
|
data/lib/alchemist.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module Alchemist
|
|
2
2
|
@@si_units = %w[m meter metre meters metres liter litre litres liters l L farad farads F coulombs C gray grays Gy siemen siemens S mhos mho ohm ohms volt volts V ]
|
|
3
|
-
@@si_units
|
|
4
|
-
@@si_units
|
|
5
|
-
@@si_units
|
|
3
|
+
@@si_units += %w[joule joules J newton newtons N lux lx henry henrys H b B bits bytes bit byte lumen lumens lm candela candelas cd]
|
|
4
|
+
@@si_units += %w[tesla teslas T gauss Gs G gram gramme grams grammes g watt watts W pascal pascals Pa]
|
|
5
|
+
@@si_units += %w[becquerel becquerels Bq curie curies Ci]
|
|
6
6
|
@@conversion_table = {
|
|
7
7
|
:absorbed_radiation_dose => {
|
|
8
8
|
:gray => 1.0, :grays => 1.0, :Gy => 1.0,
|
|
@@ -10,20 +10,20 @@ module Alchemist
|
|
|
10
10
|
},
|
|
11
11
|
:angles => {
|
|
12
12
|
:radian => 1.0, :radians => 1.0,
|
|
13
|
-
:degree => 0
|
|
14
|
-
:arcminute =>
|
|
15
|
-
:arcsecond =>
|
|
13
|
+
:degree => Math::PI / 180.0, :degrees => Math::PI / 180.0,
|
|
14
|
+
:arcminute => Math::PI / 10800.0, :arcminutes => Math::PI / 10800.0,
|
|
15
|
+
:arcsecond => Math::PI / 648000.0, :arcseconds => Math::PI / 648000.0,
|
|
16
16
|
:mil => 9.817477e-4, :mils => 9.817477e-4,
|
|
17
|
-
:revolution =>
|
|
18
|
-
:circle =>
|
|
19
|
-
:right_angle =>
|
|
20
|
-
:grad => 0
|
|
17
|
+
:revolution => Math::PI * 2.0, :revolutions => Math::PI * 2.0,
|
|
18
|
+
:circle => Math::PI * 2.0, :circles => Math::PI * 2.0,
|
|
19
|
+
:right_angle => Math::PI / 2.0, :right_angles => Math::PI / 2.0,
|
|
20
|
+
:grad => Math::PI / 200.0, :grade => Math::PI / 200.0, :gradian => Math::PI / 200.0, :gon => Math::PI / 200.0, :grads => Math::PI / 200.0, :grades => Math::PI / 200.0, :gradians => Math::PI / 200.0, :gons => Math::PI / 200.0,
|
|
21
21
|
#unusual measurements
|
|
22
22
|
:furman => 9.58737992858887e-5, :furmans => 9.58737992858887e-5
|
|
23
23
|
},
|
|
24
24
|
:area => {
|
|
25
25
|
:square_meter => 1.0, :square_meters => 1.0, :square_metre => 1.0, :square_metres => 1.0,
|
|
26
|
-
:acre =>
|
|
26
|
+
:acre => 4046.85642, :acres => 4046.85642,
|
|
27
27
|
:are => 1.0e+2, :ares => 1.0e+2, :a => 1.0e+2,
|
|
28
28
|
:barn => 1.0e-28, :barns => 1.0e-28, :b => 1.0e-28,
|
|
29
29
|
:circular_mil => 5.067075e-10, :circular_mils => 5.067075e-10,
|
|
@@ -31,7 +31,7 @@ module Alchemist
|
|
|
31
31
|
:square_foot => 9.290304e-2, :square_feet => 9.290304e-2,
|
|
32
32
|
:square_inch => 6.4516e-4, :square_inches => 6.4516e-4,
|
|
33
33
|
:square_mile => 2.589988e+6, :square_miles => 2.589988e+6,
|
|
34
|
-
:square_yard =>
|
|
34
|
+
:square_yard => 0.83612736, :square_yards => 0.83612736
|
|
35
35
|
},
|
|
36
36
|
:capacitance => {
|
|
37
37
|
:farad => 1.0, :farads => 1.0, :F => 1.0,
|
|
@@ -287,6 +287,7 @@ module Alchemist
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
@@british_standard_unit_prefixes = {
|
|
290
|
+
:googol => 1e+100,
|
|
290
291
|
:yotta => 1e+24, :Y => 1e+24,
|
|
291
292
|
:zetta => 1e+21, :Z => 1e+21,
|
|
292
293
|
:exa => 1e+18, :E => 1e+18,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alchemist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Mongeau
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-10-
|
|
12
|
+
date: 2009-10-27 00:00:00 -04:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
48
48
|
requirements: []
|
|
49
49
|
|
|
50
50
|
rubyforge_project:
|
|
51
|
-
rubygems_version: 1.3.
|
|
51
|
+
rubygems_version: 1.3.4
|
|
52
52
|
signing_key:
|
|
53
53
|
specification_version: 3
|
|
54
54
|
summary: Conversions... like you've never seen them before!
|