Class: Locomotive::Mounter::Reader::FileSystem::SiteReader
- Defined in:
- lib/locomotive/mounter/reader/file_system/site_reader.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Locomotive::Mounter::Reader::FileSystem::Base
Instance Method Details
#read ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/locomotive/mounter/reader/file_system/site_reader.rb', line 8 def read config_path = File.join(self.runner.path, 'config', 'site.yml') site = self.read_yaml(config_path) # set the default locale first Locomotive::Mounter.locale = site['locales'].first.to_sym rescue Locomotive::Mounter.locale Locomotive::Mounter::Models::Site.new(site).tap do |_site| # set the time zone for the next Time operations (UTC by default) Time.zone = ActiveSupport::TimeZone.new(_site.timezone || 'UTC') end end |