alchemist 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/alchemist.rb +163 -133
- metadata +2 -2
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.4'
|
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
@@ -6,129 +6,150 @@ module Alchemist
|
|
6
6
|
@@conversion_table = {
|
7
7
|
:absorbed_radiation_dose => {
|
8
8
|
:gray => 1.0, :grays => 1.0, :Gy => 1.0,
|
9
|
-
:rad => 1.
|
9
|
+
:rad => 1.0e-2, :rads => 1.0e-2
|
10
10
|
},
|
11
11
|
:angles => {
|
12
12
|
:radian => 1.0, :radians => 1.0,
|
13
13
|
:degree => 0.0174532925, :degrees => 0.0174532925,
|
14
|
-
:arcminute => 2.
|
15
|
-
:arcsecond => 4.
|
16
|
-
:mil => 9.
|
14
|
+
:arcminute => 2.90888208333e-4, :arcminutes => 2.90888208333e-4,
|
15
|
+
:arcsecond => 4.848136806e-6, :arcseconds => 4.848136806e-6,
|
16
|
+
:mil => 9.817477e-4, :mils => 9.817477e-4,
|
17
17
|
:revolution => 6.283185, :revolutions => 6.283185,
|
18
18
|
:circle => 6.28318531, :circles => 6.28318531,
|
19
19
|
:right_angle => 1.57079633, :right_angles => 1.57079633,
|
20
|
-
:grad => 0.0157079633, :grade => 0.0157079633, :gradian => 0.0157079633, :gon => 0.0157079633, :grads => 0.0157079633, :grades => 0.0157079633, :gradians => 0.0157079633, :gons => 0.0157079633
|
20
|
+
:grad => 0.0157079633, :grade => 0.0157079633, :gradian => 0.0157079633, :gon => 0.0157079633, :grads => 0.0157079633, :grades => 0.0157079633, :gradians => 0.0157079633, :gons => 0.0157079633,
|
21
|
+
#unusual measurements
|
22
|
+
:furman => 9.58737992858887e-5, :furmans => 9.58737992858887e-5
|
21
23
|
},
|
22
24
|
:area => {
|
23
25
|
:square_meter => 1.0, :square_meters => 1.0, :square_metre => 1.0, :square_metres => 1.0,
|
24
|
-
:acre => 4.
|
25
|
-
:are => 1.
|
26
|
-
:barn => 1.
|
27
|
-
:circular_mil => 5.
|
28
|
-
:hectare => 1.
|
29
|
-
:square_foot => 9.
|
30
|
-
:square_inch => 6.
|
31
|
-
:square_mile => 2.
|
32
|
-
:square_yard => 8.
|
26
|
+
:acre => 4.046873e+3, :acres => 4.046873e+3,
|
27
|
+
:are => 1.0e+2, :ares => 1.0e+2, :a => 1.0e+2,
|
28
|
+
:barn => 1.0e-28, :barns => 1.0e-28, :b => 1.0e-28,
|
29
|
+
:circular_mil => 5.067075e-10, :circular_mils => 5.067075e-10,
|
30
|
+
:hectare => 1.0e+4, :hectares => 1.0e+4, :ha => 1.0e+4,
|
31
|
+
:square_foot => 9.290304e-2, :square_feet => 9.290304e-2,
|
32
|
+
:square_inch => 6.4516e-4, :square_inches => 6.4516e-4,
|
33
|
+
:square_mile => 2.589988e+6, :square_miles => 2.589988e+6,
|
34
|
+
:square_yard => 8.361274e-1, :square_yards => 8.361274e-1
|
33
35
|
},
|
34
36
|
:capacitance => {
|
35
37
|
:farad => 1.0, :farads => 1.0, :F => 1.0,
|
36
|
-
:abfarad => 1.
|
37
|
-
:statfarad => 1.
|
38
|
+
:abfarad => 1.0e+9, :emu_of_capacitance => 1.0e+9, :abfarads => 1.0e+9, :emus_of_capacitance => 1.0e+9,
|
39
|
+
:statfarad => 1.112650e-12, :esu_of_capacitance => 1.112650e-12, :statfarads => 1.112650e-12, :esus_of_capacitance => 1.112650e-12
|
38
40
|
},
|
39
41
|
:distance => {
|
40
42
|
:meter => 1.0, :metres => 1.0, :meters => 1.0, :m => 1.0,
|
41
|
-
:fermi => 1.
|
42
|
-
:micron => 1.
|
43
|
+
:fermi => 1.0e-15, :fermis => 1.0e-15,
|
44
|
+
:micron => 1.0e-6, :microns => 1.0e-6,
|
43
45
|
:chain => 20.1168, :chains => 20.1168,
|
44
|
-
:inch => 25.
|
45
|
-
:microinch => 2.
|
46
|
-
:mil => 2.
|
46
|
+
:inch => 25.4e-3, :inches => 25.4e-3, :in => 25.4e-3,
|
47
|
+
:microinch => 2.54e-8, :microinches => 2.54e-8,
|
48
|
+
:mil => 2.54e-05, :mils => 2.54e-05,
|
47
49
|
:rod => 5.029210, :rods => 5.029210,
|
48
50
|
:league => 5556, :leagues => 5556,
|
49
51
|
:foot => 0.3048, :feet => 0.3048, :ft => 0.3048,
|
50
52
|
:yard => 0.9144, :yards => 0.9144, :yd => 0.9144,
|
51
53
|
:mile =>1609.344, :miles =>1609.344, :mi => 1609.344,
|
52
|
-
:astronomical_unit => 149.
|
53
|
-
:light_year => 9.
|
54
|
-
:parsec => 30.
|
54
|
+
:astronomical_unit => 149.60e+9, :astronomical_units => 149.60e+9, :au => 149.60e+9, :ua => 149.60e+9,
|
55
|
+
:light_year => 9.461e+15, :light_years => 9.461e+15, :ly => 9.461e+15,
|
56
|
+
:parsec => 30.857e+15, :parsecs => 30.857e+15,
|
55
57
|
:nautical_mile => 1852.0, :nautical_miles => 1852.0,
|
56
58
|
:admirality_mile => 185.3184, :admirality_miles => 185.3184,
|
57
59
|
:fathom => 1.8288, :fathoms => 1.8288,
|
58
60
|
:cable_length => 185.2, :cable_lengths => 185.2,
|
59
|
-
:angstrom => 100.
|
60
|
-
:pica => 4.
|
61
|
-
:printer_pica => 4.
|
62
|
-
:point => 3.
|
63
|
-
:printer_point => 3.
|
61
|
+
:angstrom => 100.0e-12, :angstroms => 100.0e-12,
|
62
|
+
:pica => 4.233333e-3, :picas => 4.233333e-3,
|
63
|
+
:printer_pica => 4.217518e-3, :printer_picas => 4.217518e-3,
|
64
|
+
:point => 3.527778e-4, :points => 3.527778e-4,
|
65
|
+
:printer_point => 3.514598e-4, :printer_points => 3.514598e-4,
|
66
|
+
# unusual mesaurements
|
67
|
+
:empire_state_building => 449.0, :empire_state_buildings => 449.0,
|
68
|
+
:sears_tower => 519.0, :sears_towers => 519.0,
|
69
|
+
:seattle_space_needle => 184.0, :seattle_space_needles => 184.0, :space_needle => 184.0, :space_needles => 184.0,
|
70
|
+
:statue_of_liberty => 46.0, :statue_of_liberties => 46.0,
|
71
|
+
:washington_monument => 169.294, :washington_monuments => 169.294,
|
72
|
+
:eiffel_tower => 324.0, :eiffel_towers => 324.0,
|
73
|
+
:nelsons_column => 61.5, :nelsons_columns => 61.5,
|
74
|
+
:blackpool_tower => 158.0, :blackpool_towers => 158.0,
|
75
|
+
:big_ben => 96.3, :big_bens => 96.3, :clock_tower_of_the_palace_of_westminster => 96.3, :clock_towers_of_the_palace_of_westminster => 96.3,
|
76
|
+
:st_pauls_cathedral => 108.0, :st_pauls_cathedrals => 108.0,
|
77
|
+
:toronto_cn_tower => 553.0, :toronto_cn_towers => 553.0, :cn_tower => 553.0, :cn_towers => 553.0,
|
78
|
+
:circle_of_the_earth => 40075016.686, :equator => 40075016.686, :circles_of_the_earth => 40075016.686, :equators => 40075016.686,
|
79
|
+
:siriometer => 1.494838e+17, :siriometers => 1.494838e+17,
|
80
|
+
:football_field => 91.0, :football_fields => 91.0,
|
81
|
+
:length_of_a_double_decker_bus => 8.4, :height_of_a_double_decker_bus => 4.4
|
82
|
+
|
64
83
|
},
|
65
84
|
:dose_equivalent => {
|
66
85
|
:sievert => 1.0, :sieverts => 1.0, :Si => 1.0,
|
67
|
-
:rem => 1.
|
86
|
+
:rem => 1.0e-2, :rems => 1.0e-2
|
68
87
|
},
|
69
88
|
:electric_charge => {
|
70
89
|
:coulomb => 1.0, :coulombs => 1.0, :C => 1.0,
|
71
90
|
:abcoulomb => 10.0, :abcoulombs => 10.0,
|
72
|
-
:ampere_hour => 3.
|
73
|
-
:faraday => 9.
|
74
|
-
:franklin => 3.
|
75
|
-
:statcoulomb => 3.
|
91
|
+
:ampere_hour => 3.6e+3, :ampere_hours => 3.6e+3,
|
92
|
+
:faraday => 9.648534e+4, :faradays => 9.648534e+4,
|
93
|
+
:franklin => 3.335641e-10, :franklins => 3.335641e-10, :Fr => 3.335641e-10,
|
94
|
+
:statcoulomb => 3.335641e-10, :statcoulombs => 3.335641e-10
|
76
95
|
},
|
77
96
|
:electric_conductance => {
|
78
97
|
:siemen => 1.0, :siemens => 1.0, :S => 1.0, :mho => 1.0,
|
79
|
-
:abmho => 1.
|
80
|
-
:statmho => 1.
|
98
|
+
:abmho => 1.0e+9, :absiemen => 1.0e+9, :absiemens => 1.0e+9,
|
99
|
+
:statmho => 1.112650e-12, :statsiemen => 1.112650e-12, :statsiemens => 1.112650e-12
|
81
100
|
},
|
82
101
|
:electrical_impedance => {
|
83
102
|
:ohm => 1.0, :ohms => 1.0,
|
84
|
-
:abohm => 1.
|
85
|
-
:statohm => 8.
|
103
|
+
:abohm => 1.0e-9, :emu_of_resistance => 1.0e-9, :abohms => 1.0e-9, :emus_of_resistance => 1.0e-9,
|
104
|
+
:statohm => 8.987552e+11, :esu_of_resistance => 8.987552e+11, :statohms => 8.987552e+11, :esus_of_resistance => 8.987552e+11
|
86
105
|
},
|
87
106
|
:electromotive_force => {
|
88
107
|
:volt => 1.0, :volts => 1.0, :V => 1.0,
|
89
|
-
:abvolt => 1.
|
90
|
-
:statvolt => 2.
|
108
|
+
:abvolt => 1.0e-8, :emu_of_electric_potential => 1.0e-8, :abvolts => 1.0e-8, :emus_of_electric_potential => 1.0e-8,
|
109
|
+
:statvolt => 2.997925e+2, :esu_of_electric_potential => 2.997925e+2, :statvolts => 2.997925e+2, :esus_of_electric_potential => 2.997925e+2
|
91
110
|
},
|
92
111
|
:energy => {
|
93
112
|
:joule => 1.0, :joules => 1.0, :J => 1.0, :watt_second => 1.0, :watt_seconds => 1.0,
|
94
|
-
:watt_hour => 3.
|
95
|
-
:ton_of_tnt => 4.
|
96
|
-
:therm => 1.
|
97
|
-
:us_therm => 1.
|
98
|
-
:kilowatt_hour => 3.6
|
113
|
+
:watt_hour => 3.6e+3, :watt_hours => 3.6e+3,
|
114
|
+
:ton_of_tnt => 4.184e+9, :tons_of_tnt => 4.184e+9,
|
115
|
+
:therm => 1.05506e+8, :therms => 1.05506e+8,
|
116
|
+
:us_therm => 1.054804e+8, :us_therms => 1.054804e+8,
|
117
|
+
:kilowatt_hour => 3.6e+6, :kilowatt_hours => 3.6e+6,
|
99
118
|
:kilocalorie => 4184.0, :kilocalories => 4184.0,
|
100
119
|
:calorie => 4.184, :calories => 4.184,
|
101
120
|
:mean_kilocalorie => 4190, :mean_kilocalories => 4190,
|
102
121
|
:mean_calorie => 4.190, :mean_calories => 4.190,
|
103
122
|
:it_kilocalorie => 4186.8, :it_kilocalories => 4186.8,
|
104
123
|
:it_calorie => 4.1868, :it_calories => 4.1868,
|
105
|
-
:foot_poundal => 4.
|
124
|
+
:foot_poundal => 4.214011e-2, :foot_poundals => 4.214011e-2,
|
106
125
|
:foot_pound_force => 1.355818,
|
107
|
-
:erg => 1.
|
108
|
-
:electronvolt => 1.
|
109
|
-
:british_thermal_unit => 1.
|
110
|
-
:mean_british_thermal_unit => 1.
|
111
|
-
:it_british_thermal_unit => 1.
|
126
|
+
:erg => 1.0e-7, :ergs => 1.0e-7,
|
127
|
+
:electronvolt => 1.602176e-19, :electronvolts => 1.602176e-19, :eV => 1.602176e-19,
|
128
|
+
:british_thermal_unit => 1.054350e+3, :british_thermal_units => 1.054350e+3,
|
129
|
+
:mean_british_thermal_unit => 1.05587e+3, :mean_british_thermal_units => 1.05587e+3,
|
130
|
+
:it_british_thermal_unit => 1.055056e+3, :it_british_thermal_units => 1.055056e+3,
|
131
|
+
#unusual measurements
|
132
|
+
:foe => 1e+44, :foes => 1e+44
|
112
133
|
},
|
113
134
|
:force => {
|
114
135
|
:newton => 1.0, :newtons => 1.0, :N => 1.0,
|
115
|
-
:dyne => 1.
|
136
|
+
:dyne => 1.0e-5, :dynes => 1.0e-5, :dyn => 1.0e-5,
|
116
137
|
:kilogram_force => 9.80665, :kgf => 9.80665, :kilopond => 9.80665, :kiloponds => 9.80665, :kp => 9.80665,
|
117
|
-
:kip => 4.
|
118
|
-
:ounce_force => 2.
|
119
|
-
:poundal => 1.
|
138
|
+
:kip => 4.448222e+3, :kips => 4.448222e+3,
|
139
|
+
:ounce_force => 2.780139e-1, :ozf => 2.780139e-1,
|
140
|
+
:poundal => 1.382550e-1, :poundals => 1.382550e-1,
|
120
141
|
:pound_force => 4.448222, :lbf => 4.448222,
|
121
|
-
:ton_force => 8.
|
142
|
+
:ton_force => 8.896443e+3
|
122
143
|
},
|
123
144
|
:illuminance => {
|
124
145
|
:lux => 1.0, :lx => 1.0, :lumens_per_square_metre => 1.0, :lumens_per_square_meter => 1.0, :lumen_per_square_metre => 1.0, :lumen_per_square_meter => 1.0,
|
125
|
-
:phot => 1.
|
146
|
+
:phot => 1.0e+4, :phots => 1.0e+4, :ph => 1.0e+4,
|
126
147
|
:lumens_per_square_foot => 10.76391, :footcandle => 10.76391, :lumen_per_square_foot => 10.76391, :footcandles => 10.76391
|
127
148
|
},
|
128
149
|
:inductance => {
|
129
150
|
:henry => 1.0, :henrys => 1.0, :H => 1.0,
|
130
|
-
:abhenrys => 1.
|
131
|
-
:stathenrys => 8.
|
151
|
+
:abhenrys => 1.0e-9, :emus_of_inductance => 1.0e-9, :abhenry => 1.0e-9, :emu_of_inductance => 1.0e-9,
|
152
|
+
:stathenrys => 8.987552e+11, :esus_of_inductance => 8.987552e+11, :stathenry => 8.987552e+11, :esu_of_inductance => 8.987552e+11
|
132
153
|
},
|
133
154
|
:information_storage => {
|
134
155
|
:bit => 1.0, :bits => 1.0, :b => 1.0,
|
@@ -143,75 +164,77 @@ module Alchemist
|
|
143
164
|
},
|
144
165
|
:magnetic_flux => {
|
145
166
|
:webers => 1.0, :Wb => 1.0,
|
146
|
-
:maxwells => 1.
|
147
|
-
:unit_poles => 1.
|
167
|
+
:maxwells => 1.0e-8, :Mx => 1.0e-8,
|
168
|
+
:unit_poles => 1.256637e-7
|
148
169
|
},
|
149
170
|
:magnetic_inductance => {
|
150
171
|
:tesla => 1.0, :teslas => 1.0, :T => 1.0,
|
151
|
-
:gamma => 1.
|
152
|
-
:gauss => 1.
|
172
|
+
:gamma => 1.0e-9, :gammas => 1.0e-9,
|
173
|
+
:gauss => 1.0e-4, :Gs => 1.0e-4, :G => 1.0e-4
|
153
174
|
},
|
154
175
|
:mass => {
|
155
176
|
:gram => 1.0, :gramme => 1.0, :grams => 1.0, :grammes => 1.0, :g => 1.0,
|
156
|
-
:carat => 2.
|
157
|
-
:ounce => 2.
|
177
|
+
:carat => 2.0e-1, :carats => 2.0e-1,
|
178
|
+
:ounce => 2.834952e+1, :ounces => 2.834952e+1, :oz => 2.834952e+1,
|
158
179
|
:pennyweight => 1.555174, :pennyweights => 1.555174, :dwt => 1.555174,
|
159
180
|
:pound => 453.59237, :pounds => 453.59237, :lb => 453.59237, :lbs => 453.59237,
|
160
181
|
:troy_pound => 373.2417, :apothecary_pound => 373.2417, :troy_pounds => 373.2417, :apothecary_pounds => 373.2417,
|
161
182
|
:slug => 14593.9029, :slugs => 14593.9029,
|
162
183
|
:assay_ton => 29.1667, :assay_tons => 29.1667, :AT => 29.1667,
|
163
184
|
:metric_ton => 1000000, :metric_tons => 1000000,
|
164
|
-
:ton => 907184.74, :tons => 907184.74, :short_tons => 907184.74
|
185
|
+
:ton => 907184.74, :tons => 907184.74, :short_tons => 907184.74,
|
186
|
+
#unusual measurements
|
187
|
+
:elephant => 5443108.44, :elephants => 5443108.44
|
165
188
|
},
|
166
189
|
:power => {
|
167
190
|
:watt => 1.0, :watts => 1.0, :W => 1.0,
|
168
|
-
:british_thermal_unit_per_hour => 2.
|
169
|
-
:it_british_thermal_unit_per_hour => 2.
|
170
|
-
:british_thermal_unit_per_second => 1.
|
171
|
-
:it_british_thermal_unit_per_second => 1.
|
172
|
-
:calorie_per_minute => 6.
|
191
|
+
:british_thermal_unit_per_hour => 2.928751e-1, :british_thermal_units_per_hour => 2.928751e-1,
|
192
|
+
:it_british_thermal_unit_per_hour => 2.930711e-1, :it_british_thermal_units_per_hour => 2.930711e-1,
|
193
|
+
:british_thermal_unit_per_second => 1.054350e+3, :british_thermal_units_per_second => 1.054350e+3,
|
194
|
+
:it_british_thermal_unit_per_second => 1.055056e+3, :it_british_thermal_units_per_second => 1.055056e+3,
|
195
|
+
:calorie_per_minute => 6.973333e-2, :calories_per_minute => 6.973333e-2,
|
173
196
|
:calorie_per_second => 4.184, :calories_per_second => 4.184,
|
174
|
-
:erg_per_second => 1.
|
175
|
-
:foot_pound_force_per_hour => 3.
|
176
|
-
:foot_pound_force_per_minute => 2.
|
197
|
+
:erg_per_second => 1.0e-7, :ergs_per_second => 1.0e-7,
|
198
|
+
:foot_pound_force_per_hour => 3.766161e-4,
|
199
|
+
:foot_pound_force_per_minute => 2.259697e-2,
|
177
200
|
:foot_pound_force_per_second => 1.355818,
|
178
|
-
:horsepower => 7.
|
179
|
-
:boiler_horsepower => 9.
|
180
|
-
:electric_horsepower => 7.
|
181
|
-
:metric_horsepower => 7.
|
182
|
-
:uk_horsepower => 7.
|
183
|
-
:water_horsepower => 7.
|
201
|
+
:horsepower => 7.456999e+2,
|
202
|
+
:boiler_horsepower => 9.80950e+3,
|
203
|
+
:electric_horsepower => 7.46e+2,
|
204
|
+
:metric_horsepower => 7.354988e+2,
|
205
|
+
:uk_horsepower => 7.4570e+2,
|
206
|
+
:water_horsepower => 7.46043e+2,
|
184
207
|
:kilocalorie_per_minute => 6.973333*10, :kilocalories_per_minute => 6.973333*10,
|
185
|
-
:kilocalorie_per_second => 4.
|
186
|
-
:ton_of_refrigeration => 3.
|
208
|
+
:kilocalorie_per_second => 4.184e+3, :kilocalories_per_second => 4.184e+3,
|
209
|
+
:ton_of_refrigeration => 3.516853e+3, :tons_of_refrigeration => 3.516853e+3
|
187
210
|
},
|
188
211
|
:pressure => {
|
189
212
|
:pascal => 1.0, :pascals => 1.0, :Pa => 1.0,
|
190
|
-
:atmosphere => 1.
|
191
|
-
:technical_atmosphere => 9.
|
192
|
-
:bar => 1.
|
193
|
-
:centimeter_of_mercury => 1.
|
213
|
+
:atmosphere => 1.01325e+5, :atmospheres => 1.01325e+5,
|
214
|
+
:technical_atmosphere => 9.80665e+4, :technical_atmospheres => 9.80665e+4,
|
215
|
+
:bar => 1.0e+5, :bars => 1.0e+5,
|
216
|
+
:centimeter_of_mercury => 1.333224e+3, :centimeters_of_mercury => 1.333224e+3,
|
194
217
|
:centimeter_of_water => 98.0665, :centimeters_of_water => 98.0665, :gram_force_per_square_centimeter => 98.0665,
|
195
|
-
:dyne_per_square_centimeter => 1.
|
196
|
-
:foot_of_mercury => 4.
|
197
|
-
:foot_of_water => 2.
|
198
|
-
:inch_of_mercury => 3.
|
199
|
-
:inch_of_water => 2.
|
200
|
-
:kilogram_force_per_square_centimeter => 9.
|
218
|
+
:dyne_per_square_centimeter => 1.0e-1, :dynes_per_square_centimeter => 1.0e-1,
|
219
|
+
:foot_of_mercury => 4.063666e+4, :feet_of_mercury => 4.063666e+4,
|
220
|
+
:foot_of_water => 2.989067e+3, :feet_of_water => 2.989067e+3,
|
221
|
+
:inch_of_mercury => 3.386389e+3, :inches_of_mercury => 3.386389e+3,
|
222
|
+
:inch_of_water => 2.490889e+2, :inches_of_water => 2.490889e+2,
|
223
|
+
:kilogram_force_per_square_centimeter => 9.80665e+4,
|
201
224
|
:kilogram_force_per_square_meter => 9.80665,
|
202
|
-
:kilogram_force_per_square_millimeter => 9.
|
203
|
-
:kip_per_square_inch => 6.
|
204
|
-
:millibar => 1.
|
205
|
-
:millimeter_of_mercury => 1.
|
225
|
+
:kilogram_force_per_square_millimeter => 9.80665e+6,
|
226
|
+
:kip_per_square_inch => 6.894757e+6, :kips_per_square_inch => 6.894757e+6, :ksi => 6.894757e+6,
|
227
|
+
:millibar => 1.0e+2, :mbar => 1.0e+2, :millibars => 1.0e+2, :mbars => 1.0e+2,
|
228
|
+
:millimeter_of_mercury => 1.333224e+2, :millimeters_of_mercury => 1.333224e+2,
|
206
229
|
:millimeter_of_water => 9.80665, :millimeters_of_water => 9.80665,
|
207
230
|
:poundal_per_square_foot => 1.488164, :poundals_per_square_foot => 1.488164,
|
208
231
|
:pound_force_per_square_foot => 47.88026,
|
209
|
-
:pound_force_per_square_inch => 6.
|
210
|
-
:torr => 1.
|
232
|
+
:pound_force_per_square_inch => 6.894757e+3, :psi => 6.894757e+3,
|
233
|
+
:torr => 1.333224e+2, :torrs => 1.333224e+2
|
211
234
|
},
|
212
235
|
:radioactivity => {
|
213
236
|
:becquerel => 1.0, :becquerels => 1.0, :Bq => 1.0,
|
214
|
-
:curie => 3.
|
237
|
+
:curie => 3.7e+10, :curies => 3.7e+10, :Ci => 3.7e+10
|
215
238
|
},
|
216
239
|
:temperature => {
|
217
240
|
:kelvin => 1.0, :K => 1.0,
|
@@ -228,55 +251,62 @@ module Alchemist
|
|
228
251
|
:minute => 60.0, :minutes => 60.0, :min => 60.0,
|
229
252
|
:sidereal_minute => 5.983617, :sidereal_minutes => 5.983617,
|
230
253
|
:hour => 3600.0, :hours => 3600.0, :hr => 3600.0,
|
231
|
-
:sidereal_hour => 3.
|
254
|
+
:sidereal_hour => 3.590170e+3, :sidereal_hours => 3.590170e+3,
|
232
255
|
:day => 86400.0, :days => 86400.0,
|
233
|
-
:sidereal_day => 8.
|
234
|
-
:shake => 1.
|
235
|
-
:year => 3.
|
236
|
-
:sidereal_year => 3.
|
237
|
-
:tropical_year => 3.
|
256
|
+
:sidereal_day => 8.616409e+4, :sidereal_days => 8.616409e+4,
|
257
|
+
:shake => 1.0e-8, :shakes => 1.0e-8,
|
258
|
+
:year => 3.1536e+7, :years => 3.1536e+7,
|
259
|
+
:sidereal_year => 3.155815e+7, :sidereal_years => 3.155815e+7,
|
260
|
+
:tropical_year => 3.155693e+7, :tropical_years => 3.155693e+7,
|
261
|
+
#unusual measurements
|
262
|
+
:jiffy => 0.01, :jiffies => 0.01,
|
263
|
+
:microfortnight => 1.2096, :microfortnights => 1.2096,
|
264
|
+
:megaannum => 3.1536e+16, :Ma => 3.1536e+16, :megaannums => 3.1536e+16,
|
265
|
+
:galactic_year => 7.884e+18, :galactic_years => 7.884e+18, :GY => 7.884e+18
|
238
266
|
},
|
239
267
|
:volume => {
|
240
268
|
:litre => 1.0, :liter => 1.0, :litres => 1.0, :liters => 1.0, :l => 1.0, :L => 1.0,
|
241
|
-
:barrel => 1.
|
242
|
-
:bushel => 3.
|
269
|
+
:barrel => 1.589873e+2, :barrels => 1.589873e+2,
|
270
|
+
:bushel => 3.523907e+1, :bushels => 3.523907e+1,
|
243
271
|
:cubic_meter => 1000.0, :cubic_meters => 1000.0,
|
244
|
-
:cup => 2.
|
272
|
+
:cup => 2.365882e-1, :cups => 2.365882e-1,
|
245
273
|
:imperial_fluid_ounce => 0.0284130742, :imperial_fluid_ounces => 0.0284130742,
|
246
274
|
:ounce => 0.0295735296, :ounces => 0.0295735296, :fluid_ounce => 0.0295735296, :fluid_ounces => 0.0295735296,
|
247
275
|
:imperial_gallon => 4.54609, :imperial_gallons => 4.54609,
|
248
276
|
:gallon => 3.785412, :gallons => 3.785412,
|
249
|
-
:imperial_gill => 1.
|
250
|
-
:gill => 1.
|
251
|
-
:pint => 5.
|
252
|
-
:liquid_pint => 4.
|
277
|
+
:imperial_gill => 1.420653e-1, :imperial_gills => 1.420653e-1,
|
278
|
+
:gill => 1.182941e-1, :gills => 1.182941e-1, :gi => 1.182941e-1,
|
279
|
+
:pint => 5.506105e-1, :pints => 5.506105e-1,
|
280
|
+
:liquid_pint => 4.731765e-1, :liquid_pints => 4.731765e-1,
|
253
281
|
:quart => 1.101221, :quarts => 1.101221,
|
254
|
-
:liquid_quart => 9.
|
282
|
+
:liquid_quart => 9.463529e-1, :liquid_quarts => 9.463529e-1,
|
255
283
|
:tablespoon => 0.0147867648, :tablespoons => 0.0147867648,
|
256
|
-
:teaspoon => 0.00492892159, :teaspoons => 0.00492892159
|
284
|
+
:teaspoon => 0.00492892159, :teaspoons => 0.00492892159,
|
285
|
+
#unusual measurements
|
286
|
+
:sydharb => 5.0e+11, :sydharbs => 5.0e+11
|
257
287
|
}
|
258
288
|
}
|
259
289
|
@@british_standard_unit_prefixes = {
|
260
|
-
:yotta =>
|
261
|
-
:zetta =>
|
262
|
-
:exa =>
|
263
|
-
:peta =>
|
264
|
-
:tera =>
|
265
|
-
:giga =>
|
266
|
-
:mega =>
|
267
|
-
:kilo =>
|
268
|
-
:hecto =>
|
290
|
+
:yotta => 1e+24, :Y => 1e+24,
|
291
|
+
:zetta => 1e+21, :Z => 1e+21,
|
292
|
+
:exa => 1e+18, :E => 1e+18,
|
293
|
+
:peta => 1e+15, :P => 1e+15,
|
294
|
+
:tera => 1e+12, :T => 1e+12,
|
295
|
+
:giga => 1e+9, :G => 1e+9,
|
296
|
+
:mega => 1e+6, :M => 1e+6,
|
297
|
+
:kilo => 1e+3, :k => 1e+3,
|
298
|
+
:hecto => 1e+2, :h => 1e+2,
|
269
299
|
:deca => 10, :da => 10,
|
270
|
-
:deci =>
|
271
|
-
:centi =>
|
272
|
-
:milli =>
|
273
|
-
:micro =>
|
274
|
-
:nano =>
|
275
|
-
:pico =>
|
276
|
-
:femto =>
|
277
|
-
:atto =>
|
278
|
-
:zepto =>
|
279
|
-
:yocto =>
|
300
|
+
:deci => 1e-1, :d => 1e-1,
|
301
|
+
:centi => 1e-2, :c => 1e-2,
|
302
|
+
:milli => 1e-3, :m => 1e-3,
|
303
|
+
:micro => 1e-6, :u => 1e-6,
|
304
|
+
:nano => 1e-9, :n => 1e-9,
|
305
|
+
:pico => 1e-12, :p => 1e-12,
|
306
|
+
:femto => 1e-15, :f => 1e-15,
|
307
|
+
:atto => 1e-18, :a => 1e-18,
|
308
|
+
:zepto => 1e-21, :z => 1e-21,
|
309
|
+
:yocto => 1e-24, :y => 1e-24
|
280
310
|
}
|
281
311
|
|
282
312
|
def from(unit_name)
|
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.4
|
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-25 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|