rails-worktree 0.1.0 → 0.1.2
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/README.md +34 -123
- data/exe/worktree +2 -2
- data/lib/rails-worktree.rb +1 -1
- data/lib/worktree/cli.rb +1 -1
- data/lib/worktree/commands/close.rb +21 -9
- data/lib/worktree/commands/create.rb +6 -1
- data/lib/worktree/commands/init.rb +45 -15
- data/lib/worktree/railtie.rb +3 -3
- data/lib/worktree/tasks.rb +2 -2
- data/lib/worktree/version.rb +1 -1
- metadata +1 -2
- data/lib/worktree.rb +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 643a94687d7bfbc445da047772aa7279dcd59cc04e9d262a3a867312eef2dec4
|
|
4
|
+
data.tar.gz: 8280fe1eddc1bb863b07952ef5428f85c3c4f36ef883b7d84f077e1393d19575
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 275bbc3e3ce90c3e7f6ebd897a5f1e647744119c34ec8e43bf88ad00ee297351bf4c4e1ea3403e84cf406298bb6a20d37c59d4182da5f0cb2f1eeef2801684d4
|
|
7
|
+
data.tar.gz: 68583904e5d42f2af6a60f5c334136aee1bdb99b61db6a5cad663836786a514b7e0a96868948fd1f9a8cd8f470148f9e1c5714826ac71d70a6943baeca7b262f
|
data/README.md
CHANGED
|
@@ -1,174 +1,85 @@
|
|
|
1
1
|
# Rails Worktree
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Git worktree management for Rails projects with isolated databases and configurations.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Create git worktrees with automatic branch creation
|
|
8
|
-
- Isolated
|
|
9
|
-
- Automatic configuration file copying
|
|
8
|
+
- Isolated databases per worktree (separate development and test databases)
|
|
9
|
+
- Automatic configuration file copying
|
|
10
10
|
- Copy node_modules from main worktree
|
|
11
11
|
- Easy cleanup with database dropping and directory removal
|
|
12
|
-
- Works across any Rails project (no hardcoded paths)
|
|
13
12
|
|
|
14
13
|
## Installation
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Add to your `Gemfile`:
|
|
17
16
|
|
|
18
17
|
```ruby
|
|
19
|
-
# Add to Gemfile (development group)
|
|
20
18
|
group :development do
|
|
21
19
|
gem "rails-worktree"
|
|
22
20
|
end
|
|
23
21
|
```
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
bundle install
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
The gem will automatically install a binstub to `bin/worktree` when Rails loads in development mode.
|
|
32
|
-
|
|
33
|
-
### Manual binstub installation
|
|
34
|
-
|
|
35
|
-
If needed, you can manually install or reinstall the binstub:
|
|
23
|
+
Run `bundle install`. A binstub will be automatically created at `bin/worktree`.
|
|
36
24
|
|
|
25
|
+
Manual binstub installation (if needed):
|
|
37
26
|
```bash
|
|
38
27
|
bundle exec rake worktree:install
|
|
39
28
|
```
|
|
40
29
|
|
|
41
|
-
To uninstall:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
bundle exec rake worktree:uninstall
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Global installation (optional)
|
|
48
|
-
|
|
49
|
-
If you want to use `worktree` command globally:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
gem install rails-worktree
|
|
53
|
-
```
|
|
54
|
-
|
|
55
30
|
## Usage
|
|
56
31
|
|
|
57
|
-
### Create a
|
|
32
|
+
### Create a worktree
|
|
58
33
|
|
|
59
34
|
```bash
|
|
60
|
-
bin/worktree feature-branch
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
bin/worktree feature-branch main
|
|
64
|
-
# Creates worktree from main branch
|
|
35
|
+
bin/worktree feature-branch # From current branch
|
|
36
|
+
bin/worktree feature-branch main # From specific branch
|
|
65
37
|
```
|
|
66
38
|
|
|
67
|
-
This
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
5. Copy node_modules
|
|
73
|
-
6. Run migrations and seed the database
|
|
39
|
+
This creates a new worktree with:
|
|
40
|
+
- Separate databases: `myapp_feature-branch_development` and `myapp_feature-branch_test`
|
|
41
|
+
- Copied configuration files (`.env`, `database.yml`, `Procfile.dev`, credentials)
|
|
42
|
+
- Copied `node_modules`
|
|
43
|
+
- Migrated and seeded databases
|
|
74
44
|
|
|
75
45
|
### Close a worktree
|
|
76
46
|
|
|
77
47
|
```bash
|
|
78
|
-
# From main
|
|
79
|
-
bin/worktree --close
|
|
80
|
-
|
|
81
|
-
# From within the worktree:
|
|
82
|
-
bin/worktree --close
|
|
48
|
+
bin/worktree --close feature-branch # From main repo
|
|
49
|
+
bin/worktree --close # From within worktree
|
|
83
50
|
```
|
|
84
51
|
|
|
85
|
-
|
|
86
|
-
1. Drop the worktree's database
|
|
87
|
-
2. Remove the worktree directory
|
|
88
|
-
3. Delete the branch
|
|
89
|
-
4. Clean up git worktree references
|
|
52
|
+
Drops both databases, removes the directory, deletes the branch, and cleans up git references.
|
|
90
53
|
|
|
91
|
-
|
|
54
|
+
## Database Configuration
|
|
92
55
|
|
|
93
|
-
|
|
56
|
+
The gem uses environment variables for database names:
|
|
94
57
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
worktree --init feature-branch
|
|
98
|
-
```
|
|
58
|
+
- `DATABASE_NAME_DEVELOPMENT` - Development database name
|
|
59
|
+
- `DATABASE_NAME_TEST` - Test database name
|
|
99
60
|
|
|
100
|
-
|
|
61
|
+
Your `config/database.yml` should look like:
|
|
101
62
|
|
|
102
|
-
|
|
63
|
+
```yaml
|
|
64
|
+
development:
|
|
65
|
+
<<: *default
|
|
66
|
+
database: <%= ENV.fetch("DATABASE_NAME_DEVELOPMENT", "myapp_development") %>
|
|
67
|
+
test:
|
|
68
|
+
<<: *default
|
|
69
|
+
database: <%= ENV.fetch("DATABASE_NAME_TEST", "myapp_test") %>
|
|
70
|
+
```
|
|
103
71
|
|
|
104
72
|
The gem automatically:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- Modifies `database.yml` to use the `DATABASE_NAME` environment variable
|
|
109
|
-
|
|
110
|
-
### Configuration files
|
|
111
|
-
|
|
112
|
-
The following files are copied from the main worktree:
|
|
113
|
-
- `.env`
|
|
114
|
-
- `config/database.yml`
|
|
115
|
-
- `Procfile.dev`
|
|
116
|
-
- `config/credentials/development.key`
|
|
117
|
-
|
|
118
|
-
### Node modules
|
|
119
|
-
|
|
120
|
-
If `node_modules` exists in the main worktree, it will be copied to the new worktree.
|
|
73
|
+
1. Sets these variables in the worktree's `.env` file
|
|
74
|
+
2. Updates the worktree's `database.yml` to use them
|
|
75
|
+
3. Creates both development and test databases with unique names
|
|
121
76
|
|
|
122
77
|
## Requirements
|
|
123
78
|
|
|
124
79
|
- Ruby >= 2.6.0
|
|
125
|
-
- Git with worktree support
|
|
126
80
|
- Rails project with standard structure
|
|
127
|
-
|
|
128
|
-
## Project structure
|
|
129
|
-
|
|
130
|
-
This gem works with Rails projects that follow the standard structure:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
your-project/
|
|
134
|
-
├── config/
|
|
135
|
-
│ ├── database.yml
|
|
136
|
-
│ └── credentials/
|
|
137
|
-
│ └── development.key
|
|
138
|
-
├── .env
|
|
139
|
-
├── Procfile.dev
|
|
140
|
-
└── bin/
|
|
141
|
-
├── rails
|
|
142
|
-
└── dev
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Development
|
|
146
|
-
|
|
147
|
-
To work on the gem:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Clone or create the gem
|
|
151
|
-
cd worktree
|
|
152
|
-
|
|
153
|
-
# Make changes to lib/worktree/**
|
|
154
|
-
|
|
155
|
-
# Test locally
|
|
156
|
-
gem build worktree.gemspec
|
|
157
|
-
gem install ./worktree-0.1.0.gem
|
|
158
|
-
|
|
159
|
-
# Test in a Rails project
|
|
160
|
-
cd /path/to/rails/project
|
|
161
|
-
worktree test-branch
|
|
162
|
-
```
|
|
81
|
+
- PostgreSQL (or modify for your database)
|
|
163
82
|
|
|
164
83
|
## License
|
|
165
84
|
|
|
166
85
|
MIT
|
|
167
|
-
|
|
168
|
-
## Contributing
|
|
169
|
-
|
|
170
|
-
1. Fork it
|
|
171
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
172
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
173
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
174
|
-
5. Create new Pull Request
|
data/exe/worktree
CHANGED
data/lib/rails-worktree.rb
CHANGED
data/lib/worktree/cli.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module RailsWorktree
|
|
4
4
|
module Commands
|
|
5
5
|
class Close
|
|
6
6
|
def initialize(args)
|
|
@@ -13,7 +13,8 @@ module Worktree
|
|
|
13
13
|
detect_worktree_name unless @worktree_name
|
|
14
14
|
|
|
15
15
|
@db_prefix = get_db_prefix
|
|
16
|
-
@
|
|
16
|
+
@dev_database_name = "#{@db_prefix}_#{@worktree_name}_development"
|
|
17
|
+
@test_database_name = "#{@db_prefix}_#{@worktree_name}_test"
|
|
17
18
|
|
|
18
19
|
detect_paths
|
|
19
20
|
|
|
@@ -21,14 +22,14 @@ module Worktree
|
|
|
21
22
|
puts "Main worktree: #{@main_worktree}"
|
|
22
23
|
puts ""
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
drop_databases
|
|
25
26
|
remove_worktree
|
|
26
27
|
prune_worktrees
|
|
27
28
|
delete_branch
|
|
28
29
|
|
|
29
30
|
puts ""
|
|
30
31
|
puts "✓ Worktree '#{@worktree_name}' closed successfully!"
|
|
31
|
-
puts "
|
|
32
|
+
puts " Databases dropped: #{@dev_database_name}, #{@test_database_name}"
|
|
32
33
|
puts " Worktree removed from #{@worktree_path}"
|
|
33
34
|
puts " Branch #{@worktree_name} deleted"
|
|
34
35
|
end
|
|
@@ -73,16 +74,27 @@ module Worktree
|
|
|
73
74
|
end
|
|
74
75
|
end
|
|
75
76
|
|
|
76
|
-
def
|
|
77
|
-
puts "Dropping
|
|
77
|
+
def drop_databases
|
|
78
|
+
puts "Dropping databases..."
|
|
78
79
|
|
|
79
80
|
Dir.chdir(@worktree_dir) do
|
|
80
81
|
env_file = ".env"
|
|
81
|
-
|
|
82
|
+
env_content = File.exist?(env_file) ? File.read(env_file) : ""
|
|
83
|
+
|
|
84
|
+
# Drop development database
|
|
85
|
+
if env_content.match?(/^DATABASE_NAME_DEVELOPMENT=#{@dev_database_name}/)
|
|
82
86
|
system("RAILS_ENV=development bin/rails db:drop 2>/dev/null") ||
|
|
83
|
-
puts("Warning: Could not drop database #{@
|
|
87
|
+
puts("Warning: Could not drop development database #{@dev_database_name}")
|
|
88
|
+
else
|
|
89
|
+
puts "Warning: DATABASE_NAME_DEVELOPMENT not set in .env, skipping development database drop"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Drop test database
|
|
93
|
+
if env_content.match?(/^DATABASE_NAME_TEST=#{@test_database_name}/)
|
|
94
|
+
system("RAILS_ENV=test bin/rails db:drop 2>/dev/null") ||
|
|
95
|
+
puts("Warning: Could not drop test database #{@test_database_name}")
|
|
84
96
|
else
|
|
85
|
-
puts "Warning:
|
|
97
|
+
puts "Warning: DATABASE_NAME_TEST not set in .env, skipping test database drop"
|
|
86
98
|
end
|
|
87
99
|
end
|
|
88
100
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module
|
|
1
|
+
module RailsWorktree
|
|
2
2
|
module Commands
|
|
3
3
|
class Create
|
|
4
4
|
def initialize(args)
|
|
@@ -14,6 +14,7 @@ module Worktree
|
|
|
14
14
|
|
|
15
15
|
@base_branch ||= current_branch
|
|
16
16
|
worktree_path = "../#{@worktree_name}"
|
|
17
|
+
absolute_path = File.expand_path(worktree_path)
|
|
17
18
|
|
|
18
19
|
puts "Creating worktree '#{@worktree_name}' from branch '#{@base_branch}' at #{worktree_path}..."
|
|
19
20
|
|
|
@@ -30,6 +31,10 @@ module Worktree
|
|
|
30
31
|
Dir.chdir(worktree_path) do
|
|
31
32
|
Init.new([@worktree_name]).run
|
|
32
33
|
end
|
|
34
|
+
|
|
35
|
+
puts ""
|
|
36
|
+
puts "To switch to the new worktree:"
|
|
37
|
+
puts " cd #{absolute_path}"
|
|
33
38
|
end
|
|
34
39
|
|
|
35
40
|
private
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module RailsWorktree
|
|
4
4
|
module Commands
|
|
5
5
|
class Init
|
|
6
6
|
def initialize(args)
|
|
@@ -16,21 +16,24 @@ module Worktree
|
|
|
16
16
|
|
|
17
17
|
@main_worktree = get_main_worktree
|
|
18
18
|
@db_prefix = get_db_prefix
|
|
19
|
-
@
|
|
19
|
+
@dev_database_name = "#{@db_prefix}_#{@worktree_name}_development"
|
|
20
|
+
@test_database_name = "#{@db_prefix}_#{@worktree_name}_test"
|
|
20
21
|
|
|
21
22
|
puts "Initializing worktree '#{@worktree_name}'..."
|
|
22
23
|
puts "Main worktree: #{@main_worktree}"
|
|
23
|
-
puts "
|
|
24
|
+
puts "Development database: #{@dev_database_name}"
|
|
25
|
+
puts "Test database: #{@test_database_name}"
|
|
24
26
|
|
|
25
27
|
copy_config_files
|
|
26
|
-
|
|
28
|
+
set_database_names
|
|
27
29
|
update_database_yml
|
|
28
30
|
copy_node_modules
|
|
29
31
|
setup_database
|
|
30
32
|
|
|
31
33
|
puts ""
|
|
32
34
|
puts "✓ Worktree initialized successfully!"
|
|
33
|
-
puts "
|
|
35
|
+
puts " Development database: #{@dev_database_name}"
|
|
36
|
+
puts " Test database: #{@test_database_name}"
|
|
34
37
|
puts " Configuration files copied"
|
|
35
38
|
puts ""
|
|
36
39
|
puts "To start the development server: bin/dev"
|
|
@@ -73,32 +76,57 @@ module Worktree
|
|
|
73
76
|
end
|
|
74
77
|
end
|
|
75
78
|
|
|
76
|
-
def
|
|
77
|
-
puts "Setting
|
|
79
|
+
def set_database_names
|
|
80
|
+
puts "Setting database names in .env..."
|
|
78
81
|
|
|
79
82
|
env_file = ".env"
|
|
80
83
|
return unless File.exist?(env_file)
|
|
81
84
|
|
|
82
85
|
content = File.read(env_file)
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
|
|
87
|
+
# Set development database name
|
|
88
|
+
if content.match?(/^DATABASE_NAME_DEVELOPMENT=/)
|
|
89
|
+
content.gsub!(/^DATABASE_NAME_DEVELOPMENT=.*$/, "DATABASE_NAME_DEVELOPMENT=#{@dev_database_name}")
|
|
90
|
+
else
|
|
91
|
+
content += "\nDATABASE_NAME_DEVELOPMENT=#{@dev_database_name}\n"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Set test database name
|
|
95
|
+
if content.match?(/^DATABASE_NAME_TEST=/)
|
|
96
|
+
content.gsub!(/^DATABASE_NAME_TEST=.*$/, "DATABASE_NAME_TEST=#{@test_database_name}")
|
|
85
97
|
else
|
|
86
|
-
content += "
|
|
98
|
+
content += "DATABASE_NAME_TEST=#{@test_database_name}\n"
|
|
87
99
|
end
|
|
88
100
|
|
|
89
101
|
File.write(env_file, content)
|
|
90
102
|
end
|
|
91
103
|
|
|
92
104
|
def update_database_yml
|
|
93
|
-
puts "Updating database.yml to use
|
|
105
|
+
puts "Updating database.yml to use separate database names..."
|
|
94
106
|
|
|
95
107
|
database_yml = "config/database.yml"
|
|
96
108
|
return unless File.exist?(database_yml)
|
|
97
109
|
|
|
98
110
|
content = File.read(database_yml)
|
|
111
|
+
|
|
112
|
+
# Update development database
|
|
113
|
+
content.gsub!(
|
|
114
|
+
/database:\s*<%= ENV\.fetch\("DATABASE_NAME",\s*"#{@db_prefix}_development"\s*%>/,
|
|
115
|
+
"database: <%= ENV.fetch(\"DATABASE_NAME_DEVELOPMENT\", \"#{@db_prefix}_development\") %>"
|
|
116
|
+
)
|
|
99
117
|
content.gsub!(
|
|
100
118
|
/database:\s*#{@db_prefix}_development/,
|
|
101
|
-
"database: <%= ENV.fetch(\"
|
|
119
|
+
"database: <%= ENV.fetch(\"DATABASE_NAME_DEVELOPMENT\", \"#{@db_prefix}_development\") %>"
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# Update test database
|
|
123
|
+
content.gsub!(
|
|
124
|
+
/database:\s*<%= ENV\.fetch\("DATABASE_NAME",\s*"#{@db_prefix}_test"\s*%>/,
|
|
125
|
+
"database: <%= ENV.fetch(\"DATABASE_NAME_TEST\", \"#{@db_prefix}_test\") %>"
|
|
126
|
+
)
|
|
127
|
+
content.gsub!(
|
|
128
|
+
/database:\s*#{@db_prefix}_test/,
|
|
129
|
+
"database: <%= ENV.fetch(\"DATABASE_NAME_TEST\", \"#{@db_prefix}_test\") %>"
|
|
102
130
|
)
|
|
103
131
|
|
|
104
132
|
File.write(database_yml, content)
|
|
@@ -116,13 +144,15 @@ module Worktree
|
|
|
116
144
|
end
|
|
117
145
|
|
|
118
146
|
def setup_database
|
|
119
|
-
puts "Creating
|
|
120
|
-
system("RAILS_ENV=development bin/rails db:create") || puts("Warning: Could not create database")
|
|
147
|
+
puts "Creating databases..."
|
|
148
|
+
system("RAILS_ENV=development bin/rails db:create") || puts("Warning: Could not create development database")
|
|
149
|
+
system("RAILS_ENV=test bin/rails db:create") || puts("Warning: Could not create test database")
|
|
121
150
|
|
|
122
151
|
puts "Running migrations..."
|
|
123
152
|
system("RAILS_ENV=development bin/rails db:migrate") || puts("Warning: Could not run migrations")
|
|
153
|
+
system("RAILS_ENV=test bin/rails db:migrate") || puts("Warning: Could not run test migrations")
|
|
124
154
|
|
|
125
|
-
puts "Seeding database..."
|
|
155
|
+
puts "Seeding development database..."
|
|
126
156
|
system("RAILS_ENV=development bin/rails db:seed") || puts("Warning: Could not seed database")
|
|
127
157
|
end
|
|
128
158
|
end
|
data/lib/worktree/railtie.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "rails/railtie"
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module RailsWorktree
|
|
4
4
|
class Railtie < Rails::Railtie
|
|
5
5
|
railtie_name :worktree
|
|
6
6
|
|
|
@@ -20,9 +20,9 @@ module Worktree
|
|
|
20
20
|
#!/usr/bin/env ruby
|
|
21
21
|
|
|
22
22
|
require "bundler/setup"
|
|
23
|
-
require "worktree"
|
|
23
|
+
require "rails-worktree"
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
RailsWorktree::CLI.run(ARGV)
|
|
26
26
|
RUBY
|
|
27
27
|
|
|
28
28
|
FileUtils.chmod("+x", binstub_path)
|
data/lib/worktree/tasks.rb
CHANGED
data/lib/worktree/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-worktree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Ulleberg
|
|
@@ -21,7 +21,6 @@ files:
|
|
|
21
21
|
- README.md
|
|
22
22
|
- exe/worktree
|
|
23
23
|
- lib/rails-worktree.rb
|
|
24
|
-
- lib/worktree.rb
|
|
25
24
|
- lib/worktree/cli.rb
|
|
26
25
|
- lib/worktree/commands/close.rb
|
|
27
26
|
- lib/worktree/commands/create.rb
|
data/lib/worktree.rb
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require_relative "worktree/version"
|
|
2
|
-
require_relative "worktree/cli"
|
|
3
|
-
require_relative "worktree/commands/create"
|
|
4
|
-
require_relative "worktree/commands/init"
|
|
5
|
-
require_relative "worktree/commands/close"
|
|
6
|
-
|
|
7
|
-
# Load Railtie only if Rails is available
|
|
8
|
-
require_relative "worktree/railtie" if defined?(Rails::Railtie)
|
|
9
|
-
|
|
10
|
-
module Worktree
|
|
11
|
-
class Error < StandardError; end
|
|
12
|
-
end
|