ruco 0.3.0 → 0.4.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 +5 -5
- data/lib/ruco/editor.rb +7 -3
- data/lib/ruco/version.rb +1 -1
- data/lib/ruco.rb +0 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 906292a945bfa6f268ee461f69e3f9dc698864cc777ca9a6fabc48db2009c427
|
4
|
+
data.tar.gz: e2bf50d323b6f807c60fa70006e6b2d153e604929aa6bfff2d13ac2f67794db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d825c984c209ba1b547136c0a2b1b4618c82d85c05e0b407d78f0967751dcde25f2b22cc27647aa9264d1f8e6818d1f58d865e4b29114c6d09299ea3cc73098
|
7
|
+
data.tar.gz: b6ae20158834cccfeef78a9ed48f27d3a950adadd2cd6c0975e4cd80df13b778c2697f3e3f86eb73f9770e3d5243cd8a4f64bd78dde9298c6c2af12c6e7d8f03
|
data/lib/ruco/editor.rb
CHANGED
@@ -14,14 +14,15 @@ module Ruco
|
|
14
14
|
def initialize(file, options)
|
15
15
|
@file = file
|
16
16
|
@options = options
|
17
|
+
handle = (File.exist?(file) ? File.open(file, 'rb') : nil)
|
17
18
|
|
18
19
|
# check for size (10000 lines * 100 chars should be enough for everybody !?)
|
19
|
-
if
|
20
|
+
if handle&.size.to_i > 1024 * 1024
|
20
21
|
raise "#{@file} is larger than 1MB, did you really want to open that with Ruco?"
|
21
22
|
end
|
22
23
|
|
23
|
-
content =
|
24
|
-
@options[:language] ||= LanguageSniffer.detect(@file, :
|
24
|
+
content = handle&.read || ''
|
25
|
+
@options[:language] ||= LanguageSniffer.detect(@file, content: content).language
|
25
26
|
content.tabs_to_spaces! if @options[:convert_tabs]
|
26
27
|
|
27
28
|
# cleanup newline formats
|
@@ -33,6 +34,9 @@ module Ruco
|
|
33
34
|
@text_area = EditorArea.new(content, @options)
|
34
35
|
@history = @text_area.history
|
35
36
|
restore_session
|
37
|
+
|
38
|
+
# git and kubectl wait for the file to be closed, so give them that event
|
39
|
+
at_exit { handle&.close }
|
36
40
|
end
|
37
41
|
|
38
42
|
def find(text)
|
data/lib/ruco/version.rb
CHANGED
data/lib/ruco.rb
CHANGED
@@ -26,9 +26,6 @@ require 'ruco/application'
|
|
26
26
|
|
27
27
|
if $ruco_colors
|
28
28
|
begin
|
29
|
-
# this can fail on ruby 1.8 <-> oniguruma is complicated to install
|
30
|
-
require 'oniguruma' if RUBY_VERSION < '1.9.0'
|
31
|
-
|
32
29
|
# there are some other gems out there like spox-textpow etc, so be picky
|
33
30
|
gem 'plist'
|
34
31
|
require 'plist'
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.0.7
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email: michael@grosser.it
|
71
71
|
executables:
|
72
72
|
- ruco
|
@@ -119,17 +119,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 2.
|
122
|
+
version: 2.7.0
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
125
|
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
|
130
|
-
|
131
|
-
signing_key:
|
129
|
+
rubygems_version: 3.4.10
|
130
|
+
signing_key:
|
132
131
|
specification_version: 4
|
133
132
|
summary: Desktop-style, Intuitive, Commandline Editor in Ruby. 'Better than nano,
|
134
133
|
simpler than vim.'
|
135
134
|
test_files: []
|
135
|
+
...
|