Rakefile in ziptz-2.0.5 vs Rakefile in ziptz-2.0.6
- old
+ new
@@ -1,15 +1,15 @@
require 'bundler/setup'
Bundler.setup(:default, :development)
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new :spec do |t|
- t.rspec_opts = %w(--color)
+ t.rspec_opts = %w[--color]
end
RSpec::Core::RakeTask.new :specdoc do |t|
- t.rspec_opts = %w(-fl)
+ t.rspec_opts = %w[-fl]
end
task default: :spec
desc 'Open an irb session preloaded with this library'
@@ -20,11 +20,11 @@
desc 'Create ziptz db from zipcodes database'
task :create_ziptz do
require 'yaml'
require 'active_record'
- db_config = YAML.load(File.open 'database.yml')
+ db_config = YAML.load(File.open('database.yml'))
ActiveRecord::Base.establish_connection(db_config)
class ZipCode < ActiveRecord::Base
self.table_name = 'ZIPCodes'
self.primary_key = 'ZipCode'
@@ -51,10 +51,10 @@
File.open('data/tz.data', 'w') do |f|
lines.each { |line| f.puts line }
end
puts 'Writing dst.data'
- lines = data.map { |k, v| "#{k}=#{v[:dst] =~ /y/i ? 1 : 0}"}
+ lines = data.map { |k, v| "#{k}=#{v[:dst] =~ /y/i ? 1 : 0}" }
lines.sort!
File.open('data/dst.data', 'w') do |f|
lines.each { |line| f.puts line }
end