ruco 0.0.21 → 0.0.22

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
@@ -15,6 +15,7 @@ Finished:
15
15
  - configuration via `~/.ruco.rb`
16
16
  - keeps indentation
17
17
  - paste from clipboard (default: Ctrl+v)
18
+ - paste-detection (e.g. cmd+v) -> clean indentation
18
19
 
19
20
  Install
20
21
  =======
@@ -61,7 +62,6 @@ TIPS
61
62
  TODO
62
63
  =====
63
64
  - session storage (stay at same line/column when reopening)
64
- - paste detection ? (ctrl+shift+insert / Cmd+v) -> no indentation
65
65
  - selecting -> delete / overwrite / copy / cut
66
66
  - smart staying at end of line/column when changing line
67
67
  - warnings / messages
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.21
1
+ 0.0.22
data/lib/ruco/keyboard.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'curses'
2
2
 
3
3
  class Keyboard
4
+ MAX_CHAR = 255
4
5
  ENTER = 13
5
6
  IS_18 = RUBY_VERSION =~ /^1\.8/
6
7
  SEQUENCE_TIMEOUT = 0.01
@@ -65,12 +66,13 @@ class Keyboard
65
66
  when 27 then :escape
66
67
  when Curses::KEY_RESIZE then :resize
67
68
  else
68
- key.chr
69
+ key > MAX_CHAR ? key : key.chr
69
70
  end
70
71
  end
71
72
 
72
73
  def self.fetch_user_input
73
74
  key = @input.call || NOTHING
75
+ key = NOTHING if key > NOTHING # strange key codes when starting via ssh
74
76
  key = key.ord if key.is_a?(String) # ruby 1.9 fix
75
77
  key
76
78
  end
data/ruco.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruco}
8
- s.version = "0.0.21"
8
+ s.version = "0.0.22"
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-21}
12
+ s.date = %q{2011-01-22}
13
13
  s.default_executable = %q{ruco}
14
14
  s.email = %q{michael@grosser.it}
15
15
  s.executables = ["ruco"]
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
48
48
  ]
49
49
  s.homepage = %q{http://github.com/grosser/ruco}
50
50
  s.require_paths = ["lib"]
51
- s.rubygems_version = %q{1.3.7}
51
+ s.rubygems_version = %q{1.4.2}
52
52
  s.summary = %q{Commandline editor written in ruby}
53
53
  s.test_files = [
54
54
  "spec/ruco/application_spec.rb",
@@ -64,7 +64,6 @@ Gem::Specification.new do |s|
64
64
  ]
65
65
 
66
66
  if s.respond_to? :specification_version then
67
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
68
67
  s.specification_version = 3
69
68
 
70
69
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -75,4 +75,14 @@ describe Keyboard do
75
75
  type [260, 127, 127, 261, 260, 195, 164, 261, 260, 195, 164]
76
76
  output.should == [:left, :backspace, :backspace, :right, :left, "ä", :right, :left, "ä"]
77
77
  end
78
+
79
+ it "ignores wtf number that is entered when using via ssh" do
80
+ type [2**64-1, 2**32-1]
81
+ output.should == []
82
+ end
83
+
84
+ it "returns key-code for unprintable keys" do
85
+ type [11121, 324234]
86
+ output.should == [11121, 324234]
87
+ end
78
88
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruco
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 51
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 21
9
- version: 0.0.21
9
+ - 22
10
+ version: 0.0.22
10
11
  platform: ruby
11
12
  authors:
12
13
  - Michael Grosser
@@ -14,24 +15,25 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-01-21 00:00:00 +01:00
18
+ date: 2011-01-22 00:00:00 +01:00
18
19
  default_executable: ruco
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: clipboard
22
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
+ hash: 51
27
28
  segments:
28
29
  - 0
29
30
  - 9
30
31
  - 4
31
32
  version: 0.9.4
32
- type: :runtime
33
33
  prerelease: false
34
34
  version_requirements: *id001
35
+ type: :runtime
36
+ name: clipboard
35
37
  description:
36
38
  email: michael@grosser.it
37
39
  executables:
@@ -86,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
88
  requirements:
87
89
  - - ">="
88
90
  - !ruby/object:Gem::Version
89
- hash: -755587743
91
+ hash: 3
90
92
  segments:
91
93
  - 0
92
94
  version: "0"
@@ -95,13 +97,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  requirements:
96
98
  - - ">="
97
99
  - !ruby/object:Gem::Version
100
+ hash: 3
98
101
  segments:
99
102
  - 0
100
103
  version: "0"
101
104
  requirements: []
102
105
 
103
106
  rubyforge_project:
104
- rubygems_version: 1.3.7
107
+ rubygems_version: 1.4.2
105
108
  signing_key:
106
109
  specification_version: 3
107
110
  summary: Commandline editor written in ruby