gravitheque 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/Gemfile +6 -3
- data/Guardfile +3 -3
- data/README.md +10 -311
- data/bin/test +38 -1
- data/gravitheque.gemspec +1 -1
- data/lib/alcohol.rb +35 -0
- data/lib/calories.rb +52 -0
- data/lib/hops.rb +140 -0
- data/lib/mash.rb +57 -0
- data/lib/numbers.rb +201 -0
- data/lib/yeast.rb +50 -0
- data/test/helper.rb +3 -0
- data/test/test_alcohol.rb +14 -0
- data/test/test_calories.rb +18 -0
- data/test/test_hops.rb +68 -0
- data/test/test_mash.rb +30 -0
- data/test/test_numbers.rb +68 -0
- data/test/test_yeast.rb +47 -0
- metadata +22 -34
- data/lib/calculators.rb +0 -6
- data/lib/calculators/alcohol.rb +0 -71
- data/lib/calculators/calories.rb +0 -115
- data/lib/calculators/hops.rb +0 -257
- data/lib/calculators/mash.rb +0 -82
- data/lib/calculators/yeast.rb +0 -71
- data/lib/conversions.rb +0 -8
- data/lib/conversions/extract.rb +0 -99
- data/lib/conversions/mass.rb +0 -47
- data/lib/conversions/temperature.rb +0 -25
- data/lib/conversions/volume.rb +0 -47
- data/lib/gravitheque.rb +0 -2
- data/test/calculators/test_alcohol.rb +0 -58
- data/test/calculators/test_calories.rb +0 -89
- data/test/calculators/test_hops.rb +0 -257
- data/test/calculators/test_mash.rb +0 -71
- data/test/calculators/test_yeast.rb +0 -149
- data/test/conversions/test_extract.rb +0 -32
- data/test/conversions/test_mass.rb +0 -22
- data/test/conversions/test_temperature.rb +0 -18
- data/test/conversions/test_volume.rb +0 -22
- data/test/test_helper.rb +0 -25
@@ -1,32 +0,0 @@
|
|
1
|
-
require "./test/test_helper"
|
2
|
-
require "conversions/extract"
|
3
|
-
|
4
|
-
describe Convert do
|
5
|
-
|
6
|
-
it "must convert specific gravity to Plato" do
|
7
|
-
(Convert.specific_gravity_to_plato 1.055).must_equal 13.5
|
8
|
-
end
|
9
|
-
|
10
|
-
it "must convert Brix to specific gravity" do
|
11
|
-
(Convert.brix_to_specific_gravity 16.2).must_equal 1.067
|
12
|
-
end
|
13
|
-
|
14
|
-
it "must convert terminal Brix to terminal gravity" do
|
15
|
-
(Convert.terminal_brix_to_terminal_gravity 16.2, 7.8).must_equal 1.009
|
16
|
-
end
|
17
|
-
|
18
|
-
it "must convert Plato to specific gravity" do
|
19
|
-
(Convert.plato_to_specific_gravity 18.9).must_equal 1.078
|
20
|
-
end
|
21
|
-
|
22
|
-
it "must convert specific gravity to temperature corrected specific gravity" do
|
23
|
-
(Convert.specific_gravity_to_temperature_corrected_gravity 1.064, 2).must_equal 1.063
|
24
|
-
(Convert.specific_gravity_to_temperature_corrected_gravity 1.064, 42).must_equal 1.072
|
25
|
-
(Convert.specific_gravity_to_temperature_corrected_gravity 1.055, 12, :celsius).must_equal 1.068
|
26
|
-
end
|
27
|
-
|
28
|
-
it "must raise an exception when the temperature unit for specific gravity to temperature corrected specific gravity is not recognized" do
|
29
|
-
lambda { Convert.specific_gravity_to_temperature_corrected_gravity 1.055, 12, :kelvin }.must_raise ArgumentError
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "./test/test_helper"
|
2
|
-
require "conversions/mass"
|
3
|
-
|
4
|
-
describe Convert do
|
5
|
-
|
6
|
-
it "must convert grams to ounces" do
|
7
|
-
(Convert.grams_to_ounces 56).must_equal 2.0
|
8
|
-
end
|
9
|
-
|
10
|
-
it "must convert ounces to grams" do
|
11
|
-
(Convert.ounces_to_grams 2).must_equal 56.7
|
12
|
-
end
|
13
|
-
|
14
|
-
it "must convert kilograms to pounds" do
|
15
|
-
(Convert.kilograms_to_pounds 10).must_equal 22.0
|
16
|
-
end
|
17
|
-
|
18
|
-
it "must convert pounds to kilograms" do
|
19
|
-
(Convert.pounds_to_kilograms 10).must_equal 4.5
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "./test/test_helper"
|
2
|
-
require "conversions/temperature"
|
3
|
-
|
4
|
-
describe Convert do
|
5
|
-
|
6
|
-
it "must convert Celsius to Fahrenheit" do
|
7
|
-
(Convert.celsius_to_fahrenheit 0).must_equal 32.0
|
8
|
-
(Convert.celsius_to_fahrenheit 50).must_equal 122.0
|
9
|
-
(Convert.celsius_to_fahrenheit 100).must_equal 212.0
|
10
|
-
end
|
11
|
-
|
12
|
-
it "must convert Fahrenheit to Celsius" do
|
13
|
-
(Convert.fahrenheit_to_celsius 32).must_equal 0.0
|
14
|
-
(Convert.fahrenheit_to_celsius 90).must_equal 32.2
|
15
|
-
(Convert.fahrenheit_to_celsius 212).must_equal 100.0
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "./test/test_helper"
|
2
|
-
require "conversions/volume"
|
3
|
-
|
4
|
-
describe Convert do
|
5
|
-
|
6
|
-
it "must convert gallons to liters" do
|
7
|
-
(Convert.gallons_to_liters 5).must_equal 18.9
|
8
|
-
end
|
9
|
-
|
10
|
-
it "must convert liters to gallons" do
|
11
|
-
(Convert.liters_to_gallons 19).must_equal 5.0
|
12
|
-
end
|
13
|
-
|
14
|
-
it "must convert liters to quarts" do
|
15
|
-
(Convert.liters_to_quarts 19).must_equal 20.1
|
16
|
-
end
|
17
|
-
|
18
|
-
it "must convert quarts to liters" do
|
19
|
-
(Convert.quarts_to_liters 20).must_equal 18.9
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# Rubinius does not yet have the 1.9 Coverage module
|
2
|
-
unless RUBY_ENGINE == "rbx"
|
3
|
-
require "simplecov"
|
4
|
-
|
5
|
-
class SimpleCov::Formatter::NoHTMLFormatter
|
6
|
-
def format result
|
7
|
-
puts "\n#{result.covered_percent.round}% test coverage"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
SimpleCov.start do
|
12
|
-
@formatter = ENV["CI"] ? SimpleCov::Formatter::NoHTMLFormatter : SimpleCov::Formatter::HTMLFormatter
|
13
|
-
end
|
14
|
-
|
15
|
-
yard_stats = `yard stats --list-undoc 2>&1`
|
16
|
-
if yard_stats =~ /100.00%/
|
17
|
-
puts "100% documentation coverage\n\n"
|
18
|
-
else
|
19
|
-
puts yard_stats
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
$:.push File.expand_path "../../lib", __FILE__
|
24
|
-
|
25
|
-
require "minitest/autorun"
|