ivar 0.4.0 → 0.4.7

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: fab4b673955331785324df9526d8c6cbefc2fb2bfd5268364fabea167842deaa
4
- data.tar.gz: 4a39dc2f3530e7292e613b9140cb668ee1755a55cf4da8676c6bc74da159a20d
3
+ metadata.gz: 126ad66ef41d7f999705ba40e7f89577f4fa1f5c1f0912f03b5ac48a188de2e7
4
+ data.tar.gz: fabf7625f5394e23c86a3bf9a4d3bd6696365eacb15b1d6de0588044ba8915e0
5
5
  SHA512:
6
- metadata.gz: e15519f99aa5c24bec436bc1365d5640eb64f31b91c901442105cd62da045b44d55a6537b73b8c8d405318afc430ce9cfa9060e99beb72368643f25933043327
7
- data.tar.gz: 7f717746c49f99ee91757429bc0dfe0c568c9e4684bcb219a11224457b06fc3aac4dc59d40e3109b600b4bd0729c58c070bee874a25787f5802afdbb13cb5cf8
6
+ metadata.gz: 46777d41f87b61c907552703b7e134e39dea6f58197c6d786c9a5660ab8ed826fdc3ca887b02e48045889813f07faf798156b60c2ad0b18d07443e752d5fddf2
7
+ data.tar.gz: 3f67259310a65e9760a25d8e9e5995d3f6a35afa23339a9f475097894f3b36a9561eb904c7ad37ddbdeacd13beab2320328bc7eb50f3be93c3c131274e9b5bd8
data/CHANGELOG.md CHANGED
@@ -7,7 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.7] - 2025-05-07
11
+
12
+ ## [0.4.6] - 2025-05-07
13
+
14
+ ## [0.4.5] - 2025-05-07
15
+
16
+ ## [0.4.4] - 2025-05-07
17
+
18
+ ### Changed
19
+ - Enhanced release script to detect and handle uncommitted changes after the release process
20
+ - Improved release script to update Gemfile.lock before committing version changes
21
+
22
+ ## [0.4.2] - 2025-05-07
23
+
24
+ ### Added
25
+ - Enhanced release script to automatically push changes and tags to the remote repository
26
+
10
27
  ### Fixed
28
+ - Fixed release script to include Gemfile.lock changes in version bump commit
11
29
  - Fixed GitHub Actions workflow to prevent "frozen Gemfile.lock" errors during gem publishing
12
30
 
13
31
  ## [0.4.0] - 2025-05-07
data/VERSION.md CHANGED
@@ -17,19 +17,21 @@ To release a new version:
17
17
  1. Make sure all changes are documented in the `CHANGELOG.md` file under the "Unreleased" section
18
18
  2. Run the release script with the appropriate version bump type:
19
19
  ```
20
- script/release [major|minor|patch]
20
+ script/release [major|minor|patch] [options]
21
21
  ```
22
+
23
+ Available options:
24
+ - `--yes` or `-y`: Skip confirmation prompt
25
+ - `--no-push`: Skip pushing changes to remote repository
26
+
22
27
  3. The script will:
23
28
  - Run tests and linter to ensure everything is working
24
29
  - Update the version number in `lib/ivar/version.rb`
25
30
  - Update the `CHANGELOG.md` file with the new version and date
26
31
  - Commit these changes
27
32
  - Create a git tag for the new version
28
- 4. Push the changes and tag to GitHub:
29
- ```
30
- git push origin main && git push origin v{version}
31
- ```
32
- 5. The GitHub Actions workflow will automatically:
33
+ - Push the changes and tag to GitHub (unless `--no-push` is specified)
34
+ 4. The GitHub Actions workflow will automatically:
33
35
  - Build the gem
34
36
  - Run tests
35
37
  - Publish the gem to RubyGems.org
data/lib/ivar/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ivar
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.7"
5
5
  end
data/script/release CHANGED
@@ -5,7 +5,8 @@
5
5
  # Usage: script/release [major|minor|patch] [options]
6
6
  #
7
7
  # Options:
8
- # --yes, -y Skip confirmation prompt
8
+ # --yes, -y Skip confirmation prompt
9
+ # --no-push Skip pushing changes to remote repository
9
10
 
10
11
  require "bundler/gem_tasks"
11
12
  require_relative "../lib/ivar/version"
@@ -84,16 +85,70 @@ def clean_build_artifacts
84
85
  end
85
86
  end
86
87
 
87
- def commit_and_tag(new_version)
88
+ def check_for_uncommitted_changes
89
+ info "Checking for uncommitted changes..."
90
+ uncommitted_changes = `git status --porcelain`.strip
91
+
92
+ if uncommitted_changes.empty?
93
+ info "No uncommitted changes detected."
94
+ false
95
+ else
96
+ info "Uncommitted changes detected:"
97
+ puts uncommitted_changes
98
+ true
99
+ end
100
+ end
101
+
102
+ def commit_remaining_changes(new_version)
103
+ info "Committing remaining changes after release process..."
104
+ system("git add --all")
105
+ system("git commit -m \"Post-release cleanup for v#{new_version}\"")
106
+ info "Remaining changes committed."
107
+ end
108
+
109
+ def push_changes_and_tag(new_version)
110
+ # Check for any uncommitted changes before pushing
111
+ has_uncommitted_changes = check_for_uncommitted_changes
112
+
113
+ # If there are uncommitted changes, commit them
114
+ if has_uncommitted_changes
115
+ commit_remaining_changes(new_version)
116
+ end
117
+
118
+ info "Pushing changes to remote repository..."
119
+ system("git push origin main") || error("Failed to push changes to remote repository.")
120
+
121
+ info "Pushing tag v#{new_version} to remote repository..."
122
+ system("git push origin v#{new_version}") || error("Failed to push tag to remote repository.")
123
+
124
+ success "Changes and tag pushed successfully!"
125
+ end
126
+
127
+ def update_gemfile_lock
128
+ info "Updating Gemfile.lock with new version..."
129
+ system("bundle install") || error("Failed to update Gemfile.lock. Run 'bundle install' manually and try again.")
130
+ info "Gemfile.lock updated successfully."
131
+ end
132
+
133
+ def commit_and_tag(new_version, skip_push = false)
88
134
  info "Committing version bump..."
89
- system("git add lib/ivar/version.rb CHANGELOG.md")
135
+
136
+ # Add all relevant files to staging
137
+ system("git add lib/ivar/version.rb CHANGELOG.md Gemfile.lock")
138
+
139
+ # Commit the changes
90
140
  system("git commit -m \"Bump version to #{new_version}\"")
91
141
 
92
142
  info "Creating tag v#{new_version}..."
93
143
  system("git tag -a v#{new_version} -m \"Version #{new_version}\"")
94
144
 
95
- info "To push the new version, run:"
96
- puts " git push origin main && git push origin v#{new_version}"
145
+ if skip_push
146
+ info "Skipping push to remote repository."
147
+ info "To push the new version manually, run:"
148
+ puts " git push origin main && git push origin v#{new_version}"
149
+ else
150
+ push_changes_and_tag(new_version)
151
+ end
97
152
  end
98
153
 
99
154
  # Main script
@@ -102,6 +157,7 @@ error "Please specify a version bump type: major, minor, or patch" if ARGV.empty
102
157
  # Parse arguments
103
158
  args = ARGV.dup
104
159
  skip_confirmation = args.delete("--yes") || args.delete("-y")
160
+ skip_push = args.delete("--no-push")
105
161
  bump_type = args[0].downcase if args[0]
106
162
 
107
163
  error "Please specify a version bump type: major, minor, or patch" unless bump_type
@@ -126,9 +182,32 @@ if confirmation == "y"
126
182
  run_linter
127
183
  update_version_file(new_version)
128
184
  update_changelog(new_version)
129
- commit_and_tag(new_version)
185
+ update_gemfile_lock
186
+ commit_and_tag(new_version, skip_push)
130
187
  success "Version bumped to #{new_version}!"
131
- success "Run 'git push origin main && git push origin v#{new_version}' to trigger the release workflow."
188
+
189
+ if skip_push
190
+ success "Remember to push changes manually to trigger the release workflow."
191
+ else
192
+ success "Release workflow triggered!"
193
+
194
+ # Final check for any remaining uncommitted changes
195
+ if check_for_uncommitted_changes
196
+ info "There are still uncommitted changes after the release process."
197
+ puts "Would you like to commit and push these changes? (y/n)"
198
+ cleanup_confirmation = $stdin.gets.chomp.downcase
199
+
200
+ if cleanup_confirmation == "y"
201
+ commit_remaining_changes(new_version)
202
+ system("git push origin main") || error("Failed to push cleanup changes.")
203
+ success "Post-release cleanup completed and pushed successfully!"
204
+ else
205
+ info "Uncommitted changes left in working directory."
206
+ end
207
+ else
208
+ success "Working directory is clean. Release completed successfully!"
209
+ end
210
+ end
132
211
  else
133
212
  info "Release cancelled."
134
213
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ivar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avdi Grimm
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-05-07 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: prism
@@ -23,19 +24,9 @@ dependencies:
23
24
  - - "~>"
24
25
  - !ruby/object:Gem::Version
25
26
  version: '1.2'
26
- description: |
27
- Ruby instance variables are so convenient - you don't even need to declare them!
28
- But... they are also dangerous, because a mispelled variable name results in `nil`
29
- instead of an error.
27
+ description: 'Ivar is a Ruby gem that automatically checks for typos in instance variables.
30
28
 
31
- Why not have the best of both worlds? Ivar lets you use plain-old instance variables,
32
- and automatically checks for typos.
33
-
34
- Ivar waits until an instance is created to do the checking, then uses Prism to look
35
- for variables that don't match what was set in initialization. So it's a little bit
36
- dynamic, a little bit static. It doesn't encumber your instance variable reads and
37
- writes with any extra checking. And with the `:warn_once` policy, it won't overwhelm
38
- you with output.
29
+ '
39
30
  email:
40
31
  - avdi@avdi.codes
41
32
  executables: []
@@ -78,7 +69,6 @@ files:
78
69
  - hooks/README.md
79
70
  - hooks/install.sh
80
71
  - hooks/pre-commit
81
- - ivar.gemspec
82
72
  - lib/ivar.rb
83
73
  - lib/ivar/check_all.rb
84
74
  - lib/ivar/check_all_manager.rb
@@ -114,6 +104,7 @@ metadata:
114
104
  homepage_uri: https://github.com/avdi/ivar
115
105
  source_code_uri: https://github.com/avdi/ivar
116
106
  changelog_uri: https://github.com/avdi/ivar/blob/main/CHANGELOG.md
107
+ post_install_message:
117
108
  rdoc_options: []
118
109
  require_paths:
119
110
  - lib
@@ -128,7 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
119
  - !ruby/object:Gem::Version
129
120
  version: '0'
130
121
  requirements: []
131
- rubygems_version: 3.6.7
122
+ rubygems_version: 3.5.3
123
+ signing_key:
132
124
  specification_version: 4
133
- summary: Automatically check instance variables for typos.
125
+ summary: A Ruby gem that automatically checks for typos in instance variables.
134
126
  test_files: []
data/ivar.gemspec DELETED
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/ivar/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "ivar"
7
- spec.version = Ivar::VERSION
8
- spec.authors = ["Avdi Grimm"]
9
- spec.email = ["avdi@avdi.codes"]
10
-
11
- spec.summary = "Automatically check instance variables for typos."
12
- spec.description = <<~DESCRIPTION
13
- Ruby instance variables are so convenient - you don't even need to declare them!
14
- But... they are also dangerous, because a mispelled variable name results in `nil`
15
- instead of an error.
16
-
17
- Why not have the best of both worlds? Ivar lets you use plain-old instance variables,
18
- and automatically checks for typos.
19
-
20
- Ivar waits until an instance is created to do the checking, then uses Prism to look
21
- for variables that don't match what was set in initialization. So it's a little bit
22
- dynamic, a little bit static. It doesn't encumber your instance variable reads and
23
- writes with any extra checking. And with the `:warn_once` policy, it won't overwhelm
24
- you with output.
25
- DESCRIPTION
26
-
27
- spec.homepage = "https://github.com/avdi/ivar"
28
- spec.license = "MIT"
29
- spec.required_ruby_version = ">= 3.3.0"
30
-
31
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
32
-
33
- spec.metadata["homepage_uri"] = spec.homepage
34
- spec.metadata["source_code_uri"] = "https://github.com/avdi/ivar"
35
- spec.metadata["changelog_uri"] = "https://github.com/avdi/ivar/blob/main/CHANGELOG.md"
36
-
37
- # Specify which files should be added to the gem when it is released.
38
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
39
- spec.files = Dir.chdir(__dir__) do
40
- `git ls-files -z`.split("\x0").reject do |f|
41
- (File.expand_path(f) == __FILE__) ||
42
- f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile]) ||
43
- f.end_with?(".gem")
44
- end
45
- end
46
- spec.require_paths = ["lib"]
47
-
48
- # Dependencies
49
- spec.add_dependency "prism", "~> 1.2"
50
- end