Skip to content

Commit

Permalink
single quoteys where double quoteys not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Sustaric committed Jun 15, 2017
1 parent a94f8af commit f91e813
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

Expand Down
28 changes: 14 additions & 14 deletions event_sourcery-postgres.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'event_sourcery/postgres/version'

Gem::Specification.new do |spec|
spec.name = "event_sourcery-postgres"
spec.name = 'event_sourcery-postgres'
spec.version = EventSourcery::Postgres::VERSION
# TODO: update authors
spec.authors = ["Steve Hodgkiss"]
spec.email = ["[email protected]"]
spec.authors = ['Steve Hodgkiss']
spec.email = ['[email protected]']

spec.summary = %q{Postgres event store for use with EventSourcery}
spec.homepage = "https://github.com/envato/event_sourcery-postgres"
spec.summary = 'Postgres event store for use with EventSourcery'
spec.homepage = 'https://github.com/envato/event_sourcery-postgres'

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against " \
"public gem pushes."
raise 'RubyGems 2.0 or newer is required to protect against ' \
'public gem pushes.'
end

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_dependency 'sequel', '~> 4.38'
spec.add_dependency 'pg'
spec.add_dependency 'event_sourcery', '>= 0.10.0'
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "pry"
spec.add_development_dependency "benchmark-ips"
spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'benchmark-ips'
end
2 changes: 1 addition & 1 deletion lib/event_sourcery/postgres/table_owner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def table(name = nil)
end

def table_name_prefixed(name)
[table_prefix, name].compact.join("_").to_sym
[table_prefix, name].compact.join('_').to_sym
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/event_sourcery/postgres/tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setup(processor_name = nil)
create_table_if_not_exists if EventSourcery::Postgres.config.auto_create_projector_tracker

unless tracker_table_exists?
raise UnableToLockProcessorError, "Projector tracker table does not exist"
raise UnableToLockProcessorError, 'Projector tracker table does not exist'
end

if processor_name
Expand Down
2 changes: 1 addition & 1 deletion lib/event_sourcery/postgres/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module EventSourcery
module Postgres
VERSION = "0.2.0"
VERSION = '0.2.0'
end
end
2 changes: 1 addition & 1 deletion script/bench_writing_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def new_event
end

Benchmark.ips do |b|
b.report("event_store.sink") do
b.report('event_store.sink') do
event_store.sink(new_event)
end
end
10 changes: 5 additions & 5 deletions spec/event_sourcery/postgres/optimised_event_poll_waiter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def notify_event_ids(*ids)
end
end

context "when an error is raised" do
context 'when an error is raised' do
let(:thread) { double }

before { allow(Thread).to receive(:new).and_return(thread) }

context "when the listening thread is alive" do
it "kills the listening thread" do
context 'when the listening thread is alive' do
it 'kills the listening thread' do
allow(thread).to receive(:alive?).and_return(true)
expect(thread).to receive(:kill)

Expand All @@ -69,8 +69,8 @@ def notify_event_ids(*ids)
end
end

context "when the listening thread is not alive" do
it "does not try to kill any listening threads" do
context 'when the listening thread is not alive' do
it 'does not try to kill any listening threads' do
allow(thread).to receive(:alive?).and_return(false)
expect(thread).to_not receive(:kill)

Expand Down
6 changes: 3 additions & 3 deletions spec/event_sourcery/postgres/projector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def new_projector(&block)
describe '#project' do
let(:event) { new_event(type: :terms_accepted) }

it "processes events via project method" do
it 'processes events via project method' do
projector = new_projector do
def project(event)
@processed_event = event
Expand Down Expand Up @@ -170,7 +170,7 @@ def process(event)

context 'when an error occurs processing the event' do

it "rolls back the projected changes" do
it 'rolls back the projected changes' do
projector.raise_error = true
projector.subscribe_to(event_store, subscription_master: subscription_master) rescue nil
expect(connection[:profiles].count).to eq 0
Expand All @@ -183,7 +183,7 @@ def process(event)
allow(tracker).to receive(:processed_event).and_raise(StandardError)
end

it "rolls back the projected changes" do
it 'rolls back the projected changes' do
projector.subscribe_to(event_store, subscription_master: subscription_master) rescue nil
expect(connection[:profiles].count).to eq 0
end
Expand Down
6 changes: 3 additions & 3 deletions spec/event_sourcery/postgres/reactor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def process(event)

before do
reactor.setup
stub_const("TestActioner", action_stub_class)
stub_const('TestActioner', action_stub_class)
end

def event_count
Expand Down Expand Up @@ -263,12 +263,12 @@ def process(event)

it 'can manupulate the event body as part of the action' do
reactor.process(event_1)
expect(latest_events(1).first.body["token"]).to eq 'secret-identifier'
expect(latest_events(1).first.body['token']).to eq 'secret-identifier'
end

it 'stores the driven by event id in the body' do
reactor.process(event_1)
expect(latest_events(1).first.body["_driven_by_event_id"]).to eq event_1.id
expect(latest_events(1).first.body['_driven_by_event_id']).to eq event_1.id
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/event_sourcery/postgres/tracker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def setup_table
context 'unable to lock tracker row' do
let(:db) { new_connection }

it "raises an error" do
it 'raises an error' do
expect {
tracker = described_class.new(db, table_name: table_name)
tracker.setup(processor_name)
Expand Down
4 changes: 2 additions & 2 deletions spec/event_sourcery/postgres_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "spec_helper"
require 'spec_helper'

RSpec.describe EventSourcery::Postgres do
it "has a version number" do
it 'has a version number' do
expect(EventSourcery::Postgres::VERSION).not_to be nil
end
end
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require "bundler/setup"
require "event_sourcery/postgres"
require 'bundler/setup'
require 'event_sourcery/postgres'
require 'event_sourcery/rspec/event_store_shared_examples'
require 'timeout'

Dir.glob(File.dirname(__FILE__) + '/support/**/*.rb') { |f| require f }

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.example_status_persistence_file_path = '.rspec_status'

config.expect_with :rspec do |c|
c.syntax = :expect
Expand Down
8 changes: 4 additions & 4 deletions spec/support/db_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def reset_database
end

def recreate_database
pg_connection.execute("drop table if exists events")
pg_connection.execute("drop table if exists aggregates")
pg_connection.execute("drop table if exists projector_tracker")
pg_connection.execute('drop table if exists events')
pg_connection.execute('drop table if exists aggregates')
pg_connection.execute('drop table if exists projector_tracker')
EventSourcery::Postgres::Schema.create_event_store(db: pg_connection)
EventSourcery::Postgres::Schema.create_projector_tracker(db: pg_connection)
end

def release_advisory_locks(connection=pg_connection)
connection.fetch("SELECT pg_advisory_unlock_all();").to_a
connection.fetch('SELECT pg_advisory_unlock_all();').to_a
end
end

Expand Down

0 comments on commit f91e813

Please sign in to comment.