@@ -57,7 +57,7 module Redmine | |||
|
57 | 57 | # Calls a hook. |
|
58 | 58 | # Returns the listeners response. |
|
59 | 59 | def call_hook(hook, context={}) |
|
60 |
|
|
|
60 | [].tap do |response| | |
|
61 | 61 | hls = hook_listeners(hook) |
|
62 | 62 | if hls.any? |
|
63 | 63 | hls.each {|listener| response << listener.send(hook, context)} |
@@ -192,13 +192,13 module Redmine | |||
|
192 | 192 | def render_menu_node_with_children(node, project=nil) |
|
193 | 193 | caption, url, selected = extract_node_details(node, project) |
|
194 | 194 | |
|
195 |
html = |
|
|
195 | html = [].tap do |html| | |
|
196 | 196 | html << '<li>' |
|
197 | 197 | # Parent |
|
198 | 198 | html << render_single_menu_node(node, caption, url, selected) |
|
199 | 199 | |
|
200 | 200 | # Standard children |
|
201 |
standard_children_list = |
|
|
201 | standard_children_list = "".tap do |child_html| | |
|
202 | 202 | node.children.each do |child| |
|
203 | 203 | child_html << render_menu_node(child, project) |
|
204 | 204 | end |
@@ -219,7 +219,7 module Redmine | |||
|
219 | 219 | def render_unattached_children_menu(node, project) |
|
220 | 220 | return nil unless node.child_menus |
|
221 | 221 | |
|
222 |
|
|
|
222 | "".tap do |child_html| | |
|
223 | 223 | unattached_children = node.child_menus.call(project) |
|
224 | 224 | # Tree nodes support #each so we need to do object detection |
|
225 | 225 | if unattached_children.is_a? Array |
@@ -18,7 +18,7 class Project < ActiveRecord::Base | |||
|
18 | 18 | end |
|
19 | 19 | |
|
20 | 20 | def self.all_modules |
|
21 |
|
|
|
21 | [].tap do |modules| | |
|
22 | 22 | Redmine::AccessControl.available_project_modules.each do |name| |
|
23 | 23 | modules << EnabledModule.new(:name => name.to_s) |
|
24 | 24 | end |
@@ -154,7 +154,7 module CollectiveIdea #:nodoc: | |||
|
154 | 154 | def each_root_valid?(roots_to_validate) |
|
155 | 155 | left = right = 0 |
|
156 | 156 | roots_to_validate.all? do |root| |
|
157 |
|
|
|
157 | (root.left > left && root.right > right).tap do | |
|
158 | 158 | left = root.left |
|
159 | 159 | right = root.right |
|
160 | 160 | end |
@@ -76,7 +76,7 class PluginMigrationGenerator < Rails::Generator::Base | |||
|
76 | 76 | # plugin names involved is shorter than 230 characters that one will be |
|
77 | 77 | # used. Otherwise a shorter name will be returned. |
|
78 | 78 | def build_migration_name |
|
79 |
|
|
|
79 | descriptive_migration_name.tap do |name| | |
|
80 | 80 | name.replace short_migration_name if name.length > MAX_FILENAME_LENGTH |
|
81 | 81 | end |
|
82 | 82 | end |
@@ -71,7 +71,7 module GravatarHelper | |||
|
71 | 71 | email_hash = Digest::MD5.hexdigest(email) |
|
72 | 72 | options = DEFAULT_OPTIONS.merge(options) |
|
73 | 73 | options[:default] = CGI::escape(options[:default]) unless options[:default].nil? |
|
74 |
|
|
|
74 | gravatar_api_url(email_hash, options.delete(:ssl)).tap do |url| | |
|
75 | 75 | opts = [] |
|
76 | 76 | [:rating, :size, :default].each do |opt| |
|
77 | 77 | unless options[opt].nil? |
General Comments 0
You need to be logged in to leave comments.
Login now