cinnabar 0.0.5 → 0.0.6
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 +11 -17
- data/misc/firb/bin/firb0 +14 -3
- data/misc/firb/lib/sh_utils.rb +5 -5
- 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: d1b9aa28bb5ec0a8ab6c27fad3c32118087ddb9bf6caef21a4b511f0c2c0c4c8
|
|
4
|
+
data.tar.gz: 952f7f0c1d2b915f3fde32ead4cc36c4c96c482e616325a7df596ed8f1187fb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b20bb4b422443e83afd40753ef2862ec59f8533b2b1e0fee3c33e755e42d1fc26b158b297f73c7ae402a09709be49e82b6f77053b3c761fea31da929d8244e4
|
|
7
|
+
data.tar.gz: c814343302e8e2f94e3ae04b9558b8306e0512b541e136391ce67863b40edc0468da990a9b69e58440a669424acca1bd352cdebb150dabd4d10dbf93a249da41
|
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
|
@@ -39,10 +39,15 @@ $ruby_cache_dir = -> {
|
|
|
39
39
|
}.call
|
|
40
40
|
|
|
41
41
|
-> {
|
|
42
|
-
|
|
42
|
+
libs = %w[gem_path utils]
|
|
43
|
+
lib_dir = File.expand_path('../../../lib/cinnabar', __dir__).then { Pathname _1 }
|
|
44
|
+
if lib_dir.exist?
|
|
45
|
+
libs.each { require lib_dir.join(_1) }
|
|
46
|
+
return
|
|
47
|
+
end
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
dir = $ruby_cache_dir.join('lib/cinnabar')
|
|
50
|
+
libs.each { require dir.join(_1) }
|
|
46
51
|
}.call
|
|
47
52
|
|
|
48
53
|
def new_cinnabar_gem_path_class(gems)
|
|
@@ -107,20 +112,9 @@ include Sinlog::Mixin
|
|
|
107
112
|
include Argvise::HashMixin
|
|
108
113
|
|
|
109
114
|
# 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'
|
|
115
|
+
require_relative '../lib/which'
|
|
116
|
+
require_relative '../lib/version'
|
|
117
|
+
require_relative '../lib/sh_utils'
|
|
124
118
|
|
|
125
119
|
# ====================
|
|
126
120
|
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
|
@@ -8,13 +8,13 @@ BAT_CAT_CMD = -> {
|
|
|
8
8
|
%w[bat batcat]
|
|
9
9
|
.each { return [_1, '-Pp'] if which(_1) }
|
|
10
10
|
['cat']
|
|
11
|
-
}.call
|
|
11
|
+
}.call.freeze
|
|
12
12
|
|
|
13
13
|
EXA_LS_CMD = -> {
|
|
14
14
|
%w[eza exa]
|
|
15
15
|
.each { return [_1, '--icons=auto'] if which(_1) }
|
|
16
16
|
['ls', '--color=auto']
|
|
17
|
-
}.call
|
|
17
|
+
}.call.freeze
|
|
18
18
|
|
|
19
19
|
# Similar to `cd "/path/to/dir"; pwd; ls`
|
|
20
20
|
def cdir(path = Dir.home)
|
|
@@ -31,10 +31,10 @@ def path_sym_to_str(path)
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def run_eza_ls(path = '.', *rest)
|
|
34
|
-
cmd = EXA_LS_CMD
|
|
34
|
+
cmd = EXA_LS_CMD.dup
|
|
35
35
|
cmd.concat(rest) unless rest.empty?
|
|
36
36
|
path = path_sym_to_str(path)
|
|
37
|
-
cmd
|
|
37
|
+
cmd.push(File.expand_path(path))
|
|
38
38
|
puts "\e[9m #{cmd} \e[0m"
|
|
39
39
|
system(*cmd)
|
|
40
40
|
end
|
|
@@ -53,7 +53,7 @@ def la(path = '.', *rest)
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def cat(path, *rest)
|
|
56
|
-
cmd = BAT_CAT_CMD
|
|
56
|
+
cmd = BAT_CAT_CMD.dup
|
|
57
57
|
path = path_sym_to_str(path)
|
|
58
58
|
cmd << File.expand_path(path)
|
|
59
59
|
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.6
|
|
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:
|