Sha256: f98cda4081f7e09327413ba79c004bbfe05f34ffd521a0a598cae4d793c524e2

Contents?: true

Size: 729 Bytes

Versions: 13

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true

require 'pathname'
require 'yaml'

require 'jekyll-indico/core'

# The main module for this package.
module JekyllIndico
  # This will cache the hash of meeting IDs given into the data_path in _data
  # in the current directory.
  def self.cache(base_url, meeting_ids, data_path)
    meeting_ids.each do |name, number|
      yield name, number
      indico_dir = Pathname.new('_data') / data_path
      folder = indico_dir / name.to_s
      indico_dir.mkdir unless indico_dir.directory?
      folder.mkdir unless folder.directory?

      iris_meeting = JekyllIndico::Meetings.new(base_url, number)
      iris_meeting.to_files(folder) { |key| puts "Making #{folder / key}.yml\n" }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jekyll-indico-0.6.2 lib/jekyll-indico/cache.rb
jekyll-indico-0.6.1 lib/jekyll-indico/cache.rb
jekyll-indico-0.6.0 lib/jekyll-indico/cache.rb
jekyll-indico-0.5.0 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.5 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.4 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.3 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.2 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.1 lib/jekyll-indico/cache.rb
jekyll-indico-0.4.0 lib/jekyll-indico/cache.rb
jekyll-indico-0.3.0 lib/jekyll-indico/cache.rb
jekyll-indico-0.2.1 lib/jekyll-indico/cache.rb
jekyll-indico-0.2.0 lib/jekyll-indico/cache.rb