mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix GraphemeBreakProperty.txt
* tool/downloader.rb: download to the file given in ARGV. * tool/enc-unicode.rb (parse_GraphemeBreakProperty): fix data file path as $(UNICODE_PROPERTY_FILES) in common.mk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
de41817351
commit
81ab413288
3 changed files with 19 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -127,6 +127,7 @@ y.tab.c
|
||||||
/enc/*.exp
|
/enc/*.exp
|
||||||
/enc/*.lib
|
/enc/*.lib
|
||||||
/enc/unicode/data/*/*.txt
|
/enc/unicode/data/*/*.txt
|
||||||
|
/enc/unicode/data/*/*/*.txt
|
||||||
|
|
||||||
# /enc/trans/
|
# /enc/trans/
|
||||||
/enc/trans/*.c
|
/enc/trans/*.c
|
||||||
|
|
|
@ -127,17 +127,17 @@ class Downloader
|
||||||
options.delete(:verify)
|
options.delete(:verify)
|
||||||
file = under(dir, name)
|
file = under(dir, name)
|
||||||
dryrun = options.delete(:dryrun)
|
dryrun = options.delete(:dryrun)
|
||||||
if dryrun
|
|
||||||
puts "Download #{url} into #{file}"
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if since.nil? and File.exist?(file)
|
if since.nil? and File.exist?(file)
|
||||||
if $VERBOSE
|
if $VERBOSE
|
||||||
$stdout.puts "#{name} already exists"
|
$stdout.puts "#{file} already exists"
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
if dryrun
|
||||||
|
puts "Download #{url} into #{file}"
|
||||||
|
return false
|
||||||
|
end
|
||||||
if !https? and url.start_with?("https:")
|
if !https? and url.start_with?("https:")
|
||||||
warn "*** using http instead of https ***"
|
warn "*** using http instead of https ***"
|
||||||
url = url.sub(/\Ahttps/, 'http')
|
url = url.sub(/\Ahttps/, 'http')
|
||||||
|
@ -237,14 +237,22 @@ if $0 == __FILE__
|
||||||
dl = Downloader.const_get(dl)
|
dl = Downloader.const_get(dl)
|
||||||
ARGV.shift
|
ARGV.shift
|
||||||
ARGV.each do |name|
|
ARGV.each do |name|
|
||||||
|
dir = destdir
|
||||||
if prefix
|
if prefix
|
||||||
if name.include?('/auxiliary/')
|
name = name.sub(/\A\.\//, '')
|
||||||
name = "#{prefix}/auxiliary/#{File.basename(name)}"
|
if name.start_with?(destdir+"/")
|
||||||
|
name = name[(destdir.size+1)..-1]
|
||||||
|
if (dir = File.dirname(name)) == '.'
|
||||||
|
dir = destdir
|
||||||
else
|
else
|
||||||
name = "#{prefix}/#{File.basename(name)}"
|
dir = File.join(destdir, dir)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
name = File.basename(name)
|
||||||
end
|
end
|
||||||
dl.download(name, destdir, since, options)
|
name = "#{prefix}/#{name}"
|
||||||
|
end
|
||||||
|
dl.download(name, dir, since, options)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
abort "usage: #{$0} url name" unless ARGV.size == 2
|
abort "usage: #{$0} url name" unless ARGV.size == 2
|
||||||
|
|
|
@ -212,7 +212,7 @@ def parse_GraphemeBreakProperty(data)
|
||||||
current = nil
|
current = nil
|
||||||
cps = []
|
cps = []
|
||||||
ages = []
|
ages = []
|
||||||
data_foreach('GraphemeBreakProperty.txt') do |line|
|
data_foreach('auxiliary/GraphemeBreakProperty.txt') do |line|
|
||||||
if /^# Total code points: / =~ line
|
if /^# Total code points: / =~ line
|
||||||
constname = constantize_Grapheme_Cluster_Break(current)
|
constname = constantize_Grapheme_Cluster_Break(current)
|
||||||
data[constname] = cps
|
data[constname] = cps
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue