jekyll-ical-tag 1.1.0 → 1.2.4

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: cdb49ea6fd0b6d006435344649a8a7d30f19155f7e1424683d8774b59e9bdcf2
4
- data.tar.gz: e323590a17d904763e2169446a2152b24eeb90629fd4f88bba0adbac1bde523c
3
+ metadata.gz: 56b34cd54ee295b4125928f2d1c0ab010fc73073f013afcd485d3f94f2f7d1e7
4
+ data.tar.gz: 6c04c4593314888e2f9f4dfbf13f9b3bd980d0739d5661bbf41243d1d8834cc8
5
5
  SHA512:
6
- metadata.gz: 6b3abd193f1de3eea850f2218ad8f42b7186e889b9915335a5da89418d59913898e09dc84e9f1d5fcf858eff2e9f49d4e0b960494fa2d930e3e2cfe75ff941a6
7
- data.tar.gz: 93db87869c4f8d9b8c0e019a0e6c9bdd201d30a6b1edae8a0f1b1c3a68beeaa3fe1940435fbefb78cb521b2364b9955492657fb0f3f93278253e60232bb2c833
6
+ metadata.gz: 69a6fd90da57c3b2b2a26065f83d4197d82e8e8fcba655acaba83485e56dd26a23dfda4b5353491027146045f740649ce01897552e9a433292fe45f9b88aa0bc
7
+ data.tar.gz: dbdbb209e8fdfed7653383ffac23c45b00579a4384789c8e11d01110de3f62fe92dae6701eb8dd231e8ab4f4d48a1979f563474b22895b1b5388b8d148004b2f
data/Gemfile CHANGED
@@ -7,7 +7,6 @@ gem 'icalendar'
7
7
  gem 'activesupport'
8
8
 
9
9
  group :development, :test do
10
- gem 'pry'
11
10
  gem 'rspec'
12
11
  gem 'nokogiri'
13
12
  end
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (5.2.1)
4
+ activesupport (5.2.4.3)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.2)
6
6
  i18n (>= 0.7, < 2)
7
7
  minitest (~> 5.1)
@@ -9,9 +9,8 @@ GEM
9
9
  addressable (2.7.0)
10
10
  public_suffix (>= 2.0.2, < 5.0)
11
11
  api_cache (0.3.0)
12
- coderay (1.1.2)
13
12
  colorator (1.1.0)
14
- concurrent-ruby (1.0.5)
13
+ concurrent-ruby (1.1.6)
15
14
  diff-lcs (1.3)
16
15
  em-websocket (0.5.1)
17
16
  eventmachine (>= 0.12.9)
@@ -20,7 +19,7 @@ GEM
20
19
  ffi (1.12.2)
21
20
  forwardable-extended (2.6.0)
22
21
  http_parser.rb (0.6.0)
23
- i18n (1.1.1)
22
+ i18n (1.8.2)
24
23
  concurrent-ruby (~> 1.0)
25
24
  icalendar (2.5.0)
26
25
  ice_cube (~> 0.16)
@@ -44,7 +43,8 @@ GEM
44
43
  sassc (> 2.0.1, < 3.0)
45
44
  jekyll-watch (2.2.1)
46
45
  listen (~> 3.0)
47
- kramdown (2.1.0)
46
+ kramdown (2.3.0)
47
+ rexml
48
48
  kramdown-parser-gfm (1.1.0)
49
49
  kramdown (~> 2.0)
50
50
  liquid (4.0.3)
@@ -52,20 +52,17 @@ GEM
52
52
  rb-fsevent (~> 0.10, >= 0.10.3)
53
53
  rb-inotify (~> 0.9, >= 0.9.10)
54
54
  mercenary (0.3.6)
55
- method_source (0.9.0)
56
55
  mini_portile2 (2.4.0)
57
- minitest (5.11.3)
56
+ minitest (5.14.1)
58
57
  nokogiri (1.10.8)
59
58
  mini_portile2 (~> 2.4.0)
60
59
  pathutil (0.16.2)
61
60
  forwardable-extended (~> 2.6)
62
- pry (0.11.3)
63
- coderay (~> 1.1.0)
64
- method_source (~> 0.9.0)
65
61
  public_suffix (4.0.3)
66
62
  rb-fsevent (0.10.3)
67
63
  rb-inotify (0.10.1)
68
64
  ffi (~> 1.0)
65
+ rexml (3.2.4)
69
66
  rouge (3.17.0)
70
67
  rspec (3.7.0)
71
68
  rspec-core (~> 3.7.0)
@@ -86,7 +83,7 @@ GEM
86
83
  terminal-table (1.8.0)
87
84
  unicode-display_width (~> 1.1, >= 1.1.1)
88
85
  thread_safe (0.3.6)
89
- tzinfo (1.2.5)
86
+ tzinfo (1.2.7)
90
87
  thread_safe (~> 0.1)
91
88
  unicode-display_width (1.7.0)
92
89
 
@@ -99,7 +96,6 @@ DEPENDENCIES
99
96
  icalendar
100
97
  jekyll
101
98
  nokogiri
102
- pry
103
99
  rspec
104
100
 
105
101
  BUNDLED WITH
@@ -30,11 +30,10 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r!^exe/!) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "jekyll", "~> 3"
33
+ spec.add_dependency "jekyll", "> 3"
34
34
  spec.add_dependency "api_cache"
35
35
  spec.add_dependency "activesupport"
36
36
  spec.add_dependency "icalendar"
37
- spec.add_dependency "pry"
38
37
 
39
38
  spec.add_development_dependency "bundler", "~> 1.15"
40
39
  spec.add_development_dependency "rspec", "~> 3.5"
@@ -31,8 +31,7 @@ module Jekyll
31
31
  result = []
32
32
 
33
33
  context.stack do
34
- url = get_url_from_assigned_value(context) ||
35
- get_url_from_page_attributes(context) ||
34
+ url = get_dereferenced_url(context) ||
36
35
  @url
37
36
 
38
37
  raise "No URL provided or in innapropriate form '#{url}'" unless is_valid_url?(url)
@@ -79,6 +78,8 @@ module Jekyll
79
78
  value.force_encoding("UTF-8")
80
79
  when Date, Icalendar::Values::DateTime
81
80
  value.to_time
81
+ when Icalendar::Values::Uri
82
+ value.to_s
82
83
  else
83
84
  value
84
85
  end
@@ -115,19 +116,10 @@ module Jekyll
115
116
  !!(url =~ URI::regexp)
116
117
  end
117
118
 
118
- def get_url_from_page_attributes(context)
119
- # Dereference url from something like "page.calender_url" to the page's calendar_url
120
- dig_attrs = @url.split(".")
121
- dig_attrs[0] = dig_attrs[0].to_sym if dig_attrs[0].present?
119
+ def get_dereferenced_url(context)
120
+ return unless context.key?(@url)
122
121
 
123
- context.registers.dig(*dig_attrs) # will return result or nil (if not found)
124
- end
125
-
126
- def get_url_from_assigned_value(context)
127
- return unless scope = context.scopes.find { |scope| scope[@url] }
128
-
129
- # Dereference the URL if we were passed a variable name.
130
- scope[@url]
122
+ context[@url]
131
123
  end
132
124
 
133
125
  def scan_attributes!
@@ -6,7 +6,27 @@ require "uri"
6
6
  module Jekyll
7
7
  class IcalTag
8
8
  class Event
9
- URL_REGEX = /(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?/
9
+ URL_REGEX = /
10
+ (?:(?:https?|ftp):\/\/) # Allowable schemes
11
+ (?:\S+(?::\S*)?@)? # username:password, which is optional
12
+ (?: # Domain part follows; non-capturing
13
+ # These IP addresses are valid domain values
14
+ (?!10(?:\.\d{1,3}){3})
15
+ (?!127(?:\.\d{1,3}){3})
16
+ (?!169\.254(?:\.\d{1,3}){2})
17
+ (?!192\.168(?:\.\d{1,3}){2})
18
+ (?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})
19
+ (?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])
20
+ (?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}
21
+ (?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))
22
+ |
23
+ (?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)
24
+ (?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*
25
+ (?:\.(?:[a-z\u00a1-\uffff]{2,}))
26
+ )
27
+ (?::\d{2,5})? # Optional port number
28
+ (?:\/[^\s"]*)? # Anything that is not a space or a double quote
29
+ /x
10
30
  extend Forwardable
11
31
 
12
32
  def initialize(event)
@@ -35,7 +55,7 @@ module Jekyll
35
55
  @simple_html_description ||= begin
36
56
  description&.clone.tap do |d|
37
57
  description_urls.each do |url|
38
- d.gsub! url, %(<a href='#{url}'>#{url}</a>)
58
+ d.force_encoding("UTF-8").gsub! url, %(<a href='#{url}'>#{url}</a>)
39
59
  end
40
60
  end
41
61
  end
@@ -46,7 +66,7 @@ module Jekyll
46
66
  end
47
67
 
48
68
  def description_urls
49
- @description_urls ||= description.to_s.scan(URL_REGEX).to_a
69
+ @description_urls ||= description.to_s.force_encoding("UTF-8").scan(URL_REGEX).to_a
50
70
  end
51
71
 
52
72
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class IcalTag < Liquid::Block
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ical-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Chilcott
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3'
27
27
  - !ruby/object:Gem::Dependency
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: bundler
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +94,7 @@ dependencies:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
96
  version: '3.5'
111
- description:
97
+ description:
112
98
  email:
113
99
  - ricky@rakefire.io
114
100
  executables: []
@@ -132,7 +118,7 @@ licenses:
132
118
  - MIT
133
119
  metadata:
134
120
  allowed_push_host: https://rubygems.org
135
- post_install_message:
121
+ post_install_message:
136
122
  rdoc_options: []
137
123
  require_paths:
138
124
  - lib
@@ -148,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
134
  version: '0'
149
135
  requirements: []
150
136
  rubygems_version: 3.1.2
151
- signing_key:
137
+ signing_key:
152
138
  specification_version: 4
153
139
  summary: A Jekyll plugin to pull ICS feed and provide a for-like loop of calendar
154
140
  events