jekyll-cooklang-converter 0.2.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: 84eb0c0f3f9686e895d90daa24604cad91fc3f336ba5311c20010c8fe08a877b
4
- data.tar.gz: a48f36af64fb5dcd32e86d38525634f3c27c5e8c767c79646128c85ea167c8c2
3
+ metadata.gz: 12645bcaffa4192f683b66dba99bab13816c443e95bfc230aefe1300b3a34cb6
4
+ data.tar.gz: e41ce8b50f24b7ca9f78eb74016dc2a5802b90e7a87f05c95577ccfa2a2b9bf8
5
5
  SHA512:
6
- metadata.gz: 796cd7fd7ebb8c7321f87cc82ca7c1708be46b657ea11fcbda63f4724a99fd739b034720aae0e1248ebdb715c32d9e271d5104c3f0493cdcdc0f633eedaffa6b
7
- data.tar.gz: 26699a51dfc7a327fe0a0077ad3075ce8818dc22c84f492baec3efcae7d8eb310f9b725598056a427398c11f56870442c225f1461d4f9808823f63dfb03fbfd8
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>
@@ -47,6 +47,6 @@
47
47
  <p>layer half of the cooked pasta into the bottom of a greased casserole dish. Ladle half of the meat + veggie mixture on top. Then, spread the cheese mixture from the previous step on top of everything. Layer sliced provolone on that, followed by the rest of the sauce, the rest of the pasta, and a final layer of mozarella cheese. Sprinkle the top with italian seasoning</p>
48
48
  </li>
49
49
  <li>
50
- <p>put the dish in the preheated oven for . Then it's all ready!</p>
50
+ <p>put the dish in the preheated oven for 25 minutes. Then it's all ready!</p>
51
51
  </li>
52
52
  </ol>
@@ -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>
@@ -47,6 +47,6 @@
47
47
  <p>layer half of the cooked pasta into the bottom of a greased casserole dish. Ladle half of the meat + veggie mixture on top. Then, spread the cheese mixture from the previous step on top of everything. Layer sliced provolone on that, followed by the rest of the sauce, the rest of the pasta, and a final layer of mozarella cheese. Sprinkle the top with italian seasoning</p>
48
48
  </li>
49
49
  <li>
50
- <p>put the dish in the preheated oven for . Then it's all ready!</p>
50
+ <p>put the dish in the preheated oven for 25 minutes. Then it's all ready!</p>
51
51
  </li>
52
52
  </ol>
@@ -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
@@ -23,10 +31,23 @@ module Jekyll
23
31
  end
24
32
  end
25
33
 
34
+ class Timer < ToHTML
35
+ def initialize(quantity, unit, name)
36
+ @name = name.to_s
37
+ @unit = unit.to_s
38
+ @quantity = quantity.to_s
39
+ end
40
+
41
+ def to_html
42
+ return "<em>#{@quantity} #{@unit}</em>" if @unit.empty?
43
+ "<em>#{@quantity} #{@unit}</em> (#{@name})"
44
+ end
45
+ end
46
+
26
47
  class CookWare < ToHTML
27
48
  def initialize(quantity, name)
28
- @name = name
29
- @quantity = quantity
49
+ @name = name.to_s
50
+ @quantity = quantity.to_s
30
51
  end
31
52
 
32
53
  def to_html
@@ -69,6 +90,8 @@ module Jekyll
69
90
  substep["name"]
70
91
  when "ingredient"
71
92
  substep["name"]
93
+ when "timer"
94
+ "#{substep["quantity"]} #{substep["units"]}"
72
95
  when "text"
73
96
  substep["value"]
74
97
  end
@@ -97,13 +120,13 @@ module Jekyll
97
120
  ingredients = recipe["steps"].flatten.select { |item|
98
121
  item["type"] == "ingredient"
99
122
  }.map { |item|
100
- Ingredient.new(item["quantity"].to_s, item["units"].to_s, item["name"].to_s)
123
+ Ingredient.new(item["quantity"], item["units"], item["name"])
101
124
  }
102
125
 
103
126
  cookware = recipe["steps"].flatten.select { |item|
104
127
  item["type"] == "cookware"
105
128
  }.map { |item|
106
- CookWare.new(item["quantity"].to_s, item["name"].to_s)
129
+ CookWare.new(item["quantity"], item["name"])
107
130
  }
108
131
 
109
132
  steps = recipe["steps"].map do |step|
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module CooklangConverter
3
- VERSION = "0.2.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.2.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