irb-theme-rk2024 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ab2ba087bc7f3a8198a5ae3697590f5041793e69d1daa82b3fc203e780ccba74
4
+ data.tar.gz: 16766fabec238a4935ca69df647ee5ffcb9b41d58f61ba449e634f873452c07e
5
+ SHA512:
6
+ metadata.gz: c03e3d480495566f24f1d6e8ca7e6f28c43d54f974de23ce5d86d1f4e880cdf1396e38f0bc7bb87d3a09b095445936c86a6c2cea1f00e57505ba6367d5c0ff68
7
+ data.tar.gz: 268368f4e3550dcec7b109706db50aa346c0ef79f9fe998452568cfadf47be2ffe3a8f56be9a934a801504847a3ffa67f51707d10c304b0428a7e66ca26b6e27
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 tompng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # IRB Theme RK2024
2
+
3
+ IRB Theme with 2024 color
4
+
5
+ ## Installation
6
+
7
+ `gem install irb-theme-rk2024`
8
+
9
+ ## Usage
10
+
11
+ Write the code below to `~/.irbrc`
12
+
13
+ ```ruby
14
+ require 'irb/theme/rk2024'
15
+ # If you want to use this theme from a project using bundler
16
+ # require '/full/path/to/installed/irb/theme/rk2024'
17
+ ```
18
+
19
+ ## Development
20
+
21
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
22
+
23
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
24
+
25
+ ## Contributing
26
+
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/irb-theme-rk2024.
28
+
29
+ ## License
30
+
31
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,36 @@
1
+ Reline::LineEditor.prepend Module.new {
2
+ eval <<~RUBY
3
+ def colorize_completion_dialog
4
+
5
+ #{(%W(d=@d ialogs[0]; (c=d&.cont ents
6
+ )&&(y=d.scroll _top ;f=R eline::Face[:c omplet
7
+ ion_di alog]; s=T ime .now.t o_f;c[ 0..]=c.i
8
+ nsta nce_ ev al{@o||=du p} .map {|t| e=t. inde
9
+ x(f[: en hanced]);x=0;l =t .gsub (/#e #[[^
10
+ m]*m/,' ') .chars.map {" #e[48;5 ;${e ==0?
11
+ '210;1' :1 45+[(y +z =((4*s+ x+=1)/2).floor)%
12
+ 2+z%5/3 <1? 0: 43, 6,41][( y%7-3)**2/4]};38
13
+ ;5;237m"+_1}*''; y+=1 ;t[1 ..][f[:scrollbar ]]&&
14
+ l[-1,0]="#e[38;5 ;203m";l}) )*'').tr'$#',?#+ ?\\}
15
+
16
+ end
17
+ RUBY
18
+
19
+ def update_dialogs(...)
20
+ super(...)
21
+ colorize_completion_dialog
22
+ end
23
+
24
+ def rerender
25
+ (@mutex ||= Mutex.new).synchronize { super }
26
+ end
27
+ }
28
+
29
+ Thread.new do
30
+ Reline.line_editor.instance_eval do
31
+ loop do
32
+ sleep 0.1
33
+ colorize_completion_dialog && rerender
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: irb-theme-rk2024
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - tompng
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-04-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: reline
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.0
27
+ description: IRB color theme for 2024
28
+ email:
29
+ - tomoyapenguin@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - LICENSE.txt
35
+ - README.md
36
+ - Rakefile
37
+ - lib/irb/theme/rk2024.rb
38
+ homepage: https://github.com/tompng/irb-theme-rk2024
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ homepage_uri: https://github.com/tompng/irb-theme-rk2024
43
+ source_code_uri: https://github.com/tompng/irb-theme-rk2024
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.0.0
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.5.9
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: IRB color theme
63
+ test_files: []