rebundler 0.5.0 → 0.5.1

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: f39f0bba7935159299bb736312beb6b0452d8997bb1f6c5bf574747b08d05af3
4
- data.tar.gz: f8920192f0a6bf48ba31f21f67f8cba06d1a682e00196a89750aed089bb392bb
3
+ metadata.gz: ca1277ce8c48c32a188112502901feab5054e3f1169c9affafdfa67efc2ad5c6
4
+ data.tar.gz: 44175bed645dd17afd40630266b09d8f3455e4366078c55324da91396e59f2dc
5
5
  SHA512:
6
- metadata.gz: 8a1144be379a959ed76e26635daf82a9e535dc8e8ac416f2509206c95f9b6673b349f62ed80260f7703e83781cf657d20ef7e0e5ba3b6ef732e7404c6e4cb543
7
- data.tar.gz: fa7d2a0423b94382e778ac048defebfe6301d994d860f1040f1cac509e9f617903234ea2eea1f2c5400f8d020183d14bd370a8617287fe0c1203a474f039d024
6
+ metadata.gz: 853ad9dfcd1305412a8ae3625f3d5a95a18a9944e1aa660b77b910accf5d0a9c1cbc1614d0410a459a82f966f3343c436a275a90eb060cfd416ddab3d7e47d8a
7
+ data.tar.gz: f3c323ad1ffb1b585008aa71e8b5aea817d7b54489b125f68e6cb958fa887ae2d437d37b5983af9df65cb823b863a7b5cccc657fb60ed1e86a42588f7f3f1966
data/.rubocop.yml CHANGED
@@ -23,6 +23,3 @@ Style/StringConcatenation:
23
23
 
24
24
  Layout/LineLength:
25
25
  Enabled: false
26
-
27
- Lint/ItWithoutArgumentsInBlock:
28
- Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.5.1] - 2026-03-13
2
+
3
+ - Remove references to running as a bundler plugin. This does not work well, so decided to remove it.
4
+ - Fixed Ruby 3.3 support.
5
+
1
6
  ## [0.5.0] - 2026-03-13
2
7
 
3
8
  - Major internal refactor and clean up.
data/README.md CHANGED
@@ -18,41 +18,15 @@ This is a real life example from my own project. That looks a lot better, doesn'
18
18
 
19
19
  ## Known limitations
20
20
 
21
- - **Probably does not work with all possible Gemfile configurations.** It is designed to work with the most common setups right now. If you encounter an issue, please open an issue on GitHub. I strive to support each sensible configuration.
21
+ - **Probably does not work with all possible Gemfile configurations.** It is designed to work with the most common setups right now. If you encounter an issue, please open an issue on GitHub. I strive to support most sensible configurations.
22
22
 
23
23
  ## Installation
24
24
 
25
- There are two ways to install Rebundler.
25
+ First add `rebundler` to your Gemfile. `bundle add rebundler`. There are two ways to run Rebundler.
26
26
 
27
- ### 1. Automatic mode
27
+ ### 1. Writing mode
28
28
 
29
- > [!NOTE]
30
- > This does not seem to work properly yet, I need to dig into why later.
31
-
32
- Simply add them gem to your Gemfile. the location does not matter as it will be resorted immediately.
33
-
34
- ```ruby
35
- gem "rebundler"
36
- ```
37
-
38
- This installs a Bundler plugin that automatically runs after installing gems. You should see a message in your terminal after running `bundle`:
39
-
40
- ```sh
41
- $ bundle
42
-
43
- ...
44
-
45
- Reordering and annotating Gemfile...
46
- Bundle complete! 10 Gemfile dependencies, 45 gems now installed.
47
- ```
48
-
49
- ### 2. Manual mode
50
-
51
- ```ruby
52
- gem "rebundler", require: false
53
- ```
54
-
55
- This does **not** load the plugin and means you have to run rebundler yourself by running the `rebundle` command:
29
+ If you run `bundle exec rebundle`, rebundler will reorder and annotate your Gemfile.
56
30
 
57
31
  ```sh
58
32
  $ bundle exec rebundle
@@ -60,7 +34,7 @@ Reordering and annotating Gemfile...
60
34
  ✓ Gemfile has been reordered and annotated
61
35
  ```
62
36
 
63
- ### 3. CI mode
37
+ ### 2. CI mode
64
38
 
65
39
  If you run `bundle exec rebundle --ci`, rebundler will run in CI mode, which will compare the output
66
40
  of the current Gemfile to a freshly formatted one.
@@ -69,6 +43,12 @@ If there are differences, rebundler will exit with a non-zero status code.
69
43
 
70
44
  This does not write to the Gemfile.
71
45
 
46
+ ```sh
47
+ ❯ bundle exec rebundle --ci
48
+ Checking if Gemfile is properly formatted...
49
+ ✓ Gemfile is properly formatted
50
+ ```
51
+
72
52
  ### Options
73
53
 
74
54
  ### `--force`
@@ -41,7 +41,7 @@ module Rebundler
41
41
 
42
42
  def self.find_spacing_character(node)
43
43
  # Assume it's formatted with tabs if ANY line starts with a tab.
44
- any_line_starts_with_tab = node.location.slice.split("\n").any? { it.start_with?("\t") }
44
+ any_line_starts_with_tab = node.location.slice.split("\n").any? { |line| line.start_with?("\t") }
45
45
 
46
46
  any_line_starts_with_tab ? "\t" : " "
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rebundler
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
data/lib/rebundler.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "zeitwerk"
4
4
  loader = Zeitwerk::Loader.for_gem
5
- loader.ignore("#{__dir__}/bundler")
6
5
  loader.setup
7
6
 
8
7
  module Rebundler
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rebundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Paagman
@@ -22,7 +22,6 @@ files:
22
22
  - README.md
23
23
  - Rakefile
24
24
  - exe/rebundle
25
- - lib/bundler/rebundle.rb
26
25
  - lib/rebundler.rb
27
26
  - lib/rebundler/Rakefile
28
27
  - lib/rebundler/formatter.rb
@@ -34,7 +33,6 @@ files:
34
33
  - lib/rebundler/version.rb
35
34
  - lib/rebundler/visitor.rb
36
35
  - mise.toml
37
- - plugins.rb
38
36
  homepage: https://github.com/dennispaagman/rebundler
39
37
  licenses:
40
38
  - MIT
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler"
4
- require "tempfile"
5
-
6
- module Bundler
7
- class Rebundle < Bundler::Plugin::API
8
- command "rebundle"
9
-
10
- hook "after-install-all" do
11
- parse_and_write_gemfile!
12
- end
13
-
14
- def exec(command, args)
15
- send command, args
16
- end
17
-
18
- def self.parse_and_write_gemfile!
19
- Bundler.ui.info "Reordering and annotating Gemfile..."
20
-
21
- file = Bundler.root.to_s + "/Gemfile"
22
-
23
- begin
24
- # Load all gems in the Gemfile so we can use them to grab the summary instead of
25
- # having to hit rubygems.org
26
- Bundler.setup
27
-
28
- parser = ::Rebundler::Parser.from_file(file)
29
- content = parser.format
30
-
31
- # Use atomic write to prevent corruption if write fails
32
- Tempfile.create("Gemfile", Bundler.root.to_s) do |tmp|
33
- tmp.write(content)
34
- tmp.flush
35
- tmp.close
36
- FileUtils.mv(tmp.path, file)
37
- end
38
- rescue StandardError => e
39
- Bundler.ui.error "Error parsing Gemfile: #{e.message}"
40
- raise Bundler::PluginError, e
41
- end
42
- end
43
- end
44
- end
data/plugins.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lib/rebundler"