ruco 0.0.13 → 0.0.14

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/Readme.md CHANGED
@@ -52,6 +52,10 @@ Customize
52
52
  bind(:home, :first)
53
53
  end
54
54
 
55
+ TIPS
56
+ ====
57
+ - Unicode support -> install libncursesw5-dev before installing ruby 1.9 (does not work for 1.8)
58
+
55
59
  TODO
56
60
  =====
57
61
  - support typing unicode like äöß etc (rework size / make strings utf8-aware)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13
1
+ 0.0.14
@@ -1,7 +1,7 @@
1
1
  module Ruco
2
2
  class Editor
3
3
  attr_reader :file
4
- delegate :view, :move, :cursor, :to => :text_area
4
+ delegate :view, :move, :cursor, :delete_line, :to => :text_area
5
5
 
6
6
  def initialize(file, options)
7
7
  @file = file
@@ -28,18 +28,6 @@ module Ruco
28
28
  @modified = true
29
29
  end
30
30
 
31
- def delete_line
32
- old_cursor = cursor
33
- move :to, cursor.line, 0
34
- delete text_area.line_length
35
- if cursor == [0,0]
36
- delete(1)
37
- else
38
- delete(-1)
39
- end
40
- move :to, *old_cursor
41
- end
42
-
43
31
  def modified?
44
32
  @modified
45
33
  end
@@ -61,6 +61,19 @@ module Ruco
61
61
  end
62
62
  end
63
63
 
64
+ # TODO this should go into editor
65
+ def delete_line
66
+ old_position = position
67
+ move :to_column, 0
68
+ delete line_length
69
+ if position == [0,0]
70
+ delete(1)
71
+ else
72
+ delete(-1)
73
+ end
74
+ move :to, *old_position
75
+ end
76
+
64
77
  def cursor
65
78
  Cursor.new @cursor_line, @cursor_column
66
79
  end
@@ -76,11 +89,15 @@ module Ruco
76
89
  [jump.size - 1, jump.last.size]
77
90
  end
78
91
 
92
+ protected
93
+
79
94
  def line_length
80
95
  lines[@line].size
81
96
  end
82
97
 
83
- protected
98
+ def position
99
+ [@line, @column]
100
+ end
84
101
 
85
102
  def move_to_eol
86
103
  after_last_word = current_line.index(/\s*$/)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruco}
8
- s.version = "0.0.13"
8
+ s.version = "0.0.14"
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"]
12
- s.date = %q{2011-01-15}
12
+ s.date = %q{2011-01-16}
13
13
  s.default_executable = %q{ruco}
14
14
  s.email = %q{michael@grosser.it}
15
15
  s.executables = ["ruco"]
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  ]
48
48
  s.homepage = %q{http://github.com/grosser/ruco}
49
49
  s.require_paths = ["lib"]
50
- s.rubygems_version = %q{1.3.7}
50
+ s.rubygems_version = %q{1.4.2}
51
51
  s.summary = %q{Commandline editor written in ruby}
52
52
  s.test_files = [
53
53
  "spec/ruco/application_spec.rb",
@@ -62,7 +62,6 @@ Gem::Specification.new do |s|
62
62
  ]
63
63
 
64
64
  if s.respond_to? :specification_version then
65
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
66
65
  s.specification_version = 3
67
66
 
68
67
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -419,5 +419,14 @@ describe Ruco::Editor do
419
419
  editor.delete_line
420
420
  editor.cursor.should == [1, 1]
421
421
  end
422
+
423
+ it "can remove lines outside of initial screen" do
424
+ write("0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n")
425
+ editor.move(:to, 5, 0)
426
+ editor.move(:to, 6, 1)
427
+ editor.delete_line
428
+ editor.view.should == "5\n7\n8\n"
429
+ editor.cursor.should == [1, 1]
430
+ end
422
431
  end
423
432
  end
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: 5
5
- prerelease: false
4
+ hash: 3
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-15 00:00:00 +01:00
18
+ date: 2011-01-16 00:00:00 +01:00
19
19
  default_executable: ruco
20
20
  dependencies: []
21
21
 
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements: []
89
89
 
90
90
  rubyforge_project:
91
- rubygems_version: 1.3.7
91
+ rubygems_version: 1.4.2
92
92
  signing_key:
93
93
  specification_version: 3
94
94
  summary: Commandline editor written in ruby