ruco 0.4.0 → 0.5.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 +4 -4
- data/bin/ruco +36 -30
- data/lib/ruco/editor/colors.rb +3 -3
- data/lib/ruco/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91fa339b648dbf0d088ca4e252f70dd045d32c0b5fba7fcaf01d61451a12fa12
|
4
|
+
data.tar.gz: 07e5fa48a8b76da387cba90c09b3c62845b7673a16cfc166f8c7aeff5be22e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0adeffa4e2005fe239ad2ddf7c303727141a6a447b21a74fd7ce415c72d3b28e6d9be8ab8cefea63c595ab4b13d8543fabeab8cbcf68effbf2d0dd89894e4ff5
|
7
|
+
data.tar.gz: 045c8dbeeaddbfd4d957bb51ac3b06488202762591ef7d66ed10cbbe32e5bf4848fdac8a95b0ce608f292db131db193744c24ce710bf54e6b084b8d0543c82c5
|
data/bin/ruco
CHANGED
@@ -23,10 +23,10 @@ def parse_options
|
|
23
23
|
opts.on("-c", "--convert-tabs","Convert tabs to spaces") { options[:convert_tabs] = true }
|
24
24
|
opts.on("-u", "--undo-stack-size SIZE","Maximum size of the undo stack. 0 allows for a complete undo stack.") { |size| options[:undo_stack_size] = size.to_i }
|
25
25
|
opts.on("-n", "--no-colors","No colors -- helps performance / broken terminals") { options[:no_colors] = true }
|
26
|
-
opts.on("--colors","Force colors -- everything could be black") { options[:colors] = true }
|
27
|
-
opts.on("--debug-cache","Show caching in action") { options[:debug_cache] = true }
|
26
|
+
opts.on("--colors", "Force colors -- everything could be black") { options[:colors] = true }
|
27
|
+
opts.on("--debug-cache", "Show caching in action") { options[:debug_cache] = true }
|
28
28
|
opts.on("--debug-keys", "Show pressed keys") { options[:debug_keys] = true }
|
29
|
-
opts.on("-v", "--version","Show Version") do
|
29
|
+
opts.on("-v", "--version", "Show Version") do
|
30
30
|
require 'ruco/version'
|
31
31
|
puts Ruco::VERSION
|
32
32
|
exit
|
@@ -40,39 +40,44 @@ def parse_options
|
|
40
40
|
exit
|
41
41
|
end
|
42
42
|
|
43
|
+
if ARGV.size != 1
|
44
|
+
puts parser
|
45
|
+
exit 1
|
46
|
+
end
|
47
|
+
|
43
48
|
options
|
44
49
|
end
|
45
50
|
|
46
|
-
def log(
|
47
|
-
File.open('ruco.log','ab') { |f| f.puts
|
51
|
+
def log(message)
|
52
|
+
File.open('ruco.log','ab') { |f| f.puts message }
|
48
53
|
end
|
49
54
|
|
50
55
|
options = parse_options
|
51
56
|
|
52
|
-
options[:colors] =
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
71
|
-
ENV['TERM'] = 'xterm-256color' if possible
|
72
|
-
end
|
57
|
+
options[:colors] =
|
58
|
+
if options[:no_colors]
|
59
|
+
false
|
60
|
+
elsif options[:colors]
|
61
|
+
true
|
62
|
+
# windows does not support colors, so disable it
|
63
|
+
elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
64
|
+
false
|
65
|
+
# this mostly is osx and works fine
|
66
|
+
elsif ENV["TERM"] == 'xterm-256color'
|
67
|
+
true
|
68
|
+
# xterm on ubuntu 10.04+ also supports colors, but ot might crash if we force it
|
69
|
+
elsif ENV['TERM'] == 'xterm'
|
70
|
+
require 'ruco/file_store'
|
71
|
+
# switch terminal, so curses knows we want colors
|
72
|
+
# setting ENV['TERM'] will sometimes crash un-rescue-able -> test if it works
|
73
|
+
possible = Ruco::FileStore.new('~/.ruco/cache').cache('color_possible') do
|
74
|
+
system(%{TERM=xterm-256color ruby -r curses -e 'Curses.noecho' > /dev/null 2>&1})
|
73
75
|
end
|
76
|
+
ENV['TERM'] = 'xterm-256color' if possible
|
77
|
+
possible
|
78
|
+
else
|
79
|
+
false
|
74
80
|
end
|
75
|
-
end
|
76
81
|
$ruco_colors = options[:colors]
|
77
82
|
|
78
83
|
require 'ruco'
|
@@ -83,9 +88,10 @@ Dispel::Screen.open(options) do |screen|
|
|
83
88
|
|
84
89
|
app = Ruco::Application.new(
|
85
90
|
ARGV[0],
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
91
|
+
convert_tabs: options[:convert_tabs],
|
92
|
+
undo_stack_size: options[:undo_stack_size],
|
93
|
+
lines: screen.lines,
|
94
|
+
columns: screen.columns
|
89
95
|
)
|
90
96
|
|
91
97
|
screen.draw *app.display_info
|
data/lib/ruco/editor/colors.rb
CHANGED
@@ -84,17 +84,17 @@ module Ruco
|
|
84
84
|
memoize :theme
|
85
85
|
|
86
86
|
def download_into_file(url)
|
87
|
-
theme_store = FileStore.new('~/.ruco/cache', :
|
87
|
+
theme_store = FileStore.new('~/.ruco/cache', string: true)
|
88
88
|
theme_store.cache(url) do
|
89
89
|
require 'open-uri'
|
90
90
|
require 'openssl'
|
91
91
|
OpenURI.without_ssl_verification do
|
92
|
-
open(url).read
|
92
|
+
URI.open(url).read
|
93
93
|
end
|
94
94
|
end
|
95
95
|
File.expand_path(theme_store.file(url))
|
96
96
|
rescue => e
|
97
|
-
STDERR.puts "Could not download #{url} -- #{e}"
|
97
|
+
STDERR.puts "Could not download #{url} set via :color_theme option -- #{e}"
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
data/lib/ruco/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|