rails-worktree 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/worktree/commands/init.rb +8 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 456c428610bf82c3e0e1ce8f720d22a70659384b87980c48ae7afa8484c1e5d3
|
|
4
|
+
data.tar.gz: d723f2b9631b97304507b63155c9a9b1a7c5b729c8d97e471d55d40032ca2a19
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1704fd1870220d15467ad2d3f7de1791eca318265982344cd61519d2202e3198cfc1346305d75e44b6d32e82e5b8b17f188e09ef4a198734f577c00325b356ff
|
|
7
|
+
data.tar.gz: 603b6dc0fed0d99407bed88ef1c3b266fdd8cd9b8fa77b90e774506e41ad8de4f14fe28ebc102007a8c9d4c133f874327da637ffb2a635e7d3b62a6d453794ed
|
|
@@ -47,12 +47,16 @@ module RailsWorktree
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def get_db_prefix
|
|
50
|
+
# Try to get prefix from database.yml first
|
|
50
51
|
database_yml = File.join(@main_worktree, "config/database.yml")
|
|
51
|
-
|
|
52
|
+
if File.exist?(database_yml)
|
|
53
|
+
content = File.read(database_yml)
|
|
54
|
+
match = content.match(/database:\s*(\w+)_development/)
|
|
55
|
+
return match[1] if match
|
|
56
|
+
end
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
match ? match[1] : nil
|
|
58
|
+
# Fall back to using the Rails app name (directory name of main worktree)
|
|
59
|
+
File.basename(@main_worktree)
|
|
56
60
|
end
|
|
57
61
|
|
|
58
62
|
def copy_config_files
|