#!/usr/bin/env ruby # frozen_string_literal: true require 'pathname' require 'yaml' require 'optparse' require 'jekyll-indico/cache' options = { config: '_config.yml' } OptionParser.new do |opts| opts.on('-c', '--config=FILE', 'Read a config file') do |c| options[:config] = c end end.parse! puts "Reading #{options[:config]}" config = YAML.safe_load(File.read(options[:config])) meeting_ids = JekyllIndico::Meetings.meeting_ids(config) base_url = JekyllIndico::Meetings.base_url(config) data_path = config.dig('indico', 'data') || 'indico' JekyllIndico.cache(base_url, meeting_ids, data_path) do |name, number| puts "Accessing #{number} for #{name}" end