jareditor 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/jareditor.gemspec +2 -2
- data/lib/jared.rb +15 -3
- data/lib/jared/buffer.rb +8 -2
- data/lib/jared/pane.rb +1 -0
- data/lib/jared/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7c8e3df3bf5baf5322111c11ee4c374bd466cd0
|
4
|
+
data.tar.gz: 658397e3d424c784a722faebe74a5821ac51dbbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0122f6e42df9b6696b1de598c6b182047d05948b06dffa8833aac7eaf4f18df68d56325a64c468f597e9fab69650c16af797a1cc39477d1dabd97c283c3fd2ba
|
7
|
+
data.tar.gz: c592be92a95219df7f0506c143f40f022382170cf348fe2da81fd002d61d0bd80289fa8b204032b7e705ca5650fcdd8d08b76fccc639233b3e05850be2d2e217
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# JarEd
|
2
2
|
|
3
|
-
The
|
3
|
+
The jerk's text editor.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -24,7 +24,7 @@ git commits and tags, and push the `.gem` file to
|
|
24
24
|
|
25
25
|
## Roadmap
|
26
26
|
|
27
|
-
- [
|
27
|
+
- [x] Opening files
|
28
28
|
- [ ] Inserting text
|
29
29
|
- [ ] Deleting text
|
30
30
|
- [ ] Saving files
|
data/jareditor.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Jared Norman"]
|
10
10
|
spec.email = ["jared@creepywizard.com"]
|
11
11
|
|
12
|
-
spec.summary = "The
|
13
|
-
spec.description = "The
|
12
|
+
spec.summary = "The jerk's text editor."
|
13
|
+
spec.description = "The jerk's text editor."
|
14
14
|
spec.homepage = "https://github.com/jarednorman/jared"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
data/lib/jared.rb
CHANGED
@@ -6,11 +6,23 @@ require "jared/buffer"
|
|
6
6
|
module JarEd
|
7
7
|
class << self
|
8
8
|
def start(args)
|
9
|
-
|
9
|
+
buffer = Buffer.new File.open(args[0], "r")
|
10
|
+
pane.buffer = buffer
|
10
11
|
|
11
12
|
take_input do |char|
|
13
|
+
case char
|
14
|
+
when "h"
|
15
|
+
buffer.cursor(0, -1)
|
16
|
+
when "j"
|
17
|
+
buffer.cursor(1, 0)
|
18
|
+
when "k"
|
19
|
+
buffer.cursor(-1, 0)
|
20
|
+
when "l"
|
21
|
+
buffer.cursor(0, 1)
|
22
|
+
when "\e"
|
23
|
+
break
|
24
|
+
end
|
12
25
|
pane.refresh(window)
|
13
|
-
break if char == "\e"
|
14
26
|
end
|
15
27
|
end
|
16
28
|
|
@@ -33,8 +45,8 @@ module JarEd
|
|
33
45
|
begin
|
34
46
|
Curses.crmode
|
35
47
|
Curses.noecho
|
36
|
-
|
37
48
|
Curses.refresh
|
49
|
+
|
38
50
|
yield nil
|
39
51
|
Curses.doupdate
|
40
52
|
|
data/lib/jared/buffer.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module JarEd
|
2
2
|
class Buffer
|
3
3
|
attr_reader :window_position,
|
4
|
-
:
|
4
|
+
:cursor_row,
|
5
5
|
:cursor_column
|
6
6
|
|
7
7
|
def initialize(file)
|
8
8
|
@file = file
|
9
9
|
@window_position = 0
|
10
|
-
@
|
10
|
+
@cursor_row = 0
|
11
11
|
@cursor_column = 0
|
12
12
|
end
|
13
13
|
|
@@ -15,6 +15,12 @@ module JarEd
|
|
15
15
|
@lines ||= file.each_line.to_a
|
16
16
|
end
|
17
17
|
|
18
|
+
# @todo Restrict cursor position to file/line length.
|
19
|
+
def cursor(rows, columns)
|
20
|
+
@cursor_row = [0, cursor_row + rows].max
|
21
|
+
@cursor_column = [0, cursor_column + columns].max
|
22
|
+
end
|
23
|
+
|
18
24
|
private
|
19
25
|
|
20
26
|
attr_reader :file
|
data/lib/jared/pane.rb
CHANGED
data/lib/jared/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jareditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Norman
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.8.7
|
111
|
-
description: The
|
111
|
+
description: The jerk's text editor.
|
112
112
|
email:
|
113
113
|
- jared@creepywizard.com
|
114
114
|
executables:
|
@@ -152,6 +152,6 @@ rubyforge_project:
|
|
152
152
|
rubygems_version: 2.5.1
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
|
-
summary: The
|
155
|
+
summary: The jerk's text editor.
|
156
156
|
test_files: []
|
157
157
|
has_rdoc:
|