diff --git a/lib/redmine/helpers/time_report.rb b/lib/redmine/helpers/time_report.rb
index 33a32f887..eb6abed04 100644
--- a/lib/redmine/helpers/time_report.rb
+++ b/lib/redmine/helpers/time_report.rb
@@ -58,7 +58,7 @@ module Redmine
end
@hours << h
end
-
+
@hours.each do |row|
case @columns
when 'year'
@@ -71,13 +71,13 @@ module Redmine
row['day'] = "#{row['spent_on']}"
end
end
-
+
min = @hours.collect {|row| row['spent_on']}.min
@from = min ? min.to_date : User.current.today
max = @hours.collect {|row| row['spent_on']}.max
@to = max ? max.to_date : User.current.today
-
+
@total_hours = @hours.inject(0) {|s,k| s = s + k['hours'].to_f}
@periods = []
diff --git a/lib/redmine/helpers/url.rb b/lib/redmine/helpers/url.rb
index 6e6246d93..f5b44555f 100644
--- a/lib/redmine/helpers/url.rb
+++ b/lib/redmine/helpers/url.rb
@@ -26,7 +26,7 @@ module Redmine
# URLs relative to the current document or document root (without a protocol
# separator, should be harmless
return true unless uri.to_s.include? ":"
-
+
# Other URLs need to be parsed
schemes.include? URI.parse(uri).scheme
rescue URI::Error
diff --git a/lib/redmine/hook/view_listener.rb b/lib/redmine/hook/view_listener.rb
index 1e69d0755..411658dd7 100644
--- a/lib/redmine/hook/view_listener.rb
+++ b/lib/redmine/hook/view_listener.rb
@@ -67,11 +67,11 @@ module Redmine
end
end
end
-
+
def controller
nil
end
-
+
def config
ActionController::Base.config
end
diff --git a/lib/redmine/nested_set/issue_nested_set.rb b/lib/redmine/nested_set/issue_nested_set.rb
index 2c34cac96..1f62bc072 100644
--- a/lib/redmine/nested_set/issue_nested_set.rb
+++ b/lib/redmine/nested_set/issue_nested_set.rb
@@ -86,19 +86,19 @@ module Redmine
if parent
previous_root_id = root_id
self.root_id = parent.root_id
-
+
lft_after_move = target_lft
self.class.where(:root_id => parent.root_id).update_all([
"lft = CASE WHEN lft >= :lft THEN lft + :shift ELSE lft END, " +
"rgt = CASE WHEN rgt >= :lft THEN rgt + :shift ELSE rgt END",
{:lft => lft_after_move, :shift => (rgt - lft + 1)}
])
-
+
self.class.where(:root_id => previous_root_id).update_all([
"root_id = :root_id, lft = lft + :shift, rgt = rgt + :shift",
{:root_id => parent.root_id, :shift => lft_after_move - lft}
])
-
+
self.lft, self.rgt = lft_after_move, (rgt - lft + lft_after_move)
parent.send :reload_nested_set_values
end
@@ -107,7 +107,7 @@ module Redmine
def remove_from_nested_set
self.class.where(:root_id => root_id).where("lft >= ? AND rgt <= ?", lft, rgt).
update_all(["root_id = :id, lft = lft - :shift, rgt = rgt - :shift", {:id => id, :shift => lft - 1}])
-
+
self.class.where(:root_id => root_id).update_all([
"lft = CASE WHEN lft >= :lft THEN lft - :shift ELSE lft END, " +
"rgt = CASE WHEN rgt >= :lft THEN rgt - :shift ELSE rgt END",
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index 4780dece0..b3982fcfd 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -398,7 +398,7 @@ module Redmine
# * :label - label for the formatter displayed in application settings
#
# Examples:
- # wiki_format_provider(:custom_formatter, CustomFormatter, :label => "My custom formatter")
+ # wiki_format_provider(:custom_formatter, CustomFormatter, :label => "My custom formatter")
#
def wiki_format_provider(name, *args)
Redmine::WikiFormatting.register(name, *args)
diff --git a/lib/redmine/safe_attributes.rb b/lib/redmine/safe_attributes.rb
index 52c2df096..a08e63f7e 100644
--- a/lib/redmine/safe_attributes.rb
+++ b/lib/redmine/safe_attributes.rb
@@ -34,7 +34,7 @@ module Redmine
@safe_attributes ||= []
if args.empty?
if superclass.include?(Redmine::SafeAttributes)
- @safe_attributes + superclass.safe_attributes
+ @safe_attributes + superclass.safe_attributes
else
@safe_attributes
end
diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb
index a901bfb54..c342d13ff 100644
--- a/lib/redmine/scm/adapters/bazaar_adapter.rb
+++ b/lib/redmine/scm/adapters/bazaar_adapter.rb
@@ -294,7 +294,7 @@ module Redmine
full_args_locale << scm_iconv(@path_encoding, 'UTF-8', e)
end
ret = shellout(
- self.class.sq_bin + ' ' +
+ self.class.sq_bin + ' ' +
full_args_locale.map { |e| shell_quote e.to_s }.join(' '),
&block
)
@@ -313,7 +313,7 @@ module Redmine
full_args_locale << scm_iconv(@path_encoding, 'UTF-8', e)
end
ret = shellout(
- self.class.sq_bin + ' ' +
+ self.class.sq_bin + ' ' +
full_args_locale.map { |e| shell_quote e.to_s }.join(' '),
&block
)
diff --git a/lib/redmine/wiki_formatting/html_parser.rb b/lib/redmine/wiki_formatting/html_parser.rb
index be01ca339..aa4891ce0 100644
--- a/lib/redmine/wiki_formatting/html_parser.rb
+++ b/lib/redmine/wiki_formatting/html_parser.rb
@@ -31,11 +31,11 @@ module Redmine
def self.to_text(html)
html = html.gsub(/[\n\r]/, '').squeeze(' ')
-
+
doc = Loofah.document(html)
doc.scrub!(WikiTags.new(tags))
doc.scrub!(:newline_block_elements)
-
+
Loofah.remove_extraneous_whitespace(doc.text).strip
end
@@ -44,7 +44,7 @@ module Redmine
@direction = :bottom_up
@tags_to_text = tags_to_text || {}
end
-
+
def scrub(node)
formatting = @tags_to_text[node.name]
case formatting
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb
index 0cc55e281..8afa0f8e7 100644
--- a/lib/redmine/wiki_formatting/macros.rb
+++ b/lib/redmine/wiki_formatting/macros.rb
@@ -69,7 +69,7 @@ module Redmine
# macro :my_macro do |obj, args|
# "My macro output"
# end
- #
+ #
# desc "This is my macro that accepts a block of text"
# macro :my_macro do |obj, args, text|
# "My macro output"
@@ -83,7 +83,7 @@ module Redmine
#
# Options:
# * :desc - A description of the macro
- # * :parse_args => false - Disables arguments parsing (the whole arguments
+ # * :parse_args => false - Disables arguments parsing (the whole arguments
# string is passed to the macro)
#
# Macro blocks accept 2 or 3 arguments:
@@ -91,7 +91,7 @@ module Redmine
# * args: macro arguments
# * text: the block of text given to the macro (should be present only if the
# macro accepts a block of text). text is a String or nil if the macro is
- # invoked without a block of text.
+ # invoked without a block of text.
#
# Examples:
# By default, when the macro is invoked, the comma separated list of arguments
@@ -164,7 +164,7 @@ module Redmine
# Builtin macros
desc "Sample macro."
macro :hello_world do |obj, args, text|
- h("Hello world! Object: #{obj.class.name}, " +
+ h("Hello world! Object: #{obj.class.name}, " +
(args.empty? ? "Called with no argument" : "Arguments: #{args.join(', ')}") +
" and " + (text.present? ? "a #{text.size} bytes long block of text." : "no block of text.")
)
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index c4dc4c25e..5a8c15142 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -73,33 +73,33 @@
#
# == Links
#
-# To make a hypertext link, put the link text in "quotation
+# To make a hypertext link, put the link text in "quotation
# marks" followed immediately by a colon and the URL of the link.
-#
-# Optional: text in (parentheses) following the link text,
-# but before the closing quotation mark, will become a Title
+#
+# Optional: text in (parentheses) following the link text,
+# but before the closing quotation mark, will become a Title
# attribute for the link, visible as a tool tip when a cursor is above it.
-#
+#
# Example:
#
# "This is a link (This is a title) ":http://www.textism.com
-#
+#
# Will become:
-#
+#
# This is a link
#
# == Images
#
# To insert an image, put the URL for the image inside exclamation marks.
#
-# Optional: text that immediately follows the URL in (parentheses) will
-# be used as the Alt text for the image. Images on the web should always
-# have descriptive Alt text for the benefit of readers using non-graphical
+# Optional: text that immediately follows the URL in (parentheses) will
+# be used as the Alt text for the image. Images on the web should always
+# have descriptive Alt text for the benefit of readers using non-graphical
# browsers.
#
-# Optional: place a colon followed by a URL immediately after the
+# Optional: place a colon followed by a URL immediately after the
# closing ! to make the image into a link.
-#
+#
# Example:
#
# !http://www.textism.com/common/textist.gif(Textist)!
@@ -118,13 +118,13 @@
#
# == Defining Acronyms
#
-# HTML allows authors to define acronyms via the tag. The definition appears as a
-# tool tip when a cursor hovers over the acronym. A crucial aid to clear writing,
+# HTML allows authors to define acronyms via the tag. The definition appears as a
+# tool tip when a cursor hovers over the acronym. A crucial aid to clear writing,
# this should be used at least once for each acronym in documents where they appear.
#
-# To quickly define an acronym in Textile, place the full text in (parentheses)
+# To quickly define an acronym in Textile, place the full text in (parentheses)
# immediately following the acronym.
-#
+#
# Example:
#
# ACLU(American Civil Liberties Union)
@@ -147,7 +147,7 @@
# (background:#ddd;color:red). |{}| | | |
#
# == Using RedCloth
-#
+#
# RedCloth is simply an extension of the String class, which can handle
# Textile formatting. Use it like a String and output HTML with its
# RedCloth#to_html method.
@@ -270,14 +270,14 @@ class RedCloth3 < String
rules = DEFAULT_RULES if rules.empty?
# make our working copy
text = self.dup
-
+
@urlrefs = {}
@shelf = []
textile_rules = [:block_textile_table, :block_textile_lists,
:block_textile_prefix, :inline_textile_image, :inline_textile_code,
:inline_textile_span, :inline_textile_link, :glyphs_textile]
markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule,
- :block_markdown_bq, :block_markdown_lists,
+ :block_markdown_bq, :block_markdown_lists,
:inline_markdown_reflink, :inline_markdown_link]
@rules = rules.collect do |rule|
case rule
@@ -291,8 +291,8 @@ class RedCloth3 < String
end.flatten
# standard clean up
- incoming_entities text
- clean_white_space text
+ incoming_entities text
+ clean_white_space text
# start processor
@pre_list = []
@@ -301,7 +301,7 @@ class RedCloth3 < String
escape_html_tags text
# need to do this before #hard_break and #blocks
block_textile_quotes text unless @lite_mode
- hard_break text
+ hard_break text
unless @lite_mode
refs text
blocks text
@@ -328,10 +328,10 @@ class RedCloth3 < String
#
TEXTILE_TAGS =
- [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230],
- [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249],
- [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217],
- [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732],
+ [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230],
+ [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249],
+ [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217],
+ [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732],
[153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]].
collect! do |a, b|
@@ -359,7 +359,7 @@ class RedCloth3 < String
# Text markup tags, don't conflict with block tags
SIMPLE_HTML_TAGS = [
- 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',
+ 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',
'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br',
'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo'
]
@@ -375,9 +375,9 @@ class RedCloth3 < String
['+', 'ins', :limit],
['^', 'sup', :limit],
['~', 'sub', :limit]
- ]
+ ]
QTAGS_JOIN = QTAGS.map {|rc, ht, rtype| Regexp::quote rc}.join('|')
-
+
QTAGS.collect! do |rc, ht, rtype|
rcq = Regexp::quote rc
re =
@@ -397,7 +397,7 @@ class RedCloth3 < String
(#{C})
(?::(\S+))?
([[:word:]]|[^\s\-].*?[^\s\-])
- #{rcq}/xm
+ #{rcq}/xm
end
[rc, ht, re, rtype]
end
@@ -466,7 +466,7 @@ class RedCloth3 < String
# Parses Textile attribute lists and builds an HTML attribute string
def pba( text_in, element = "" )
-
+
return +'' unless text_in
style = []
@@ -487,7 +487,7 @@ class RedCloth3 < String
cls = $1 if
text.sub!( /\(([^()]+?)\)/, '' )
-
+
style << "padding-left:#{ $1.length }em;" if
text.sub!( /([(]+)/, '' )
@@ -512,7 +512,7 @@ class RedCloth3 < String
atts << " id=\"#{ id }\"" if id
atts << " colspan=\"#{ colspan }\"" if colspan
atts << " rowspan=\"#{ rowspan }\"" if rowspan
-
+
atts
end
@@ -527,9 +527,9 @@ class RedCloth3 < String
end
TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m
-
+
# Parses a Textile table block, building HTML from the result.
- def block_textile_table( text )
+ def block_textile_table( text )
text.gsub!( TABLE_RE ) do |matches|
tatts, fullrow = $~[1..2]
@@ -540,7 +540,7 @@ class RedCloth3 < String
fullrow.each_line do |row|
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
cells = []
- # the regexp prevents wiki links with a | from being cut as cells
+ # the regexp prevents wiki links with a | from being cut as cells
row.scan(/\|(_?#{S}#{A}#{C}\. ?)?((\[\[[^|\]]*\|[^|\]]*\]\]|[^|])*?)(?=\|)/) do |modifiers, cell|
ctyp = 'd'
ctyp = 'h' if modifiers && modifiers =~ /^_/
@@ -549,7 +549,7 @@ class RedCloth3 < String
catts = pba( modifiers, 'td' ) if modifiers
catts = shelve( catts ) if catts
- cells << "\t\t\t
" out = "
#{ out }"
@@ -993,18 +993,18 @@ class RedCloth3 < String
end
end
- def shelve( val )
+ def shelve( val )
@shelf << val
" :redsh##{ @shelf.length }:"
end
-
- def retrieve( text )
+
+ def retrieve( text )
text.gsub!(/ :redsh#(\d+):/) do
@shelf[$1.to_i - 1] || $&
end
end
- def incoming_entities( text )
+ def incoming_entities( text )
## turn any incoming ampersands into a dummy character for now.
## This uses a negative lookahead for alphanumerics followed by a semicolon,
## implying an incoming html entity, to be skipped
@@ -1012,14 +1012,14 @@ class RedCloth3 < String
text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" )
end
- def no_textile( text )
+ def no_textile( text )
text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/,
'\1