jekyll-indico 0.5.0 → 0.6.2

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
- SHA1:
3
- metadata.gz: 4e2a1ea8813f626061be2c5da553cafe9453aaac
4
- data.tar.gz: '06758dd8b0908b58f065a13a5fc8f8990ff1ab0d'
2
+ SHA256:
3
+ metadata.gz: d124f3713e35e2ad776692c06116ebc2dba52358beeb11a7389afb05c2038cad
4
+ data.tar.gz: 2ed50d8baf327069145f520a8ed18d87d998966f8c4d770e62df50cc640d0fdf
5
5
  SHA512:
6
- metadata.gz: 7f909dd6bffbd0f595c03daa73d2da3fc234a3ff9f72ccca3e35e532a962dada79dc5be4f978b3aa4e4c92edbb6248807d03be92e08658fb7d45c679576a4dc1
7
- data.tar.gz: 246baf00d16729890482b79743ef9c625e6976c52bf8c336c91b66bfd039c6a6c3f1333f6984e393e8de366b391ce6be2b499b1ddd257a7b50161b42550967ad
6
+ metadata.gz: 6a188068b5e19e3349779d4c1286ab9b61643da46b0d1d85fcbff8b8588816c6d6893d9822b393bda3ee60c56a37243a028ffa9cb98c168be1a936e2af89d511
7
+ data.tar.gz: a75b07944de85ab2b2b2ad14cd1d664f7f0c50e10086758d888a509e79ff5149897611e9a4bcba06cf9ee5cafffab105669eca350078c945f98c379e4b1ced22
@@ -7,15 +7,24 @@ on:
7
7
  branches:
8
8
  - main
9
9
 
10
+ concurrency:
11
+ group: test-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
10
14
  jobs:
11
15
  test:
12
16
  runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ ruby: [2.6, 3.1]
13
21
 
14
22
  steps:
15
- - uses: actions/checkout@v2
23
+ - uses: actions/checkout@v3
16
24
 
17
25
  - uses: ruby/setup-ruby@v1
18
26
  with:
27
+ ruby-version: ${{ matrix.ruby }}
19
28
  bundler-cache: true
20
29
 
21
30
  - name: Style checking
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.1.0
3
+ rev: v4.2.0
4
4
  hooks:
5
5
  - id: check-added-large-files
6
6
  - id: mixed-line-ending
@@ -11,7 +11,7 @@ repos:
11
11
  - id: check-yaml
12
12
 
13
13
  - repo: https://github.com/Lucas-C/pre-commit-hooks
14
- rev: v1.1.11
14
+ rev: v1.1.13
15
15
  hooks:
16
16
  - id: remove-crlf
17
17
  - id: forbid-tabs
data/.rubocop.yml CHANGED
@@ -2,10 +2,12 @@ Metrics/MethodLength:
2
2
  Max: 25
3
3
  Metrics/AbcSize:
4
4
  Max: 55
5
+ Metrics/CyclomaticComplexity:
6
+ Max: 10
5
7
  Style/NumericLiterals:
6
8
  Enabled: false
7
9
  Naming/FileName:
8
10
  Enabled: false
9
11
  AllCops:
10
12
  NewCops: enable
11
- TargetRubyVersion: 2.4
13
+ TargetRubyVersion: 2.6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.10
1
+ 2.6.10
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # Version 0.6.2
2
+
3
+ Fix one more issue with caching.
4
+
5
+ # Version 0.6.1
6
+
7
+ Fix issue with caching. Update actions & bundler.
8
+
9
+ # Version 0.6
10
+
11
+ Minimum Ruby version is now Ruby 2.6. Optimized `paginate` to reduce the API calls by one.
12
+
1
13
  # Version 0.5
2
14
 
3
15
  Added a way to paginate. Use `paginate: N` to iterate over pages of results.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-indico (0.5.0)
4
+ jekyll-indico (0.6.2)
5
5
  jekyll (>= 3.8, < 5.0)
6
6
 
7
7
  GEM
@@ -11,7 +11,7 @@ GEM
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  ast (2.4.2)
13
13
  colorator (1.1.0)
14
- concurrent-ruby (1.1.9)
14
+ concurrent-ruby (1.1.10)
15
15
  diff-lcs (1.5.0)
16
16
  em-websocket (0.5.3)
17
17
  eventmachine (>= 0.12.9)
@@ -20,95 +20,98 @@ GEM
20
20
  ffi (1.15.5)
21
21
  forwardable-extended (2.6.0)
22
22
  http_parser.rb (0.8.0)
23
- i18n (0.9.5)
23
+ i18n (1.10.0)
24
24
  concurrent-ruby (~> 1.0)
25
- jekyll (3.9.1)
25
+ jekyll (4.2.2)
26
26
  addressable (~> 2.4)
27
27
  colorator (~> 1.0)
28
28
  em-websocket (~> 0.5)
29
- i18n (~> 0.7)
30
- jekyll-sass-converter (~> 1.0)
29
+ i18n (~> 1.0)
30
+ jekyll-sass-converter (~> 2.0)
31
31
  jekyll-watch (~> 2.0)
32
- kramdown (>= 1.17, < 3)
32
+ kramdown (~> 2.3)
33
+ kramdown-parser-gfm (~> 1.0)
33
34
  liquid (~> 4.0)
34
- mercenary (~> 0.3.3)
35
+ mercenary (~> 0.4.0)
35
36
  pathutil (~> 0.9)
36
- rouge (>= 1.7, < 4)
37
+ rouge (~> 3.0)
37
38
  safe_yaml (~> 1.0)
38
- jekyll-sass-converter (1.5.2)
39
- sass (~> 3.4)
39
+ terminal-table (~> 2.0)
40
+ jekyll-sass-converter (2.2.0)
41
+ sassc (> 2.0.1, < 3.0)
40
42
  jekyll-watch (2.2.1)
41
43
  listen (~> 3.0)
42
- kramdown (2.3.1)
44
+ kramdown (2.4.0)
43
45
  rexml
46
+ kramdown-parser-gfm (1.1.0)
47
+ kramdown (~> 2.0)
44
48
  liquid (4.0.3)
45
49
  listen (3.7.1)
46
50
  rb-fsevent (~> 0.10, >= 0.10.3)
47
51
  rb-inotify (~> 0.9, >= 0.9.10)
48
- mercenary (0.3.6)
49
- parallel (1.20.1)
50
- parser (3.1.0.0)
52
+ mercenary (0.4.0)
53
+ parallel (1.22.1)
54
+ parser (3.1.2.0)
51
55
  ast (~> 2.4.1)
52
56
  pathutil (0.16.2)
53
57
  forwardable-extended (~> 2.6)
54
- public_suffix (4.0.6)
58
+ public_suffix (4.0.7)
55
59
  rainbow (3.1.1)
56
60
  rake (13.0.6)
57
61
  rb-fsevent (0.11.1)
58
62
  rb-inotify (0.10.1)
59
63
  ffi (~> 1.0)
60
- regexp_parser (2.2.0)
64
+ regexp_parser (2.3.1)
61
65
  rexml (3.2.5)
62
66
  rouge (3.28.0)
63
- rspec (3.10.0)
64
- rspec-core (~> 3.10.0)
65
- rspec-expectations (~> 3.10.0)
66
- rspec-mocks (~> 3.10.0)
67
- rspec-core (3.10.2)
68
- rspec-support (~> 3.10.0)
69
- rspec-expectations (3.10.2)
67
+ rspec (3.11.0)
68
+ rspec-core (~> 3.11.0)
69
+ rspec-expectations (~> 3.11.0)
70
+ rspec-mocks (~> 3.11.0)
71
+ rspec-core (3.11.0)
72
+ rspec-support (~> 3.11.0)
73
+ rspec-expectations (3.11.0)
70
74
  diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.10.0)
72
- rspec-mocks (3.10.3)
75
+ rspec-support (~> 3.11.0)
76
+ rspec-mocks (3.11.1)
73
77
  diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.10.0)
75
- rspec-support (3.10.3)
76
- rubocop (1.12.1)
78
+ rspec-support (~> 3.11.0)
79
+ rspec-support (3.11.0)
80
+ rubocop (1.28.2)
77
81
  parallel (~> 1.10)
78
- parser (>= 3.0.0.0)
82
+ parser (>= 3.1.0.0)
79
83
  rainbow (>= 2.2.2, < 4.0)
80
84
  regexp_parser (>= 1.8, < 3.0)
81
85
  rexml
82
- rubocop-ast (>= 1.2.0, < 2.0)
86
+ rubocop-ast (>= 1.17.0, < 2.0)
83
87
  ruby-progressbar (~> 1.7)
84
88
  unicode-display_width (>= 1.4.0, < 3.0)
85
- rubocop-ast (1.4.1)
86
- parser (>= 2.7.1.5)
87
- rubocop-rake (0.5.1)
88
- rubocop
89
- rubocop-rspec (2.2.0)
89
+ rubocop-ast (1.17.0)
90
+ parser (>= 3.1.1.0)
91
+ rubocop-rake (0.6.0)
90
92
  rubocop (~> 1.0)
91
- rubocop-ast (>= 1.1.0)
93
+ rubocop-rspec (2.10.0)
94
+ rubocop (~> 1.19)
92
95
  ruby-progressbar (1.11.0)
93
96
  safe_yaml (1.0.5)
94
- sass (3.7.4)
95
- sass-listen (~> 4.0.0)
96
- sass-listen (4.0.0)
97
- rb-fsevent (~> 0.9, >= 0.9.4)
98
- rb-inotify (~> 0.9, >= 0.9.7)
99
- unicode-display_width (2.1.0)
97
+ sassc (2.4.0)
98
+ ffi (~> 1.9)
99
+ terminal-table (2.0.0)
100
+ unicode-display_width (~> 1.1, >= 1.1.1)
101
+ unicode-display_width (1.8.0)
100
102
 
101
103
  PLATFORMS
102
- ruby
104
+ x86_64-darwin-21
105
+ x86_64-linux
103
106
 
104
107
  DEPENDENCIES
105
- bundler (~> 2.0)
108
+ bundler (~> 2.1)
106
109
  jekyll-indico!
107
110
  rake (~> 13.0)
108
111
  rspec (~> 3.0)
109
- rubocop (~> 1.9)
110
- rubocop-rake (~> 0.5)
112
+ rubocop (~> 1.25)
113
+ rubocop-rake (~> 0.6)
111
114
  rubocop-rspec (~> 2.2)
112
115
 
113
116
  BUNDLED WITH
114
- 2.2.8
117
+ 2.3.13
@@ -18,10 +18,14 @@ end.parse!
18
18
  puts "Reading #{options[:config]}"
19
19
 
20
20
  config = YAML.safe_load(File.read(options[:config]))
21
- meeting_ids = JekyllIndico::Meetings.meeting_ids(config)
22
- base_url = JekyllIndico::Meetings.base_url(config)
21
+ meeting_ids = config.dig('indico', 'ids')
22
+ base_url = config.dig('indico', 'url')
23
23
  data_path = config.dig('indico', 'data') || 'indico'
24
24
 
25
+ raise MissingURL, 'indico: url: MISSING from your config!' unless base_url
26
+ raise MissingIDs, 'indico: ids: MISSING from your config!' unless meeting_ids
27
+ raise MissingIDs, 'indico: ids: must be a hash!' unless meeting_ids.is_a?(Hash)
28
+
25
29
  JekyllIndico.cache(base_url, meeting_ids, data_path) do |name, number|
26
30
  puts "Accessing #{number} for #{name}"
27
31
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.metadata['changelog_uri'] = 'https://github.com/iris-hep/jekyll-indico/blob/main/CHANGELOG.md'
21
21
  else
22
22
  raise 'RubyGems 2.0 or newer is required to protect against ' \
23
- 'public gem pushes.'
23
+ 'public gem pushes.'
24
24
  end
25
25
 
26
26
  # Specify which files should be added to the gem when it is released.
@@ -32,14 +32,15 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.required_ruby_version = '>= 2.4.0'
35
+ spec.required_ruby_version = '>= 2.6.0'
36
36
 
37
37
  spec.add_dependency 'jekyll', '>= 3.8', '< 5.0'
38
38
 
39
- spec.add_development_dependency 'bundler', '~> 2.0'
39
+ spec.add_development_dependency 'bundler', '~> 2.1'
40
40
  spec.add_development_dependency 'rake', '~> 13.0'
41
41
  spec.add_development_dependency 'rspec', '~> 3.0'
42
- spec.add_development_dependency 'rubocop', '~> 1.9'
43
- spec.add_development_dependency 'rubocop-rake', '~> 0.5'
42
+ spec.add_development_dependency 'rubocop', '~> 1.25'
43
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
44
44
  spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
45
+ spec.metadata['rubygems_mfa_required'] = 'true'
45
46
  end
@@ -29,7 +29,7 @@ module JekyllIndico
29
29
  download_and_iterate(base_url, indico_id, limit: limit, **kargs) do |i|
30
30
  # Trim paragraph tags
31
31
  d = i['description']
32
- d = d[3..-1] if d.start_with? '<p>'
32
+ d = d[3..] if d.start_with? '<p>'
33
33
  d = d[0..-5] if d.end_with? '</p>'
34
34
 
35
35
  start_date = Date.parse i['startDate']['date']
@@ -71,8 +71,8 @@ module JekyllIndico
71
71
 
72
72
  req = Net::HTTP::Get.new(uri)
73
73
  if ENV['INDICO_TOKEN']
74
- req['Authorization'] = "Bearer #{ENV['INDICO_TOKEN']}"
75
- elsif ENV['INDICO_SECRET_KEY'] || ENV['INDICO_API_KEY']
74
+ req['Authorization'] = "Bearer #{ENV.fetch('INDICO_TOKEN', nil)}"
75
+ elsif ENV.fetch('INDICO_SECRET_KEY', nil) || ENV.fetch('INDICO_API_KEY', nil)
76
76
  raise Error, 'Use INDICO_TOKEN with a new-style token'
77
77
  end
78
78
 
@@ -84,20 +84,18 @@ module JekyllIndico
84
84
 
85
85
  # Run a block over each item in the downloaded results
86
86
  def download_and_iterate(base_url, indico_id, limit: nil, **params, &block)
87
- params[:limit] = limit if limit
88
87
  params[:pretty] = 'no'
89
88
 
90
- unless limit
89
+ if limit.nil? || limit.zero?
91
90
  results = get_parsed_results(base_url, indico_id, **params)
92
91
  results.each(&block)
93
92
  return
94
93
  end
95
94
 
96
95
  0.step.each do |n|
97
- results = get_parsed_results(base_url, indico_id, offset: n * limit, **params)
98
- break if results.empty?
99
-
96
+ results = get_parsed_results(base_url, indico_id, offset: n * limit, limit: limit, **params)
100
97
  results.each(&block)
98
+ break if results.length < limit
101
99
  end
102
100
  end
103
101
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllIndico
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-indico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Schreiner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-08 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '2.0'
39
+ version: '2.1'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '2.0'
46
+ version: '2.1'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -78,28 +78,28 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.9'
81
+ version: '1.25'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.9'
88
+ version: '1.25'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rubocop-rake
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.5'
95
+ version: '0.6'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '0.5'
102
+ version: '0.6'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rubocop-rspec
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +151,7 @@ metadata:
151
151
  homepage_uri: https://rubygems.org/gems/jekyll-indico
152
152
  source_code_uri: https://github.com/iris-hep/jekyll-indico
153
153
  changelog_uri: https://github.com/iris-hep/jekyll-indico/blob/main/CHANGELOG.md
154
+ rubygems_mfa_required: 'true'
154
155
  post_install_message:
155
156
  rdoc_options: []
156
157
  require_paths:
@@ -159,15 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
160
  requirements:
160
161
  - - ">="
161
162
  - !ruby/object:Gem::Version
162
- version: 2.4.0
163
+ version: 2.6.0
163
164
  required_rubygems_version: !ruby/object:Gem::Requirement
164
165
  requirements:
165
166
  - - ">="
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0'
168
169
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 2.6.14.4
170
+ rubygems_version: 3.0.3.1
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Read and/or cache indico meeting lists for Jekyll