textbringer 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +13 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +41 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +9 -0
- data/bin/console +9 -0
- data/exe/tb +40 -0
- data/lib/textbringer/buffer.rb +1367 -0
- data/lib/textbringer/commands.rb +690 -0
- data/lib/textbringer/config.rb +9 -0
- data/lib/textbringer/controller.rb +129 -0
- data/lib/textbringer/errors.rb +12 -0
- data/lib/textbringer/keymap.rb +141 -0
- data/lib/textbringer/mode.rb +64 -0
- data/lib/textbringer/modes/backtrace_mode.rb +38 -0
- data/lib/textbringer/modes/fundamental_mode.rb +6 -0
- data/lib/textbringer/modes/programming_mode.rb +43 -0
- data/lib/textbringer/modes/ruby_mode.rb +192 -0
- data/lib/textbringer/modes.rb +7 -0
- data/lib/textbringer/utils.rb +277 -0
- data/lib/textbringer/version.rb +3 -0
- data/lib/textbringer/window.rb +646 -0
- data/lib/textbringer.rb +10 -0
- data/textbringer.gemspec +30 -0
- metadata +170 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: acc31bc853df5cf7a60816b8b22397e96eea7aa3
|
4
|
+
data.tar.gz: '058c53153c9645dfe51c7aaf9112e0a9ef27e5b5'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6d66c3c3fefd66a2ac7b669c24216a77a627b9265ca93d3ac9d3ed4321b6dbc3433ab70bd6b1a675e740dad40ad684f84579bd8f81d57a238fc16412fb913fad
|
7
|
+
data.tar.gz: 8d9b9c1cb9717ad7da44786b46be1033e85017eb5f42a06cff89b83d81813ca4c4a147e2c7d03b366ddf885022dd81453b8905ec84d49e4e9005d8cb110cda0f
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
textbringer (0.1.0)
|
5
|
+
ncursesw (~> 1.4)
|
6
|
+
unicode-display_width (~> 1.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
bundler-audit (0.5.0)
|
12
|
+
bundler (~> 1.2)
|
13
|
+
thor (~> 0.18)
|
14
|
+
docile (1.1.5)
|
15
|
+
json (2.0.3)
|
16
|
+
ncursesw (1.4.10)
|
17
|
+
power_assert (0.4.1)
|
18
|
+
rake (10.5.0)
|
19
|
+
simplecov (0.12.0)
|
20
|
+
docile (~> 1.1.0)
|
21
|
+
json (>= 1.8, < 3)
|
22
|
+
simplecov-html (~> 0.10.0)
|
23
|
+
simplecov-html (0.10.0)
|
24
|
+
test-unit (3.2.3)
|
25
|
+
power_assert
|
26
|
+
thor (0.19.4)
|
27
|
+
unicode-display_width (1.1.3)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
bundler (~> 1.11)
|
34
|
+
bundler-audit
|
35
|
+
rake (~> 10.0)
|
36
|
+
simplecov
|
37
|
+
test-unit
|
38
|
+
textbringer!
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
1.13.7
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Shugo Maeda
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Textbringer
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/shugo/textbringer.svg?branch=master)](https://travis-ci.org/shugo/textbringer)
|
4
|
+
|
5
|
+
Textbringer is a member of a demon race that takes on the form of a text
|
6
|
+
editor.
|
7
|
+
|
8
|
+
## Demo
|
9
|
+
|
10
|
+
[![asciicast](https://asciinema.org/a/100156.png)](https://asciinema.org/a/100156)
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
$ gem install textbringer
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
$ tb
|
19
|
+
|
20
|
+
You can quit the editor by C-x C-c.
|
21
|
+
|
22
|
+
## Configuration of terminal emulators
|
23
|
+
|
24
|
+
### xterm
|
25
|
+
|
26
|
+
Add the following line to ~/.Xresources.
|
27
|
+
|
28
|
+
XTerm*metaSendsEscape: true
|
29
|
+
|
30
|
+
### mlterm
|
31
|
+
|
32
|
+
Add the following lines to ~/.mlterm/main.
|
33
|
+
|
34
|
+
mod_meta_key = alt
|
35
|
+
mod_meta_mode = esc
|
36
|
+
col_size_of_width_a = 1
|
37
|
+
|
38
|
+
### screen
|
39
|
+
|
40
|
+
Add the following line to ~/.screenrc.
|
41
|
+
|
42
|
+
cjkwidth off
|
43
|
+
|
44
|
+
## Development
|
45
|
+
|
46
|
+
After checking out the repo, run `bundle install` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
47
|
+
|
48
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/shugo/textbringer.
|
53
|
+
|
54
|
+
|
55
|
+
## License
|
56
|
+
|
57
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
58
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/exe/tb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "textbringer"
|
4
|
+
|
5
|
+
include Textbringer
|
6
|
+
include Commands
|
7
|
+
|
8
|
+
def load_user_config
|
9
|
+
config_file = File.expand_path("~/.textbringer.rb")
|
10
|
+
begin
|
11
|
+
load(config_file)
|
12
|
+
rescue LoadError
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
$VERBOSE = nil
|
17
|
+
|
18
|
+
Controller.current = Controller.new
|
19
|
+
Window.start do
|
20
|
+
message("Type C-x C-c to exit Textbringer")
|
21
|
+
begin
|
22
|
+
load_user_config
|
23
|
+
ruby_mode
|
24
|
+
if ARGV.size > 0
|
25
|
+
ARGV.each do |arg|
|
26
|
+
find_file(arg)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
rescue Exception => e
|
30
|
+
handle_exception(e)
|
31
|
+
end
|
32
|
+
Window.redisplay
|
33
|
+
trap(:CONT) do
|
34
|
+
Window.redraw
|
35
|
+
end
|
36
|
+
loop do
|
37
|
+
Controller.current.command_loop(TOP_LEVEL_TAG)
|
38
|
+
Window.redisplay
|
39
|
+
end
|
40
|
+
end
|