lib/almanack/configuration.rb in almanack-1.0.3 vs lib/almanack/configuration.rb in almanack-1.0.4
- old
+ new
@@ -1,9 +1,5 @@
-require 'net/http'
-require 'uri'
-require 'ri_cal'
-
module Almanack
class Configuration
class ThemeNotFound < StandardError; end
DEFAULT_THEME = "legacy"
@@ -14,10 +10,14 @@
def initialize
reset!
end
+ def connection
+ @connection ||= Faraday.new
+ end
+
def reset!
@theme = DEFAULT_THEME
@days_lookahead = DEFAULT_DAYS_LOOKAHEAD
@event_sources = []
@@ -32,17 +32,17 @@
root = paths.find { |path| path.exist? }
root || raise(ThemeNotFound, "Could not find theme #{theme} in #{paths}")
end
def add_ical_feed(url)
- @event_sources << EventSource::IcalFeed.new(url)
+ @event_sources << EventSource::IcalFeed.new(url, connection: connection)
end
def add_events(events)
@event_sources << EventSource::Static.new(events)
end
def add_meetup_group(options)
- @event_sources << EventSource::MeetupGroup.new(options)
+ @event_sources << EventSource::MeetupGroup.new(options.merge(connection: connection))
end
end
end