database_fork 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/database_fork.gemspec +1 -1
- data/lib/database_fork.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c55bfad322d375591c58edb013cd6ddb50e5592
|
4
|
+
data.tar.gz: cf3428234871dbc9d381b0b73a37a1ff362c0699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5057ca6ac35017463ce3278a8dfcdd639a1948fd8daa0e27e6bac00e7bfb8e3dda5160370a4dd12e71443bdd3f0f1f1431f95435a0e471c66d46b9e8e3c53b95
|
7
|
+
data.tar.gz: 8035c591db231b8e2f073003e06916ea7e42b7f0757d2d580bcd8fdef27e0c29e24a154a2ed4ae063829b3dc6dc65e34aa55cad59fbfb52689a34041e7fb989d
|
data/README.md
CHANGED
data/database_fork.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'database_fork'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.7'
|
8
8
|
spec.authors = ['the-architect']
|
9
9
|
spec.email = ['marcel.scherf@epicteams.com']
|
10
10
|
spec.summary = %q{Fork your database}
|
data/lib/database_fork.rb
CHANGED
@@ -39,7 +39,7 @@ class DatabaseFork
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def run
|
42
|
-
if
|
42
|
+
if qualified_branch?(current_branch) && !ignored_branch?(current_branch)
|
43
43
|
log_info 'branch qualified for database forking'
|
44
44
|
|
45
45
|
config['environments'].each do |env|
|
@@ -61,7 +61,6 @@ class DatabaseFork
|
|
61
61
|
adapter.reset_env
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
65
64
|
end
|
66
65
|
|
67
66
|
else
|
@@ -71,6 +70,14 @@ class DatabaseFork
|
|
71
70
|
save_config
|
72
71
|
end
|
73
72
|
|
73
|
+
def qualified_branch?(branch_name)
|
74
|
+
Regexp.new(config['check_branch_name_regex']).match(branch_name)
|
75
|
+
end
|
76
|
+
|
77
|
+
def ignored_branch?(branch_name)
|
78
|
+
config['ignore'] ||= []
|
79
|
+
config['ignore'].include?(branch_name)
|
80
|
+
end
|
74
81
|
|
75
82
|
def ask_user(question)
|
76
83
|
log_info question
|
@@ -97,6 +104,7 @@ class DatabaseFork
|
|
97
104
|
end
|
98
105
|
|
99
106
|
def save_config
|
107
|
+
config['ignore'].uniq!
|
100
108
|
File.open(@config_file, 'w') do |f|
|
101
109
|
f.puts @config.to_yaml
|
102
110
|
end
|