beer_recipe 0.4.3 → 0.4.4

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: b8e2bb78a9f64806b377bd0e0222c07028f82777
4
- data.tar.gz: 378bcc1bf96f2f0f4ceeca9c89120fef04a24cc0
3
+ metadata.gz: e37fba916d446ebaf2a70aeddaa14bed5a57ec92
4
+ data.tar.gz: 743c134364ea2f89a41fa2c5e0d51c6a5b74203b
5
5
  SHA512:
6
- metadata.gz: 346bea94b4361255d09db38fc337af63e0d80423a2f843a7438f12996824a41e3e6468acd560446171dec311234473973fec6cbb8f5d3262a936c593be67af87
7
- data.tar.gz: 8d7c6e320d56f637e38e1b02c6c0ac32280be731c22b2d9a3b78c86f32c7e3038e198474ddd31adc46d9704e70eda885a30d71bea53f38affe63f343ec9752d7
6
+ metadata.gz: c1bdeb18556929ae818c8429d96a010d1befbe6c40d5b05626385f8c39347ef350812b1f6218bba654e4a4d936b35d6ebf5353a0a8b9289efe91a1d0e020c992
7
+ data.tar.gz: d09a7ada40ae086ec201ae8b03a7c21b3b1822e8e1e7b92d1fc9a48ebd414b7691d63c2ed37e31a7a8e383370ee25fc82bd2527faca984bc8ee1899c32bf49dc
@@ -0,0 +1,30 @@
1
+ class BeerRecipe::MiscWrapper < BeerRecipe::Wrapper
2
+ def unit
3
+ if amount_is_weight
4
+ 'grams'
5
+ else
6
+ 'ml'
7
+ end
8
+ end
9
+
10
+ def formatted_amount
11
+ "#{'%.1f' % (1000 * amount)}"
12
+ end
13
+
14
+ def formatted_time
15
+ t = if time > 1440
16
+ "#{'%.0f' % (time / 1440)}"
17
+ else
18
+ "#{'%.0f' % time}"
19
+ end
20
+ end
21
+
22
+ def time_unit
23
+ if time > 1440
24
+ 'days'
25
+ else
26
+ 'minutes'
27
+ end
28
+ end
29
+ end
30
+
@@ -1,3 +1,3 @@
1
1
  module BeerRecipe
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
data/lib/beer_recipe.rb CHANGED
@@ -12,6 +12,7 @@ require 'beer_recipe/reader'
12
12
  require 'beer_recipe/formula'
13
13
  require 'beer_recipe/wrapper'
14
14
  require 'beer_recipe/mash_wrapper'
15
+ require 'beer_recipe/misc_wrapper'
15
16
  require 'beer_recipe/mash_step_wrapper'
16
17
  require 'beer_recipe/hop_wrapper'
17
18
  require 'beer_recipe/yeast_wrapper'
data/locales/en.yml CHANGED
@@ -77,3 +77,17 @@ Low Saccharification: Low Saccharification
77
77
  High Saccharification: High Saccharification
78
78
  Mash Out: Mash Out
79
79
  generated_by: Generated by
80
+ miscs: Other ingredients
81
+ misc_name: Namn
82
+ misc_type: Type
83
+ misc_amount: Amount
84
+ misc_use: Use
85
+ misc_use_for: Use for
86
+ misc_time: Time
87
+ Fining: Fining
88
+ Herb: Herb
89
+ Other: Other
90
+ Secondary: Secondary
91
+ Yeast Nutrient: Yeast Nutrient
92
+ Ginger Root: Ginger Root
93
+ Fermentation: Fermentation
data/locales/se.yml CHANGED
@@ -56,7 +56,7 @@ yeast_name: Namn
56
56
  yeast_product_id: Produkt ID
57
57
  yeast_lab: Labb
58
58
  yeast_form: Form
59
- yeast_attenuation: Attenuering
59
+ yeast_attenuation: Förjäsbarhet
60
60
  yeast_temperature: Temperatur
61
61
  Dry: Torr
62
62
  Liquid: Flytande
@@ -76,3 +76,17 @@ Low Saccharification: Låg försockring
76
76
  High Saccharification: Hög försockring
77
77
  Mash Out: Utmäskning
78
78
  generated_by: Genererad av
79
+ miscs: Övriga ingredienser
80
+ misc_name: Namn
81
+ misc_type: Typ
82
+ misc_amount: Mängd
83
+ misc_use: Användning
84
+ misc_use_for: Användningsområde
85
+ misc_time: Tid
86
+ Fining: Klarning
87
+ Herb: Krydda
88
+ Other: Övrigt
89
+ Secondary: Sekundär
90
+ Yeast Nutrient: Jästnäring
91
+ Ginger Root: Ingefära
92
+ Fermentation: Jäsning
@@ -31,7 +31,7 @@
31
31
  <div id="header" class="container">
32
32
 
33
33
  <!-- Logo -->
34
- <h1 id="logo" itemprop="name"><a href="index.html"><%= name %></a></h1>
34
+ <h1 id="logo"><a href="index.html"><%= name %></a></h1>
35
35
  <p><%= style.name %></p>
36
36
 
37
37
  <!-- Nav -->
@@ -98,9 +98,10 @@
98
98
 
99
99
  <!-- Post -->
100
100
  <article class="box post beer_recipe" itemscope itemtype="http://schema.org/Recipe">
101
- <meta itemprop="author" content="<%= brewer %>"/>
102
- <meta itemprop="recipeCategory" content="beverage"/>
103
- <meta itemprop="totalTime" content="<%= total_time_period %>"/>
101
+ <meta itemprop="name" content="<%= name %>">
102
+ <meta itemprop="author" content="<%= brewer %>">
103
+ <meta itemprop="recipeCategory" content="beverage">
104
+ <meta itemprop="totalTime" content="<%= total_time_period %>">
104
105
  <meta itemprop="cookTime" content="<%= boil_time_period %>">
105
106
 
106
107
  <div class="row">
@@ -222,6 +223,33 @@
222
223
  </table>
223
224
  </section>
224
225
 
226
+ <section class="recipe_miscs">
227
+ <h2><%= I18n.t(:miscs) %></h2>
228
+ <table>
229
+ <thead>
230
+ <tr>
231
+ <th><%= I18n.t(:misc_name) %></th>
232
+ <th><%= I18n.t(:misc_amount) %></th>
233
+ <th><%= I18n.t(:misc_type) %></th>
234
+ <th><%= I18n.t(:misc_use) %></th>
235
+ </tr>
236
+ </thead>
237
+ <tbody>
238
+ <% miscs.each do |m| %>
239
+ <meta itemprop="recipeIngredient"
240
+ content="<%= m.formatted_amount %> <%= I18n.t(m.unit, default: m.unit) %> <%= m.name %>">
241
+ <tr>
242
+ <td class="misc_name"><%= I18n.t(m.name, default: m.name) %></td>
243
+ <td class="misc_amount format_number"><%= m.formatted_amount %> <%= I18n.t(m.unit, default: m.unit) %></td>
244
+ <td class="misc_type"><%= I18n.t(m.type, default: m.type) %></td>
245
+ <td class="misc_use"><%= I18n.t(m.use, default: m.use) %></td>
246
+ <td class="misc_time"><%= m.formatted_time %> <%= I18n.t(m.time_unit, default: m.time_unit) %></td>
247
+ </tr>
248
+ <% end %>
249
+ </tbody>
250
+ </table>
251
+ </section>
252
+
225
253
  <section class="recipe_hops">
226
254
  <h2><%= I18n.t(:hops) %></h2>
227
255
  <table>
@@ -272,7 +300,7 @@
272
300
  <tbody>
273
301
  <% yeasts.each do |yeast| %>
274
302
  <tr>
275
- <meta itemprop="name" content="<%= yeast.name %> (<%= yeast.product_id %>) <%= yeast.laboratory %>">
303
+ <meta itemprop="recipeIngredient" content="<%= yeast.name %> (<%= yeast.product_id %>) <%= yeast.laboratory %>">
276
304
  <td class="yeast_name"><%= yeast.name %></td>
277
305
  <td class="yeast_product_id"><%= yeast.product_id %></td>
278
306
  <td class="yeast_laboratory"><%= yeast.laboratory %></td>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beer_recipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olle Johansson
@@ -82,6 +82,7 @@ files:
82
82
  - lib/beer_recipe/html_formatter.rb
83
83
  - lib/beer_recipe/mash_step_wrapper.rb
84
84
  - lib/beer_recipe/mash_wrapper.rb
85
+ - lib/beer_recipe/misc_wrapper.rb
85
86
  - lib/beer_recipe/reader.rb
86
87
  - lib/beer_recipe/recipe_formatter.rb
87
88
  - lib/beer_recipe/recipe_reader.rb