dynamic_curses_input 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -10
- data/Gemfile +5 -5
- data/LICENSE +71 -0
- data/README.md +14 -7
- data/Rakefile +3 -3
- data/dynamic_curses_input.gemspec +2 -2
- data/lib/dynamic_curses_input/version.rb +1 -1
- metadata +5 -7
- data/LICENSE.txt +0 -21
- data/buildgem.sh +0 -23
- data/tester.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abd6d9170839e5a4e3c3612c28bdd38ed289a6bd608f05babd9b2c7aa64187be
|
4
|
+
data.tar.gz: 7399a896660df0ffd778e420d465a5ef9b51e6086790a632e3627c4f68091744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4b6155144005e614681ca2643ceb585a20f726530fd3df7f832aa743e904c9075a0187c600c0f23ccfb35daf80b887f49e39174a6ede1b2b72ed71dc047842e
|
7
|
+
data.tar.gz: 5eb5070443e66adc6b431f0a31a703aadeecedfc264db73041ff0192c18914c39e923b917f16cf74133322a29e00233503d4201217a7e2ce90347e3ed41c9d0b
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
- Initial release
|
6
6
|
|
7
|
+
## [Release]
|
8
|
+
|
7
9
|
## [1.1.0] - 2023-07-26
|
8
10
|
|
9
11
|
- Features and Enhancements:
|
@@ -26,13 +28,3 @@
|
|
26
28
|
- Other Changes:
|
27
29
|
|
28
30
|
- Removed redundant and unused code snippets to improve code cleanliness and maintainability.
|
29
|
-
|
30
|
-
## [1.2.0] - 2023-07-31
|
31
|
-
|
32
|
-
- Features Added
|
33
|
-
|
34
|
-
- Added automatic handling for the up and down arrow keys to behave more like the user would expect.
|
35
|
-
|
36
|
-
- The Up arrow will bring the cursor to the beginning of the line by setting the cursor position to 0 after checking if the cursor is already there
|
37
|
-
|
38
|
-
- The Down arrow will bring the cursor to the end of the line by setting the cursor to the position equal to the length of the input line plus 1
|
data/Gemfile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in dynamic_curses_input.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem
|
8
|
+
gem 'rake'
|
9
9
|
|
10
|
-
gem
|
10
|
+
gem 'rubocop'
|
11
11
|
|
12
|
-
gem
|
12
|
+
gem 'curses'
|
13
13
|
|
14
|
-
gem
|
14
|
+
gem 'reline'
|
data/LICENSE
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
PixelRidge Business Exclusive General Public Use License for Software Executables (PixelRidge-BEGPULSE)
|
2
|
+
|
3
|
+
## Version 1.2
|
4
|
+
|
5
|
+
### Preamble
|
6
|
+
|
7
|
+
This License governs the terms under which the software ("Software") provided by PixelRidge Softworks ("Licensor") may be used, modified, and distributed.
|
8
|
+
|
9
|
+
### 1. Definitions
|
10
|
+
|
11
|
+
- **Software**: The original software and associated documentation provided under this license.
|
12
|
+
- **Business Purposes**: Any activity designed with the main intent to generate revenue or profit.
|
13
|
+
- **Modification**: Any change or addition to the Software's source code or executable.
|
14
|
+
- **Distribution**: The act of making the Software available to third parties.
|
15
|
+
- **Contributor**: Any individual or entity that modifies or distributes the Software.
|
16
|
+
|
17
|
+
### 2. License Grant
|
18
|
+
|
19
|
+
Subject to the terms and conditions of this License, Licensor hereby grants you a worldwide, non-exclusive, non-transferable, non-sublicensable license to use and modify the Software.
|
20
|
+
|
21
|
+
### 3. Attribution
|
22
|
+
|
23
|
+
You must provide proper attribution to the Licensor by including a plain-view backlink to the Licensor's website. This backlink must be easily visible to all users and not hidden under any circumstances.
|
24
|
+
|
25
|
+
### 4. Business Use
|
26
|
+
|
27
|
+
If you wish to use the Software for Business Purposes, you must obtain written permission from PixelRidge Softworks. Failure to obtain such permission will result in a violation of this License.
|
28
|
+
|
29
|
+
### 5. Indemnification
|
30
|
+
|
31
|
+
You agree to indemnify, defend, and hold harmless PixelRidge Softworks and its affiliates from and against any and all claims, damages, losses, liabilities, costs, and expenses arising out of or relating to your use or distribution of the Software.
|
32
|
+
|
33
|
+
### 6. No Warranty and Limitation of Liability
|
34
|
+
|
35
|
+
The Software is provided "AS-IS," without any warranty of any kind, either express or implied. The Software is designed to be highly secure but will only be as secure as the system on which it is deployed. On an insecure system, the Software may exacerbate existing security issues. PixelRidge Softworks shall not be liable for any damages arising from the use of the Software.
|
36
|
+
|
37
|
+
### 7. Updates and Versioning
|
38
|
+
|
39
|
+
PixelRidge Softworks may or may not provide updates to the Software in the future. There is no obligation to provide updates or support for the Software. The latest version of this License shall always be considered the governing terms. PixelRidge Softworks will provide reasonable notice in the event of a license change.
|
40
|
+
|
41
|
+
### 8. Source Code Availability
|
42
|
+
|
43
|
+
Any modifications to the Software must remain open-source and source-available in their entirety.
|
44
|
+
|
45
|
+
### 9. Compliance Monitoring
|
46
|
+
|
47
|
+
Compliance with this License may or may not be monitored by PixelRidge Softworks. You grant PixelRidge Softworks the right to monitor for compliance as it sees fit.
|
48
|
+
|
49
|
+
### 10. Data Collection
|
50
|
+
|
51
|
+
If the Software collects any data, such data will be used in accordance with PixelRidge Softworks' privacy policy.
|
52
|
+
|
53
|
+
### 11. Export Control
|
54
|
+
|
55
|
+
You agree not to use the Software in violation of any export laws or regulations.
|
56
|
+
|
57
|
+
### 12. Termination and Revocation
|
58
|
+
|
59
|
+
This License will automatically terminate if you fail to comply with any of its terms or conditions. Revocation is allowed only in the event of a violation of this License.
|
60
|
+
|
61
|
+
### 13. Dispute Resolution
|
62
|
+
|
63
|
+
Any disputes arising out of this License shall be resolved through arbitration in Alberta, Canada.
|
64
|
+
|
65
|
+
### 14. Jurisdiction
|
66
|
+
|
67
|
+
This License shall be governed by the laws of Alberta, Canada.
|
68
|
+
|
69
|
+
### 15. Miscellaneous
|
70
|
+
|
71
|
+
This License constitutes the entire agreement between you and PixelRidge Softworks concerning the Software. It may only be modified in writing, signed by both parties.
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# DynamicCursesInput
|
2
2
|
|
3
|
-
|
3
|
+
DynamicCursesInput is a Ruby gem that provides a simple and intuitive way to handle user input in a Curses-based terminal user interface (TUI). It allows for dynamic input handling, including cursor movement and inline character addition and deletion.
|
4
|
+
|
5
|
+
## Table of Contents
|
4
6
|
|
5
7
|
- [Installation](#installation)
|
6
8
|
- [Usage](#usage)
|
@@ -13,7 +15,7 @@ Dynamic Curses Input is a Ruby gem that provides a simple and intuitive way to h
|
|
13
15
|
|
14
16
|
## Installation
|
15
17
|
|
16
|
-
To install
|
18
|
+
To install DynamicCursesInput, add the following line to your application's Gemfile:
|
17
19
|
|
18
20
|
```ruby
|
19
21
|
gem 'dynamic_curses_input'
|
@@ -33,7 +35,7 @@ $ gem install dynamic_curses_input
|
|
33
35
|
|
34
36
|
## Usage
|
35
37
|
|
36
|
-
Here's a simple example of how to use
|
38
|
+
Here's a simple example of how to use DynamicCursesInput:
|
37
39
|
|
38
40
|
```ruby
|
39
41
|
require "curses"
|
@@ -59,15 +61,20 @@ In this example, `DCI.catch_input(true)` will capture user input until the Enter
|
|
59
61
|
|
60
62
|
## Documentation
|
61
63
|
|
62
|
-
Detailed documentation for each function is available in the [wiki](https://
|
64
|
+
Detailed documentation for each function is available in the [wiki](https://github.com/Pixelated-Studios/dynamic_curses_input/wiki).
|
63
65
|
|
64
66
|
## Dependencies
|
65
67
|
|
66
68
|
DynamicCursesInput depends on the [Curses](https://github.com/ruby/curses) gem.
|
67
69
|
|
70
|
+
## FAQs
|
71
|
+
|
72
|
+
- **Q: How do I handle special keys like arrow keys?**
|
73
|
+
- A: Special keys like arrow keys are automatically handled by DynamicCursesInput.
|
74
|
+
|
68
75
|
## Troubleshooting
|
69
76
|
|
70
|
-
If you encounter any issues while using DynamicCursesInput, please check the [issues](https://
|
77
|
+
If you encounter any issues while using DynamicCursesInput, please check the [issues](https://github.com/yourusername/dynamic_curses_input/issues) page. If your issue isn't listed, feel free to open a new issue.
|
71
78
|
|
72
79
|
## Contribution Guidelines
|
73
80
|
|
@@ -79,6 +86,6 @@ DynamicCursesInput is available under the [MIT License](LICENSE.txt).
|
|
79
86
|
|
80
87
|
---
|
81
88
|
|
82
|
-
### Note from the Developer:
|
89
|
+
### Note from the Developer:
|
83
90
|
|
84
91
|
There is a function in this gem that is not finished yet, it's for making asking questions in a Curses TUI easier from within the gem. This method shouldn't be used yet.
|
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
5
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
7
7
|
|
8
|
-
require
|
8
|
+
require "rubocop/rake_task"
|
9
9
|
|
10
10
|
RuboCop::RakeTask.new
|
11
11
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'A simple library for making Curses TUI input more dynamic and user-friendly'
|
12
12
|
spec.description = "Dynamic Curses Input is a highly simple, yet powerful gem that allows simple implementation of
|
13
13
|
dynamic typing in curses TUI menus built in Ruby. For example, one can't simply use their arrow
|
14
|
-
keys to navigate and edit inputs in
|
14
|
+
keys to navigate and edit inputs in Curses TUI menus without adding a bunch of extra code to your
|
15
15
|
project to handle it. A lot of which can be tricky to handle. This gem eliminates the need for
|
16
16
|
that code, by providing simple to use methods that allow developers to capture user input, while
|
17
17
|
allowing the special keys to work as the average user would expect.
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.files = Dir.glob('{bin,lib,sig}/**/*') + Dir.glob('*').reject do |f|
|
33
33
|
f.start_with?('spec', '.rspec', 'dynamic_curses_input.gemspec')
|
34
34
|
end
|
35
|
-
spec.files << 'LICENSE
|
35
|
+
spec.files << 'LICENSE'
|
36
36
|
spec.files << 'README.md'
|
37
37
|
spec.files << 'dynamic_curses_input.gemspec'
|
38
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_curses_input
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PixelRidge-Softworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
description: |-
|
56
56
|
Dynamic Curses Input is a highly simple, yet powerful gem that allows simple implementation of
|
57
57
|
dynamic typing in curses TUI menus built in Ruby. For example, one can't simply use their arrow
|
58
|
-
keys to navigate and edit inputs in
|
58
|
+
keys to navigate and edit inputs in Curses TUI menus without adding a bunch of extra code to your
|
59
59
|
project to handle it. A lot of which can be tricky to handle. This gem eliminates the need for
|
60
60
|
that code, by providing simple to use methods that allow developers to capture user input, while
|
61
61
|
allowing the special keys to work as the average user would expect.
|
@@ -74,19 +74,17 @@ files:
|
|
74
74
|
- CODE_OF_CONDUCT.md
|
75
75
|
- Gemfile
|
76
76
|
- Gemfile.lock
|
77
|
-
- LICENSE
|
77
|
+
- LICENSE
|
78
78
|
- README.md
|
79
79
|
- Rakefile
|
80
80
|
- bin/console
|
81
81
|
- bin/setup
|
82
|
-
- buildgem.sh
|
83
82
|
- dynamic_curses_input.gemspec
|
84
83
|
- lib/dynamic_curses_input.rb
|
85
84
|
- lib/dynamic_curses_input/color_window.rb
|
86
85
|
- lib/dynamic_curses_input/input_handler.rb
|
87
86
|
- lib/dynamic_curses_input/version.rb
|
88
87
|
- sig/dynamic_curses_input.rbs
|
89
|
-
- tester.rb
|
90
88
|
homepage: https://git.pixelridgesoftworks.com/PixelRidge-Softworks/dynamic_curses_input
|
91
89
|
licenses:
|
92
90
|
- MIT
|
@@ -109,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
107
|
- !ruby/object:Gem::Version
|
110
108
|
version: '0'
|
111
109
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.5.0.dev
|
113
111
|
signing_key:
|
114
112
|
specification_version: 4
|
115
113
|
summary: A simple library for making Curses TUI input more dynamic and user-friendly
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2023 VetheonGames
|
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/buildgem.sh
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#/bin/bash
|
2
|
-
echo "rebuilding dynamic_curses_input..."
|
3
|
-
sleep 1
|
4
|
-
echo "Uninstalling existing version..."
|
5
|
-
sleep 1
|
6
|
-
gem uninstall dynamic_curses_input
|
7
|
-
sleep 1
|
8
|
-
echo "Cleaning up old files..."
|
9
|
-
sleep 1
|
10
|
-
gem cleanup dynamic_curses_input
|
11
|
-
rm -f dynamic_curses_input-1.2.0.gem
|
12
|
-
sleep 1
|
13
|
-
echo "Building DCI..."
|
14
|
-
sleep 1
|
15
|
-
gem build dynamic_curses_input.gemspec
|
16
|
-
echo "built!"
|
17
|
-
sleep 1
|
18
|
-
echo "Installing new version of DCI..."
|
19
|
-
sleep 1
|
20
|
-
gem install dynamic_curses_input-1.2.0.gem
|
21
|
-
echo "Installed!"
|
22
|
-
echo "press any key to exit..."
|
23
|
-
read ""
|
data/tester.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'dynamic_curses_input'
|
4
|
-
|
5
|
-
# Create and display a red window at the center of the screen
|
6
|
-
DCI.print_color_window('red', 'test', y_value: 60, x: '40')
|
7
|
-
|
8
|
-
# Create and display a magenta window at a specific position
|
9
|
-
DCI.print_color_window('magenta', 'testy-test', y_value: 30, x: '20')
|
10
|
-
|
11
|
-
# Initialize Curses
|
12
|
-
Curses.init_screen
|
13
|
-
Curses.cbreak
|
14
|
-
Curses.noecho
|
15
|
-
|
16
|
-
# Wait for the Enter key to be pressed
|
17
|
-
Curses.stdscr.getch until Curses.stdscr.getch == 10
|
18
|
-
|
19
|
-
# Clean up and close Curses
|
20
|
-
Curses.close_screen
|