Skip to content

Commit

Permalink
Fix various warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltrix committed Feb 23, 2013
1 parent 5ba0cfa commit 29931ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions lib/prowler/application.rb
Expand Up @@ -15,7 +15,8 @@ class ConfigurationError < StandardError; end

class Application
attr_accessor :service_url, :api_key, :provider_key #:nodoc:
attr_accessor :application, :send_notifications #:nodoc:
attr_accessor :application #:nodoc:
attr_writer :send_notifications #:nodoc:

# Create an instance for sending to different accounts within a single Rails application
# Pass any of the following options to override the global configuration:
Expand All @@ -24,6 +25,8 @@ class Application
# * :api_key: Your API key.
# * :service_url: Override the configured service url
def initialize(*args)
@send_notifications = true

if args.empty?
CONFIG_ATTRS.each{ |attr| send("#{attr}=".to_sym, Prowler.send(attr)) }
elsif args.first.is_a?(Hash)
Expand Down Expand Up @@ -139,7 +142,7 @@ def root_certificates #:nodoc:
end

def send_notifications #:nodoc:
@send_notifications.nil? ? true : !!@send_notifications
!!@send_notifications
end

def send_notifications? #:nodoc:
Expand Down Expand Up @@ -192,7 +195,7 @@ def perform_request(url, request, klass) #:nodoc:
end
end
end
rescue TimeoutError => e
rescue TimeoutError
logger.error "Timeout while contacting the Prowl server."
false
end
Expand Down
10 changes: 5 additions & 5 deletions lib/prowler/configuration.rb
@@ -1,10 +1,10 @@
module Prowler
class << self
attr_accessor :service_url, :api_key, :provider_key
attr_accessor :application, :send_notifications
attr_accessor :read_timeout, :open_timeout #:nodoc:
attr_accessor :delayed, :verify_certificate, :root_certificates
attr_accessor :raise_errors
attr_writer :service_url, :send_notifications, :delayed
attr_writer :raise_errors, :root_certificates
attr_writer :read_timeout, :open_timeout

attr_accessor :api_key, :provider_key, :application, :verify_certificate

# Call this method to configure your account details in an initializer.
def configure
Expand Down

0 comments on commit 29931ce

Please sign in to comment.