aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/acts_as_xapian/acts_as_xapian.rb12
-rw-r--r--lib/has_tag_string/has_tag_string.rb2
-rw-r--r--lib/health_checks/checks/days_ago_check.rb2
-rw-r--r--lib/health_checks/health_checkable.rb6
-rw-r--r--lib/health_checks/health_checks.rb2
-rw-r--r--lib/mail_handler/backends/mail_backend.rb2
-rw-r--r--lib/mail_handler/mail_handler.rb2
-rw-r--r--lib/strip_attributes/test/test_helper.rb2
8 files changed, 13 insertions, 17 deletions
diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb
index 7076fc586..380c882d9 100644
--- a/lib/acts_as_xapian/acts_as_xapian.rb
+++ b/lib/acts_as_xapian/acts_as_xapian.rb
@@ -137,10 +137,10 @@ module ActsAsXapian
prepare_environment
# We need to reopen the database each time, so Xapian gets changes to it.
- # Calling reopen() does not always pick up changes for reasons that I can
+ # Calling reopen does not always pick up changes for reasons that I can
# only speculate about at the moment. (It is easy to reproduce this by
- # changing the code below to use reopen() rather than open() followed by
- # close(), and running rake spec.)
+ # changing the code below to use reopen rather than open followed by
+ # close, and running rake spec.)
if !@@db.nil?
@@db.close
end
@@ -260,7 +260,7 @@ module ActsAsXapian
# for indexing
@@writable_db = Xapian::WritableDatabase.new(full_path, Xapian::DB_CREATE_OR_OPEN)
@@enquire = Xapian::Enquire.new(@@writable_db)
- @@term_generator = Xapian::TermGenerator.new()
+ @@term_generator = Xapian::TermGenerator.new
@@term_generator.set_flags(Xapian::TermGenerator::FLAG_SPELLING, 0)
@@term_generator.database = @@writable_db
@@term_generator.stemmer = @@stemmer
@@ -336,7 +336,7 @@ module ActsAsXapian
delay *= 2
delay = MSET_MAX_DELAY if delay > MSET_MAX_DELAY
- ActsAsXapian.db.reopen()
+ ActsAsXapian.db.reopen
retry
else
raise
@@ -559,7 +559,7 @@ module ActsAsXapian
matches = ActsAsXapian.enquire.mset(0, 100, 100) # TODO: so this whole method will only work with 100 docs
# Get set of relevant terms for those documents
- selection = Xapian::RSet.new()
+ selection = Xapian::RSet.new
iter = matches._begin
while not iter.equals(matches._end)
selection.add_document(iter)
diff --git a/lib/has_tag_string/has_tag_string.rb b/lib/has_tag_string/has_tag_string.rb
index a1af8c597..70dbbda5d 100644
--- a/lib/has_tag_string/has_tag_string.rb
+++ b/lib/has_tag_string/has_tag_string.rb
@@ -152,7 +152,7 @@ module HasTagString
######################################################################
# Main entry point, add has_tag_string to your model.
module HasMethods
- def has_tag_string()
+ def has_tag_string
has_many :tags, :conditions => "model = '" + self.to_s + "'", :foreign_key => "model_id", :class_name => 'HasTagString::HasTagStringTag'
include InstanceMethods
diff --git a/lib/health_checks/checks/days_ago_check.rb b/lib/health_checks/checks/days_ago_check.rb
index 9e574fe95..3c1cb784f 100644
--- a/lib/health_checks/checks/days_ago_check.rb
+++ b/lib/health_checks/checks/days_ago_check.rb
@@ -20,7 +20,7 @@ module HealthChecks
"#{ super }: #{ subject.call }"
end
- def check
+ def ok?
subject.call >= days.days.ago
end
diff --git a/lib/health_checks/health_checkable.rb b/lib/health_checks/health_checkable.rb
index f71ca36ca..1e324c1c7 100644
--- a/lib/health_checks/health_checkable.rb
+++ b/lib/health_checks/health_checkable.rb
@@ -13,12 +13,8 @@ module HealthChecks
self.class.to_s
end
- def check
- raise NotImplementedError
- end
-
def ok?
- check ? true : false
+ raise NotImplementedError
end
def message
diff --git a/lib/health_checks/health_checks.rb b/lib/health_checks/health_checks.rb
index 54cb0d96b..6c98365fc 100644
--- a/lib/health_checks/health_checks.rb
+++ b/lib/health_checks/health_checks.rb
@@ -32,7 +32,7 @@ module HealthChecks
private
def assert_valid_check(check)
- check.respond_to?(:check)
+ check.respond_to?(:ok?)
end
end
diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb
index 89fc24bb9..2f1052a0c 100644
--- a/lib/mail_handler/backends/mail_backend.rb
+++ b/lib/mail_handler/backends/mail_backend.rb
@@ -36,7 +36,7 @@ module MailHandler
module Backends
module MailBackend
- def backend()
+ def backend
'Mail'
end
diff --git a/lib/mail_handler/mail_handler.rb b/lib/mail_handler/mail_handler.rb
index 0c60fd3f5..313869d16 100644
--- a/lib/mail_handler/mail_handler.rb
+++ b/lib/mail_handler/mail_handler.rb
@@ -134,7 +134,7 @@ module MailHandler
begin
zip_file = Zip::ZipFile.open(tempfile.path)
text += get_attachment_text_from_zip_file(zip_file)
- zip_file.close()
+ zip_file.close
rescue
$stderr.puts("Error processing zip file: #{$!.inspect}")
end
diff --git a/lib/strip_attributes/test/test_helper.rb b/lib/strip_attributes/test/test_helper.rb
index b69440715..6a4f6136a 100644
--- a/lib/strip_attributes/test/test_helper.rb
+++ b/lib/strip_attributes/test/test_helper.rb
@@ -10,7 +10,7 @@ require "#{PLUGIN_ROOT}/init"
class ActiveRecord::Base
alias_method :save, :valid?
- def self.columns()
+ def self.columns
@columns ||= []
end