Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
fixed string quotation
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed May 13, 2014
1 parent 1ddc94f commit 7938d53
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 33 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$:.unshift File.expand_path('..', __FILE__)
require "tasks/release"
require 'tasks/release'

desc "Build gem files for all projects"
task :build => "all:build"
desc 'Build gem files for all projects'
task :build => 'all:build'

desc "Release all gems to rubygems and create a tag"
task :release => "all:release"
desc 'Release all gems to rubygems and create a tag'
task :release => 'all:release'

desc "Run all tests"
desc 'Run all tests'
task :test do
%w(active_event active_projection active_domain).each do |gem|
sh "cd #{gem} && rspec"
Expand Down
2 changes: 1 addition & 1 deletion active_event/lib/active_event/support/multi_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MultiLogger
def initialize(progname = nil, formatter = nil)
@loggers = []
@loggers << Logger.new(STDOUT)
@loggers << Logger.new("log/disco.log")
@loggers << Logger.new('log/disco.log')
@loggers.each do |logger|
logger.progname = progname if progname.present?
logger.formatter = if formatter.present?
Expand Down
2 changes: 1 addition & 1 deletion active_event/spec/lib/event_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TestEvent

it 'publishes an event' do
allow(@server).to receive(:event_exchange).and_return(Object)
expect(@server.event_exchange).to receive(:publish).with("Test2", :type => "TestEvent", :headers => "Test")
expect(@server.event_exchange).to receive(:publish).with('Test2', :type => 'TestEvent', :headers => 'Test')
expect(@event).to receive(:store_infos).and_return('Test')
expect(@event).to receive(:to_json).and_return('Test2')
@server.class.publish(@event)
Expand Down
2 changes: 1 addition & 1 deletion active_event/spec/lib/replay_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TestEvent
it 'republishes an event' do
date = DateTime.now.utc
allow(@server).to receive(:resend_exchange).and_return(Object)
expect(@server.resend_exchange).to receive(:publish).with("{\"bla\":\"Test2\"}", :type => "TestEvent", :headers => {id: 0, created_at: date.to_s, replayed: true})
expect(@server.resend_exchange).to receive(:publish).with("{\"bla\":\"Test2\"}", :type => 'TestEvent', :headers => {id: 0, created_at: date.to_s, replayed: true})
expect(@event).to receive(:event).and_return(@event.class.name)
expect(@event).to receive(:data).and_return(bla: 'Test2')
expect(@event).to receive(:id).and_return(0)
Expand Down
2 changes: 1 addition & 1 deletion active_projection/lib/active_projection/event_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def send_request_for(id)
def replay_done
LOGGER.debug 'All replayed events received'
broken_projections = CachedProjectionRepository.all_broken
LOGGER.error "These projections are still broken: #{broken_projections.join(", ")}" unless broken_projections.empty?
LOGGER.error "These projections are still broken: #{broken_projections.join(', ')}" unless broken_projections.empty?
replay_queue.unbind(resend_exchange)
self.current = true
flush_delay_queue
Expand Down
14 changes: 7 additions & 7 deletions disco-railties/lib/disco/commands/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
exit(0)
end

if ARGV.first != "new"
ARGV[0] = "--help"
if ARGV.first != 'new'
ARGV[0] = '--help'
else
ARGV.shift
unless ARGV.delete("--no-rc")
customrc = ARGV.index{ |x| x.include?("--rc=") }
unless ARGV.delete('--no-rc')
customrc = ARGV.index{ |x| x.include?('--rc=') }
railsrc = if customrc
File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ''))
else
File.join(File.expand_path("~"), '.railsrc')
File.join(File.expand_path('~'), '.railsrc')
end
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
puts "Using #{extra_args.join(' ')} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
Expand Down
2 changes: 1 addition & 1 deletion disco-railties/lib/rails-disco/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module RailsDisco
class Railtie < Rails::Railtie
rake_tasks do
load "tasks/db.rake"
load 'tasks/db.rake'
end
end
end
2 changes: 1 addition & 1 deletion disco-railties/lib/rails-disco/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module VERSION
TINY = 2
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
end
26 changes: 13 additions & 13 deletions tasks/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version = File.read("#{root}/RAILS-DISCO_VERSION").strip
tag = "v#{version}"

directory "pkg"
directory 'pkg'

(FRAMEWORKS + ['rails-disco']).each do |framework|
namespace framework do
Expand All @@ -17,15 +17,15 @@

task :update_version_rb do
glob = root.dup
glob << "/#{framework}/lib/*" unless framework == "rails-disco"
glob << "/version.rb"
glob << "/#{framework}/lib/*" unless framework == 'rails-disco'
glob << '/version.rb'

file = Dir[glob].first
ruby = File.read(file)

if framework == "rails-disco" || framework == "disco-railties"
if framework == 'rails-disco' || framework == 'disco-railties'
major, minor, tiny, pre = version.split('.')
pre = pre ? pre.inspect : "nil"
pre = pre ? pre.inspect : 'nil'

ruby.gsub!(/^(\s*)MAJOR(\s*)= .*?$/, "\\1MAJOR = #{major}")
raise "Could not insert MAJOR in #{file}" unless $1
Expand All @@ -47,8 +47,8 @@
end

task gem => %w(update_version_rb pkg) do
cmd = ""
cmd << "cd #{framework} && " unless framework == "rails-disco"
cmd = ''
cmd << "cd #{framework} && " unless framework == 'rails-disco'
cmd << "gem build #{gemspec} && mv #{framework}-#{version}.gem #{root}/pkg/"
sh cmd
end
Expand Down Expand Up @@ -99,29 +99,29 @@

task :ensure_clean_state do
unless `git status -s | grep -v RAILS-DISCO_VERSION`.strip.empty?
abort "[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed"
abort '[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed'
end

unless ENV['SKIP_TAG'] || `git tag | grep #{tag}`.strip.empty?
abort "[ABORTING] `git tag` shows that #{tag} already exists. Has this version already\n"\
" been released? Git tagging can be skipped by setting SKIP_TAG=1"
' been released? Git tagging can be skipped by setting SKIP_TAG=1'
end
end

task :commit do
File.open('pkg/commit_message.txt', 'w') do |f|
f.puts "# Preparing for #{version} release\n"
f.puts
f.puts "# UNCOMMENT THE LINE ABOVE TO APPROVE THIS COMMIT"
f.puts '# UNCOMMENT THE LINE ABOVE TO APPROVE THIS COMMIT'
end

sh "git add . && git commit --verbose --template=pkg/commit_message.txt"
rm_f "pkg/commit_message.txt"
sh 'git add . && git commit --verbose --template=pkg/commit_message.txt'
rm_f 'pkg/commit_message.txt'
end

task :tag do
sh "git tag #{tag}"
sh "git push --tags"
sh 'git push --tags'
end

task :release => %w(ensure_clean_state build commit tag push)
Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module VERSION
TINY = 2
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
end

0 comments on commit 7938d53

Please sign in to comment.