migration-lock-timeout 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9b1c5bcab7e5a412ebbbce7aada13b4bc7f72a5
4
- data.tar.gz: 40fab9fcf770f14687f514573af74f317093b1c3
3
+ metadata.gz: 1325d4e01b685b2b269015d7f9db368a4999e0bb
4
+ data.tar.gz: 00acc2f8cad5b72dd237df217cfeb41b991fb2a5
5
5
  SHA512:
6
- metadata.gz: 7f8e9dcde22d5a5e12b86f6ffe94cdcea8bcc9fb544400c17c38a34d5aacc90920d6c1c4d08f9a3fa8b01ae7e29d1fad2a4f21508c4e2987dd1c0593ae41a895
7
- data.tar.gz: f4a5b1a8cdd182a09fc0294219a7c147614e4b98885af91d81a9fe7d85c4fbf78fbcc13fd3d11aa34481ce475d29ff57a857ec9b32196d95e55efe49cbefb3e0
6
+ metadata.gz: 6c5acacd2a2674efd06456150632b5830c69002b2cdc2902df9bef675657c2bb7f33c7af2365c38243c837b9f6084a6656ac18eece9b5242f2406709b9da68fd
7
+ data.tar.gz: 1c41ff211a8a0569b10a605af00db656ff8b4f963434419b75c464df0353915ec5030974715bfa64fa6203f004600fd5d0860bcce6b2d2bf1dc3d56ca0b76bcf
@@ -0,0 +1,28 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ # working_directory: ~/appName
5
+ docker:
6
+ - image: ruby:2.3.3
7
+ environment:
8
+ PG_HOST: localhost
9
+ PG_USER: ubuntu
10
+ - image: circleci/postgres:9.5-ram
11
+ environment:
12
+ POSTGRES_USER: ubuntu
13
+ POSTGRES_DB: circle_test
14
+ steps:
15
+ - checkout
16
+ - run:
17
+ name: Install Ruby Dependencies
18
+ command: bundle install
19
+ - run:
20
+ name: Install Appraisals Dependencies
21
+ command: bundle exec appraisal install
22
+ - run:
23
+ name: Run Appraisals Tests
24
+ environment:
25
+ POSTGRES_DB_DATABASE: circle_test
26
+ POSTGRES_DB_USERNAME: ubuntu
27
+ POSTGRES_DB_PASSWORD:
28
+ command: bundle exec appraisal rspec
@@ -0,0 +1 @@
1
+ 2.4.3
data/Appraisals CHANGED
@@ -2,6 +2,16 @@ appraise "activerecord-4" do
2
2
  gem "activerecord", "4.2.7.1"
3
3
  end
4
4
 
5
+ appraise "activerecord-4_with_strong_migrations" do
6
+ gem "activerecord", "4.2.7.1"
7
+ gem "strong_migrations", "0.2"
8
+ end
9
+
5
10
  appraise "activerecord-5" do
6
11
  gem "activerecord", "5.0.0.1"
7
12
  end
13
+
14
+ appraise "activerecord-5_with_strong_migrations" do
15
+ gem "activerecord", "5.0.0.1"
16
+ gem "strong_migrations", "0.2"
17
+ end
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.2.0]
8
+ ### Added
9
+ - Support for using with the [strong_migrations](https://github.com/ankane/strong_migrations) gem
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "4.2.7.1"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "4.2.7.1"
6
+ gem "strong_migrations", "0.2"
7
+
8
+ gemspec path: "../"
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "5.0.0.1"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "5.0.0.1"
6
+ gem "strong_migrations", "0.2"
7
+
8
+ gemspec path: "../"
@@ -3,12 +3,22 @@ module MigrationLockTimeout
3
3
 
4
4
  def migrate(direction)
5
5
  timeout_disabled = self.class.disable_lock_timeout
6
- time = self.class.lock_timeout_override ||
6
+ time = self.class.lock_timeout_override ||
7
7
  MigrationLockTimeout.try(:config).try(:default_timeout)
8
8
  if !timeout_disabled && direction == :up && time && !disable_ddl_transaction
9
- execute "SET LOCAL lock_timeout = '#{time}s'"
9
+ safety_assured? do
10
+ execute "SET LOCAL lock_timeout = '#{time}s'"
11
+ end
10
12
  end
11
13
  super
12
14
  end
15
+
16
+ def safety_assured?
17
+ if defined?(StrongMigrations)
18
+ safety_assured { yield }
19
+ else
20
+ yield
21
+ end
22
+ end
13
23
  end
14
24
  end
@@ -1,3 +1,3 @@
1
1
  module MigrationLockTimeout
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency "appraisal"
31
31
  spec.add_development_dependency "database_cleaner"
32
- spec.add_development_dependency "pg"
32
+ spec.add_development_dependency "pg", "< 1.0"
33
33
  spec.add_development_dependency "pry"
34
34
  spec.add_development_dependency "rake", "~> 11.2.2"
35
35
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration-lock-timeout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Urani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: pg
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -123,10 +123,13 @@ executables: []
123
123
  extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
+ - ".circleci/config.yml"
126
127
  - ".gitignore"
127
128
  - ".rspec"
129
+ - ".ruby-version"
128
130
  - ".travis.yml"
129
131
  - Appraisals
132
+ - CHANGELOG.md
130
133
  - CODE_OF_CONDUCT.md
131
134
  - Gemfile
132
135
  - LICENSE
@@ -134,9 +137,10 @@ files:
134
137
  - Rakefile
135
138
  - bin/console
136
139
  - bin/setup
137
- - circle.yml
138
140
  - gemfiles/activerecord_4.gemfile
141
+ - gemfiles/activerecord_4_with_strong_migrations.gemfile
139
142
  - gemfiles/activerecord_5.gemfile
143
+ - gemfiles/activerecord_5_with_strong_migrations.gemfile
140
144
  - lib/migration-lock-timeout.rb
141
145
  - lib/migration_lock_timeout/config.rb
142
146
  - lib/migration_lock_timeout/lock_manager.rb
@@ -165,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
169
  version: '0'
166
170
  requirements: []
167
171
  rubyforge_project:
168
- rubygems_version: 2.5.2
172
+ rubygems_version: 2.6.14
169
173
  signing_key:
170
174
  specification_version: 4
171
175
  summary: Ruby gem that adds a lock timeout to Active Record migrations
data/circle.yml DELETED
@@ -1,18 +0,0 @@
1
- machine:
2
- environment:
3
- POSTGRES_DB_DATABASE: circle_test
4
- POSTGRES_DB_USERNAME: ubuntu
5
- POSTGRES_DB_PASSWORD: ''
6
- ruby:
7
- version: 2.3.3
8
-
9
- database:
10
- override:
11
- - echo 'using circle_test'
12
-
13
- dependencies:
14
- post:
15
- - bundle exec appraisal install
16
- test:
17
- override:
18
- - bundle exec appraisal rspec