once-ler 0.1.4 → 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
  SHA256:
3
- metadata.gz: d070c6fcc9f43b0c3f46b28046a64bee1476a3f2e6369e386bf918ae8d5717b1
4
- data.tar.gz: 7022f92a6f2d92a1e35cdf08362606b7b7dc4e446c070fe77dbf8bb503971aae
3
+ metadata.gz: 494ac049dd247bc5578276f65940cc08171bf71002937bfe3c8f14514433bdc5
4
+ data.tar.gz: 701e2e2d48d4243ea0d6ddc43f94f870d9ae36b8ec61330f17e45e8e47b0cdf8
5
5
  SHA512:
6
- metadata.gz: 01c8cc6c6a2964809cc65a8dfde2c35ca8a8fbfc3e777552e689e544bfe31aa3d5011fcb779de1f358186ad5c73d3ffbef53ad4a2f8128d3ac36a6ed3323cc60
7
- data.tar.gz: 7f6568a41e20f9c41d24fb2abca6297db5d5b7a0ddc2255bcfd75091535d2c6640742c8e78d7d8a73e5fd3f14418e82bb87a25ca382b6a86574b822decc43a45
6
+ metadata.gz: 6fa2391255b52c952b8fe9976310f937b2bf79a3e69836b2d10948faadee764ca9e92efa5d42aa14a31eee5b9b0a83cf7ee1c340caad79846f20cd321c937447
7
+ data.tar.gz: 6758091868cddcb4bf47d1e8122440e11ece9b58cb022e586dc142f9bcd629a4354645f71d102d9247c83dba27b22dce4abbc1b18ce37ac9f4d6af50a363c5c1
data/lib/onceler.rb CHANGED
@@ -1,7 +1,14 @@
1
1
  require "rspec"
2
+ require "rubygems"
3
+
2
4
  require "onceler/basic_helpers"
3
5
  require "onceler/configuration"
4
6
  require "onceler/extensions/active_record"
7
+
5
8
  if defined?(DatabaseCleaner)
9
+ unless !DatabaseCleaner.const_defined?("VERSION") ||
10
+ Gem::Requirement.new(">= 1.7").satisfied_by?(Gem::Version.new(DatabaseCleaner::VERSION))
11
+ raise "Onceler in only compatible with DatabaseCleaner >= 1.7."
12
+ end
6
13
  require "onceler/extensions/database_cleaner"
7
14
  end
@@ -1,7 +1,19 @@
1
1
  require "active_record"
2
2
 
3
- if ActiveRecord::VERSION::STRING >= "4.1."
4
- require "onceler/extensions/active_record_4_1"
5
- else
6
- require "onceler/extensions/active_record_4_0"
3
+ # monkey-patch this to not clear connections so that we don't lose our
4
+ # transactions
5
+
6
+ module ActiveRecord::TestFixtures
7
+ def teardown_fixtures
8
+ # Rollback changes if a transaction is active.
9
+ if run_in_transaction?
10
+ @fixture_connections.each do |connection|
11
+ connection.rollback_transaction if connection.transaction_open?
12
+ end
13
+ @fixture_connections.clear
14
+ else
15
+ ActiveRecord::FixtureSet.reset_cache
16
+ end
17
+ ### ONCELER'd
18
+ end
7
19
  end
@@ -1,2 +1,2 @@
1
1
  require "active_record"
2
- require "onceler/transactions/active_record_4"
2
+ require "onceler/transactions/active_record"
@@ -1,7 +1,7 @@
1
1
  module Onceler
2
2
  module Transactions
3
3
  def begin_transaction(conn)
4
- conn.begin_transaction requires_new: true, joinable: false
4
+ conn.begin_transaction joinable: false
5
5
  end
6
6
 
7
7
  def rollback_transaction(conn)
@@ -9,4 +9,3 @@ module Onceler
9
9
  end
10
10
  end
11
11
  end
12
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: once-ler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Jensen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-10 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,28 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '5.2'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '4.0'
29
+ version: '5.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '3.0'
39
+ version: '3.6'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '3.0'
46
+ version: '3.6'
47
+ - !ruby/object:Gem::Dependency
48
+ name: appraisal
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 2.3.0
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 2.3.0
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: byebug
43
63
  requirement: !ruby/object:Gem::Requirement
@@ -66,17 +86,16 @@ files:
66
86
  - lib/onceler/basic_helpers.rb
67
87
  - lib/onceler/configuration.rb
68
88
  - lib/onceler/extensions/active_record.rb
69
- - lib/onceler/extensions/active_record_4_0.rb
70
- - lib/onceler/extensions/active_record_4_1.rb
71
89
  - lib/onceler/extensions/database_cleaner.rb
72
90
  - lib/onceler/recordable.rb
73
91
  - lib/onceler/recorder.rb
74
92
  - lib/onceler/transactions.rb
75
- - lib/onceler/transactions/active_record_4.rb
93
+ - lib/onceler/transactions/active_record.rb
76
94
  homepage: http://github.com/instructure/once-ler
77
- licenses: []
95
+ licenses:
96
+ - MIT
78
97
  metadata: {}
79
- post_install_message:
98
+ post_install_message:
80
99
  rdoc_options: []
81
100
  require_paths:
82
101
  - lib
@@ -84,16 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
103
  requirements:
85
104
  - - ">="
86
105
  - !ruby/object:Gem::Version
87
- version: 1.9.3
106
+ version: '2.6'
88
107
  required_rubygems_version: !ruby/object:Gem::Requirement
89
108
  requirements:
90
109
  - - ">="
91
110
  - !ruby/object:Gem::Version
92
- version: 1.3.5
111
+ version: 2.6.0
93
112
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.7.6
96
- signing_key:
113
+ rubygems_version: 3.2.15
114
+ signing_key:
97
115
  specification_version: 4
98
116
  summary: rspec supercharger
99
117
  test_files: []
@@ -1,19 +0,0 @@
1
- # monkey-patch this to not clear connections so that we don't lose our
2
- # transactions
3
-
4
- module ActiveRecord::TestFixtures
5
- def teardown_fixtures
6
- return if ActiveRecord::Base.configurations.blank?
7
-
8
- # Rollback changes if a transaction is active.
9
- if run_in_transaction?
10
- @fixture_connections.each do |connection|
11
- connection.rollback_transaction if connection.transaction_open?
12
- end
13
- @fixture_connections.clear
14
- else
15
- ActiveRecord::FixtureSet.reset_cache
16
- end
17
- ### ONCELER'd
18
- end
19
- end
@@ -1,17 +0,0 @@
1
- # monkey-patch this to not clear connections so that we don't lose our
2
- # transactions
3
-
4
- module ActiveRecord::TestFixtures
5
- def teardown_fixtures
6
- # Rollback changes if a transaction is active.
7
- if run_in_transaction?
8
- @fixture_connections.each do |connection|
9
- connection.rollback_transaction if connection.transaction_open?
10
- end
11
- @fixture_connections.clear
12
- else
13
- ActiveRecord::FixtureSet.reset_cache
14
- end
15
- ### ONCELER'd
16
- end
17
- end