cinnabar 0.0.5 → 0.0.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 +4 -4
- data/.rubocop.yml +0 -2
- data/docs/Readme.md +1 -1
- data/lib/cinnabar/gem_path.rb +5 -1
- data/lib/cinnabar/version.rb +1 -1
- data/misc/firb/bin/firb +35 -18
- data/misc/firb/bin/firb0 +14 -3
- data/misc/firb/lib/sh_utils.rb +6 -14
- data/misc/firb/lib/version.rb +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6421e09dfa0c80203e6f23bcc2fab637dc1e8b1e8673d0f584a9bbcd323e3f4
|
|
4
|
+
data.tar.gz: 4828cb0de49dc9039b61ad2367913db43957a8debac9a5dad2224ed49a818872
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f29c1326ae25a3658027ae98dc160af3c31204e6f4d720e10094c10286591f34586fd07e231bc9604cdbeba40ddb93c8a9c35cd803e8821271f66d77a98a439
|
|
7
|
+
data.tar.gz: dfe9e80083ed0da1b47c0cde810f4dde2a0a33111d6e06a55bc59740c44cdc4fd5f4e208a6b7e647e28372b1a4015b665a2ba5e59a0cea4e3462f6b0b6a39981
|
data/.rubocop.yml
CHANGED
data/docs/Readme.md
CHANGED
data/lib/cinnabar/gem_path.rb
CHANGED
data/lib/cinnabar/version.rb
CHANGED
data/misc/firb/bin/firb
CHANGED
|
@@ -22,8 +22,31 @@
|
|
|
22
22
|
# which :ruby #=> `which ruby`
|
|
23
23
|
# cdir '~/.cache' #=> `cd ~/.cache; pwd; ls`
|
|
24
24
|
# pwd #=> Dir.pwd
|
|
25
|
+
#
|
|
26
|
+
# Install Dependencies:
|
|
27
|
+
#
|
|
28
|
+
# - Windows:
|
|
29
|
+
# winget install Microsoft.VCRedist.2015+.x64
|
|
30
|
+
# # OR: winget install Microsoft.VCRedist.2015+.arm64
|
|
31
|
+
#
|
|
32
|
+
# scoop install bat eza
|
|
33
|
+
#
|
|
34
|
+
# - macOS:
|
|
35
|
+
# brew install bat eza
|
|
36
|
+
#
|
|
37
|
+
# - Debian:
|
|
38
|
+
#
|
|
39
|
+
# apt update
|
|
40
|
+
# apt install -y bat eza
|
|
41
|
+
# ln -svf /usr/bin/batcat /usr/local/bin/bat
|
|
42
|
+
#
|
|
43
|
+
# - Arch:
|
|
44
|
+
# pacman -Sy bat eza
|
|
45
|
+
#
|
|
46
|
+
# - Alpine:
|
|
47
|
+
# apk add bat eza
|
|
48
|
+
#
|
|
25
49
|
# ====================
|
|
26
|
-
|
|
27
50
|
Kernel.warn " ruby:\t#{RUBY_VERSION}" if ARGV.empty?
|
|
28
51
|
|
|
29
52
|
$ruby_cache_dir = -> {
|
|
@@ -39,10 +62,15 @@ $ruby_cache_dir = -> {
|
|
|
39
62
|
}.call
|
|
40
63
|
|
|
41
64
|
-> {
|
|
42
|
-
|
|
65
|
+
libs = %w[gem_path utils]
|
|
66
|
+
lib_dir = File.expand_path('../../../lib/cinnabar', __dir__).then { Pathname _1 }
|
|
67
|
+
if lib_dir.exist?
|
|
68
|
+
libs.each { require lib_dir.join(_1) }
|
|
69
|
+
return
|
|
70
|
+
end
|
|
43
71
|
|
|
44
|
-
|
|
45
|
-
|
|
72
|
+
dir = $ruby_cache_dir.join('lib/cinnabar')
|
|
73
|
+
libs.each { require dir.join(_1) }
|
|
46
74
|
}.call
|
|
47
75
|
|
|
48
76
|
def new_cinnabar_gem_path_class(gems)
|
|
@@ -107,20 +135,9 @@ include Sinlog::Mixin
|
|
|
107
135
|
include Argvise::HashMixin
|
|
108
136
|
|
|
109
137
|
# load `which` & `sh-utils`
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
new_cinnabar_gem_path_class([gem])
|
|
114
|
-
.cache_hash[gem]
|
|
115
|
-
.last
|
|
116
|
-
.then { File.expand_path('../misc/firb/lib', _1).to_path }
|
|
117
|
-
.tap do |dir|
|
|
118
|
-
%w[which sh_utils]
|
|
119
|
-
.each { require dir.join(_1) }
|
|
120
|
-
end
|
|
121
|
-
}.call
|
|
122
|
-
# require_relative '../lib/which'
|
|
123
|
-
# require_relative '../lib/sh_utils'
|
|
138
|
+
require_relative '../lib/which'
|
|
139
|
+
require_relative '../lib/version'
|
|
140
|
+
require_relative '../lib/sh_utils'
|
|
124
141
|
|
|
125
142
|
# ====================
|
|
126
143
|
run_ruby_cli unless ARGV.empty?
|
data/misc/firb/bin/firb0
CHANGED
|
@@ -33,10 +33,15 @@ $ruby_cache_dir = -> {
|
|
|
33
33
|
}.call
|
|
34
34
|
|
|
35
35
|
-> {
|
|
36
|
-
|
|
36
|
+
libs = %w[gem_path utils]
|
|
37
|
+
lib_dir = File.expand_path('../../../lib/cinnabar', __dir__).then { Pathname _1 }
|
|
38
|
+
if lib_dir.exist?
|
|
39
|
+
libs.each { require lib_dir.join(_1) }
|
|
40
|
+
return
|
|
41
|
+
end
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
dir = $ruby_cache_dir.join('lib/cinnabar')
|
|
44
|
+
libs.each { require dir.join(_1) }
|
|
40
45
|
}.call
|
|
41
46
|
|
|
42
47
|
def new_cinnabar_gem_path_class(gems)
|
|
@@ -71,6 +76,12 @@ def start_irb
|
|
|
71
76
|
IRB.start
|
|
72
77
|
end
|
|
73
78
|
|
|
79
|
+
begin
|
|
80
|
+
require_relative '../lib/version'
|
|
81
|
+
rescue StandardError
|
|
82
|
+
nil
|
|
83
|
+
end
|
|
84
|
+
|
|
74
85
|
unless ARGV.empty?
|
|
75
86
|
require 'rbconfig'
|
|
76
87
|
ENV['RUBYOPT'] = '--disable=gems'
|
data/misc/firb/lib/sh_utils.rb
CHANGED
|
@@ -4,17 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
require_relative 'which'
|
|
6
6
|
|
|
7
|
-
BAT_CAT_CMD =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
['cat']
|
|
11
|
-
}.call
|
|
12
|
-
|
|
13
|
-
EXA_LS_CMD = -> {
|
|
14
|
-
%w[eza exa]
|
|
15
|
-
.each { return [_1, '--icons=auto'] if which(_1) }
|
|
16
|
-
['ls', '--color=auto']
|
|
17
|
-
}.call
|
|
7
|
+
BAT_CAT_CMD = ['bat', '-Pp'].freeze
|
|
8
|
+
EXA_LS_CMD = ['eza', '--icons=auto'].freeze
|
|
9
|
+
# EXA_LS_CMD = ['ls', '--color=auto'].freeze
|
|
18
10
|
|
|
19
11
|
# Similar to `cd "/path/to/dir"; pwd; ls`
|
|
20
12
|
def cdir(path = Dir.home)
|
|
@@ -31,10 +23,10 @@ def path_sym_to_str(path)
|
|
|
31
23
|
end
|
|
32
24
|
|
|
33
25
|
def run_eza_ls(path = '.', *rest)
|
|
34
|
-
cmd = EXA_LS_CMD
|
|
26
|
+
cmd = EXA_LS_CMD.dup
|
|
35
27
|
cmd.concat(rest) unless rest.empty?
|
|
36
28
|
path = path_sym_to_str(path)
|
|
37
|
-
cmd
|
|
29
|
+
cmd.push(File.expand_path(path))
|
|
38
30
|
puts "\e[9m #{cmd} \e[0m"
|
|
39
31
|
system(*cmd)
|
|
40
32
|
end
|
|
@@ -53,7 +45,7 @@ def la(path = '.', *rest)
|
|
|
53
45
|
end
|
|
54
46
|
|
|
55
47
|
def cat(path, *rest)
|
|
56
|
-
cmd = BAT_CAT_CMD
|
|
48
|
+
cmd = BAT_CAT_CMD.dup
|
|
57
49
|
path = path_sym_to_str(path)
|
|
58
50
|
cmd << File.expand_path(path)
|
|
59
51
|
cmd.concat(rest) unless rest.empty?
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cinnabar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 2moe
|
|
@@ -49,6 +49,7 @@ files:
|
|
|
49
49
|
- misc/firb/bin/firb0.bat
|
|
50
50
|
- misc/firb/install-cinnabar.ps1
|
|
51
51
|
- misc/firb/lib/sh_utils.rb
|
|
52
|
+
- misc/firb/lib/version.rb
|
|
52
53
|
- misc/firb/lib/which.rb
|
|
53
54
|
homepage: https://github.com/2moe/cinnabar
|
|
54
55
|
licenses:
|