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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41b7c3b966daedbb73dc65a9ceb67bb5653791757713bc33dd838f3327d9c33b
4
- data.tar.gz: 636ed748a5e8efbe0291ccacb65031c814524e85e731ce076c9918c8adcfddc0
3
+ metadata.gz: 9a87751fe5e98dee814b470aa90818bd0f798cbdb4143f55522ffcf610d8de0c
4
+ data.tar.gz: d1c47033ac959cc1bbd50af0fe96e526df4d2f72077efc914d0570b8df6e0e7b
5
5
  SHA512:
6
- metadata.gz: d7e9b24e7f865efadec5dfe8729945bbf4c24bfa49df8c175e85d5de45c63457aba733fe09156950293e1ef3af4addd3831dd4e5a32f353e507b09667749eb23
7
- data.tar.gz: 2b24694b491e148932545f6a727ca966a4803c489ca9d623098cd5e36ecc53cbcaf5761cf5fb1c6e259390555f6341551a1d55a1d765069a582275fc8d4c811a
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
- if file_ext == '.md' && glow_available?
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}\"")
@@ -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])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sergeant
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
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.3
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
Binary file
Binary file