jekyll-ical-tag 1.6.0 → 1.7.0

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: 1b71de33f80f9e2ff9554027bea500fa7e66d68468aaed22e539e4551b5e2132
4
- data.tar.gz: 130b7534016609598f51c37216a95c36993c78e0e75569107f5eb521d12a4e31
3
+ metadata.gz: 4b980a00058eadbb3e7a24212a696afc8fa52ba64f9e19326503aab22969c150
4
+ data.tar.gz: 896b23ae674ba9b42061ce22fb509972f8e60cb79d6df4efe6ac814e0931c78d
5
5
  SHA512:
6
- metadata.gz: 70b795e541f7c3b15f588d606e0f5aaf0734a9e0fae90a6980b2fdafbd871d2e97a25e772aec02faa16441ff828acc6fb3d9afa36e6d66cc2307c9868504ec3f
7
- data.tar.gz: eaaf3787045379728460e53d317becabf502cc9382e41cb60ff4a965ad264a5292acf25f2b7d325bb53eda68ccca1bb830322438f66b6ed9fdd2af582ab046fa
6
+ metadata.gz: 2887ee224b4a23684b50a3ad15cd4aabaab666f1e9b937f91b3d1492045fadc9a85f4322a7899ca581f4b914ef393f90610206f1014c47c3b3b9b13c17f4c431
7
+ data.tar.gz: 6dd23b22cf807f33363b45b5a9137f6153dd8b1961413ab0736b78f4322843d6c0488441e1ec0a5f9d47ae480938ff78bbfe2a1a47c239a31ed4744f5f227195
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -26,7 +26,7 @@ jobs:
26
26
  strategy:
27
27
  fail-fast: false
28
28
  matrix:
29
- ruby: [3.0, 3.1, 3.2, 3.3]
29
+ ruby: [3.2, 3.3, head]
30
30
 
31
31
  steps:
32
32
  - uses: actions/checkout@v4
data/Gemfile CHANGED
@@ -11,4 +11,5 @@ group :development, :test do
11
11
  gem "rspec"
12
12
  gem "nokogiri"
13
13
  gem "standard"
14
+ gem "csv"
14
15
  end
data/Gemfile.lock CHANGED
@@ -1,46 +1,53 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (7.1.3.2)
4
+ activesupport (8.0.1)
5
5
  base64
6
+ benchmark (>= 0.3)
6
7
  bigdecimal
7
- concurrent-ruby (~> 1.0, >= 1.0.2)
8
+ concurrent-ruby (~> 1.0, >= 1.3.1)
8
9
  connection_pool (>= 2.2.5)
9
10
  drb
10
11
  i18n (>= 1.6, < 2)
12
+ logger (>= 1.4.2)
11
13
  minitest (>= 5.1)
12
- mutex_m
13
- tzinfo (~> 2.0)
14
- addressable (2.8.4)
15
- public_suffix (>= 2.0.2, < 6.0)
14
+ securerandom (>= 0.3)
15
+ tzinfo (~> 2.0, >= 2.0.5)
16
+ uri (>= 0.13.1)
17
+ addressable (2.8.7)
18
+ public_suffix (>= 2.0.2, < 7.0)
16
19
  api_cache (0.3.0)
17
20
  ast (2.4.2)
18
21
  base64 (0.2.0)
19
- bigdecimal (3.1.6)
22
+ benchmark (0.4.0)
23
+ bigdecimal (3.1.8)
20
24
  colorator (1.1.0)
21
- concurrent-ruby (1.2.3)
25
+ concurrent-ruby (1.3.4)
22
26
  connection_pool (2.4.1)
23
- diff-lcs (1.5.0)
24
- drb (2.2.0)
25
- ruby2_keywords
27
+ csv (3.3.0)
28
+ diff-lcs (1.5.1)
29
+ drb (2.2.1)
26
30
  em-websocket (0.5.3)
27
31
  eventmachine (>= 0.12.9)
28
32
  http_parser.rb (~> 0)
29
33
  eventmachine (1.2.7)
30
- ffi (1.15.5)
34
+ ffi (1.17.0)
31
35
  forwardable-extended (2.6.0)
32
- google-protobuf (3.23.3)
36
+ google-protobuf (4.29.1)
37
+ bigdecimal
38
+ rake (>= 13)
33
39
  http_parser.rb (0.8.0)
34
- i18n (1.14.1)
40
+ i18n (1.14.6)
35
41
  concurrent-ruby (~> 1.0)
36
- icalendar (2.10.1)
42
+ icalendar (2.10.3)
37
43
  ice_cube (~> 0.16)
44
+ ostruct
38
45
  icalendar-recurrence (1.2.0)
39
46
  icalendar (~> 2.0)
40
47
  ice_cube (~> 0.16)
41
48
  tzinfo (~> 2.0)
42
- ice_cube (0.16.4)
43
- jekyll (4.3.2)
49
+ ice_cube (0.17.0)
50
+ jekyll (4.3.4)
44
51
  addressable (~> 2.4)
45
52
  colorator (~> 1.0)
46
53
  em-websocket (~> 0.5)
@@ -60,93 +67,94 @@ GEM
60
67
  sass-embedded (~> 1.54)
61
68
  jekyll-watch (2.2.1)
62
69
  listen (~> 3.0)
63
- json (2.7.2)
64
- kramdown (2.4.0)
65
- rexml
70
+ json (2.9.0)
71
+ kramdown (2.5.1)
72
+ rexml (>= 3.3.9)
66
73
  kramdown-parser-gfm (1.1.0)
67
74
  kramdown (~> 2.0)
68
75
  language_server-protocol (3.17.0.3)
69
76
  lint_roller (1.1.0)
70
77
  liquid (4.0.4)
71
- listen (3.8.0)
78
+ listen (3.9.0)
72
79
  rb-fsevent (~> 0.10, >= 0.10.3)
73
80
  rb-inotify (~> 0.9, >= 0.9.10)
81
+ logger (1.6.3)
74
82
  mercenary (0.4.0)
75
- mini_portile2 (2.8.2)
76
- minitest (5.22.2)
77
- mutex_m (0.2.0)
78
- nokogiri (1.15.2)
83
+ mini_portile2 (2.8.8)
84
+ minitest (5.25.4)
85
+ nokogiri (1.17.2)
79
86
  mini_portile2 (~> 2.8.2)
80
87
  racc (~> 1.4)
81
- parallel (1.25.1)
82
- parser (3.3.4.0)
88
+ ostruct (0.6.1)
89
+ parallel (1.26.3)
90
+ parser (3.3.6.0)
83
91
  ast (~> 2.4.1)
84
92
  racc
85
93
  pathutil (0.16.2)
86
94
  forwardable-extended (~> 2.6)
87
- public_suffix (5.0.1)
88
- racc (1.7.1)
95
+ public_suffix (6.0.1)
96
+ racc (1.8.1)
89
97
  rainbow (3.1.1)
90
- rake (13.0.6)
98
+ rake (13.2.1)
91
99
  rb-fsevent (0.11.2)
92
- rb-inotify (0.10.1)
100
+ rb-inotify (0.11.1)
93
101
  ffi (~> 1.0)
94
- regexp_parser (2.9.2)
95
- rexml (3.2.5)
96
- rouge (4.1.2)
97
- rspec (3.12.0)
98
- rspec-core (~> 3.12.0)
99
- rspec-expectations (~> 3.12.0)
100
- rspec-mocks (~> 3.12.0)
101
- rspec-core (3.12.2)
102
- rspec-support (~> 3.12.0)
103
- rspec-expectations (3.12.3)
102
+ regexp_parser (2.9.3)
103
+ rexml (3.3.9)
104
+ rouge (4.5.1)
105
+ rspec (3.13.0)
106
+ rspec-core (~> 3.13.0)
107
+ rspec-expectations (~> 3.13.0)
108
+ rspec-mocks (~> 3.13.0)
109
+ rspec-core (3.13.2)
110
+ rspec-support (~> 3.13.0)
111
+ rspec-expectations (3.13.3)
104
112
  diff-lcs (>= 1.2.0, < 2.0)
105
- rspec-support (~> 3.12.0)
106
- rspec-mocks (3.12.5)
113
+ rspec-support (~> 3.13.0)
114
+ rspec-mocks (3.13.2)
107
115
  diff-lcs (>= 1.2.0, < 2.0)
108
- rspec-support (~> 3.12.0)
109
- rspec-support (3.12.1)
110
- rubocop (1.64.1)
116
+ rspec-support (~> 3.13.0)
117
+ rspec-support (3.13.2)
118
+ rubocop (1.69.2)
111
119
  json (~> 2.3)
112
120
  language_server-protocol (>= 3.17.0)
113
121
  parallel (~> 1.10)
114
122
  parser (>= 3.3.0.2)
115
123
  rainbow (>= 2.2.2, < 4.0)
116
- regexp_parser (>= 1.8, < 3.0)
117
- rexml (>= 3.2.5, < 4.0)
118
- rubocop-ast (>= 1.31.1, < 2.0)
124
+ regexp_parser (>= 2.9.3, < 3.0)
125
+ rubocop-ast (>= 1.36.2, < 2.0)
119
126
  ruby-progressbar (~> 1.7)
120
- unicode-display_width (>= 2.4.0, < 3.0)
121
- rubocop-ast (1.31.3)
127
+ unicode-display_width (>= 2.4.0, < 4.0)
128
+ rubocop-ast (1.37.0)
122
129
  parser (>= 3.3.1.0)
123
- rubocop-performance (1.21.1)
130
+ rubocop-performance (1.23.0)
124
131
  rubocop (>= 1.48.1, < 2.0)
125
132
  rubocop-ast (>= 1.31.1, < 2.0)
126
133
  ruby-progressbar (1.13.0)
127
- ruby2_keywords (0.0.5)
128
134
  safe_yaml (1.0.5)
129
- sass-embedded (1.63.6)
130
- google-protobuf (~> 3.23)
131
- rake (>= 13.0.0)
132
- standard (1.39.2)
135
+ sass-embedded (1.83.0)
136
+ google-protobuf (~> 4.28)
137
+ rake (>= 13)
138
+ securerandom (0.4.0)
139
+ standard (1.43.0)
133
140
  language_server-protocol (~> 3.17.0.2)
134
141
  lint_roller (~> 1.0)
135
- rubocop (~> 1.64.0)
142
+ rubocop (~> 1.69.1)
136
143
  standard-custom (~> 1.0.0)
137
- standard-performance (~> 1.4)
144
+ standard-performance (~> 1.6)
138
145
  standard-custom (1.0.2)
139
146
  lint_roller (~> 1.0)
140
147
  rubocop (~> 1.50)
141
- standard-performance (1.4.0)
148
+ standard-performance (1.6.0)
142
149
  lint_roller (~> 1.1)
143
- rubocop-performance (~> 1.21.0)
150
+ rubocop-performance (~> 1.23.0)
144
151
  terminal-table (3.0.2)
145
152
  unicode-display_width (>= 1.1.1, < 3)
146
153
  tzinfo (2.0.6)
147
154
  concurrent-ruby (~> 1.0)
148
- unicode-display_width (2.4.2)
149
- webrick (1.8.1)
155
+ unicode-display_width (2.6.0)
156
+ uri (1.0.2)
157
+ webrick (1.9.1)
150
158
 
151
159
  PLATFORMS
152
160
  ruby
@@ -154,6 +162,7 @@ PLATFORMS
154
162
  DEPENDENCIES
155
163
  activesupport
156
164
  api_cache
165
+ csv
157
166
  icalendar (~> 2.10.1)
158
167
  icalendar-recurrence
159
168
  jekyll
data/README.md CHANGED
@@ -33,6 +33,21 @@ plugins:
33
33
  {% endical %}
34
34
  ```
35
35
 
36
+ ### Empty state
37
+
38
+ Use the `{% empty %}` tag to display fallback content when the calendar has no events:
39
+
40
+ ```html
41
+ {% ical url: https://space.floern.com/launch.ics only_future: true %}
42
+ <div class="event">
43
+ <h3>{{ event.summary }}</h3>
44
+ <p>{{ event.dtstart | date: "%B %d, %Y" }}</p>
45
+ </div>
46
+ {% empty %}
47
+ <p>No upcoming events scheduled.</p>
48
+ {% endical %}
49
+ ```
50
+
36
51
  ## Options
37
52
 
38
53
  - `reverse` - Defaults to 'false', ordering events by start_time (or reverse start_time).
@@ -36,6 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "icalendar", "~> 2.10.1"
37
37
  spec.add_dependency "icalendar-recurrence"
38
38
 
39
- spec.add_development_dependency "bundler", "~> 1.15"
39
+ spec.add_development_dependency "bundler", "~> 2.2"
40
40
  spec.add_development_dependency "rspec", "~> 3.5"
41
41
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class IcalTag < Liquid::Block
5
- VERSION = "1.6.0"
5
+ VERSION = "1.7.0"
6
6
  end
7
7
  end
@@ -17,6 +17,8 @@ module Jekyll
17
17
  super
18
18
  @markup = markup
19
19
  @attributes = {}
20
+ @main_block = Liquid::BlockBody.new
21
+ @empty_block = nil
20
22
 
21
23
  scan_attributes!
22
24
  set_limit!
@@ -24,6 +26,20 @@ module Jekyll
24
26
  set_only!
25
27
  end
26
28
 
29
+ def parse(tokens)
30
+ return unless parse_body(@main_block, tokens)
31
+ parse_body(@empty_block, tokens)
32
+ end
33
+
34
+ def nodelist
35
+ @empty_block ? [@main_block, @empty_block] : [@main_block]
36
+ end
37
+
38
+ def unknown_tag(tag, markup, tokens)
39
+ return super unless tag == "empty"
40
+ @empty_block = Liquid::BlockBody.new
41
+ end
42
+
27
43
  def render(context)
28
44
  self.context = context
29
45
  context.registers[:ical] ||= Hash.new(0)
@@ -48,47 +64,46 @@ module Jekyll
48
64
  recurring_end_date: @recurring_end_date
49
65
  )
50
66
  events = calendar_feed_coordinator.events
51
- event_count = events.length
52
-
53
- events.each_with_index do |event, index|
54
- # Init
55
- context["event"] = {}
56
-
57
- # Jekyll helper variables
58
- context["event"]["index"] = index
59
-
60
- # RFC 5545 conformant and custom properties.
61
- context["event"].merge!(event.all_properties)
62
-
63
- # Supported but non-standard attributes.
64
- context["event"]["attendees"] = event.attendees
65
- context["event"]["simple_html_description"] = event.simple_html_description
66
-
67
- # Overridden values
68
- context["event"]["url"] ||= event.description_urls.first
69
-
70
- # Deprecated attribute names.
71
- context["event"]["end_time"] = context["event"]["dtend"]
72
- context["event"]["start_time"] = context["event"]["dtstart"]
73
-
74
- context["forloop"] = {
75
- "name" => "ical",
76
- "length" => event_count,
77
- "index" => index + 1,
78
- "index0" => index,
79
- "rindex" => event_count - index,
80
- "rindex0" => event_count - index - 1,
81
- "first" => (index == 0),
82
- "last" => (index == event_count - 1)
83
- }
84
-
85
- result << nodelist.map do |n|
86
- if n.respond_to? :render
87
- n.render(context)
88
- else
89
- n
90
- end
91
- end.join
67
+
68
+ if events.empty?
69
+ result << @empty_block.render(context) if @empty_block
70
+ else
71
+ event_count = events.length
72
+
73
+ events.each_with_index do |event, index|
74
+ # Init
75
+ context["event"] = {}
76
+
77
+ # Jekyll helper variables
78
+ context["event"]["index"] = index
79
+
80
+ # RFC 5545 conformant and custom properties.
81
+ context["event"].merge!(event.all_properties)
82
+
83
+ # Supported but non-standard attributes.
84
+ context["event"]["attendees"] = event.attendees
85
+ context["event"]["simple_html_description"] = event.simple_html_description
86
+
87
+ # Overridden values
88
+ context["event"]["url"] ||= event.description_urls.first
89
+
90
+ # Deprecated attribute names.
91
+ context["event"]["end_time"] = context["event"]["dtend"]
92
+ context["event"]["start_time"] = context["event"]["dtstart"]
93
+
94
+ context["forloop"] = {
95
+ "name" => "ical",
96
+ "length" => event_count,
97
+ "index" => index + 1,
98
+ "index0" => index,
99
+ "rindex" => event_count - index,
100
+ "rindex0" => event_count - index - 1,
101
+ "first" => (index == 0),
102
+ "last" => (index == event_count - 1)
103
+ }
104
+
105
+ result << @main_block.render(context)
106
+ end
92
107
  end
93
108
  end
94
109
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ical-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Chilcott
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-07-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: jekyll
@@ -86,14 +85,14 @@ dependencies:
86
85
  requirements:
87
86
  - - "~>"
88
87
  - !ruby/object:Gem::Version
89
- version: '1.15'
88
+ version: '2.2'
90
89
  type: :development
91
90
  prerelease: false
92
91
  version_requirements: !ruby/object:Gem::Requirement
93
92
  requirements:
94
93
  - - "~>"
95
94
  - !ruby/object:Gem::Version
96
- version: '1.15'
95
+ version: '2.2'
97
96
  - !ruby/object:Gem::Dependency
98
97
  name: rspec
99
98
  requirement: !ruby/object:Gem::Requirement
@@ -108,13 +107,13 @@ dependencies:
108
107
  - - "~>"
109
108
  - !ruby/object:Gem::Version
110
109
  version: '3.5'
111
- description:
112
110
  email:
113
111
  - ricky@rakefire.io
114
112
  executables: []
115
113
  extensions: []
116
114
  extra_rdoc_files: []
117
115
  files:
116
+ - ".github/dependabot.yml"
118
117
  - ".github/workflows/build.yml"
119
118
  - ".gitignore"
120
119
  - ".rspec"
@@ -138,7 +137,6 @@ licenses:
138
137
  - MIT
139
138
  metadata:
140
139
  allowed_push_host: https://rubygems.org
141
- post_install_message:
142
140
  rdoc_options: []
143
141
  require_paths:
144
142
  - lib
@@ -153,8 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
151
  - !ruby/object:Gem::Version
154
152
  version: '0'
155
153
  requirements: []
156
- rubygems_version: 3.5.9
157
- signing_key:
154
+ rubygems_version: 3.7.1
158
155
  specification_version: 4
159
156
  summary: A Jekyll plugin to pull ICS feed and provide a for-like loop of calendar
160
157
  events