squasher 0.7.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -4
- data/lib/squasher/config.rb +7 -6
- data/lib/squasher/version.rb +1 -1
- data/spec/lib/config_spec.rb +1 -1
- data/spec/lib/worker_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58b6246f12c84f3e639e620a90d461314bf5d0b8e452d812b4e3ed2e845baae
|
4
|
+
data.tar.gz: 720447fa89a2a8c64f12ab1d0c73b21a71e5e920ad95f6656aa3dd193fc59399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bac4b5782dfd94e7f008321f4473b5e7d7bfdf90bf16afbbc777c892223df991d6b9e4cc6a571cf9b6b05203407b395baa217f214a0a20ba04dc6a85ab8d5dd
|
7
|
+
data.tar.gz: 6bd32f9b1fde3da1a34cfdada1898813f0ce3a5db191dcbdf5e48189fe7e86ba3907df40c500be087266226147cb66e6bd58f62a6e60b616ae750143c5aa24e0
|
data/.travis.yml
CHANGED
data/lib/squasher/config.rb
CHANGED
@@ -9,8 +9,9 @@ module Squasher
|
|
9
9
|
|
10
10
|
def process(path)
|
11
11
|
@error = false
|
12
|
-
|
13
|
-
|
12
|
+
# Support for Psych 4 (the default yaml parser for Ruby 3.1)
|
13
|
+
opts = Gem::Version.new(Psych::VERSION).segments.first < 4 ? {} : { aliases: true }
|
14
|
+
str = YAML.load(ERB.new(File.read(path)).result(binding), **opts)
|
14
15
|
[str, @error]
|
15
16
|
end
|
16
17
|
|
@@ -81,7 +82,7 @@ module Squasher
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def migrations_folder?
|
84
|
-
Dir.
|
85
|
+
Dir.exist?(migrations_folder)
|
85
86
|
end
|
86
87
|
|
87
88
|
def dbconfig?
|
@@ -93,7 +94,7 @@ module Squasher
|
|
93
94
|
|
94
95
|
list = [dbconfig_file, schema_file]
|
95
96
|
list.each do |file|
|
96
|
-
next unless File.
|
97
|
+
next unless File.exist?(file)
|
97
98
|
FileUtils.mv file, "#{ file }.sq"
|
98
99
|
end
|
99
100
|
|
@@ -103,7 +104,7 @@ module Squasher
|
|
103
104
|
|
104
105
|
ensure
|
105
106
|
list.each do |file|
|
106
|
-
next unless File.
|
107
|
+
next unless File.exist?("#{ file }.sq")
|
107
108
|
FileUtils.mv "#{ file }.sq", file
|
108
109
|
end
|
109
110
|
end
|
@@ -118,7 +119,7 @@ module Squasher
|
|
118
119
|
|
119
120
|
def dbconfig
|
120
121
|
return @dbconfig if defined?(@dbconfig)
|
121
|
-
return @dbconfig = nil unless File.
|
122
|
+
return @dbconfig = nil unless File.exist?(dbconfig_file)
|
122
123
|
|
123
124
|
@dbconfig = nil
|
124
125
|
|
data/lib/squasher/version.rb
CHANGED
data/spec/lib/config_spec.rb
CHANGED
data/spec/lib/worker_spec.rb
CHANGED
@@ -42,7 +42,7 @@ describe Squasher::Worker do
|
|
42
42
|
|
43
43
|
worker.process
|
44
44
|
|
45
|
-
expect(File.
|
45
|
+
expect(File.exist?(new_migration_path)).to be_truthy
|
46
46
|
File.open(new_migration_path) do |stream|
|
47
47
|
content = stream.read
|
48
48
|
expect(content).to include("InitSchema")
|
@@ -69,7 +69,7 @@ describe Squasher::Worker do
|
|
69
69
|
expect(Squasher).to receive(:ask).with(:apply_clean).and_return(false)
|
70
70
|
worker.process
|
71
71
|
|
72
|
-
expect(File.
|
72
|
+
expect(File.exist?(new_migration_path)).to be_truthy
|
73
73
|
File.open(new_migration_path) do |stream|
|
74
74
|
content = stream.read
|
75
75
|
expect(content.strip).to eq(%q{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squasher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Pchelintsev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.3.7
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Squash your old migrations
|