backhoe 0.4.1 → 0.5.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: 2b6089d4e1d4565019872fb57c0544064b6b5909fb687c237bc75d797dae6e9f
4
- data.tar.gz: 4c3a1cd94424ecefa74f1250ad19e8d9b2b2198e7cd35dc7635d3da05da6466b
3
+ metadata.gz: 2eedc96f1b7466ebc166988dce01252aec90d14fcadd216cf926699e5d97b2e4
4
+ data.tar.gz: ac773a88ca48fa6f3d89228b6e3ea319bec0e64e4a5ab0ce2fbbd67e08a3127f
5
5
  SHA512:
6
- metadata.gz: 298870b55d10c2d318850c74199f0743bb1ade6e21f33019059fbcb57fb26d599838c16d88bc30ede5b0cdc7421e198eb14ad80be3478f1ad2b96aa89ba8569d
7
- data.tar.gz: 549aa16fadb2ea565463f4f80aca644443406250f803c23d0268bbd473a824145e453756359fc80ce86bd5c95b44bfd579b84cf8908c6cf30b0ff1529ef096c9
6
+ metadata.gz: ad26930dc3f9f53b3fbc62909fcd0942f478dd97c496ca3cb5127d19d81fdedd24db74358d33c3c797084c75bef77f1402ec308159c59265642f2093eda982eb
7
+ data.tar.gz: eb1a3ddb18501571bc2cbd2d3fd9af921d75788f5fc9c43ec7cfac20437c834b470ed335ce38223212cdc7950e18e09c16148a134c486b5e6c138428c4a16be6
@@ -0,0 +1,34 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ gemfile: [ activerecord_5.1, activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_7.0 ]
9
+ ruby: [ 2.6, 2.7, 3.0 ]
10
+ exclude:
11
+ - gemfile: activerecord_5.1
12
+ ruby: 3.0
13
+ - gemfile: activerecord_5.2
14
+ ruby: 3.0
15
+ - gemfile: activerecord_7.0
16
+ ruby: 2.6
17
+
18
+ runs-on: ubuntu-18.04
19
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
20
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - uses: shogo82148/actions-setup-mysql@v1
24
+ with:
25
+ mysql-version: 5.7
26
+ my-cnf: |
27
+ socket=/tmp/mysql.sock
28
+ - uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
32
+ cache-version: 10
33
+ - run: bundle exec rake
34
+
data/Appraisals CHANGED
@@ -14,3 +14,7 @@ appraise "activerecord-6.1" do
14
14
  gem "activerecord", "~>6.1.0"
15
15
  end
16
16
 
17
+ appraise "activerecord-7.0" do
18
+ gem "activerecord", "~>7.0.0"
19
+ end
20
+
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Backhoe
2
- [![Build Status](https://travis-ci.org/botandrose/backhoe.svg)](https://travis-ci.org/botandrose/backhoe)
2
+ [![CI Status](https://github.com/botandrose/backhoe/workflows/CI/badge.svg?branch=master)](https://github.com/botandrose/backhoe/actions?query=workflow%3ACI+branch%3Amaster)
3
3
 
4
4
  Dump and load current ActiveRecord database to and from a file.
5
5
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- backhoe (0.4.0)
4
+ backhoe (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -62,4 +62,4 @@ DEPENDENCIES
62
62
  rspec (~> 3.0)
63
63
 
64
64
  BUNDLED WITH
65
- 1.17.2
65
+ 2.2.32
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- backhoe (0.4.0)
4
+ backhoe (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -62,4 +62,4 @@ DEPENDENCIES
62
62
  rspec (~> 3.0)
63
63
 
64
64
  BUNDLED WITH
65
- 1.17.2
65
+ 2.2.32
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- backhoe (0.4.0)
4
+ backhoe (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -62,4 +62,4 @@ DEPENDENCIES
62
62
  rspec (~> 3.0)
63
63
 
64
64
  BUNDLED WITH
65
- 1.17.2
65
+ 2.2.32
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- backhoe (0.4.0)
4
+ backhoe (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -61,4 +61,4 @@ DEPENDENCIES
61
61
  rspec (~> 3.0)
62
62
 
63
63
  BUNDLED WITH
64
- 1.17.2
64
+ 2.2.32
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~>7.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ backhoe (0.4.1)
5
+ activerecord
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.0.1)
11
+ activesupport (= 7.0.1)
12
+ activerecord (7.0.1)
13
+ activemodel (= 7.0.1)
14
+ activesupport (= 7.0.1)
15
+ activesupport (7.0.1)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ appraisal (2.4.1)
21
+ bundler
22
+ rake
23
+ thor (>= 0.14.0)
24
+ byebug (11.1.3)
25
+ concurrent-ruby (1.1.9)
26
+ diff-lcs (1.5.0)
27
+ i18n (1.8.11)
28
+ concurrent-ruby (~> 1.0)
29
+ minitest (5.15.0)
30
+ mysql2 (0.5.3)
31
+ rake (10.5.0)
32
+ rspec (3.10.0)
33
+ rspec-core (~> 3.10.0)
34
+ rspec-expectations (~> 3.10.0)
35
+ rspec-mocks (~> 3.10.0)
36
+ rspec-core (3.10.1)
37
+ rspec-support (~> 3.10.0)
38
+ rspec-expectations (3.10.2)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-mocks (3.10.2)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-support (3.10.3)
45
+ thor (1.2.1)
46
+ tzinfo (2.0.4)
47
+ concurrent-ruby (~> 1.0)
48
+
49
+ PLATFORMS
50
+ x86_64-linux
51
+
52
+ DEPENDENCIES
53
+ activerecord (~> 7.0.0)
54
+ appraisal
55
+ backhoe!
56
+ byebug
57
+ mysql2
58
+ rake (~> 10.0)
59
+ rspec (~> 3.0)
60
+
61
+ BUNDLED WITH
62
+ 2.2.32
data/lib/backhoe/mysql.rb CHANGED
@@ -37,7 +37,7 @@ module Backhoe
37
37
  SanitizedDatabase.new(skip_columns, file_path).dump do |skip_tables|
38
38
  options[:skip_tables] ||= []
39
39
  options[:skip_tables] += skip_tables
40
- super options
40
+ super **options
41
41
  end
42
42
  else
43
43
  super
@@ -1,3 +1,3 @@
1
1
  module Backhoe
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/backhoe.rb CHANGED
@@ -24,8 +24,18 @@ module Backhoe
24
24
 
25
25
  def database_config
26
26
  env = Rails.env || "development"
27
- config = ActiveRecord::Base.configurations[env]
28
- HashWithIndifferentAccess.new(config)
27
+ configs = ActiveRecord::Base.configurations
28
+ hash = if configs.respond_to?(:configs_for)
29
+ config = configs.configs_for(env_name: env).first
30
+ if config.respond_to?(:configuration_hash)
31
+ config.configuration_hash # rails 7
32
+ else
33
+ config.config # rails 6
34
+ end
35
+ else
36
+ configs[env] # rails 5
37
+ end
38
+ HashWithIndifferentAccess.new(hash)
29
39
  end
30
40
  end
31
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backhoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2022-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".github/workflows/ci.yml"
104
105
  - ".gitignore"
105
106
  - ".rspec"
106
- - ".travis.yml"
107
107
  - Appraisals
108
108
  - Gemfile
109
109
  - LICENSE.txt
@@ -121,6 +121,8 @@ files:
121
121
  - gemfiles/activerecord_6.0.gemfile.lock
122
122
  - gemfiles/activerecord_6.1.gemfile
123
123
  - gemfiles/activerecord_6.1.gemfile.lock
124
+ - gemfiles/activerecord_7.0.gemfile
125
+ - gemfiles/activerecord_7.0.gemfile.lock
124
126
  - lib/backhoe.rb
125
127
  - lib/backhoe/base.rb
126
128
  - lib/backhoe/mysql.rb
@@ -146,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
148
  - !ruby/object:Gem::Version
147
149
  version: '0'
148
150
  requirements: []
149
- rubygems_version: 3.0.3
151
+ rubygems_version: 3.2.32
150
152
  signing_key:
151
153
  specification_version: 4
152
154
  summary: Dump and load current database to and from a file.
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- gemfile:
3
- - gemfiles/activerecord_5.1.gemfile
4
- - gemfiles/activerecord_5.2.gemfile
5
- - gemfiles/activerecord_6.0.gemfile
6
- - gemfiles/activerecord_6.1.gemfile
7
- services:
8
- - mysql
9
- cache:
10
- bundler: true
11
-