gw 0.1.1 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a657c62f1c78434600116e8ea0f975aabab4c75e40630786fbe6559c3c33b36
4
- data.tar.gz: 972faabb497b6aa59b3b50f081e1c4424a8e6ba5f601b531ad3b291f21fef661
3
+ metadata.gz: 3e52867b1534466cd786ae0044e5fe47b00121bf3b4d9beea640bfb02aa4ceec
4
+ data.tar.gz: ba364eaa4573b9a3c563e96809bba26fc25c40e4a0eccd742aefaf022c9ae915
5
5
  SHA512:
6
- metadata.gz: '028f55f5f766a42b26928de3918fe464cb5ff08db9d940646e4f1d8b3500ffeb0b8d8c8b81dab9d453a9b5244ff52bf9d897d01a6e36c5397d2305699f2c4fd0'
7
- data.tar.gz: a8589decf53531c102b02b645dad6061de856ee560b05864c63a0920c0c80ba9a2081796f9ed1f6f128a1c03fc4c1dade90ff7c21bd3d7e72c0b4ca88ada257d
6
+ metadata.gz: a0902b99541321176897afb5aefb55b8be3298972993f48f45c651ac75b1eec09548b7a186a195d3d084d7eb12fbcde43593f83fc2124766f754fef07fe3b0ce
7
+ data.tar.gz: aadda946aaf1ea08e275c649a9b80358f6a6a40057b9c5d9d4ce33f4cf4d842fefdd7a527a0ca36eb820407ecfa9e88c41af1c5c56c6cda67019a5b0704d80eb
@@ -0,0 +1,44 @@
1
+ name: Release Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ persist-credentials: false
18
+
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: '3.4.8'
23
+ bundler-cache: true
24
+
25
+ - name: Build gem
26
+ run: gem build gw.gemspec
27
+
28
+ - name: Publish to RubyGems
29
+ env:
30
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
31
+ run: |
32
+ mkdir -p ~/.gem
33
+ echo "---
34
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials
35
+ chmod 0600 ~/.gem/credentials
36
+ gem push *.gem
37
+
38
+ - name: Create GitHub Release
39
+ uses: softprops/action-gh-release@v1
40
+ with:
41
+ files: '*.gem'
42
+ generate_release_notes: true
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/lib/gw/repository.rb CHANGED
@@ -75,5 +75,13 @@ module Gw
75
75
 
76
76
  @default_branch
77
77
  end
78
+
79
+ def fetch
80
+ puts "Fetching latest changes from remote..."
81
+ success = system("git -C #{bare_path} fetch --all --prune")
82
+ raise Error, "Failed to fetch from remote" unless success
83
+
84
+ true
85
+ end
78
86
  end
79
87
  end
data/lib/gw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gw
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/gw/worktree.rb CHANGED
@@ -16,6 +16,9 @@ module Gw
16
16
 
17
17
  raise WorktreeAlreadyExistsError, "Worktree '#{branch}' already exists" if worktree.exist?
18
18
 
19
+ # Fetch latest changes from remote
20
+ repo.fetch
21
+
19
22
  # Check if branch exists (locally or remotely)
20
23
  branch_exists = system("git -C #{repo.bare_path} show-ref --verify --quiet refs/heads/#{branch}") ||
21
24
  system("git -C #{repo.bare_path} show-ref --verify --quiet refs/remotes/origin/#{branch}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AILERON
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".github/workflows/main.yml"
78
+ - ".github/workflows/release.yml"
78
79
  - ".gitignore"
79
80
  - ".rspec"
80
81
  - ".rubocop.yml"
@@ -119,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
120
  - !ruby/object:Gem::Version
120
121
  version: '0'
121
122
  requirements: []
122
- rubygems_version: 3.6.9
123
+ rubygems_version: 4.0.3
123
124
  specification_version: 4
124
125
  summary: Git worktree manager with bare repository pattern
125
126
  test_files: []