diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:28:46 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:28:46 +0200 |
commit | e6ab70c439301d533f14b3387ee181d843a86b30 (patch) | |
tree | aec5e61d15660ff68ec99b8280b2f01f889127b1 /activesupport | |
parent | adca8154c6ffce978a5dbc514273cceecbb15f8e (diff) | |
download | rails-e6ab70c439301d533f14b3387ee181d843a86b30.tar.gz rails-e6ab70c439301d533f14b3387ee181d843a86b30.tar.bz2 rails-e6ab70c439301d533f14b3387ee181d843a86b30.zip |
applies new string literal convention to the rest of the project
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/Rakefile | 8 | ||||
-rwxr-xr-x | activesupport/bin/generate_tables | 30 |
2 files changed, 19 insertions, 19 deletions
diff --git a/activesupport/Rakefile b/activesupport/Rakefile index 7b56e36abf..de3467529d 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -1,12 +1,12 @@ -require 'rake/testtask' +require "rake/testtask" task :default => :test task :package Rake::TestTask.new do |t| - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' + t.libs << "test" + t.pattern = "test/**/*_test.rb" t.warning = true t.verbose = true t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION) @@ -15,7 +15,7 @@ end namespace :test do task :isolated do Dir.glob("test/**/*_test.rb").all? do |file| - sh(Gem.ruby, '-w', '-Ilib:test', file) + sh(Gem.ruby, "-w", "-Ilib:test", file) end or raise "Failures" end end diff --git a/activesupport/bin/generate_tables b/activesupport/bin/generate_tables index 2193533588..c5ed991d94 100755 --- a/activesupport/bin/generate_tables +++ b/activesupport/bin/generate_tables @@ -1,13 +1,13 @@ #!/usr/bin/env ruby begin - $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib')) - require 'active_support' + $:.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) + require "active_support" rescue IOError end -require 'open-uri' -require 'tmpdir' +require "open-uri" +require "tmpdir" module ActiveSupport module Multibyte @@ -20,10 +20,10 @@ module ActiveSupport class DatabaseGenerator BASE_URI = "http://www.unicode.org/Public/#{UNICODE_VERSION}/ucd/" SOURCES = { - :codepoints => BASE_URI + 'UnicodeData.txt', - :composition_exclusion => BASE_URI + 'CompositionExclusions.txt', - :grapheme_break_property => BASE_URI + 'auxiliary/GraphemeBreakProperty.txt', - :cp1252 => 'http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' + :codepoints => BASE_URI + "UnicodeData.txt", + :composition_exclusion => BASE_URI + "CompositionExclusions.txt", + :grapheme_break_property => BASE_URI + "auxiliary/GraphemeBreakProperty.txt", + :cp1252 => "http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT" } def initialize @@ -52,9 +52,9 @@ module ActiveSupport codepoint.code = $1.hex codepoint.combining_class = Integer($4) codepoint.decomp_type = $7 - codepoint.decomp_mapping = ($8=='') ? nil : $8.split.collect(&:hex) - codepoint.uppercase_mapping = ($16=='') ? 0 : $16.hex - codepoint.lowercase_mapping = ($17=='') ? 0 : $17.hex + codepoint.decomp_mapping = ($8=="") ? nil : $8.split.collect(&:hex) + codepoint.uppercase_mapping = ($16=="") ? 0 : $16.hex + codepoint.lowercase_mapping = ($17=="") ? 0 : $17.hex @ucd.codepoints[codepoint.code] = codepoint end @@ -62,8 +62,8 @@ module ActiveSupport if line =~ /^([0-9A-F.]+)\s*;\s*([\w]+)\s*#/ type = $2.downcase.intern @ucd.boundary[type] ||= [] - if $1.include? '..' - parts = $1.split '..' + if $1.include? ".." + parts = $1.split ".." @ucd.boundary[type] << (parts[0].hex..parts[1].hex) else @ucd.boundary[type] << $1.hex @@ -105,7 +105,7 @@ module ActiveSupport filename = File.join(Dir.tmpdir, "#{url.split('/').last}") unless File.exist?(filename) $stderr.puts "Downloading #{url.split('/').last}" - File.open(filename, 'wb') do |target| + File.open(filename, "wb") do |target| open(url) do |source| source.each_line { |line| target.write line } end @@ -120,7 +120,7 @@ module ActiveSupport end def dump_to(filename) - File.open(filename, 'wb') do |f| + File.open(filename, "wb") do |f| f.write Marshal.dump([@ucd.codepoints, @ucd.composition_exclusion, @ucd.composition_map, @ucd.boundary, @ucd.cp1252]) end end |