remedy 0.0.4.pre → 0.0.4
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.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.markdown +7 -5
- data/lib/remedy.rb +12 -6
- data/lib/remedy/version.rb +1 -1
- data/lib/remedy/viewport.rb +2 -2
- data/remedy.gemspec +2 -0
- data/spec/remedy_spec.rb +5 -0
- data/spec/spec_helper.rb +0 -0
- metadata +32 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3656685f4f4eca02da54269885a8ba11a5662bef
|
4
|
+
data.tar.gz: cb12f074fc24fdf142a882edf15f3115ac47f73a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b5dc6cce2e13229f7322d22cb711d330c2b43c69a1d7065729625f58880ac33391888c7362658a9a7f4ba4deb11747490e75c2b0f0ad0b80e006c8c628091ae
|
7
|
+
data.tar.gz: 4756a1a9438777926813cbf2bf3f7edc63cf96ed4caedb9cd537940503d64c7f9a0d2bde6f7aed256518dc6942a6b82ffa0ca3d597228bb7cbf84c586c906068
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
remedy
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -3,6 +3,8 @@ Remedy
|
|
3
3
|
|
4
4
|
Remedy is a console interaction framework along the lines of Curses written in pure Ruby with an Object-Oriented approach and baked-in support for bulding MVC applications.
|
5
5
|
|
6
|
+
[](https://travis-ci.org/acook/remedy)
|
7
|
+
|
6
8
|
THIS SOFTWARE IS PRE-ALPHA!!
|
7
9
|
----------------------------
|
8
10
|
|
@@ -38,11 +40,11 @@ Usage
|
|
38
40
|
|
39
41
|
Remedy makes a few different classes and modules available to allow straight forward half-duplex communication with users via the console.
|
40
42
|
|
41
|
-
There are
|
43
|
+
There are objects for input as well as output, including low level console keystroke reads and screen drawing.
|
42
44
|
|
43
45
|
### Interaction
|
44
46
|
|
45
|
-
The Interaction object wraps raw keyboard reads and streamlines some aspects of accepting keyboard input.
|
47
|
+
The `Interaction` object wraps raw keyboard reads and streamlines some aspects of accepting keyboard input.
|
46
48
|
|
47
49
|
```ruby
|
48
50
|
include Remedy
|
@@ -55,7 +57,7 @@ The Interaction object wraps raw keyboard reads and streamlines some aspects of
|
|
55
57
|
|
56
58
|
### Viewport
|
57
59
|
|
58
|
-
Viewport is the object that draws on your screen, you can give it any compatible Remedy::Partial object, or something that responds like one.
|
60
|
+
`Viewport` is the object that draws on your screen, you can give it any compatible `Remedy::Partial` object, or something that responds like one.
|
59
61
|
|
60
62
|
```ruby
|
61
63
|
include Remedy
|
@@ -67,7 +69,7 @@ Viewport is the object that draws on your screen, you can give it any compatible
|
|
67
69
|
screen.draw joke
|
68
70
|
```
|
69
71
|
|
70
|
-
Remedy::Partial has the subclasses Header
|
72
|
+
`Remedy::Partial` has the subclasses `Header`, `Footer`, and `Content`.
|
71
73
|
|
72
74
|
You can use the above classes to divide your Views into 3 seperate pieces. Content will be truncated as needed to accomodate the header and footer and the dimensions of the console. You can also specify the cursor/scroll position of the content being drawn, and when specifying headers or footers, you must.
|
73
75
|
|
@@ -89,7 +91,7 @@ You can use the above classes to divide your Views into 3 seperate pieces. Conte
|
|
89
91
|
|
90
92
|
### Console
|
91
93
|
|
92
|
-
If you want easy access to some lower level console commands, you can use Console
|
94
|
+
If you want easy access to some lower level console commands, you can use `Console`.
|
93
95
|
|
94
96
|
The most interesting function in my opinion is the callback that gets triggered when the user resizes the console window.
|
95
97
|
|
data/lib/remedy.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module Remedy
|
2
|
+
module_function
|
3
|
+
|
4
|
+
def libs
|
5
|
+
%w{
|
6
|
+
version ansi characters console console_resized content header footer
|
7
|
+
interaction key keyboard partial view viewport
|
8
|
+
}
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
|
-
|
12
|
+
Remedy.libs.each do |lib|
|
13
|
+
require "remedy/#{lib}"
|
9
14
|
end
|
15
|
+
|
data/lib/remedy/version.rb
CHANGED
data/lib/remedy/viewport.rb
CHANGED
@@ -19,9 +19,9 @@ module Remedy
|
|
19
19
|
Console.output << view
|
20
20
|
end
|
21
21
|
|
22
|
-
def range_find
|
22
|
+
def range_find partial, center, heightwidth
|
23
23
|
row_size, col_size = heightwidth
|
24
|
-
row_limit, col_limit =
|
24
|
+
row_limit, col_limit = partial.size
|
25
25
|
|
26
26
|
center_row, center_col = center.coords
|
27
27
|
|
data/remedy.gemspec
CHANGED
data/spec/remedy_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
File without changes
|
metadata
CHANGED
@@ -1,16 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remedy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4
|
5
|
-
prerelease: 6
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Anthony M. Cook
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
11
|
+
date: 2015-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
14
27
|
description: Pure Ruby console interaction library in the vein of Curses with baked-in
|
15
28
|
MVC support.
|
16
29
|
email:
|
@@ -19,7 +32,10 @@ executables: []
|
|
19
32
|
extensions: []
|
20
33
|
extra_rdoc_files: []
|
21
34
|
files:
|
22
|
-
- .gitignore
|
35
|
+
- ".gitignore"
|
36
|
+
- ".ruby-gemset"
|
37
|
+
- ".ruby-version"
|
38
|
+
- ".travis.yml"
|
23
39
|
- Gemfile
|
24
40
|
- LICENSE.txt
|
25
41
|
- README.markdown
|
@@ -41,29 +57,32 @@ files:
|
|
41
57
|
- lib/remedy/view.rb
|
42
58
|
- lib/remedy/viewport.rb
|
43
59
|
- remedy.gemspec
|
60
|
+
- spec/remedy_spec.rb
|
61
|
+
- spec/spec_helper.rb
|
44
62
|
homepage: http://github.com/acook/remedy
|
45
63
|
licenses: []
|
64
|
+
metadata: {}
|
46
65
|
post_install_message:
|
47
66
|
rdoc_options: []
|
48
67
|
require_paths:
|
49
68
|
- lib
|
50
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
51
70
|
requirements:
|
52
|
-
- -
|
71
|
+
- - ">="
|
53
72
|
- !ruby/object:Gem::Version
|
54
73
|
version: '0'
|
55
|
-
none: false
|
56
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
75
|
requirements:
|
58
|
-
- -
|
76
|
+
- - ">="
|
59
77
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
none: false
|
78
|
+
version: '0'
|
62
79
|
requirements: []
|
63
80
|
rubyforge_project:
|
64
|
-
rubygems_version:
|
81
|
+
rubygems_version: 2.4.6
|
65
82
|
signing_key:
|
66
|
-
specification_version:
|
83
|
+
specification_version: 4
|
67
84
|
summary: MVC Console Interaction Library
|
68
|
-
test_files:
|
85
|
+
test_files:
|
86
|
+
- spec/remedy_spec.rb
|
87
|
+
- spec/spec_helper.rb
|
69
88
|
has_rdoc:
|