jekyll-cooklang-converter 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 598f60f293b9daafa043f024da2f59a48583071ce45fdfb6c15ef115e8736079
4
- data.tar.gz: 4e1988e3e4c447b9dcfdde2c8ef525ee76c2c2d1701c3975bb4fa3db64dfb860
3
+ metadata.gz: 12645bcaffa4192f683b66dba99bab13816c443e95bfc230aefe1300b3a34cb6
4
+ data.tar.gz: e41ce8b50f24b7ca9f78eb74016dc2a5802b90e7a87f05c95577ccfa2a2b9bf8
5
5
  SHA512:
6
- metadata.gz: 59648f9165ccae0db06142f2236134b7d22c2a4bcf8182d59adac5e0a1932e5c8f2f78690e9e1dccda15383da4736899d4b76067ea9eaf246543fe12fdf85f2c
7
- data.tar.gz: 6a9a8bd601532ba52d984d8fe0062823035380fd9842ed63db079887c3c998e54375d5c87ba8485565c6d694d428e5a7895aac5dfe4f1e79c967e4d604b009a9
6
+ metadata.gz: ce4a582b365abf71907ca9b219835738be2a03339390e840a0cadb3d35c66b4686e6a75e86476c8749c55e6ed48cf9e20a8b4fec0209e76a6bbf07c09fe94645
7
+ data.tar.gz: 21e44551283bd5a9e2f4a01670a885bd19a654b7279a20e4910d2e7d8897f2392a42603903621983873319a706beabbbcf4c23a6846976dd420face48fda39fe
@@ -1,6 +1,6 @@
1
1
  <h2>Ingredients</h2>
2
2
  <ul>
3
- <li><em>1 box</em> mushrooms</li>
3
+ <li><em>1/2 box</em> mushrooms</li>
4
4
  <li><em>1 pound</em> ground sausage</li>
5
5
  <li><em>some</em> garlic powder</li>
6
6
  <li><em>some</em> italian seasoning</li>
@@ -2,7 +2,7 @@
2
2
  ---
3
3
  set a #pot of water on the stove, to boil (you'll need for pasta later), and preheat the oven to 350
4
4
 
5
- cut @mushrooms{1%box} into slices, and sautee (no oil) in a pan over medium high heat until browned. Set aside
5
+ cut @mushrooms{1/2%box} into slices, and sautee (no oil) in a pan over medium high heat until browned. Set aside
6
6
 
7
7
  brown @ground sausage{1%pound} in the same pan, seasoning with @garlic powder{}, @italian seasoning{}, and @chili powder{} set aside
8
8
 
@@ -1,6 +1,6 @@
1
1
  <h2>Ingredients</h2>
2
2
  <ul>
3
- <li><em>1 box</em> mushrooms</li>
3
+ <li><em>1/2 box</em> mushrooms</li>
4
4
  <li><em>1 pound</em> ground sausage</li>
5
5
  <li><em>some</em> garlic powder</li>
6
6
  <li><em>some</em> italian seasoning</li>
@@ -12,9 +12,17 @@ module Jekyll
12
12
 
13
13
  class Ingredient < ToHTML
14
14
  def initialize(quantity, unit, name)
15
- @name = name
16
- @unit = unit
17
- @quantity = quantity
15
+ @name = name.to_s
16
+ @unit = unit.to_s
17
+ @quantity = if quantity.respond_to? :rationalize
18
+ if quantity.rationalize(0.1).denominator == 1
19
+ quantity.to_s
20
+ else
21
+ quantity.rationalize(0.1).to_s
22
+ end
23
+ else
24
+ quantity.to_s
25
+ end
18
26
  end
19
27
 
20
28
  def to_html
@@ -25,9 +33,9 @@ module Jekyll
25
33
 
26
34
  class Timer < ToHTML
27
35
  def initialize(quantity, unit, name)
28
- @name = name
29
- @unit = unit
30
- @quantity = quantity
36
+ @name = name.to_s
37
+ @unit = unit.to_s
38
+ @quantity = quantity.to_s
31
39
  end
32
40
 
33
41
  def to_html
@@ -38,8 +46,8 @@ module Jekyll
38
46
 
39
47
  class CookWare < ToHTML
40
48
  def initialize(quantity, name)
41
- @name = name
42
- @quantity = quantity
49
+ @name = name.to_s
50
+ @quantity = quantity.to_s
43
51
  end
44
52
 
45
53
  def to_html
@@ -112,13 +120,13 @@ module Jekyll
112
120
  ingredients = recipe["steps"].flatten.select { |item|
113
121
  item["type"] == "ingredient"
114
122
  }.map { |item|
115
- Ingredient.new(item["quantity"].to_s, item["units"].to_s, item["name"].to_s)
123
+ Ingredient.new(item["quantity"], item["units"], item["name"])
116
124
  }
117
125
 
118
126
  cookware = recipe["steps"].flatten.select { |item|
119
127
  item["type"] == "cookware"
120
128
  }.map { |item|
121
- CookWare.new(item["quantity"].to_s, item["name"].to_s)
129
+ CookWare.new(item["quantity"], item["name"])
122
130
  }
123
131
 
124
132
  steps = recipe["steps"].map do |step|
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module CooklangConverter
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-cooklang-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BraeTroutman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-27 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll