jekyll-ical-tag 1.0.2 → 1.0.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: 5b682456bd14cbe8d3461a834f13069b3a3f21b784262cd34539544f7f75cf1d
4
- data.tar.gz: 7b8e9cf431e0461b8e42e8dd9dee886e3ac162b3ea98803827b1f4eca7f8dc14
3
+ metadata.gz: 89414a4e5d53342a51bd18b90035331494b1a7d718dfcbe8705aa20a9e3d1e1d
4
+ data.tar.gz: 06157166f55b9e8b6b9264d39f2bb6619e610e19db0b5a039c61291a252ee296
5
5
  SHA512:
6
- metadata.gz: 2f85c6e83e0169978388495bb42ed92a4015aa6a7db3445fd574e056f23de724980933c466415ef50a26214dd3150a29640d163b21a2c86266eaf1bdb43c740a
7
- data.tar.gz: 6616759701233047f4fd9994ff4d2d58426900d3e30fb46fcf19628719d400b9ffa86321417ea0876ac3bea6d0b257f8922fe73be526c5ebb410b2e73253bdb2
6
+ metadata.gz: a00924f04b4e499e93aefa24a898c16c08ddbca5b700545cefad9709d2196dc96f4d3f38bd527cfb116952bafecbcfd54282baf1e01da30d51ccd265ae3b112d
7
+ data.tar.gz: fd81c2593db6517ca458560bce823778ec595765a0716d7365cade974d4e3204008aa3782903753d2ee1614ce5049708831cc924dbf0107650a049806114748a
data/_plugins/ical_tag.rb CHANGED
@@ -89,30 +89,29 @@ module Jekyll
89
89
 
90
90
  context.stack do
91
91
  events.each_with_index do |event, index|
92
-
93
- attendees = event.attendee.map(&:to_s).map {|a| a.slice!("mailto:"); a }
94
-
95
- context['event'] = {
96
- 'index' => index,
97
- 'uid' => event.uid,
98
- 'summary' => event.summary,
99
- 'description' => event.description,
100
- 'location' => event.location,
101
- 'url' => event.url&.to_s,
102
- 'start_time' => event.dtstart&.to_time,
103
- 'end_time' => event.dtend&.to_time,
104
- 'attendees' => attendees,
92
+ attendees = event.attendee.map(&:to_s).map { |a| a.slice!("mailto:"); a }
93
+
94
+ context["event"] = {
95
+ "index" => index,
96
+ "uid" => event.uid,
97
+ "summary" => event.summary,
98
+ "description" => event.description,
99
+ "location" => event.location,
100
+ "url" => event.url&.to_s,
101
+ "start_time" => event.dtstart&.to_time,
102
+ "end_time" => event.dtend&.to_time,
103
+ "attendees" => attendees,
105
104
  }
106
105
 
107
- context['forloop'] = {
108
- 'name' => 'calendar',
109
- 'length' => length,
110
- 'index' => index + 1,
111
- 'index0' => index,
112
- 'rindex' => length - index,
113
- 'rindex0' => length - index - 1,
114
- 'first' => (index == 0),
115
- 'last' => (index == length - 1)
106
+ context["forloop"] = {
107
+ "name" => "calendar",
108
+ "length" => length,
109
+ "index" => index + 1,
110
+ "index0" => index,
111
+ "rindex" => length - index,
112
+ "rindex0" => length - index - 1,
113
+ "first" => (index == 0),
114
+ "last" => (index == length - 1),
116
115
  }
117
116
 
118
117
  result << nodelist.map do |n|
@@ -138,11 +137,11 @@ module Jekyll
138
137
  end
139
138
 
140
139
  def set_reverse!
141
- @reverse = @attributes['order'] == 'reverse'
140
+ @reverse = @attributes["order"] == "reverse"
142
141
  end
143
142
 
144
143
  def set_url!
145
- @url = @attributes['url']
144
+ @url = @attributes["url"]
146
145
  raise "No URL provided" unless @url
147
146
  end
148
147
 
@@ -165,8 +164,8 @@ module Jekyll
165
164
  def set_before_date!
166
165
  @before_date =
167
166
  begin
168
- if @attributes['before_date']
169
- Time.parse(@attributes['before_date'])
167
+ if @attributes["before_date"]
168
+ Time.parse(@attributes["before_date"])
170
169
  end
171
170
  rescue => e
172
171
  nil
@@ -176,8 +175,8 @@ module Jekyll
176
175
  def set_after_date!
177
176
  @after_date =
178
177
  begin
179
- if @attributes['after_date']
180
- Time.parse(@attributes['after_date'])
178
+ if @attributes["after_date"]
179
+ Time.parse(@attributes["after_date"])
181
180
  end
182
181
  rescue => e
183
182
  nil
@@ -186,4 +185,4 @@ module Jekyll
186
185
  end
187
186
  end
188
187
 
189
- Liquid::Template.register_tag('ical', Jekyll::CalendarTag)
188
+ Liquid::Template.register_tag("ical", Jekyll::CalendarTag)
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+
3
+ rm *.gem
4
+ gem build jekyll-ical-tag.gemspec
5
+ gem push jekyll-ical-tag-*.gem
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Jekyll
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "api_cache"
@@ -15,7 +16,7 @@ module Jekyll
15
16
  @events ||= begin
16
17
  Icalendar::Event.parse(ics_feed)
17
18
  .sort { |e1, e2| e1.dtstart <=> e2.dtstart }
18
- .map{|e| Jekyll::IcalTag::Event.new(e) }
19
+ .map { |e| Jekyll::IcalTag::Event.new(e) }
19
20
  end
20
21
  end
21
22
 
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "uri"
@@ -25,11 +26,11 @@ module Jekyll
25
26
  end
26
27
 
27
28
  def attendees
28
- attendee.map(&:to_s).map {|a| a.slice!("mailto:"); a }
29
+ attendee.map(&:to_s).map { |a| a.slice!("mailto:"); a }
29
30
  end
30
31
 
31
32
  def description_urls
32
- @description_urls ||= description.scan(URL_REGEX).to_a
33
+ @description_urls ||= description.to_s.force_encoding("UTF-8").scan(URL_REGEX).to_a
33
34
  end
34
35
 
35
36
  private
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Jekyll
5
5
  class IcalTag < Liquid::Block
6
- VERSION = "1.0.2"
6
+ VERSION = "1.0.3"
7
7
  end
8
8
  end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require "jekyll"
@@ -40,28 +41,28 @@ module Jekyll
40
41
 
41
42
  context.stack do
42
43
  events.each_with_index do |event, index|
43
- context['event'] = {
44
- 'index' => index,
45
- 'uid' => event.uid.presence,
46
- 'summary' => event.summary.presence,
47
- 'description' => event.description.presence,
48
- 'simple_html_description' => event.simple_html_description.presence,
49
- 'location' => event.location.presence,
50
- 'url' => event.url&.to_s.presence || event.description_urls.first,
51
- 'start_time' => event.dtstart&.to_time.presence,
52
- 'end_time' => event.dtend&.to_time.presence,
53
- 'attendees' => event.attendees,
44
+ context["event"] = {
45
+ "index" => index,
46
+ "uid" => event.uid.presence,
47
+ "summary" => event.summary.presence,
48
+ "description" => event.description.presence,
49
+ "simple_html_description" => event.simple_html_description.presence,
50
+ "location" => event.location.presence,
51
+ "url" => event.url&.to_s.presence || event.description_urls.first,
52
+ "start_time" => event.dtstart&.to_time.presence,
53
+ "end_time" => event.dtend&.to_time.presence,
54
+ "attendees" => event.attendees,
54
55
  }
55
56
 
56
- context['forloop'] = {
57
- 'name' => 'ical',
58
- 'length' => length,
59
- 'index' => index + 1,
60
- 'index0' => index,
61
- 'rindex' => length - index,
62
- 'rindex0' => length - index - 1,
63
- 'first' => (index == 0),
64
- 'last' => (index == length - 1)
57
+ context["forloop"] = {
58
+ "name" => "ical",
59
+ "length" => length,
60
+ "index" => index + 1,
61
+ "index0" => index,
62
+ "rindex" => length - index,
63
+ "rindex0" => length - index - 1,
64
+ "first" => (index == 0),
65
+ "last" => (index == length - 1),
65
66
  }
66
67
 
67
68
  result << nodelist.map do |n|
@@ -87,11 +88,11 @@ module Jekyll
87
88
  end
88
89
 
89
90
  def set_reverse!
90
- @reverse = @attributes['order'] == 'reverse'
91
+ @reverse = @attributes["order"] == "reverse"
91
92
  end
92
93
 
93
94
  def set_url!
94
- @url = @attributes['url']
95
+ @url = @attributes["url"]
95
96
  raise "No URL provided" unless @url
96
97
  end
97
98
 
@@ -114,8 +115,8 @@ module Jekyll
114
115
  def set_before_date!
115
116
  @before_date =
116
117
  begin
117
- if @attributes['before_date']
118
- Time.parse(@attributes['before_date'])
118
+ if @attributes["before_date"]
119
+ Time.parse(@attributes["before_date"])
119
120
  end
120
121
  rescue => e
121
122
  nil
@@ -125,8 +126,8 @@ module Jekyll
125
126
  def set_after_date!
126
127
  @after_date =
127
128
  begin
128
- if @attributes['after_date']
129
- Time.parse(@attributes['after_date'])
129
+ if @attributes["after_date"]
130
+ Time.parse(@attributes["after_date"])
130
131
  end
131
132
  rescue => e
132
133
  nil
@@ -135,4 +136,4 @@ module Jekyll
135
136
  end
136
137
  end
137
138
 
138
- Liquid::Template.register_tag('ical', Jekyll::IcalTag)
139
+ Liquid::Template.register_tag("ical", Jekyll::IcalTag)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ical-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Chilcott
@@ -120,6 +120,7 @@ files:
120
120
  - Gemfile.lock
121
121
  - README.md
122
122
  - _plugins/ical_tag.rb
123
+ - bin/build-and-publish-gem
123
124
  - jekyll-ical-tag.gemspec
124
125
  - lib/jekyll-ical-tag.rb
125
126
  - lib/jekyll-ical-tag/calendar_limiter.rb