spec/dummy/tmp/generator/config/initializers/bobot.rb in bobot-2.6.2 vs spec/dummy/tmp/generator/config/initializers/bobot.rb in bobot-3.0.1
- old
+ new
@@ -1,24 +1,24 @@
-bobot_config_path = Rails.root.join("config", "bobot.yml")
-bobot_config = YAML.safe_load(ERB.new(File.read(bobot_config_path)).result, [], [], true)[Rails.env]
+bobot_config_path = Rails.root.join("config", "secrets.yml")
+bobot_config = YAML.safe_load(ERB.new(File.read(bobot_config_path)).result, [], [], true)[Rails.env]["bobot"]
if bobot_config.present?
unless bobot_config.key?("pages")
raise "Bobot: #{bobot_config_path} required an array key :pages (cf. https://github.com/navidemad/bobot)"
end
Bobot.configure do |config|
config.app_id = bobot_config["app_id"],
config.app_secret = bobot_config["app_secret"],
config.verify_token = bobot_config["verify_token"],
config.domains = bobot_config["domains"],
- config.debug_log = bobot_config["debug_log"],
config.async = bobot_config["async"],
bobot_config["pages"].each do |page|
- config.pages << Bobot::Configuration::Page.new(
- name: page["name"],
- language: page["language"],
- page_access_token: page["page_access_token"],
- page_id: page["page_id"],
+ config.pages << Bobot::Page.new(
+ slug: page["slug"],
+ language: page["language"],
+ page_id: page["page_id"],
+ page_access_token: page["page_access_token"],
+ get_started_payload: page["get_started_payload"],
)
end
end
else
warn "#{bobot_config_path} not configured yet in #{Rails.env} environment."