brewscribe 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: af00f3d29b4923ed9c0060c9486497eccdb513d063b6c7fdb866ca55e2846aae
4
+ data.tar.gz: aecf4b8c398ced1cd2853a4d972d06d015940272134651b0fb4d6f9a71d6bfdd
5
+ SHA512:
6
+ metadata.gz: 0c482a4d575c022a38d09b7cd4af3f403255d34a64e58d0ea0b3a41934515928efdbc94f30b588554b0b845393ecff73f192e65d252c02c78b154c51fe8eb0f4
7
+ data.tar.gz: 6f6e4cb3bace9449790922b2d73db1d82ecc915b95544310230abc7a8a0875b483415f3b3f11d4330ff9b03e3658607b6121188b7ba56d5959facd61672b01c6
@@ -0,0 +1,21 @@
1
+ workflow "Publish to Rubygems" {
2
+ on = "push"
3
+ resolves = ["Publish"]
4
+ }
5
+
6
+ action "Tag Filter" {
7
+ uses = "actions/bin/filter@master"
8
+ args = "tag v*"
9
+ }
10
+
11
+ action "Install Dependencies" {
12
+ uses = "docker://ruby:2.6.0"
13
+ runs = "bundle install"
14
+ needs = ["Tag Filter"]
15
+ }
16
+
17
+ action "Publish" {
18
+ uses = "cadwallion/publish-rubygems-action@master"
19
+ needs = ["Install Dependencies"]
20
+ secrets = ["GITHUB_TOKEN", "RUBYGEMS_API_KEY"]
21
+ }
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ *.DS_Store
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Andrew Nordman
1
+ Copyright (c) 2012-2013 Andrew Nordman
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Brewscribe [![Build Status](https://secure.travis-ci.org/cadwallion/brewscribe.png)](http://travis-ci.org/cadwallion/brewscribe)
1
+ # Brewscribe [![Build Status](https://secure.travis-ci.org/cadwallion/brewscribe.png)](http://travis-ci.org/cadwallion/brewscribe) [![Code Climate](https://codeclimate.com/github/cadwallion/brewscribe.png)](https://codeclimate.com/github/cadwallion/brewscribe)
2
2
 
3
3
  Brewscribe is a Beersmith2 (.bsmx) file parser.
4
4
 
@@ -39,9 +39,7 @@ I <3 Contributions.
39
39
 
40
40
  ## TODO
41
41
 
42
- * More detailed Brewscribe::Recipe parsing. Mash info especially
43
- * Beersmith Style parsing
44
- * Writing back to .bsmx
42
+ * Document / Recipe Export
45
43
  * More documentation
46
44
 
47
45
  ## Author
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency 'rake'
21
21
  gem.add_development_dependency 'pry'
22
22
  gem.add_dependency 'nokogiri'
23
+ gem.add_dependency 'htmlentities'
23
24
  end
@@ -1,3 +1,4 @@
1
+ require 'htmlentities'
1
2
  module Brewscribe
2
3
  class Document
3
4
  attr_reader :raw_data, :hash
@@ -17,7 +18,8 @@ module Brewscribe
17
18
  end
18
19
 
19
20
  def parse_data
20
- @xml = Nokogiri::XML(@raw_data).xpath('/Selections/Data')
21
+ @raw_data = HTMLEntities.new.decode(@raw_data)
22
+ @xml = Nokogiri::XML(@raw_data, nil, 'UTF-8').xpath('/Selections/Data')
21
23
  @hash = xml_node_to_hash @xml.first
22
24
 
23
25
  if @hash[:recipe].class == Hash
@@ -28,7 +28,7 @@ module Brewscribe
28
28
  batch_vol: FLOAT_CONV,
29
29
  fermenter_loss: FLOAT_CONV,
30
30
  top_up: FLOAT_CONV,
31
- efficiency: PERCENT_CONV,
31
+ efficiency: ->(k) { k.to_f * 0.01 },
32
32
  hop_util: PERCENT_CONV
33
33
  }
34
34
 
@@ -14,7 +14,7 @@ module Brewscribe
14
14
  KEY_CONVERSION = {
15
15
  amount: FLOAT_CONV,
16
16
  color: FLOAT_CONV,
17
- yield: PERCENT_CONV,
17
+ yield: ->(k) { k.to_f * 0.01 },
18
18
  price: FLOAT_CONV,
19
19
  boil_time: ->(k) { k.to_i },
20
20
  percent: PERCENT_CONV,
@@ -36,5 +36,17 @@ module Brewscribe
36
36
 
37
37
  data_to_properties grain_data
38
38
  end
39
+
40
+ def ppg
41
+ self.yield * 46.214
42
+ end
43
+
44
+ def total_ppg
45
+ ppg * in_pounds
46
+ end
47
+
48
+ def in_pounds
49
+ self.amount / 16.0
50
+ end
39
51
  end
40
52
  end
@@ -79,7 +79,7 @@ module Brewscribe
79
79
  end
80
80
 
81
81
  def srm
82
- volume_in_gallons = volume_measured / 128.0
82
+ volume_in_gallons = equipment.batch_vol / 128.0
83
83
  mcu = ingredients.grains.inject(0.0) do |sum, grain|
84
84
  grain_in_pounds = grain.amount / 16.0
85
85
  sum + ((grain.color * grain_in_pounds) / volume_in_gallons)
@@ -87,5 +87,20 @@ module Brewscribe
87
87
 
88
88
  (1.4922 * (mcu ** 0.6859)).round(1)
89
89
  end
90
+
91
+ def original_gravity
92
+ #binding.pry
93
+ 1 + ((total_ppg / volume_in_gallons) * 0.001).round(3)
94
+ end
95
+
96
+ def total_ppg
97
+ ingredients.grains.inject(0.0) do |sum, grain|
98
+ sum + (grain.total_ppg * equipment.efficiency)
99
+ end
100
+ end
101
+
102
+ def volume_in_gallons
103
+ equipment.batch_vol / 128.0
104
+ end
90
105
  end
91
106
  end
@@ -1,3 +1,3 @@
1
1
  module Brewscribe
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1,18 +1,17 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Brewscribe::Carbonation do
4
- subject { Brewscribe::Carbonation.from_data RECIPE_HASH[:carb] }
4
+ let(:document) { import_document }
5
+ let(:recipe) { document.recipes.first }
6
+ let(:carbonation) { recipe.carbonation }
7
+ subject { carbonation }
5
8
 
6
9
  describe '#from_data' do
7
- it { subject.should be_a Brewscribe::Carbonation }
10
+ it { should be_a Brewscribe::Carbonation }
8
11
 
9
- it { subject.carb_rate.should be_a Float }
10
- it { subject.temperature.should be_a Float }
11
- it { subject.last_modified.should be_a Date }
12
-
13
-
14
- it 'should set the type to one of the TYPES' do
15
- Brewscribe::Carbonation::TYPES.should include subject.type
16
- end
12
+ its(:carb_rate) { should be_a Float }
13
+ its(:temperature) { should be_a Float }
14
+ its(:last_modified) { should be_a Date }
15
+ its(:type) { should be_one_of Brewscribe::Carbonation::TYPES }
17
16
  end
18
17
  end
@@ -1,37 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Brewscribe::Equipment do
4
- subject { Brewscribe::Equipment.from_data RECIPE_HASH[:equipment] }
4
+ let(:document) { import_document }
5
+ let(:recipe) { document.recipes.first }
6
+ let(:equipment) { recipe.equipment }
7
+ subject { equipment }
5
8
 
6
- it { subject.should be_a Brewscribe::Equipment }
7
- it { subject.last_modified.should be_a Date }
8
- it { subject.mash_vol.should be_a Float }
9
- it { subject.tun_mass.should be_a Float }
10
- it { subject.boil_time.should be_a Float }
11
- it { subject.tun_specific_heat.should be_a Float }
12
- it { subject.tun_deadspace.should be_a Float }
13
- it { subject.tun_adj_deadspace.should be_a Float }
14
- it { subject.boil_vol.should be_a Float }
15
- it { subject.old_evap_rate.should be_a Float }
16
- it { subject.boil_off.should be_a Float }
17
- it { subject.trub_loss.should be_a Float }
18
- it { subject.cool_pct.should be_a Float }
19
- it { subject.top_up_kettle.should be_a Float }
20
- it { subject.batch_vol.should be_a Float }
21
- it { subject.fermenter_loss.should be_a Float }
22
- it { subject.top_up.should be_a Float }
23
- it { subject.efficiency.should be_a Float }
24
- it { subject.hop_util.should be_a Float }
9
+ it { should be_a Brewscribe::Equipment }
25
10
 
26
- it 'boil_rate_flag should be a boolean' do
27
- [true, false].should include subject.boil_rate_flag
28
- end
29
-
30
- it 'calc_boil should be a boolean' do
31
- [true, false].should include subject.calc_boil
32
- end
33
-
34
- it 'equip_39 should be a boolean' do
35
- [true, false].should include subject.equip_39
36
- end
11
+ its(:last_modified) { should be_a Date }
12
+ its(:mash_vol) { should be_a Float }
13
+ its(:tun_mass) { should be_a Float }
14
+ its(:boil_time) { should be_a Float }
15
+ its(:tun_specific_heat) { should be_a Float }
16
+ its(:tun_deadspace) { should be_a Float }
17
+ its(:tun_adj_deadspace) { should be_a Float }
18
+ its(:boil_vol) { should be_a Float }
19
+ its(:old_evap_rate) { should be_a Float }
20
+ its(:boil_off) { should be_a Float }
21
+ its(:trub_loss) { should be_a Float }
22
+ its(:cool_pct) { should be_a Float }
23
+ its(:top_up_kettle) { should be_a Float }
24
+ its(:batch_vol) { should be_a Float }
25
+ its(:fermenter_loss) { should be_a Float }
26
+ its(:top_up) { should be_a Float }
27
+ its(:efficiency) { should be_a Float }
28
+ its(:hop_util) { should be_a Float }
29
+ its(:boil_rate_flag) { should be_boolean }
30
+ its(:calc_boil) { should be_boolean }
31
+ its(:equip_39) { should be_boolean }
37
32
  end
@@ -2,52 +2,38 @@ require 'spec_helper'
2
2
 
3
3
  describe Brewscribe::Mash do
4
4
  describe '#from_data' do
5
- let(:data) { RECIPE_HASH[:mash] }
6
- subject { Brewscribe::Mash.from_data(data) }
5
+ let(:document) { import_document }
6
+ let(:recipe) { document.recipes.first }
7
+ let(:mash) { recipe.mash }
8
+ subject { mash }
7
9
 
8
- it 'returns a Mash object with data preloaded' do
9
- subject.should be_a Brewscribe::Mash
10
- subject.name.should == RECIPE_HASH[:mash][:name]
11
- end
10
+ it { should be_a Brewscribe::Mash }
11
+ its(:name) { should == 'Single Infusion, Light Body, No Mash Out' }
12
+ its(:steps) { should be_a Array }
12
13
 
13
14
  it 'converts steps into an array of Mash::Step objects' do
14
- subject.steps.should be_a Array
15
- subject.steps[0].should be_a Brewscribe::Mash::Step
16
- end
17
-
18
- it { subject.grain_weight.should be_a Float }
19
- it { subject.grain_temp.should be_a Float }
20
- it { subject.boil_temp.should be_a Float }
21
- it { subject.tun_temp.should be_a Float }
22
- it { subject.sparge_temp.should be_a Float }
23
- it { subject.ph.should be_a Float }
24
- it { subject.batch.should be_a Float }
25
- it { subject.batch_pct.should be_a Float }
26
- it { subject.tun_deadspace.should be_a Float }
27
- it { subject.biab_vol.should be_a Float }
28
- it { subject.tun_vol.should be_a Float }
29
- it { subject.tun_mass.should be_a Float }
30
- it { subject.tun_hc.should be_a Float }
31
- it { subject.last_modified.should be_a Date }
32
-
33
- it 'batch_even should be a boolean' do
34
- [true, false].should include subject.batch_even
35
- end
36
-
37
- it 'batch_drain should be a boolean' do
38
- [true, false].should include subject.batch_drain
15
+ mash.steps[0].should be_a Brewscribe::Mash::Step
39
16
  end
40
17
 
41
- it 'mash_39 should be a boolean' do
42
- [true, false].should include subject.mash_39
43
- end
44
-
45
- it 'biab should be a boolean' do
46
- [true, false].should include subject.biab
47
- end
48
-
49
- it 'equip_adjust should be a boolean' do
50
- [true, false].should include subject.equip_adjust
51
- end
18
+ its(:grain_weight) { should be_a Float }
19
+ its(:grain_temp) { should be_a Float }
20
+ its(:boil_temp) { should be_a Float }
21
+ its(:tun_temp) { should be_a Float }
22
+ its(:sparge_temp) { should be_a Float }
23
+ its(:ph) { should be_a Float }
24
+ its(:batch) { should be_a Float }
25
+ its(:batch_pct) { should be_a Float }
26
+ its(:tun_deadspace) { should be_a Float }
27
+ its(:biab_vol) { should be_a Float }
28
+ its(:tun_vol) { should be_a Float }
29
+ its(:tun_mass) { should be_a Float }
30
+ its(:tun_hc) { should be_a Float }
31
+ its(:last_modified) { should be_a Date }
32
+
33
+ its(:batch_even) { should be_boolean }
34
+ its(:batch_drain) { should be_boolean }
35
+ its(:mash_39) { should be_boolean }
36
+ its(:biab) { should be_boolean }
37
+ its(:equip_adjust) { should be_boolean }
52
38
  end
53
39
  end
@@ -3,7 +3,8 @@ require 'spec_helper'
3
3
  describe Brewscribe::Recipe do
4
4
  let(:recipe_file) { File.read(File.dirname(__FILE__) + '/support/recipe.bsmx') }
5
5
  let(:data) { Brewscribe::Document.new(data: recipe_file).hash[:recipe] }
6
- subject { Brewscribe::Recipe.new(data) }
6
+ let(:recipe) { Brewscribe::Recipe.new(data) }
7
+ subject { recipe }
7
8
  it 'should convert the recipe data into properties' do
8
9
  subject.brewer.should == 'CadBrew'
9
10
  end
@@ -80,4 +81,6 @@ describe Brewscribe::Recipe do
80
81
 
81
82
  its(:ibu) { should == 65.1 }
82
83
  its(:srm) { should == 30.6 }
84
+
85
+ its(:original_gravity) { should == 1.084 }
83
86
  end
@@ -1,5 +1,27 @@
1
1
  $: << '../lib'
2
2
 
3
3
  require 'brewscribe'
4
- require './spec/support/recipe_hash'
5
4
  require 'pry'
5
+
6
+ def import_document
7
+ Brewscribe.import File.open(File.dirname(__FILE__) + '/support/recipe.bsmx', 'r')
8
+ end
9
+
10
+ RSpec::Matchers.define :be_boolean do
11
+ match do |actual|
12
+ [true, false].include? actual
13
+ end
14
+ failure_message_for_should do |actual|
15
+ "expected #{actual} to be true or false"
16
+ end
17
+ end
18
+
19
+ RSpec::Matchers.define :be_one_of do |expected|
20
+ match do |actual|
21
+ expected.include? actual
22
+ end
23
+
24
+ failure_message_for_should do |actual|
25
+ "expected #{actual.class.name} to be in #{expected}"
26
+ end
27
+ end
@@ -2,29 +2,29 @@ require 'spec_helper'
2
2
 
3
3
  describe Brewscribe::Mash::Step do
4
4
  describe '#from_data' do
5
- let(:mashstep) { RECIPE_HASH[:mash][:steps][:data][:mashstep] }
6
- subject { Brewscribe::Mash::Step.from_data mashstep }
5
+ let(:document) { import_document }
6
+ let(:recipe) { document.recipes.first }
7
+ let(:mashstep) { recipe.mash.steps[0] }
8
+ subject { mashstep }
7
9
 
8
- it { subject.should be_a Brewscribe::Mash::Step }
9
- it { subject.last_modified.should be_a Date }
10
- it { subject.infusion.should be_a Float }
11
- it { subject.step_temp.should be_a Float }
12
- it { subject.tun_addition.should be_a Float }
13
- it { subject.tun_hc.should be_a Float }
14
- it { subject.tun_vol.should be_a Float }
15
- it { subject.tun_temp.should be_a Float }
16
- it { subject.tun_mass.should be_a Float }
17
- it { subject.start_temp.should be_a Float }
18
- it { subject.grain_temp.should be_a Float }
19
- it { subject.start_vol.should be_a Float }
20
- it { subject.grain_weight.should be_a Float }
21
- it { subject.infusion_temp.should be_a Float }
22
- it { subject.decoction_amt.should be_a Float }
23
- it { subject.step_time.should be_a Fixnum }
24
- it { subject.rise_time.should be_a Fixnum }
10
+ it { should be_a Brewscribe::Mash::Step }
11
+ its(:last_modified) { should be_a Date }
12
+ its(:infusion) { should be_a Float }
13
+ its(:step_temp) { should be_a Float }
14
+ its(:tun_addition) { should be_a Float }
15
+ its(:tun_hc) { should be_a Float }
16
+ its(:tun_vol) { should be_a Float }
17
+ its(:tun_temp) { should be_a Float }
18
+ its(:tun_mass) { should be_a Float }
19
+ its(:start_temp) { should be_a Float }
20
+ its(:grain_temp) { should be_a Float }
21
+ its(:start_vol) { should be_a Float }
22
+ its(:grain_weight) { should be_a Float }
23
+ its(:infusion_temp) { should be_a Float }
24
+ its(:decoction_amt) { should be_a Float }
25
+ its(:step_time) { should be_a Fixnum }
26
+ its(:rise_time) { should be_a Fixnum }
25
27
 
26
- it 'should set the type to one of the TYPES' do
27
- Brewscribe::Mash::Step::TYPES.should include subject.type
28
- end
28
+ its(:type) { should be_one_of Brewscribe::Mash::Step::TYPES }
29
29
  end
30
30
  end
@@ -1,8 +1,9 @@
1
+ #encoding: UTF-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Brewscribe::Style do
4
5
  subject { Brewscribe::Style.from_data RECIPE_HASH[:style] }
5
-
6
+ it {subject.name.should == 'Oktoberfest/Märzen'}
6
7
  it { subject.should be_a Brewscribe::Style }
7
8
  it { subject.last_modified.should be_a Date }
8
9
  it { subject.min_og.should be_a Float }
@@ -17,11 +18,27 @@ describe Brewscribe::Style do
17
18
  it { subject.max_color.should be_a Float }
18
19
  it { subject.number.should be_a Fixnum }
19
20
  it { subject.letter.should == 'F' }
21
+ let(:document) { import_document }
22
+ let(:recipe) { document.recipes.first }
23
+ subject { recipe.style }
20
24
 
21
- it 'examples should be an array of beer names' do
22
- subject.examples.should be_a Array
23
- subject.examples.should have(17).examples
24
- end
25
+ it { should be_a Brewscribe::Style }
26
+ its(:last_modified) { should be_a Date }
27
+ its(:min_og) { should be_a Float }
28
+ its(:max_og) { should be_a Float }
29
+ its(:min_fg) { should be_a Float }
30
+ its(:max_fg) { should be_a Float }
31
+ its(:min_ibu) { should be_a Float }
32
+ its(:max_ibu) { should be_a Float }
33
+ its(:min_abv) { should be_a Float }
34
+ its(:max_abv) { should be_a Float }
35
+ its(:min_color) { should be_a Float }
36
+ its(:max_color) { should be_a Float }
37
+ its(:number) { should be_a Fixnum }
38
+ its(:letter) { should == 'F' }
39
+
40
+ its(:examples) { should be_a Array }
41
+ its(:examples) { should have(17).examples }
25
42
 
26
43
  it 'should set the type to one of the TYPES' do
27
44
  Brewscribe::Style::TYPES.should include subject.type
@@ -47,7 +47,7 @@
47
47
  </F_R_EQUIPMENT>
48
48
  <F_R_STYLE>
49
49
  <_MOD_>2012-03-12</_MOD_>
50
- <F_S_NAME>Imperial Stout</F_S_NAME>
50
+ <F_S_NAME>Oktoberfest/M&auml;rzen</F_S_NAME>
51
51
  <F_S_CATEGORY>Stout</F_S_CATEGORY>
52
52
  <F_S_GUIDE>BJCP 2008</F_S_GUIDE>
53
53
  <F_S_LETTER>6</F_S_LETTER>
metadata CHANGED
@@ -1,110 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewscribe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andrew Nordman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-08 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: guard
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: guard-rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: pry
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: nokogiri
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: htmlentities
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
110
111
  description:
@@ -114,9 +115,10 @@ executables: []
114
115
  extensions: []
115
116
  extra_rdoc_files: []
116
117
  files:
117
- - .gitignore
118
- - .rspec
119
- - .travis.yml
118
+ - ".github/main.workflow"
119
+ - ".gitignore"
120
+ - ".rspec"
121
+ - ".travis.yml"
120
122
  - CHANGELOG.md
121
123
  - Gemfile
122
124
  - Guardfile
@@ -152,37 +154,28 @@ files:
152
154
  - spec/step_spec.rb
153
155
  - spec/style_spec.rb
154
156
  - spec/support/recipe.bsmx
155
- - spec/support/recipe_hash.rb
156
157
  - spec/yeast_spec.rb
157
158
  homepage: ''
158
159
  licenses: []
160
+ metadata: {}
159
161
  post_install_message:
160
162
  rdoc_options: []
161
163
  require_paths:
162
164
  - lib
163
165
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
166
  requirements:
166
- - - ! '>='
167
+ - - ">="
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
- segments:
170
- - 0
171
- hash: 1203638230809629989
172
170
  required_rubygems_version: !ruby/object:Gem::Requirement
173
- none: false
174
171
  requirements:
175
- - - ! '>='
172
+ - - ">="
176
173
  - !ruby/object:Gem::Version
177
174
  version: '0'
178
- segments:
179
- - 0
180
- hash: 1203638230809629989
181
175
  requirements: []
182
- rubyforge_project:
183
- rubygems_version: 1.8.24
176
+ rubygems_version: 3.0.1
184
177
  signing_key:
185
- specification_version: 3
178
+ specification_version: 4
186
179
  summary: A Beersmith (.bsmx) file parser
187
180
  test_files:
188
181
  - spec/brewscribe_spec.rb
@@ -199,5 +192,4 @@ test_files:
199
192
  - spec/step_spec.rb
200
193
  - spec/style_spec.rb
201
194
  - spec/support/recipe.bsmx
202
- - spec/support/recipe_hash.rb
203
195
  - spec/yeast_spec.rb
@@ -1,98 +0,0 @@
1
- RECIPE_HASH = {
2
- equipment: {
3
- :last_modified=>"1978-12-22", :name=>"Pot ( 4 Gal/15.1 L) - Extract",
4
- :mash_vol=>"512.0000000", :tun_mass=>"64.0000000", :boil_rate_flag=>"1",
5
- :tun_specific_heat=>"0.1200000", :tun_deadspace=>"0.0000000",
6
- :tun_adj_deadspace=>"1", :calc_boil=>"1", :boil_vol=>"469.7600000",
7
- :boil_time=>"60.0000000", :old_evap_rate=>"9.0000000", :equip_39=>"1",
8
- :boil_off=>"37.1200000", :trub_loss=>"64.0000000", :cool_pct=>"4.0000000",
9
- :top_up_kettle=>"0.0000000", :batch_vol=>"640.0000000",
10
- :fermenter_loss=>"51.2000000", :top_up=>"288.0000000", :efficiency=>"72.0000000",
11
- :hop_util=>"100.0000000",
12
- :notes=>"Simple Brew Pot with a 4 Gallon Capacity - leaving a workable boil volume of around 3.25 gal. Used for extract or partial mash brewing."
13
- },
14
- mash: {
15
- :last_modified=>"1978-12-22", :name=>"Single Infusion, Light Body, No Mash Out",
16
- :grain_weight=>"72.0000000", :grain_temp=>"72.0000000",
17
- :boil_temp=>"212.0000000", :tun_temp=>"72.0000000", :ph=>"5.4000000",
18
- :sparge_temp=>"168.0000000", :batch=>"0", :batch_pct=>"100.0000000",
19
- :batch_even=>"0", :batch_drain=>"0", :mash_39=>"1", :tun_deadspace=>"0.0000000",
20
- :biab_vol=>"640.0000000", :biab=>"0",
21
- :notes=>"Simple single infusion mash for use with most modern well modified grains (about 95% of the time).",
22
- :steps=> {
23
- :last_modified=>"2012-03-14",
24
- :name=>"steps",
25
- :type=>"7432",
26
- :owndata=>"1",
27
- :tid=>"7149",
28
- :size=>"1",
29
- :_xname=>"steps",
30
- :allocinc=>"16",
31
- :data=>{
32
- :mashstep=>{
33
- :last_modified=>"2012-03-12",
34
- :name=>"Mash In",
35
- :type=>"0",
36
- :infusion=>"180.0000000",
37
- :step_temp=>"148.0000000",
38
- :step_time=>"75.0000000",
39
- :rise_time=>"2.0000000",
40
- :tun_addition=>"0.0000000",
41
- :tun_hc=>"0.1200000",
42
- :tun_vol=>"512.0000000",
43
- :tun_temp=>"72.0000000",
44
- :tun_mass=>"0.0000000",
45
- :start_temp=>"0.0000000",
46
- :grain_temp=>"72.0000000",
47
- :start_vol=>"0.0000000",
48
- :grain_weight=>"72.0000000",
49
- :infusion_temp=>"159.0738063",
50
- :decoction_amt=>"0.0000000"
51
- }
52
- },
53
- :_texpanded=>"1"
54
- },
55
- :equip_adjust=>"0",
56
- :tun_vol=>"512.0000000",
57
- :tun_mass=>"64.0000000",
58
- :tun_hc=>"0.1200000"
59
- },
60
- :carb => {
61
- :last_modified=>"1978-12-30",
62
- :name=>"Corn Sugar",
63
- :temperature=>"70.0000000",
64
- :type=>"0", :primer_name=>"Corn Sugar",
65
- :carb_rate=>"100.0000000",
66
- :notes=>"Use corn sugar for priming the beer"
67
- },
68
- :style => {
69
- :last_modified=>"2012-03-12",
70
- :name=>"Imperial Stout",
71
- :category=>"Stout",
72
- :guide=>"BJCP 2008",
73
- :letter=>"6",
74
- :number=>"13",
75
- :type=>"0",
76
- :min_og=>"1.0750000",
77
- :max_og=>"1.1150000",
78
- :min_fg=>"1.0180000",
79
- :max_fg=>"1.0300000",
80
- :min_ibu=>"50.0000000",
81
- :max_ibu=>"90.0000000",
82
- :min_carb=>"1.8000000",
83
- :max_carb=>"2.6000000",
84
- :min_color=>"30.0000000",
85
- :max_color=>"40.0000000",
86
- :min_abv=>"8.0000000",
87
- :max_abv=>"12.0000000",
88
- :description=>"An intensely flavored, big, dark ale. Roasty, fruity, and bittersweet, with a noticeable alcohol presence. Dark fruit flavors meld with roasty, burnt, or almost tarlike sensations. Like a black barleywine with every dimension of flavor coming into play. Brewed to high gravity and hopping level in England for export to the Baltic States and Russia. Said to be popular with the Russian Imperial Court. Today is even more popular with American craft brewers, who have extended the style with unique American characteristics. Variations exist, with English and American interpretations (predictably, the American versions have more bitterness, roasted character, and finishing hops, while the English varieties
89
- reflect a more complex specialty malt character and a more forward ester profile). The wide range of allowable characteristics allow for maximum brewer creativity.",
90
- :profile=>"Aroma: Rich and complex, with variable amounts of roasted grains, maltiness, fruity esters, hops, and alcohol. The roasted malt character can take on coffee, dark chocolate, or slightly burnt tones and can be light to moderately strong. The malt aroma can be subtle to rich and barleywine-like, depending on the gravity and grain bill. May optionally show a slight specialty malt character (e.g., caramel), but this should only add complexity and not dominate. Fruity esters may be low to moderately strong, and may take on a complex, dark fruit (e.g., plums, prunes, raisins) character. Hop aroma can be very low to quite aggressive, and may contain any hop variety. An alcohol character may be present, but shouldnt be sharp, hot or solventy. Aged versions may have a slight vinous or portlike quality, but shouldnt be sour. No diacetyl. The balance can vary with any of the aroma elements taking center stage. Not all possible aromas described need be present; many interpretations are possible. Aging affects the intensity, balance and smoothness of aromatics.\n Appearance: Color may range from very dark reddish-brown to jet black. Opaque. Deep tan to dark brown head. Generally has a well-formed head, although head retention may be low to moderate. High alcohol and viscosity may be visible in legs when beer is swirled in a glass.\n
91
- Flavor: Rich, deep, complex and frequently quite intense, with variable amounts of roasted malt/grains, maltiness, fruity esters, hop bitterness and flavor, and alcohol. Medium to aggressively high bitterness. Medium-low to high hop flavor (any variety). Moderate to aggressively high roasted malt/grain flavors can suggest bittersweet or unsweetened chocolate, cocoa, and/or strong coffee. A slightly burnt grain, burnt currant or tarry character may be evident. Fruity esters may be low to intense, and can take on a dark fruit character (raisins, plums, or prunes). Malt backbone can be balanced and supportive to rich and barleywine-like, and may optionally show some supporting caramel, bready or toasty flavors. Alcohol strength
92
- should be evident, but not hot, sharp, or solventy. No diacetyl. The palate and finish can vary from relatively dry to moderately sweet, usually with some lingering roastiness, hop bitterness and warming character. The balance and intensity of flavors can be affected by aging, with some flavors becoming more subdued over time and some aged, vinous or port-like qualities developing.\n
93
- Mouthfeel: Full to very full-bodied and chewy, with a velvety, luscious texture (although the body may decline with long conditioning). Gentle smooth warmth from alcohol should be present and noticeable. Should not be syrupy and underattenuated. Carbonation may be low to moderate, depending on age and conditioning.",
94
- :ingredients=>"Well-modified pale malt, with generous quantities of roasted malts and/or grain. May have a complex grain bill using virtually any variety of malt. Any type of hops may be used. Alkaline water balances the abundance of acidic roasted grain in the grist. American or English ale yeast.",
95
- :examples=>"Three Floyds Dark Lord, Bells Expedition Stout, North Coast Old Rasputin Imperial Stout, Stone Imperial Stout, Samuel Smith Imperial Stout, Scotch Irish Tsarina Katarina Imperial Stout, Thirsty Dog Siberian Night, Deschutes The Abyss, Great Divide Yeti, Southampton Russian Imperial Stout, Rogue Imperial Stout, Bear Republic Big Bear Black Stout, Great Lakes Blackout Stout, Avery The Czar, Founders Imperial Stout, Victory Storm King, Brooklyn Black Chocolate Stout",
96
- :web_link=>"http://www.bjcp.org"
97
- }
98
- }