New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove activesupport from runtime dependency #27

Merged
merged 3 commits into from Sep 22, 2018
Jump to file or symbol
Failed to load files and symbols.
+3 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Use string_blank? instead of blank?

  • Loading branch information...
sue445 committed Sep 22, 2018
commit 4df5878cbcceae6631dbf8c4e116804b6ce3383b
@@ -1,7 +1,6 @@
module AppleSystemStatus
require "capybara"
require "selenium-webdriver"
require "active_support/core_ext/object/blank"
class Crawler
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36"
@@ -66,7 +65,7 @@ def perform(country: nil, title: nil)
raise "Not found services" if response[:services].empty?
unless title.blank?
unless self.class.blank_string?(title)
response[:services].select! { |service| service[:title] == title }
end
@@ -76,7 +75,7 @@ def perform(country: nil, title: nil)
end
def apple_url(country)
if country.blank? || country == "us"
if self.class.blank_string?(country) || country == "us"
"https://www.apple.com/support/systemstatus/"
else
"https://www.apple.com/#{country}/support/systemstatus/"
@@ -104,7 +103,7 @@ def self.perform(country: nil, title: nil)
def self.blank_string?(str)
return true unless str
!!str.strip.empty?
str.strip.empty?
end
private
ProTip! Use n and p to navigate between commits in a pull request.