git-merge-structure-sql 1.1.0 → 1.1.1

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: 84da2722a1dae47932ee39b2b8fab2afe1cf3e45f44dc13a47b2827b31a8ead7
4
- data.tar.gz: ef4564d98915f1d3793ceed52293dc842c2ea7b360a0ef510e9cbfda1752ed02
3
+ metadata.gz: 0e8c35db8645408746b82cf6f317a2a6c6c5c70ba693ca198f84325c508d4f49
4
+ data.tar.gz: ad2f45570587be9299b378adcb601a481c3f953c2b7eed39a348003e696ff946
5
5
  SHA512:
6
- metadata.gz: 7e6460ea9caf2df665e595714a2d47dce362bb6aadfab4a3a176e0591c88ac5b00695ddbc0bef567c8c1661832e85bbca1d65fa64f797153e65d9e6468cb45d5
7
- data.tar.gz: 38663df90de6dff046713ca93b5836a62ad5c0f96f377425ff2d6ff0adc8e18c29dc1d5d93607bb56b9f389a6a6de6fc206cb5644f915ce239112e524d596491
6
+ metadata.gz: ce85fd23fe236cb10da132ae9e06577c196a0b754425de855087614486de10492b06650a4ebde6f5cf05719e0b7aef5a5eb9c342eb24bc1c235658e85b436d78
7
+ data.tar.gz: 6558f1ed947236bf03762e0d22d47653e7d8957209ea912a16f757f02859599103eab39245c4dded0c49d6a2502f5085d05c98eaca115cc92181846461ab9c23
data/CHANGELOG.md CHANGED
@@ -8,3 +8,7 @@
8
8
 
9
9
  - Add support for the latest MySQL dump format
10
10
  - Mention support for the SQLite3 dump format
11
+
12
+ ## 1.1.1 (2021-04-28)
13
+
14
+ - Fix installation when the attribute file does not exist yet
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018 Akinori MUSHA
1
+ Copyright (c) 2018-2021 Akinori MUSHA
2
2
 
3
3
  All rights reserved.
4
4
 
data/README.md CHANGED
@@ -1,7 +1,16 @@
1
1
  # git-merge-structure-sql
2
2
 
3
- This is a merge driver for Git that resolves trivial parts of
4
- merge conflicts in a db/structure.sql file of Rails.
3
+ This is a merge driver for Git that resolves typical merge conflicts
4
+ in a `db/structure.sql` file of Rails.
5
+
6
+ When your project is configured with
7
+ `config.active_record.schema_format = :sql`, the database schema is
8
+ kept in `db/structure.sql` instead of `db/schema.rb` in the native
9
+ dump format of the underlying database engine, which is not suitable
10
+ for the default merge driver of Git to deal with. As a result, when
11
+ you try to merge two branches you always have to resolve trivial
12
+ conflicts manually if new schema migrations take place in both
13
+ branches. This custom driver takes away such a pain.
5
14
 
6
15
  Currently only PostgreSQL, MySQL and SQLite3 dump formats are
7
16
  supported.
@@ -17,10 +26,9 @@ for you by this command:
17
26
 
18
27
  $ git-merge-structure-sql --install
19
28
 
20
- This adds necessary settings to your
21
- `~/.gitconfig`/`$XDG_CONFIG_HOME/git/config` and the default
22
- gitattributes(5) file to enable the merge driver for structure.sql
23
- files.
29
+ This adds necessary settings to your `~/.gitconfig` or
30
+ `$XDG_CONFIG_HOME/git/config` and the default gitattributes(5) file to
31
+ enable the merge driver for structure.sql files.
24
32
 
25
33
  ## Usage
26
34
 
@@ -33,7 +41,7 @@ See `CHANGELOG.md` for the version history.
33
41
 
34
42
  ## Author
35
43
 
36
- Copyright (c) 2018 Akinori MUSHA.
44
+ Copyright (c) 2018-2021 Akinori MUSHA.
37
45
 
38
46
  Licensed under the 2-clause BSD license. See `LICENSE.txt` for
39
47
  details.
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_development_dependency "bundler", "~> 1.16"
32
- spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "bundler", "~> 2.2"
32
+ spec.add_development_dependency "rake", "~> 13.0"
33
33
  spec.add_development_dependency "rspec", "~> 3.0"
34
34
  end
@@ -6,7 +6,7 @@
6
6
  # How to use:
7
7
  # $ git-merge-structure-sql --install
8
8
  #
9
- # Copyright (c) 2018 Akinori MUSHA
9
+ # Copyright (c) 2018-2021 Akinori MUSHA
10
10
  #
11
11
  # All rights reserved.
12
12
  #
@@ -33,7 +33,7 @@
33
33
  #
34
34
 
35
35
  class StructureSqlMergeDriver
36
- VERSION = '1.1.0'
36
+ VERSION = '1.1.1'
37
37
  VARIANTS = []
38
38
 
39
39
  module Default # This covers PostgreSQL, SQLite and newer MySQL formats.
@@ -192,12 +192,13 @@ class StructureSqlMergeDriver
192
192
  } or raise "don't you have home?"
193
193
  end
194
194
 
195
- File.open(attributes_file, 'r+') { |f|
195
+ File.open(attributes_file, 'a+') { |f|
196
196
  pattern = /^\s*structure.sql\s+(?:\S+\s+)*merge=#{Regexp.quote(driver_name)}(?:\s|$)/
197
197
  break if f.any? { |line| pattern === line }
198
198
 
199
199
  puts "Enabling the \"#{driver_name}\" driver for structure.sql"
200
- f.puts "\nstructure.sql merge=#{driver_name}"
200
+ f.puts if f.pos > 0
201
+ f.puts "structure.sql merge=#{driver_name}"
201
202
  }
202
203
 
203
204
  exit
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-merge-structure-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-30 00:00:00.000000000 Z
11
+ date: 2021-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description:
55
+ description:
56
56
  email:
57
57
  - knu@idaemons.org
58
58
  executables:
@@ -80,7 +80,7 @@ metadata:
80
80
  homepage_uri: https://github.com/knu/git-merge-structure-sql
81
81
  source_code_uri: https://github.com/knu/git-merge-structure-sql
82
82
  changelog_uri: https://github.com/knu/git-merge-structure-sql/blob/master/CHANGELOG.md
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -95,9 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.7.6
100
- signing_key:
98
+ rubygems_version: 3.2.11
99
+ signing_key:
101
100
  specification_version: 4
102
101
  summary: git merge driver for db/structure.sql in a Rails project
103
102
  test_files: []