mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-10 03:03:05 +00:00
Support frozen_string_literal in lib/**/*.rb (#26561).
Contributed by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17988 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
bd5977d97e
commit
30e341db69
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_activity_provider'
|
require File.dirname(__FILE__) + '/lib/acts_as_activity_provider'
|
||||||
ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
|
ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_attachable'
|
require File.dirname(__FILE__) + '/lib/acts_as_attachable'
|
||||||
ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
|
ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_customizable'
|
require File.dirname(__FILE__) + '/lib/acts_as_customizable'
|
||||||
ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
|
ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_event'
|
require File.dirname(__FILE__) + '/lib/acts_as_event'
|
||||||
ActiveRecord::Base.send(:include, Redmine::Acts::Event)
|
ActiveRecord::Base.send(:include, Redmine::Acts::Event)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_searchable'
|
require File.dirname(__FILE__) + '/lib/acts_as_searchable'
|
||||||
ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
|
ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActiveRecord
|
module ActiveRecord
|
||||||
module Acts
|
module Acts
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Include hook code here
|
# Include hook code here
|
||||||
require File.dirname(__FILE__) + '/lib/acts_as_watchable'
|
require File.dirname(__FILE__) + '/lib/acts_as_watchable'
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# ActsAsWatchable
|
# ActsAsWatchable
|
||||||
module Redmine
|
module Redmine
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'gravatar'
|
require 'gravatar'
|
||||||
ActionView::Base.send :include, GravatarHelper::PublicMethods
|
ActionView::Base.send :include, GravatarHelper::PublicMethods
|
||||||
|
|||||||
@ -89,7 +89,7 @@ module OpenIdAuthentication
|
|||||||
# dodge XRIs -- TODO: validate, don't just skip.
|
# dodge XRIs -- TODO: validate, don't just skip.
|
||||||
unless ['=', '@', '+', '$', '!', '('].include?(identifier.at(0))
|
unless ['=', '@', '+', '$', '!', '('].include?(identifier.at(0))
|
||||||
# does it begin with http? if not, add it.
|
# does it begin with http? if not, add it.
|
||||||
identifier = "http://#{identifier}" unless identifier =~ /^http/i
|
identifier = +"http://#{identifier}" unless identifier =~ /^http/i
|
||||||
|
|
||||||
# strip any fragments
|
# strip any fragments
|
||||||
identifier.gsub!(/\#(.*)$/, '')
|
identifier.gsub!(/\#(.*)$/, '')
|
||||||
|
|||||||
@ -185,7 +185,7 @@ module Redmine
|
|||||||
|
|
||||||
def parse_keyword(custom_field, keyword, &block)
|
def parse_keyword(custom_field, keyword, &block)
|
||||||
separator = Regexp.escape ","
|
separator = Regexp.escape ","
|
||||||
keyword = keyword.to_s
|
keyword = keyword.dup.to_s
|
||||||
|
|
||||||
if custom_field.multiple?
|
if custom_field.multiple?
|
||||||
values = []
|
values = []
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -46,7 +46,7 @@ module Redmine
|
|||||||
add_at = nil
|
add_at = nil
|
||||||
add_to = nil
|
add_to = nil
|
||||||
del_at = nil
|
del_at = nil
|
||||||
deleted = ""
|
deleted = +""
|
||||||
diff.each do |change|
|
diff.each do |change|
|
||||||
pos = change[1]
|
pos = change[1]
|
||||||
if change[0] == "+"
|
if change[0] == "+"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -76,8 +76,8 @@ module Redmine
|
|||||||
end
|
end
|
||||||
@date_from = Date.civil(@year_from, @month_from, 1)
|
@date_from = Date.civil(@year_from, @month_from, 1)
|
||||||
@date_to = (@date_from >> @months) - 1
|
@date_to = (@date_from >> @months) - 1
|
||||||
@subjects = ''
|
@subjects = +''
|
||||||
@lines = ''
|
@lines = +''
|
||||||
@number_of_rows = nil
|
@number_of_rows = nil
|
||||||
@truncated = false
|
@truncated = false
|
||||||
if options.has_key?(:max_rows)
|
if options.has_key?(:max_rows)
|
||||||
@ -198,8 +198,8 @@ module Redmine
|
|||||||
:indent_increment => 20, :render => :subject,
|
:indent_increment => 20, :render => :subject,
|
||||||
:format => :html}.merge(options)
|
:format => :html}.merge(options)
|
||||||
indent = options[:indent] || 4
|
indent = options[:indent] || 4
|
||||||
@subjects = '' unless options[:only] == :lines
|
@subjects = +'' unless options[:only] == :lines
|
||||||
@lines = '' unless options[:only] == :subjects
|
@lines = +'' unless options[:only] == :subjects
|
||||||
@number_of_rows = 0
|
@number_of_rows = 0
|
||||||
begin
|
begin
|
||||||
Project.project_tree(projects) do |project, level|
|
Project.project_tree(projects) do |project, level|
|
||||||
@ -652,7 +652,7 @@ module Redmine
|
|||||||
case object
|
case object
|
||||||
when Issue
|
when Issue
|
||||||
issue = object
|
issue = object
|
||||||
css_classes = ''
|
css_classes = +''
|
||||||
css_classes << ' issue-overdue' if issue.overdue?
|
css_classes << ' issue-overdue' if issue.overdue?
|
||||||
css_classes << ' issue-behind-schedule' if issue.behind_schedule?
|
css_classes << ' issue-behind-schedule' if issue.behind_schedule?
|
||||||
css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
|
css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to
|
||||||
@ -663,7 +663,7 @@ module Redmine
|
|||||||
css_classes << ' behind-start-date' if progress_date < self.date_from
|
css_classes << ' behind-start-date' if progress_date < self.date_from
|
||||||
css_classes << ' over-end-date' if progress_date > self.date_to
|
css_classes << ' over-end-date' if progress_date > self.date_to
|
||||||
end
|
end
|
||||||
s = "".html_safe
|
s = (+"").html_safe
|
||||||
if issue.assigned_to.present?
|
if issue.assigned_to.present?
|
||||||
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
|
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
|
||||||
s << view.avatar(issue.assigned_to,
|
s << view.avatar(issue.assigned_to,
|
||||||
@ -676,7 +676,7 @@ module Redmine
|
|||||||
view.content_tag(:span, s, :class => css_classes).html_safe
|
view.content_tag(:span, s, :class => css_classes).html_safe
|
||||||
when Version
|
when Version
|
||||||
version = object
|
version = object
|
||||||
html_class = ""
|
html_class = +""
|
||||||
html_class << 'icon icon-package '
|
html_class << 'icon icon-package '
|
||||||
html_class << (version.behind_schedule? ? 'version-behind-schedule' : '') << " "
|
html_class << (version.behind_schedule? ? 'version-behind-schedule' : '') << " "
|
||||||
html_class << (version.overdue? ? 'version-overdue' : '')
|
html_class << (version.overdue? ? 'version-overdue' : '')
|
||||||
@ -691,7 +691,7 @@ module Redmine
|
|||||||
view.content_tag(:span, s, :class => html_class).html_safe
|
view.content_tag(:span, s, :class => html_class).html_safe
|
||||||
when Project
|
when Project
|
||||||
project = object
|
project = object
|
||||||
html_class = ""
|
html_class = +""
|
||||||
html_class << 'icon icon-projects '
|
html_class << 'icon icon-projects '
|
||||||
html_class << (project.overdue? ? 'project-overdue' : '')
|
html_class << (project.overdue? ? 'project-overdue' : '')
|
||||||
s = view.link_to_project(project).html_safe
|
s = view.link_to_project(project).html_safe
|
||||||
@ -727,7 +727,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
if has_children
|
if has_children
|
||||||
content = view.content_tag(:span, nil, :class => :expander) + content
|
content = view.content_tag(:span, nil, :class => :expander) + content
|
||||||
tag_options[:class] << ' open'
|
tag_options[:class] += ' open'
|
||||||
else
|
else
|
||||||
if params[:indent]
|
if params[:indent]
|
||||||
params = params.dup
|
params = params.dup
|
||||||
@ -735,7 +735,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
|
style = "position: absolute;top:#{params[:top]}px;left:#{params[:indent]}px;"
|
||||||
style << "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
|
style += "width:#{params[:subject_width] - params[:indent]}px;" if params[:subject_width]
|
||||||
tag_options[:style] = style
|
tag_options[:style] = style
|
||||||
output = view.content_tag(:div, content, tag_options)
|
output = view.content_tag(:div, content, tag_options)
|
||||||
@subjects << output
|
@subjects << output
|
||||||
@ -774,7 +774,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def html_task(params, coords, markers, label, object)
|
def html_task(params, coords, markers, label, object)
|
||||||
output = ''
|
output = +''
|
||||||
data_options = {}
|
data_options = {}
|
||||||
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase if object
|
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase if object
|
||||||
|
|
||||||
@ -792,7 +792,7 @@ module Redmine
|
|||||||
# Renders the task bar, with progress and late
|
# Renders the task bar, with progress and late
|
||||||
if coords[:bar_start] && coords[:bar_end]
|
if coords[:bar_start] && coords[:bar_end]
|
||||||
width = coords[:bar_end] - coords[:bar_start] - 2
|
width = coords[:bar_end] - coords[:bar_start] - 2
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:bar_start]}px;"
|
style << "left:#{coords[:bar_start]}px;"
|
||||||
style << "width:#{width}px;"
|
style << "width:#{width}px;"
|
||||||
@ -812,7 +812,7 @@ module Redmine
|
|||||||
output << view.content_tag(:div, ' '.html_safe, content_opt)
|
output << view.content_tag(:div, ' '.html_safe, content_opt)
|
||||||
if coords[:bar_late_end]
|
if coords[:bar_late_end]
|
||||||
width = coords[:bar_late_end] - coords[:bar_start] - 2
|
width = coords[:bar_late_end] - coords[:bar_start] - 2
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:bar_start]}px;"
|
style << "left:#{coords[:bar_start]}px;"
|
||||||
style << "width:#{width}px;"
|
style << "width:#{width}px;"
|
||||||
@ -823,7 +823,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
if coords[:bar_progress_end]
|
if coords[:bar_progress_end]
|
||||||
width = coords[:bar_progress_end] - coords[:bar_start] - 2
|
width = coords[:bar_progress_end] - coords[:bar_start] - 2
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:bar_start]}px;"
|
style << "left:#{coords[:bar_start]}px;"
|
||||||
style << "width:#{width}px;"
|
style << "width:#{width}px;"
|
||||||
@ -839,7 +839,7 @@ module Redmine
|
|||||||
# Renders the markers
|
# Renders the markers
|
||||||
if markers
|
if markers
|
||||||
if coords[:start]
|
if coords[:start]
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:start]}px;"
|
style << "left:#{coords[:start]}px;"
|
||||||
style << "width:15px;"
|
style << "width:15px;"
|
||||||
@ -849,7 +849,7 @@ module Redmine
|
|||||||
:data => data_options)
|
:data => data_options)
|
||||||
end
|
end
|
||||||
if coords[:end]
|
if coords[:end]
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:end] + params[:zoom]}px;"
|
style << "left:#{coords[:end] + params[:zoom]}px;"
|
||||||
style << "width:15px;"
|
style << "width:15px;"
|
||||||
@ -861,7 +861,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
# Renders the label on the right
|
# Renders the label on the right
|
||||||
if label
|
if label
|
||||||
style = ""
|
style = +""
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{(coords[:bar_end] || 0) + 8}px;"
|
style << "left:#{(coords[:bar_end] || 0) + 8}px;"
|
||||||
style << "width:15px;"
|
style << "width:15px;"
|
||||||
@ -876,7 +876,7 @@ module Redmine
|
|||||||
view.render_issue_tooltip(object).html_safe,
|
view.render_issue_tooltip(object).html_safe,
|
||||||
:class => "tip")
|
:class => "tip")
|
||||||
s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => object.id, :style => 'display:none;', :class => 'toggle-selection')
|
s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => object.id, :style => 'display:none;', :class => 'toggle-selection')
|
||||||
style = ""
|
style = +""
|
||||||
style << "position: absolute;"
|
style << "position: absolute;"
|
||||||
style << "top:#{params[:top]}px;"
|
style << "top:#{params[:top]}px;"
|
||||||
style << "left:#{coords[:bar_start]}px;"
|
style << "left:#{coords[:bar_start]}px;"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Redmine
|
module Redmine
|
||||||
module Info
|
module Info
|
||||||
@ -9,7 +9,7 @@ module Redmine
|
|||||||
def versioned_name; "#{app_name} #{Redmine::VERSION}" end
|
def versioned_name; "#{app_name} #{Redmine::VERSION}" end
|
||||||
|
|
||||||
def environment
|
def environment
|
||||||
s = "Environment:\n"
|
s = +"Environment:\n"
|
||||||
s << [
|
s << [
|
||||||
["Redmine version", Redmine::VERSION],
|
["Redmine version", Redmine::VERSION],
|
||||||
["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
|
["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -159,7 +159,7 @@ module Redmine
|
|||||||
per_page_links = false if count.nil?
|
per_page_links = false if count.nil?
|
||||||
page_param = paginator.page_param
|
page_param = paginator.page_param
|
||||||
|
|
||||||
html = '<ul class="pages">'
|
html = +'<ul class="pages">'
|
||||||
|
|
||||||
if paginator.multiple_pages?
|
if paginator.multiple_pages?
|
||||||
# \xc2\xab(utf-8) = «
|
# \xc2\xab(utf-8) = «
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -276,8 +276,9 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def scm_iconv(to, from, str)
|
def scm_iconv(to, from, str)
|
||||||
return nil if str.nil?
|
return if str.nil?
|
||||||
return str if to == from && str.encoding.to_s == from
|
return str if to == from && str.encoding.to_s == from
|
||||||
|
str = str.dup
|
||||||
str.force_encoding(from)
|
str.force_encoding(from)
|
||||||
begin
|
begin
|
||||||
str.encode(to)
|
str.encode(to)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -154,7 +154,7 @@ module Redmine
|
|||||||
parsing = $1
|
parsing = $1
|
||||||
elsif line =~ /^ (.*)$/
|
elsif line =~ /^ (.*)$/
|
||||||
if parsing == 'message'
|
if parsing == 'message'
|
||||||
revision.message << "#{$1}\n"
|
revision.message += "#{$1}\n"
|
||||||
else
|
else
|
||||||
if $1 =~ /^(.*)\s+(\S+)$/
|
if $1 =~ /^(.*)\s+(\S+)$/
|
||||||
path_locale = $1.strip
|
path_locale = $1.strip
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# redMine - project management software
|
# redMine - project management software
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||||
@ -93,7 +93,7 @@ module Redmine
|
|||||||
def entries(path=nil, identifier=nil, options={})
|
def entries(path=nil, identifier=nil, options={})
|
||||||
logger.debug "<cvs> entries '#{path}' with identifier '#{identifier}'"
|
logger.debug "<cvs> entries '#{path}' with identifier '#{identifier}'"
|
||||||
path_locale = scm_iconv(@path_encoding, 'UTF-8', path)
|
path_locale = scm_iconv(@path_encoding, 'UTF-8', path)
|
||||||
path_locale.force_encoding("ASCII-8BIT")
|
path_locale = path_locale.dup.force_encoding("ASCII-8BIT")
|
||||||
entries = Entries.new
|
entries = Entries.new
|
||||||
cmd_args = %w|-q rls -e|
|
cmd_args = %w|-q rls -e|
|
||||||
cmd_args << "-D" << time_to_cvstime_rlog(identifier) if identifier
|
cmd_args << "-D" << time_to_cvstime_rlog(identifier) if identifier
|
||||||
@ -161,7 +161,7 @@ module Redmine
|
|||||||
cmd_args << path_with_project_utf8
|
cmd_args << path_with_project_utf8
|
||||||
scm_cmd(*cmd_args) do |io|
|
scm_cmd(*cmd_args) do |io|
|
||||||
state = "entry_start"
|
state = "entry_start"
|
||||||
commit_log = String.new
|
commit_log = ""
|
||||||
revision = nil
|
revision = nil
|
||||||
date = nil
|
date = nil
|
||||||
author = nil
|
author = nil
|
||||||
@ -171,7 +171,7 @@ module Redmine
|
|||||||
branch_map = nil
|
branch_map = nil
|
||||||
io.each_line() do |line|
|
io.each_line() do |line|
|
||||||
if state != "revision" && /^#{ENDLOG}/ =~ line
|
if state != "revision" && /^#{ENDLOG}/ =~ line
|
||||||
commit_log = String.new
|
commit_log = ""
|
||||||
revision = nil
|
revision = nil
|
||||||
state = "entry_start"
|
state = "entry_start"
|
||||||
end
|
end
|
||||||
@ -186,7 +186,7 @@ module Redmine
|
|||||||
elsif /^symbolic names:/ =~ line
|
elsif /^symbolic names:/ =~ line
|
||||||
state = "symbolic" #unless entry.nil?
|
state = "symbolic" #unless entry.nil?
|
||||||
elsif /^#{STARTLOG}/ =~ line
|
elsif /^#{STARTLOG}/ =~ line
|
||||||
commit_log = String.new
|
commit_log = ""
|
||||||
state = "revision"
|
state = "revision"
|
||||||
end
|
end
|
||||||
next
|
next
|
||||||
@ -230,7 +230,7 @@ module Redmine
|
|||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
commit_log = String.new
|
commit_log = ""
|
||||||
revision = nil
|
revision = nil
|
||||||
if /^#{ENDLOG}/ =~ line
|
if /^#{ENDLOG}/ =~ line
|
||||||
state = "entry_start"
|
state = "entry_start"
|
||||||
@ -261,7 +261,7 @@ module Redmine
|
|||||||
# version.line_minus = 0
|
# version.line_minus = 0
|
||||||
# end
|
# end
|
||||||
else
|
else
|
||||||
commit_log << line unless line =~ /^\*\*\* empty log message \*\*\*/
|
commit_log += line unless line =~ /^\*\*\* empty log message \*\*\*/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -203,7 +203,7 @@ module Redmine
|
|||||||
cmd_args << "--" << scm_iconv(@path_encoding, 'UTF-8', path) if path && !path.empty?
|
cmd_args << "--" << scm_iconv(@path_encoding, 'UTF-8', path) if path && !path.empty?
|
||||||
revisions = []
|
revisions = []
|
||||||
if identifier_from || identifier_to
|
if identifier_from || identifier_to
|
||||||
revisions << ""
|
revisions << +""
|
||||||
revisions[0] << "#{identifier_from}.." if identifier_from
|
revisions[0] << "#{identifier_from}.." if identifier_from
|
||||||
revisions[0] << "#{identifier_to}" if identifier_to
|
revisions[0] << "#{identifier_to}" if identifier_to
|
||||||
else
|
else
|
||||||
@ -261,7 +261,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
elsif (parsing_descr == 0) && line.chomp.to_s == ""
|
elsif (parsing_descr == 0) && line.chomp.to_s == ""
|
||||||
parsing_descr = 1
|
parsing_descr = 1
|
||||||
changeset[:description] = ""
|
changeset[:description] = +""
|
||||||
elsif (parsing_descr == 1 || parsing_descr == 2) \
|
elsif (parsing_descr == 1 || parsing_descr == 2) \
|
||||||
&& line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
|
&& line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/
|
||||||
parsing_descr = 2
|
parsing_descr = 2
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -61,7 +61,7 @@ module Redmine
|
|||||||
|
|
||||||
# Get info about the svn repository
|
# Get info about the svn repository
|
||||||
def info
|
def info
|
||||||
cmd = "#{self.class.sq_bin} info --xml #{target}"
|
cmd = +"#{self.class.sq_bin} info --xml #{target}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
info = nil
|
info = nil
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
@ -91,7 +91,7 @@ module Redmine
|
|||||||
path ||= ''
|
path ||= ''
|
||||||
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
||||||
entries = Entries.new
|
entries = Entries.new
|
||||||
cmd = "#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}"
|
cmd = +"#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
output = io.read.force_encoding('UTF-8')
|
output = io.read.force_encoding('UTF-8')
|
||||||
@ -130,7 +130,7 @@ module Redmine
|
|||||||
return nil unless self.class.client_version_above?([1, 5, 0])
|
return nil unless self.class.client_version_above?([1, 5, 0])
|
||||||
|
|
||||||
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
||||||
cmd = "#{self.class.sq_bin} proplist --verbose --xml #{target(path)}@#{identifier}"
|
cmd = +"#{self.class.sq_bin} proplist --verbose --xml #{target(path)}@#{identifier}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
properties = {}
|
properties = {}
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
@ -152,7 +152,7 @@ module Redmine
|
|||||||
identifier_from = (identifier_from && identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD"
|
identifier_from = (identifier_from && identifier_from.to_i > 0) ? identifier_from.to_i : "HEAD"
|
||||||
identifier_to = (identifier_to && identifier_to.to_i > 0) ? identifier_to.to_i : 1
|
identifier_to = (identifier_to && identifier_to.to_i > 0) ? identifier_to.to_i : 1
|
||||||
revisions = Revisions.new
|
revisions = Revisions.new
|
||||||
cmd = "#{self.class.sq_bin} log --xml -r #{identifier_from}:#{identifier_to}"
|
cmd = +"#{self.class.sq_bin} log --xml -r #{identifier_from}:#{identifier_to}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
cmd << " --verbose " if options[:with_paths]
|
cmd << " --verbose " if options[:with_paths]
|
||||||
cmd << " --limit #{options[:limit].to_i}" if options[:limit]
|
cmd << " --limit #{options[:limit].to_i}" if options[:limit]
|
||||||
@ -192,7 +192,7 @@ module Redmine
|
|||||||
|
|
||||||
identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1)
|
identifier_to = (identifier_to and identifier_to.to_i > 0) ? identifier_to.to_i : (identifier_from.to_i - 1)
|
||||||
|
|
||||||
cmd = "#{self.class.sq_bin} diff -r "
|
cmd = +"#{self.class.sq_bin} diff -r "
|
||||||
cmd << "#{identifier_to}:"
|
cmd << "#{identifier_to}:"
|
||||||
cmd << "#{identifier_from}"
|
cmd << "#{identifier_from}"
|
||||||
cmd << " #{target(path)}@#{identifier_from}"
|
cmd << " #{target(path)}@#{identifier_from}"
|
||||||
@ -209,7 +209,7 @@ module Redmine
|
|||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
||||||
cmd = "#{self.class.sq_bin} cat #{target(path)}@#{identifier}"
|
cmd = +"#{self.class.sq_bin} cat #{target(path)}@#{identifier}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
cat = nil
|
cat = nil
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
@ -222,7 +222,7 @@ module Redmine
|
|||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
|
||||||
cmd = "#{self.class.sq_bin} blame #{target(path)}@#{identifier}"
|
cmd = +"#{self.class.sq_bin} blame #{target(path)}@#{identifier}"
|
||||||
cmd << credentials_string
|
cmd << credentials_string
|
||||||
blame = Annotate.new
|
blame = Annotate.new
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
@ -244,7 +244,7 @@ module Redmine
|
|||||||
private
|
private
|
||||||
|
|
||||||
def credentials_string
|
def credentials_string
|
||||||
str = ''
|
str = +''
|
||||||
str << " --username #{shell_quote(@login)}" unless @login.blank?
|
str << " --username #{shell_quote(@login)}" unless @login.blank?
|
||||||
str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
|
str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank?
|
||||||
str << " --no-auth-cache --non-interactive"
|
str << " --no-auth-cache --non-interactive"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -274,7 +274,7 @@ module Redmine
|
|||||||
|
|
||||||
def line_to_html_raw(line, offsets)
|
def line_to_html_raw(line, offsets)
|
||||||
if offsets
|
if offsets
|
||||||
s = ''
|
s = +''
|
||||||
unless offsets.first == 0
|
unless offsets.first == 0
|
||||||
s << CGI.escapeHTML(line[0..offsets.first-1])
|
s << CGI.escapeHTML(line[0..offsets.first-1])
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -83,7 +83,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def extract_sections(index)
|
def extract_sections(index)
|
||||||
sections = ['', '', '']
|
sections = [+'', +'', +'']
|
||||||
offset = 0
|
offset = 0
|
||||||
i = 0
|
i = 0
|
||||||
l = 1
|
l = 1
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
@ -65,9 +65,9 @@ module Redmine
|
|||||||
@pre_list = []
|
@pre_list = []
|
||||||
text = self.dup
|
text = self.dup
|
||||||
rip_offtags text, false, false
|
rip_offtags text, false, false
|
||||||
before = ''
|
before = +''
|
||||||
s = ''
|
s = +''
|
||||||
after = ''
|
after = +''
|
||||||
i = 0
|
i = 0
|
||||||
l = 1
|
l = 1
|
||||||
started = false
|
started = false
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: false
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# vim:ts=4:sw=4:
|
# vim:ts=4:sw=4:
|
||||||
# = RedCloth - Textile and Markdown Hybrid for Ruby
|
# = RedCloth - Textile and Markdown Hybrid for Ruby
|
||||||
@ -467,7 +467,7 @@ class RedCloth3 < String
|
|||||||
# Parses Textile attribute lists and builds an HTML attribute string
|
# Parses Textile attribute lists and builds an HTML attribute string
|
||||||
def pba( text_in, element = "" )
|
def pba( text_in, element = "" )
|
||||||
|
|
||||||
return '' unless text_in
|
return +'' unless text_in
|
||||||
|
|
||||||
style = []
|
style = []
|
||||||
text = text_in.dup
|
text = text_in.dup
|
||||||
@ -505,7 +505,7 @@ class RedCloth3 < String
|
|||||||
|
|
||||||
id = id.starts_with?('wiki-id-') ? id : "wiki-id-#{id}" if id
|
id = id.starts_with?('wiki-id-') ? id : "wiki-id-#{id}" if id
|
||||||
|
|
||||||
atts = ''
|
atts = +''
|
||||||
atts << " style=\"#{ style.join }\"" unless style.empty?
|
atts << " style=\"#{ style.join }\"" unless style.empty?
|
||||||
atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
|
atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
|
||||||
atts << " lang=\"#{ lang }\"" if lang
|
atts << " lang=\"#{ lang }\"" if lang
|
||||||
@ -586,9 +586,9 @@ class RedCloth3 < String
|
|||||||
depth << tl
|
depth << tl
|
||||||
atts = pba( atts )
|
atts = pba( atts )
|
||||||
atts = shelve( atts ) if atts
|
atts = shelve( atts ) if atts
|
||||||
lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t<li>#{ content }"
|
lines[line_id] = +"\t<#{ lT(tl) }l#{ atts }>\n\t<li>#{ content }"
|
||||||
else
|
else
|
||||||
lines[line_id] = "\t\t<li>#{ content }"
|
lines[line_id] = +"\t\t<li>#{ content }"
|
||||||
end
|
end
|
||||||
last_line = line_id
|
last_line = line_id
|
||||||
|
|
||||||
@ -611,7 +611,7 @@ class RedCloth3 < String
|
|||||||
def block_textile_quotes( text )
|
def block_textile_quotes( text )
|
||||||
text.gsub!( QUOTES_RE ) do |match|
|
text.gsub!( QUOTES_RE ) do |match|
|
||||||
lines = match.split( /\n/ )
|
lines = match.split( /\n/ )
|
||||||
quotes = ''
|
quotes = +''
|
||||||
indent = 0
|
indent = 0
|
||||||
lines.each do |line|
|
lines.each do |line|
|
||||||
line =~ QUOTES_CONTENT_RE
|
line =~ QUOTES_CONTENT_RE
|
||||||
@ -639,7 +639,7 @@ class RedCloth3 < String
|
|||||||
text.gsub!( CODE_RE ) do |m|
|
text.gsub!( CODE_RE ) do |m|
|
||||||
before,lang,code,after = $~[1..4]
|
before,lang,code,after = $~[1..4]
|
||||||
lang = " lang=\"#{ lang }\"" if lang
|
lang = " lang=\"#{ lang }\"" if lang
|
||||||
rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }", false )
|
rip_offtags( +"#{ before }<code#{ lang }>#{ code }</code>#{ after }", false )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -851,7 +851,7 @@ class RedCloth3 < String
|
|||||||
post = ")"+post # add closing parenth to post
|
post = ")"+post # add closing parenth to post
|
||||||
end
|
end
|
||||||
atts = pba( atts )
|
atts = pba( atts )
|
||||||
atts = " href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
|
atts = +" href=\"#{ htmlesc url }#{ slash }\"#{ atts }"
|
||||||
atts << " title=\"#{ htmlesc title }\"" if title
|
atts << " title=\"#{ htmlesc title }\"" if title
|
||||||
atts = shelve( atts ) if atts
|
atts = shelve( atts ) if atts
|
||||||
|
|
||||||
@ -962,7 +962,7 @@ class RedCloth3 < String
|
|||||||
stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
|
stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
|
||||||
htmlesc title
|
htmlesc title
|
||||||
atts = pba( atts )
|
atts = pba( atts )
|
||||||
atts = " src=\"#{ htmlesc url.dup }\"#{ atts }"
|
atts = +" src=\"#{ htmlesc url.dup }\"#{ atts }"
|
||||||
atts << " title=\"#{ title }\"" if title
|
atts << " title=\"#{ title }\"" if title
|
||||||
atts << " alt=\"#{ title }\""
|
atts << " alt=\"#{ title }\""
|
||||||
# size = @getimagesize($url);
|
# size = @getimagesize($url);
|
||||||
@ -973,7 +973,7 @@ class RedCloth3 < String
|
|||||||
|
|
||||||
next m unless uri_with_safe_scheme?(url)
|
next m unless uri_with_safe_scheme?(url)
|
||||||
|
|
||||||
out = ''
|
out = +''
|
||||||
out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
|
out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
|
||||||
out << "<img#{ shelve( atts ) } />"
|
out << "<img#{ shelve( atts ) } />"
|
||||||
out << "</a>#{ href_a1 }#{ href_a2 }" if href
|
out << "</a>#{ href_a1 }#{ href_a2 }" if href
|
||||||
@ -1096,25 +1096,25 @@ class RedCloth3 < String
|
|||||||
if codepre - used_offtags.length > 0
|
if codepre - used_offtags.length > 0
|
||||||
htmlesc( line, :NoQuotes ) if escape_line
|
htmlesc( line, :NoQuotes ) if escape_line
|
||||||
@pre_list.last << line
|
@pre_list.last << line
|
||||||
line = ""
|
line = +""
|
||||||
else
|
else
|
||||||
### htmlesc is disabled between CODE tags which will be parsed with highlighter
|
### htmlesc is disabled between CODE tags which will be parsed with highlighter
|
||||||
### Regexp in formatter.rb is : /<code\s+class="(\w+)">\s?(.+)/m
|
### Regexp in formatter.rb is : /<code\s+class="(\w+)">\s?(.+)/m
|
||||||
### NB: some changes were made not to use $N variables, because we use "match"
|
### NB: some changes were made not to use $N variables, because we use "match"
|
||||||
### and it breaks following lines
|
### and it breaks following lines
|
||||||
htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag && !first.match(/<code\s+class="(\w+)">/)
|
htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag && !first.match(/<code\s+class="(\w+)">/)
|
||||||
line = "<redpre##{ @pre_list.length }>"
|
line = +"<redpre##{ @pre_list.length }>"
|
||||||
first.match(/<#{ OFFTAGS }([^>]*)>/)
|
first.match(/<#{ OFFTAGS }([^>]*)>/)
|
||||||
tag = $1
|
tag = $1
|
||||||
$2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
|
$2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
|
||||||
tag << " #{$1}" if $1 && tag == 'code'
|
tag << " #{$1}" if $1 && tag == 'code'
|
||||||
@pre_list << "<#{ tag }>#{ aftertag }"
|
@pre_list << +"<#{ tag }>#{ aftertag }"
|
||||||
end
|
end
|
||||||
elsif $1 and codepre > 0
|
elsif $1 and codepre > 0
|
||||||
if codepre - used_offtags.length > 0
|
if codepre - used_offtags.length > 0
|
||||||
htmlesc( line, :NoQuotes ) if escape_line
|
htmlesc( line, :NoQuotes ) if escape_line
|
||||||
@pre_list.last << line
|
@pre_list.last << line
|
||||||
line = ""
|
line = +""
|
||||||
end
|
end
|
||||||
codepre -= 1 unless codepre.zero?
|
codepre -= 1 unless codepre.zero?
|
||||||
used_offtags = {} if codepre.zero?
|
used_offtags = {} if codepre.zero?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user