reline_pac 0.1.2 → 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: d881431e4f3e7e058bcf9b86b3c6d9b158a698a9a852841667a4946b04ad7d85
4
- data.tar.gz: 026e26a82aa0fc1629eacfc39d52717af6d2d99e70dad66e691eff4f269ee5be
3
+ metadata.gz: 7c61a45c4702a7fdc1888dd1d04c830a5ffa68ebb4c1999cf188fc3b89861336
4
+ data.tar.gz: b51077083526cc2686035a563f4ee005641a643ed9cc5d3f484ca49c789c89a6
5
5
  SHA512:
6
- metadata.gz: 9441eaaf77f792712508b1650365d2137be574f0cf88735280ceb2592d06d2412a8aadb92cad692d2207be4a83f3420da5404e91a476e8bb27b17dcae48bb8cb
7
- data.tar.gz: 1058b656bc369868a80636386dce5c62efb2c78bff159fa60e139e6832765db898ddd3ca8c6a2b36b795e94938618a70c1ddf292d79960fdc5f9b9d31a711ef2
6
+ metadata.gz: 1eb580d27e783a853a98f6687695335cdb09c81bc534eb8818776f56e5685898c8a4e7f81ac91046f694134ac1128bf4c39d92658efc667ebfebdf05e19c6fd3
7
+ data.tar.gz: cea3333e3b23673659d3c699153405abf24962ef1fb39975ce21526921d8ddadaab512df653d4495da25784611d43401c3e280b9e738a7c24def0f1013c71c96
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.0] - 2026-01-19
4
+
5
+ ## What's Changed
6
+ * Add .irbrc example and update README for Bundler compatibility by @Syati in https://github.com/Syati/reline_pac/pull/5
7
+ * Add custom package support to RelinePac configuration by @Syati in https://github.com/Syati/reline_pac/pull/3
8
+
9
+
10
+ **Full Changelog**: https://github.com/Syati/reline_pac/compare/v0.1.2...v0.2.0
11
+
3
12
  ## [0.1.2] - 2026-01-17
4
13
 
5
14
  ## What's Changed
@@ -7,6 +7,19 @@ module RelinePac
7
7
  Packages.install_all
8
8
  end
9
9
 
10
+ # Add a custom package (method) to Reline::LineEditor.
11
+ # @param method_name [Symbol] the method name to add
12
+ # @yield a block that defines the method body; receives _key as first argument
13
+ def add_package(method_name, &block)
14
+ raise ArgumentError, 'add_package requires a block to define the package method body' unless block_given?
15
+
16
+ Packages::Custom.module_eval do
17
+ define_method(method_name, &block)
18
+ end
19
+
20
+ Reline::LineEditor.prepend(Packages::Custom) unless Reline::LineEditor.ancestors.include?(Packages::Custom)
21
+ end
22
+
10
23
  # Add a keybinding that invokes the given LineEditor method symbol.
11
24
  # @param key [String] a string such as "\C-r"
12
25
  # @param method [Symbol] the LineEditor method to invoke
@@ -18,7 +31,7 @@ module RelinePac
18
31
  private
19
32
 
20
33
  def reline_config
21
- @reline_config ||= Reline.send(:core).config
34
+ @reline_config ||= Reline.core.config
22
35
  end
23
36
  end
24
37
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RelinePac
4
+ module Packages
5
+ # Custom holds user-defined packages added via Config#add_package.
6
+ module Custom
7
+ end
8
+ end
9
+ end
@@ -4,6 +4,7 @@ require 'reline'
4
4
  require_relative 'packages/completion'
5
5
  require_relative 'packages/clipboard'
6
6
  require_relative 'packages/history'
7
+ require_relative 'packages/custom'
7
8
 
8
9
  module RelinePac
9
10
  # Packages contains all Reline extensions and their default keybindings.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelinePac
4
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reline_pac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mizuki-y
@@ -43,6 +43,7 @@ files:
43
43
  - lib/reline_pac/packages.rb
44
44
  - lib/reline_pac/packages/clipboard.rb
45
45
  - lib/reline_pac/packages/completion.rb
46
+ - lib/reline_pac/packages/custom.rb
46
47
  - lib/reline_pac/packages/history.rb
47
48
  - lib/reline_pac/version.rb
48
49
  - sig/reline_pac.rbs