lib/amp_html/configuration.rb in amp-html-0.7.7 vs lib/amp_html/configuration.rb in amp-html-0.7.8
- old
+ new
@@ -39,11 +39,11 @@
end
def self.assets_only_amp
config = get_config
- if config.key(:assets) && config[:assets].key :only_amp
+ if config.key(:assets) && config[:assets].key(:only_amp)
config[:assets][:only_amp]
else
if AmpHtml.split_view
false
else
@@ -53,101 +53,101 @@
end
def self.application_name
config = get_config
- if config.key(:application) && config[:application].key :name
+ if config.key(:application) && config[:application].key(:name)
config[:application][:name]
else
Rails.application.class.parent
end
end
def self.application_type
config = get_config
- if config.key(:application) && config[:application].key :type
+ if config.key(:application) && config[:application].key(:type)
config[:application][:type]
else
nil
end
end
def self.application_date_published
config = get_config
- if config.key(:application) && config[:application].key :date_published
+ if config.key(:application) && config[:application].key(:date_published)
config[:application][:date_published]
else
DateTime.now
end
end
def self.application_image
config = get_config
- if config.key(:application) && config[:application].key :image
+ if config.key(:application) && config[:application].key(:image)
config[:application][:image]
else
nil
end
end
def self.forms_selector
config = get_config
- if config.key(:forms) && config[:forms].key :amp_selector
+ if config.key(:forms) && config[:forms].key(:amp_selector)
config[:forms][:amp_selector]
else
false
end
end
def self.analytics_default_vendor
config = get_config
- if config.key(:analytics) && config[:analytics].key :default_vendor
+ if config.key(:analytics) && config[:analytics].key(:default_vendor)
config[:analytics][:default_vendor]
else
nil
end
end
def self.google_analytics_account
config = get_config
- if config.key(:analytics) && config[:analytics].key(:google_analytics) && config[:analytics][:google_analytics].key :account
+ if config.key(:analytics) && config[:analytics].key(:google_analytics) && config[:analytics][:google_analytics].key(:account)
config[:analytics][:google_analytics][:account]
else
nil
end
end
def self.ad_default_network
config = get_config
- if config.key(:ad) && config[:ad].key :default_network
+ if config.key(:ad) && config[:ad].key(:default_network)
config[:ad][:default_network]
else
nil
end
end
def self.auto_ads_default_network
config = get_config
- if config.key(:ad) && config[:ad].key(:auto_ads) && config[:ad][:auto_ads].key :default_network
+ if config.key(:ad) && config[:ad].key(:auto_ads) && config[:ad][:auto_ads].key(:default_network)
config[:ad][:auto_ads][:default_network]
else
nil
end
end
def self.social_share_default_provider
config = get_config
- if config.key(:social) && config[:social].key(:share) && config[:social][:share].key :default_provider
+ if config.key(:social) && config[:social].key(:share) && config[:social][:share].key(:default_provider)
config[:social][:share][:default_provider]
else
nil
end
end
def self.social_share_default_data_share_endpoint
config = get_config
- if config.key(:social) && config[:social].key(:share) && config[:social][:share].key :default_data_share_endpoint
+ if config.key(:social) && config[:social].key(:share) && config[:social][:share].key(:default_data_share_endpoint)
config[:social][:share][:default_data_share_endpoint]
else
nil
end
end
@@ -158,10 +158,10 @@
def self.get_config
require 'yaml'
begin
- YAML.load_file('config/amp-html.yml')
+ YAML.load_file 'config/amp-html.yml'
rescue Exception
warn 'WARNING (AMP): You need to run `rails g amp-html:bundle` first.'
exit
end
end