ruco 0.0.14 → 0.0.15
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/Gemfile +2 -0
- data/Gemfile.lock +4 -0
- data/Readme.md +3 -1
- data/VERSION +1 -1
- data/lib/ruco.rb +2 -0
- data/lib/ruco/application.rb +5 -0
- data/lib/ruco/text_area.rb +3 -0
- data/ruco.gemspec +4 -1
- data/spec/ruco/application_spec.rb +24 -0
- metadata +18 -5
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
clipboard (0.9.3)
|
5
|
+
zucker (>= 8)
|
4
6
|
diff-lcs (1.1.2)
|
5
7
|
git (1.2.5)
|
6
8
|
jeweler (1.5.2)
|
@@ -18,11 +20,13 @@ GEM
|
|
18
20
|
rspec-mocks (2.0.1)
|
19
21
|
rspec-core (~> 2.0.1)
|
20
22
|
rspec-expectations (~> 2.0.1)
|
23
|
+
zucker (8)
|
21
24
|
|
22
25
|
PLATFORMS
|
23
26
|
ruby
|
24
27
|
|
25
28
|
DEPENDENCIES
|
29
|
+
clipboard
|
26
30
|
jeweler
|
27
31
|
rake
|
28
32
|
rspec (~> 2)
|
data/Readme.md
CHANGED
@@ -13,6 +13,8 @@ Finished:
|
|
13
13
|
- find / go to line
|
14
14
|
- delete line
|
15
15
|
- configuration via `~/.ruco.rb`
|
16
|
+
- keeps indentation
|
17
|
+
- paste from clipboard (default: Ctrl+v)
|
16
18
|
|
17
19
|
Install
|
18
20
|
=======
|
@@ -58,9 +60,9 @@ TIPS
|
|
58
60
|
|
59
61
|
TODO
|
60
62
|
=====
|
63
|
+
- selecting -> delete / overwrite / copy / cut
|
61
64
|
- support typing unicode like äöß etc (rework size / make strings utf8-aware)
|
62
65
|
- smart staying at end of line/column when changing line
|
63
|
-
- indentation + paste support
|
64
66
|
- warnings / messages
|
65
67
|
- syntax highlighting
|
66
68
|
- support more key-combos/codes in keyboard.rb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.15
|
data/lib/ruco.rb
CHANGED
data/lib/ruco/application.rb
CHANGED
@@ -84,6 +84,10 @@ module Ruco
|
|
84
84
|
def setup_actions
|
85
85
|
@actions = {}
|
86
86
|
|
87
|
+
action :paste do
|
88
|
+
editor.insert(Clipboard.paste('clipboard'))
|
89
|
+
end
|
90
|
+
|
87
91
|
action :save do
|
88
92
|
editor.save
|
89
93
|
end
|
@@ -119,6 +123,7 @@ module Ruco
|
|
119
123
|
bind :"Ctrl+g", :go_to_line
|
120
124
|
bind :"Ctrl+f", :find
|
121
125
|
bind :"Ctrl+d", :delete_line
|
126
|
+
bind :"Ctrl+v", :paste
|
122
127
|
end
|
123
128
|
|
124
129
|
def load_user_config
|
data/lib/ruco/text_area.rb
CHANGED
data/ruco.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ruco}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.15"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
@@ -65,9 +65,12 @@ Gem::Specification.new do |s|
|
|
65
65
|
s.specification_version = 3
|
66
66
|
|
67
67
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
68
|
+
s.add_runtime_dependency(%q<clipboard>, [">= 0"])
|
68
69
|
else
|
70
|
+
s.add_dependency(%q<clipboard>, [">= 0"])
|
69
71
|
end
|
70
72
|
else
|
73
|
+
s.add_dependency(%q<clipboard>, [">= 0"])
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
@@ -9,6 +9,10 @@ describe Ruco::Application do
|
|
9
9
|
File.open(@file,'w'){|f| f.write(content) }
|
10
10
|
end
|
11
11
|
|
12
|
+
def editor_part(view)
|
13
|
+
view.naive_split("\n")[1..-2].join("\n")
|
14
|
+
end
|
15
|
+
|
12
16
|
let(:app){ Ruco::Application.new(@file, :lines => 5, :columns => 10) }
|
13
17
|
let(:status){ "Ruco #{Ruco::VERSION} -- spec/temp.txt \n" }
|
14
18
|
let(:command){ "^W Exit" }
|
@@ -101,6 +105,26 @@ describe Ruco::Application do
|
|
101
105
|
end
|
102
106
|
end
|
103
107
|
|
108
|
+
describe 'indentation' do
|
109
|
+
it "does not extra-indent when pasting" do
|
110
|
+
write('')
|
111
|
+
Ruco.class_eval "Clipboard.copy('ab\n cd\n ef')"
|
112
|
+
app.key(:tab)
|
113
|
+
app.key(:tab)
|
114
|
+
app.key(:'Ctrl+v') # paste
|
115
|
+
editor_part(app.view).should == " ab\n cd\n ef"
|
116
|
+
end
|
117
|
+
|
118
|
+
it "indents when typing" do
|
119
|
+
write('')
|
120
|
+
app.key(:tab)
|
121
|
+
app.key(:tab)
|
122
|
+
app.key(:enter)
|
123
|
+
app.key('a')
|
124
|
+
editor_part(app.view).should == " \n a\n"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
104
128
|
describe '.ruco.rb' do
|
105
129
|
it "loads it and can use the bound keys" do
|
106
130
|
Tempfile.string_as_file("Ruco.configure{ bind(:'Ctrl+e'){ @editor.insert('TEST') } }") do |file|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 15
|
10
|
+
version: 0.0.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -17,8 +17,21 @@ cert_chain: []
|
|
17
17
|
|
18
18
|
date: 2011-01-16 00:00:00 +01:00
|
19
19
|
default_executable: ruco
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
type: :runtime
|
34
|
+
name: clipboard
|
22
35
|
description:
|
23
36
|
email: michael@grosser.it
|
24
37
|
executables:
|