lib/bobot/page.rb in bobot-4.1.0 vs lib/bobot/page.rb in bobot-4.2.0
- old
+ new
@@ -198,57 +198,117 @@
#
# SETUP
#
#####################################
def update_facebook_setup!
- puts "- unset_whitelist_domains! [....]"
- unset_whitelist_domains!
- puts "- unset_whitelist_domains! [DONE]"
- puts "- set_whitelist_domains! [....]"
- set_whitelist_domains!
- puts "- set_whitelist_domains! [DONE]"
- puts "- unset_greeting_text! [....]"
- unset_greeting_text!
- puts "- unset_greeting_text! [DONE]"
- puts "- set_greeting_text! [....]"
- set_greeting_text!
- puts "- set_greeting_text! [DONE]"
- puts "- unset_get_started_button! [....]"
- unset_get_started_button!
- puts "- unset_get_started_button! [DONE]"
- puts "- set_get_started_button! [....]"
- set_get_started_button!
- puts "- set_get_started_button! [DONE]"
- puts "- unset_persistent_menu! [....]"
- unset_persistent_menu!
- puts "- unset_persistent_menu! [DONE]"
- puts "- set_persistent_menu! [....]"
- set_persistent_menu!
- puts "- set_persistent_menu! [DONE]"
- puts "- unsubscribe_to_facebook_page! [....]"
- unsubscribe_to_facebook_page!
- puts "- unsubscribe_to_facebook_page! [DONE]"
- puts "- subscribe_to_facebook_page! [....]"
- subscribe_to_facebook_page!
- puts "- subscribe_to_facebook_page! [DONE]"
+ begin
+ puts "- unset_whitelist_domains! [....]"
+ unset_whitelist_domains!
+ puts "- unset_whitelist_domains! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- set_whitelist_domains! [....]"
+ set_whitelist_domains!
+ puts "- set_whitelist_domains! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- unset_greeting_text! [....]"
+ unset_greeting_text!
+ puts "- unset_greeting_text! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- set_greeting_text! [....]"
+ set_greeting_text!
+ puts "- set_greeting_text! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- unset_get_started_button! [....]"
+ unset_get_started_button!
+ puts "- unset_get_started_button! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- set_get_started_button! [....]"
+ set_get_started_button!
+ puts "- set_get_started_button! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- unset_persistent_menu! [....]"
+ unset_persistent_menu!
+ puts "- unset_persistent_menu! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- set_persistent_menu! [....]"
+ set_persistent_menu!
+ puts "- set_persistent_menu! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- unsubscribe_to_facebook_page! [....]"
+ unsubscribe_to_facebook_page!
+ puts "- unsubscribe_to_facebook_page! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- subscribe_to_facebook_page! [....]"
+ subscribe_to_facebook_page!
+ puts "- subscribe_to_facebook_page! [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
end
def get_facebook_setup
- puts "- get_whitelist_domains [....]"
- puts get_whitelist_domains.inspect
- puts "- get_whitelist_domains [DONE]"
- puts "- get_greeting_text [....]"
- puts get_greeting_text.inspect
- puts "- get_greeting_text [DONE]"
- puts "- get_started_button [....]"
- puts get_started_button.inspect
- puts "- get_started_button [DONE]"
- puts "- get_persistent_menu [....]"
- puts get_persistent_menu.inspect
- puts "- get_persistent_menu [DONE]"
- puts "- subscribed_facebook_pages [....]"
- puts subscribed_facebook_pages.inspect
- puts "- subscribed_facebook_pages [DONE]"
+ begin
+ puts "- get_whitelist_domains [....]"
+ puts get_whitelist_domains.inspect
+ puts "- get_whitelist_domains [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- get_greeting_text [....]"
+ puts get_greeting_text.inspect
+ puts "- get_greeting_text [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- get_started_button [....]"
+ puts get_started_button.inspect
+ puts "- get_started_button [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- get_persistent_menu [....]"
+ puts get_persistent_menu.inspect
+ puts "- get_persistent_menu [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
+ begin
+ puts "- subscribed_facebook_pages [....]"
+ puts subscribed_facebook_pages.inspect
+ puts "- subscribed_facebook_pages [DONE]"
+ rescue e
+ Rails.logger.error(e.message)
+ end
end
## == Set bot description (only displayed on first time). ==
def set_greeting_text!
raise Bobot::FieldFormat.new("access_token is required") unless page_access_token.present?