rawfeed 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 8592ae30b0051b09cbb61aef70b5d6af2ebc46b5b3b2dba0e21c17b6c1aac881
4
- data.tar.gz: 1d1f85c4ded6ed5742be960c4a84c55c7cdf3a5138a80179b18b2a0745a96258
3
+ metadata.gz: 5c77c26cafbcdaddf6d5297d5ec37d0e6912e305b31055c412d5f3fb595e6011
4
+ data.tar.gz: ee87b78c301ed6862181631c4b71938c8fbeb67133262f915218dc63943e9706
5
5
  SHA512:
6
- metadata.gz: 1ce3dd3f7a45c1fcd1b9825f52df2ed0c5d3eb0300dd9d868fa6420bf3ccdcf107f3deca58261d73e7b045baf810cbd67934fcd6da700730152bd9a253559199
7
- data.tar.gz: 4051a9375c9f6c885d6f1645cf398e478778ee00d13622ca1de5bd789b176efcc16c9d06a796d321f5510af06b93b6bbb95158598482f4c4567324ed45e8d771
6
+ metadata.gz: fb7020880c461a817305c26e2a5076cd7418b2509aaf0207e5b3352e071f4ea86595a24bb9a9791043e23d122686131066b3fb33f062fc0a5c2f16f9e676dd6e
7
+ data.tar.gz: 99d68cc1a6ea32e42c900f8e3bf2d6bc4561bad407ee50bd83449586e562ba6aba4bcfcf4b8023acc30260f98e893e2fe8ae52ba0ff46e157128c08fcf0c9a9e
data/_data/resume.yml CHANGED
@@ -143,6 +143,7 @@ body:
143
143
 
144
144
  # section: [Certificates]
145
145
  # Full links will only appear in print mode. Online and PDF modes are clickable.
146
+ # TODO: Bugfix: Quando tem muitos certificados, existe uma quebra de espaço absurda na impressão
146
147
  certificates:
147
148
  enable: true
148
149
  caption: Certificates
@@ -36,7 +36,13 @@ module Rawfeed
36
36
  return "[datelang: invalid date '#{date_input}']" unless date
37
37
 
38
38
  formatted = date.strftime(format)
39
- replace_months(formatted, data)
39
+
40
+ # Automatically detects month type based on format
41
+ if format.include?("%B")
42
+ replace_months(formatted, data, :full)
43
+ else
44
+ replace_months(formatted, data, :short)
45
+ end
40
46
  end
41
47
 
42
48
  private
@@ -44,23 +50,18 @@ module Rawfeed
44
50
  def parse_args(text, context)
45
51
  args = {}
46
52
 
47
- # captures tokens respecting quoted strings
48
53
  tokens = text.scan(/"[^"]*"|\S+/).map { |t| t.strip }
49
54
 
50
55
  tokens.each do |tok|
51
56
  if tok.include?(':')
52
57
  key, raw_val = tok.split(':', 2)
53
- # value in quotes -> literal
54
58
  if raw_val.start_with?('"') && raw_val.end_with?('"')
55
59
  val = raw_val[1..-2]
56
60
  else
57
- # unquoted value -> can be a Liquid variable (e.g., site.date.format)
58
- # we render "{{ value }}" in the context to get its actual content
59
61
  val = Liquid::Template.parse("{{ #{raw_val} }}").render(context).strip
60
62
  end
61
63
  args[key.to_sym] = val
62
64
  else
63
- # standalone token (e.g: page.date)
64
65
  rendered = Liquid::Template.parse("{{ #{tok} }}").render(context).strip
65
66
  args[:date] = rendered unless rendered.empty?
66
67
  end
@@ -74,7 +75,6 @@ module Rawfeed
74
75
  when Date then input
75
76
  when Time then input.to_date
76
77
  else
77
- # if it is string like "2025-10-13 12:34:00 -0300" etc, Date.parse works
78
78
  begin
79
79
  Date.parse(input.to_s)
80
80
  rescue ArgumentError
@@ -83,13 +83,13 @@ module Rawfeed
83
83
  end
84
84
  end
85
85
 
86
- def replace_months(str, data)
87
- data["months_full"].each_with_index do |m, i|
86
+ def replace_months(str, data, type)
87
+ months_key = (type == :full ? "months_full" : "months_short")
88
+ months = data[months_key] || []
89
+
90
+ months.each_with_index do |m, i|
88
91
  next if i.zero?
89
92
  str = str.gsub(Date::MONTHNAMES[i], m)
90
- end
91
- data["months_short"].each_with_index do |m, i|
92
- next if i.zero?
93
93
  str = str.gsub(Date::ABBR_MONTHNAMES[i], m)
94
94
  end
95
95
  str
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rawfeed
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rawfeed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William C. Canin