sergeant 1.0.3 → 1.0.4
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/lib/sergeant/modals/file_operations.rb +7 -1
- data/lib/sergeant/rendering.rb +10 -3
- data/lib/sergeant/version.rb +1 -1
- data/sergeant.gemspec +2 -0
- metadata +1 -5
- data/highlight.gif +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/sergeant/.DS_Store +0 -0
- data/lib/sergeant/modals/.DS_Store +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a87751fe5e98dee814b470aa90818bd0f798cbdb4143f55522ffcf610d8de0c
|
|
4
|
+
data.tar.gz: d1c47033ac959cc1bbd50af0fe96e526df4d2f72077efc914d0570b8df6e0e7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77dac789c948ee83d3bfeda13cdda4fa0c3f03779d2e6cfc3ec85126dd97465c309d55cfa2500008656be3b65367e961c7af8b639c4d237a0716572d2cfa82be
|
|
7
|
+
data.tar.gz: e0e1222dba1be26d9a3da7611aa8c5289ea422f58f9c1f5d3813d7f7581c05f860e61144e7623c1f66ccbb127ba37d27eaded1b9c5633f6e9e5cfa7422df8c0b
|
|
@@ -23,6 +23,9 @@ module Sergeant
|
|
|
23
23
|
if editor
|
|
24
24
|
# Use user's preferred editor
|
|
25
25
|
system("#{editor} \"#{file_path}\"")
|
|
26
|
+
elsif Gem.win_platform?
|
|
27
|
+
# Windows: use notepad (always available)
|
|
28
|
+
system("notepad \"#{file_path}\"")
|
|
26
29
|
elsif nvim_available?
|
|
27
30
|
# Second fallback: nvim (modern vim)
|
|
28
31
|
system("nvim \"#{file_path}\"")
|
|
@@ -83,8 +86,11 @@ module Sergeant
|
|
|
83
86
|
close_screen
|
|
84
87
|
|
|
85
88
|
begin
|
|
89
|
+
if Gem.win_platform?
|
|
90
|
+
# Windows: use notepad for preview (simpler and always works)
|
|
91
|
+
system("notepad \"#{file_path}\"")
|
|
86
92
|
# Use glow for markdown files if available, otherwise fall back to less
|
|
87
|
-
|
|
93
|
+
elsif file_ext == '.md' && glow_available?
|
|
88
94
|
system("glow -p \"#{file_path}\"")
|
|
89
95
|
elsif file_ext == '.md'
|
|
90
96
|
system("less -R -F -X \"#{file_path}\"")
|
data/lib/sergeant/rendering.rb
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
module Sergeant
|
|
6
6
|
module Rendering
|
|
7
|
+
# Use ASCII icons on Windows for better terminal compatibility
|
|
8
|
+
WINDOWS = Gem.win_platform?
|
|
9
|
+
ICON_DIR = WINDOWS ? '[D] ' : '📁 '
|
|
10
|
+
ICON_FILE = WINDOWS ? '[F] ' : '📄 '
|
|
11
|
+
ICON_MARK = WINDOWS ? '* ' : '✓ '
|
|
12
|
+
ICON_SELECT = WINDOWS ? '> ' : '▶ '
|
|
13
|
+
|
|
7
14
|
def draw_screen
|
|
8
15
|
clear
|
|
9
16
|
|
|
@@ -127,13 +134,13 @@ module Sergeant
|
|
|
127
134
|
end
|
|
128
135
|
|
|
129
136
|
def draw_item(item, max_x, is_selected)
|
|
130
|
-
icon = item[:type] == :directory ?
|
|
137
|
+
icon = item[:type] == :directory ? ICON_DIR : ICON_FILE
|
|
131
138
|
|
|
132
139
|
# Check if item is marked
|
|
133
140
|
is_marked = @marked_items.include?(item[:path])
|
|
134
|
-
mark_indicator = is_marked ?
|
|
141
|
+
mark_indicator = is_marked ? ICON_MARK : ' '
|
|
135
142
|
|
|
136
|
-
prefix = is_selected ?
|
|
143
|
+
prefix = is_selected ? ICON_SELECT : ' '
|
|
137
144
|
|
|
138
145
|
size_str = format_size(item[:size])
|
|
139
146
|
date_str = format_date(item[:mtime])
|
data/lib/sergeant/version.rb
CHANGED
data/sergeant.gemspec
CHANGED
|
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
`git ls-files -z`.split("\x0").reject do |f|
|
|
25
25
|
f.match(%r{\A(?:test|spec|features)/}) ||
|
|
26
26
|
f.match(%r{\A\.}) ||
|
|
27
|
+
f.match(%r{\.DS_Store$}) ||
|
|
28
|
+
f.match(%r{\.(gif|png|jpg|jpeg|mp4|webm)$}) || # Exclude media files
|
|
27
29
|
f == 'build.rb' ||
|
|
28
30
|
f == 'install.sh' ||
|
|
29
31
|
f == 'sgt.rb'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sergeant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mateusz Grotha
|
|
@@ -66,13 +66,9 @@ files:
|
|
|
66
66
|
- LICENSE
|
|
67
67
|
- README.md
|
|
68
68
|
- bin/sgt
|
|
69
|
-
- highlight.gif
|
|
70
|
-
- lib/.DS_Store
|
|
71
69
|
- lib/sergeant.rb
|
|
72
|
-
- lib/sergeant/.DS_Store
|
|
73
70
|
- lib/sergeant/config.rb
|
|
74
71
|
- lib/sergeant/modals.rb
|
|
75
|
-
- lib/sergeant/modals/.DS_Store
|
|
76
72
|
- lib/sergeant/modals/dialogs.rb
|
|
77
73
|
- lib/sergeant/modals/file_operations.rb
|
|
78
74
|
- lib/sergeant/modals/help.rb
|
data/highlight.gif
DELETED
|
Binary file
|
data/lib/.DS_Store
DELETED
|
Binary file
|
data/lib/sergeant/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|