Merge branch 'unstable' into release-v2.0.0
This commit is contained in:
commit
6b8897db5f
|
@ -20,21 +20,6 @@ module Redmine
|
|||
PATCH = 0
|
||||
TINY = PATCH # Redmine compat
|
||||
|
||||
# Used by semver to define the special version (if any).
|
||||
# A special version "satify but have a lower precedence than the associated
|
||||
# normal version". So 2.0.0RC1 would be part of the 2.0.0 series but
|
||||
# be considered to be an older version.
|
||||
#
|
||||
# 1.4.0 < 2.0.0RC1 < 2.0.0RC2 < 2.0.0 < 2.1.0
|
||||
#
|
||||
# This method may be overridden by third party code to provide vendor or
|
||||
# distribution specific versions. They may or may not follow semver.org:
|
||||
#
|
||||
# 2.0.0debian-2
|
||||
def self.special
|
||||
'RC1'
|
||||
end
|
||||
|
||||
def self.revision
|
||||
revision = nil
|
||||
entries_path = "#{RAILS_ROOT}/.svn/entries"
|
||||
|
|
|
@ -14,14 +14,20 @@
|
|||
namespace :code do
|
||||
desc "Fix line endings of all source files"
|
||||
task :fix_line_endings do
|
||||
unless `which fromdos`.present?
|
||||
raise "fromdos command not found"
|
||||
end
|
||||
|
||||
Dir['**/**{.rb,.html.erb,.rhtml,.rjs,.rsb,.plain.erb,.rxml,.yml,.rake,.eml}'].each do |file_name|
|
||||
next if file_name.include?("vendor")
|
||||
system("fromdos #{file_name}")
|
||||
end
|
||||
Dir.chdir(File.join(File.dirname(__FILE__), "../..")) do
|
||||
files = Dir['**/**{.rb,.html.erb,.rhtml,.rjs,.rsb,.plain.erb,.rxml,.yml,.rake,.eml}']
|
||||
files.reject!{ |f|
|
||||
f.include?("vendor") ||
|
||||
f.include?("lib/SVG") ||
|
||||
f.include?("lib/faster_csv") ||
|
||||
f.include?("lib/redcloth") ||
|
||||
f.include?("lib/diff")
|
||||
}
|
||||
|
||||
# handle files in chunks of 50 to avoid too long command lines
|
||||
while (slice = files.slice!(0, 50)).present?
|
||||
system('ruby', '-i', '-pe', 'gsub(/\s+$/,"\n")', *slice)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,24 @@
|
|||
#-- copyright
|
||||
# ChiliProject is a project management system.
|
||||
#
|
||||
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# See doc/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
namespace :copyright do
|
||||
desc "Update the copyright on the source files"
|
||||
task :update do
|
||||
short_copyright = File.readlines("doc/COPYRIGHT_short.rdoc").collect do |line|
|
||||
"# #{line}"
|
||||
end.join("")
|
||||
"# #{line}".rstrip
|
||||
end.join("\n")
|
||||
|
||||
short_copyright_as_rdoc = "#-- copyright\n" + short_copyright + "#++"
|
||||
short_copyright_as_rdoc = "#-- copyright\n" + short_copyright + "\n#++"
|
||||
|
||||
Dir['**/**{.rb,.rake}'].each do |file_name|
|
||||
# Skip 3rd party code
|
||||
|
@ -14,11 +27,9 @@ namespace :copyright do
|
|||
file_name.include?("lib/faster_csv") ||
|
||||
file_name.include?("lib/redcloth") ||
|
||||
file_name.include?("lib/diff")
|
||||
next if file_name.include?("lib/tasks/copyright") # skip self
|
||||
next if file_name.include?("unified_diff_test") # confict
|
||||
|
||||
file_content = File.read(file_name)
|
||||
@copyright_regex = /#-- copyright.*\+\+/m
|
||||
@copyright_regex = /^#--\s*copyright.*?\+\+/m
|
||||
if file_content.match(@copyright_regex)
|
||||
file_content.gsub!(@copyright_regex, short_copyright_as_rdoc)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue