ruco 0.2.0.beta7 → 0.2.0.beta8
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.
- data/VERSION +1 -1
- data/bin/ruco +23 -8
- data/lib/ruco/file_store.rb +1 -1
- data/ruco.gemspec +1 -1
- data/spec/ruco/file_store_spec.rb +6 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.0.
|
1
|
+
0.2.0.beta8
|
data/bin/ruco
CHANGED
@@ -22,6 +22,7 @@ BANNER
|
|
22
22
|
opts.on("-c", "--convert-tabs","Convert tabs to spaces") { options[:convert_tabs] = true }
|
23
23
|
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 }
|
24
24
|
opts.on("-n", "--no-colors","No colors -- helps performance / broken terminals") { options[:no_colors] = true }
|
25
|
+
opts.on("--colors","Force colors -- everything could be black") { options[:colors] = true }
|
25
26
|
opts.on("--debug-cache","Show caching in action") { options[:debug_cache] = true }
|
26
27
|
opts.on("--debug-keys", "Show pressed keys") { options[:debug_keys] = true }
|
27
28
|
opts.on("-v", "--version","Show Version"){
|
@@ -45,23 +46,37 @@ def log(stuff)
|
|
45
46
|
File.open('ruco.log','ab'){|f| f.puts stuff }
|
46
47
|
end
|
47
48
|
|
48
|
-
# do not use colors if
|
49
|
-
# so far the only terminal that supports it
|
50
|
-
#
|
49
|
+
# do not use colors if the terminal does not support colors
|
50
|
+
# so far the only terminal that supports it:
|
51
|
+
# - xterm-256color on osx (not ssh)
|
52
|
+
# - xterm on ubuntu (not ssh)
|
53
|
+
# (setting ENV['TERM'] will sometimes crash un-rescue-able -> test if it works)
|
51
54
|
def activate_256_colors
|
55
|
+
require 'ruco/file_store'
|
52
56
|
(
|
53
|
-
|
54
|
-
|
57
|
+
# not windows
|
58
|
+
RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ and
|
59
|
+
|
60
|
+
# possible to open xterm-256color
|
61
|
+
['xterm', 'xterm-256color'].include?(ENV['TERM']) and
|
55
62
|
Ruco::FileStore.new('~/.ruco/cache').cache('color_possible'){
|
56
63
|
system(%{TERM=xterm-256color ruby -r curses -e 'Curses.noecho' > /dev/null 2>&1})
|
57
64
|
}
|
58
|
-
|
65
|
+
|
66
|
+
# finally switch terminal, so curses knows we want colors
|
67
|
+
) and ENV['TERM'] = 'xterm-256color'
|
59
68
|
end
|
60
69
|
|
61
70
|
options = parse_options
|
62
71
|
|
63
|
-
|
64
|
-
|
72
|
+
$ruco_colors = if options[:no_colors]
|
73
|
+
false
|
74
|
+
elsif options[:colors]
|
75
|
+
true
|
76
|
+
else
|
77
|
+
activate_256_colors
|
78
|
+
end
|
79
|
+
|
65
80
|
require 'ruco'
|
66
81
|
|
67
82
|
# draw app and redraw after each keystroke (or paste)
|
data/lib/ruco/file_store.rb
CHANGED
data/ruco.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196371
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 0.2.0.
|
11
|
+
- 8
|
12
|
+
version: 0.2.0.beta8
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Michael Grosser
|