remedy 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b308f7cf135ba7a8f6ab69ef9c56ff7d640a189c9f44056e14f49b987948ec1f
4
- data.tar.gz: 9f1969fea60358a6585974f948f572bdeeeb55afd0f176d6dd220bdd4b29c094
3
+ metadata.gz: 2efe0ed0180c60202b73b0cf9f0fce46b51bcfeefe2a83171f4915c9d2b022ad
4
+ data.tar.gz: 2b11a6544dec2796c6bdf5ce96691be0c7b232f132174d0b79496098252fe5ab
5
5
  SHA512:
6
- metadata.gz: 0d664d1b61638b139bd2aef66ed2facd0d25e4dbaa65a39014892bcb3f967895cbf78304a8b4235cce1a5210384e7cadaa6672fa41a2d2e102c22a80c0cd40ef
7
- data.tar.gz: ea8a3d1aeaeb8a0e474bf2a69f6837ab300810dfaf3bd014200e284f6e45058875fa5363e73948228806e35e24957ded1d342d07a8622f089726e94da2e93a3b
6
+ metadata.gz: c76c67debc47dd95b9b614a6681923cb5e47f53c4135335c39170243bcb9a007630af5bc364894f33489cde79c5692e9a28d97ed0f5caf0bfbe83e229ad394eb
7
+ data.tar.gz: a001aa18bd36640ebe267c8d6ae4bf68e7e73d60df0017e31875b222ff30b87169c4c36d06130c27096def9e4ccfa26c50ad350ea1d2cf2adbb42228af5dcf8d
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", ruby-head, jruby-9.2, jruby-9.3, jruby-head]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ bundler-cache: true # 'bundle install' and cache gems
21
+ ruby-version: ${{ matrix.ruby }}
22
+ - name: Run tests
23
+ run: bundle exec rspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.3
1
+ 3.1.2
data/README.markdown CHANGED
@@ -5,7 +5,7 @@ Remedy is a console interaction framework along the lines of Curses written in p
5
5
 
6
6
  [![Gem Version](https://img.shields.io/gem/v/remedy.svg?style=for-the-badge)](https://rubygems.org/gems/remedy)
7
7
  [![Gem Downloads](https://img.shields.io/gem/dt/remedy.svg?style=for-the-badge)](https://rubygems.org/gems/remedy)
8
- [![Build Status](https://img.shields.io/travis/acook/remedy.svg?style=for-the-badge)](https://travis-ci.org/acook/remedy)
8
+ [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/acook/remedy/ci.yml?style=for-the-badge)](https://github.com/acook/remedy/actions/workflows/ci.yml)
9
9
  [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/acook/remedy?style=for-the-badge)](https://codeclimate.com/github/acook/remedy/maintainability)
10
10
 
11
11
 
@@ -70,20 +70,18 @@ For instance to get a keypress from the terminal and display it:
70
70
  screen.draw joke
71
71
  ```
72
72
 
73
- `Remedy::Partial` has the subclasses `Header`, `Footer`, and `Content`.
74
-
75
- You can use the above classes to divide your Views into 3 separate pieces. Content will be truncated as needed to accommodate 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
+ Content in `Remedy::Partial`s will be truncated as needed to accommodate 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.
76
74
 
77
75
  ```ruby
78
76
  include Remedy
79
- title = Header.new
77
+ title = Partial.new
80
78
  title << "Someone Said These Were Good"
81
79
 
82
80
  jokes = Content.new
83
81
  jokes << %q{1. A woman gets on a bus with her baby. The bus driver says: 'Ugh, that's the ugliest baby I've ever seen!' The woman walks to the rear of the bus and sits down, fuming. She says to a man next to her: 'The driver just insulted me!' The man says: 'You go up there and tell him off. Go on, I'll hold your monkey for you.'}
84
82
  jokes << %q{2. I went to the zoo the other day, there was only one dog in it, it was a shitzu.}
85
83
 
86
- disclaimer = Footer.new
84
+ disclaimer = Partial.new
87
85
  disclaimer << "According to a survey they were funny. I didn't make them."
88
86
 
89
87
  screen = Viewport.new
@@ -102,7 +100,7 @@ The most interesting function in my opinion is the callback that gets triggered
102
100
  screen = Viewport.new
103
101
 
104
102
  Console.set_console_resized_hook! do |size|
105
- notice = Content.new
103
+ notice = Partial.new
106
104
  notice << "You just resized your screen!\n\nNew size:"
107
105
  notice << size
108
106
  screen.draw notice
@@ -114,7 +112,10 @@ Remedy in the Wild
114
112
 
115
113
  Remedy was originally written for my own console-based game which was sort of like Dwarf Fortress. Most of the project files were lost, but since Remedy was extracted from it and open-sourced it has lived on.
116
114
 
117
- Here are a couple of projects that use many of Remedy's features:
115
+ Here are some projects that use Remedy:
116
+
117
+ - A screenreader-friendly code editor for blind and visually impaired programmers: [Viper](https://github.com/edhowland/viper)
118
+ - [The Official ElasticSearch Ruby Connector](https://github.com/elastic/connectors-ruby)
118
119
  - A multiplayer Yahtzee for web and console: [YahtzeeGame](https://github.com/ProgrammingPractice/YahtzeeGame)
119
120
  - Twitter/RSS/Facebook reader: [noizee](https://github.com/acook/noizee)
120
121
 
@@ -133,4 +134,3 @@ Contributing
133
134
  3. Commit your changes (`git commit -am 'Add some feature'`)
134
135
  4. Push to the branch (`git push origin my-new-feature`)
135
136
  5. Create new Pull Request
136
-
@@ -7,7 +7,7 @@ include Remedy
7
7
  screen = Viewport.new
8
8
 
9
9
  Console.set_console_resized_hook! do |size|
10
- notice = Content.new
10
+ notice = Partial.new
11
11
  notice << "You just resized your screen!\n\nNew size:"
12
12
  notice << size
13
13
 
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  user_input = Interaction.new "press any key to continue"
18
18
 
19
- joke = Content.new
19
+ joke = Partial.new
20
20
  joke << "Q: What's the difference between a duck?"
21
21
  joke << "A: Purple, because ice cream has no bones!"
22
22
 
@@ -24,14 +24,14 @@ screen.draw joke
24
24
 
25
25
  user_input.get_key
26
26
 
27
- title = Header.new
27
+ title = Partial.new
28
28
  title << "Someone Said These Were Good"
29
29
 
30
- jokes = Content.new
30
+ jokes = Partial.new
31
31
  jokes << %q{1. A woman gets on a bus with her baby. The bus driver says: 'Ugh, that's the ugliest baby I've ever seen!' The woman walks to the rear of the bus and sits down, fuming. She says to a man next to her: 'The driver just insulted me!' The man says: 'You go up there and tell him off. Go on, I'll hold your monkey for you.'}
32
32
  jokes << %q{2. I went to the zoo the other day, there was only one dog in it, it was a shitzu.}
33
33
 
34
- disclaimer = Footer.new
34
+ disclaimer = Partial.new
35
35
  disclaimer << "According to a survey they were funny. I didn't make them."
36
36
 
37
37
  screen.draw jokes, Size.new(0,0), title, disclaimer
@@ -39,7 +39,7 @@ screen.draw jokes, Size.new(0,0), title, disclaimer
39
39
  user_input.get_key
40
40
 
41
41
  ANSI.cursor.next_line!
42
- keys = Content.new
42
+ keys = Partial.new
43
43
  loop_demo = Interaction.new "press q to exit, or any other key to display that key's name\n"
44
44
  loop_demo.loop do |key|
45
45
  keys << key
@@ -47,7 +47,7 @@ class Menu
47
47
  # this creates a new content every time we draw
48
48
  # you may want to only create a new content/header/footer when they change
49
49
  # or create your own Partial subclass
50
- c = Content.new
50
+ c = Partial.new
51
51
  c << <<-CONTENT
52
52
 
53
53
  1. Do the thing
@@ -61,12 +61,12 @@ class Menu
61
61
 
62
62
  # headers are displayed the top of the viewport
63
63
  def header
64
- Header.new << "The time is: #{Time.now}"
64
+ Partial.new << "The time is: #{Time.now}"
65
65
  end
66
66
 
67
67
  # footers are displayed the bottom of the viewport
68
68
  def footer
69
- Footer.new << "Screen size: #{Console.size} You pressed: #{@last_key}"
69
+ Partial.new << "Screen size: #{Console.size} You pressed: #{@last_key}"
70
70
  end
71
71
  end
72
72
 
@@ -1,3 +1,3 @@
1
1
  module Remedy
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -1,6 +1,5 @@
1
1
  require 'remedy/view'
2
2
  require 'remedy/size'
3
- require 'remedy/content'
4
3
  require 'remedy/console'
5
4
  require 'remedy/ansi'
6
5
 
data/lib/remedy.rb CHANGED
@@ -3,7 +3,7 @@ module Remedy
3
3
 
4
4
  def libs
5
5
  %w{
6
- version ansi characters console console_resize content header footer
6
+ version ansi characters console console_resize
7
7
  interaction key keyboard partial view viewport
8
8
  }
9
9
  end
@@ -3,7 +3,7 @@ require 'remedy/viewport'
3
3
 
4
4
  describe Remedy::Viewport do
5
5
  it 'should be able to execute the example code from the readme' do
6
- joke = ::Remedy::Content.new
6
+ joke = ::Remedy::Partial.new
7
7
  joke << "Q: What's the difference between a duck?"
8
8
  joke << "A: Purple, because ice cream has no bones!"
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remedy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony M. Cook
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -32,6 +32,8 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - ".github/dependabot.yml"
36
+ - ".github/workflows/ci.yml"
35
37
  - ".gitignore"
36
38
  - ".ruby-gemset"
37
39
  - ".ruby-version"
@@ -47,9 +49,6 @@ files:
47
49
  - lib/remedy/characters.rb
48
50
  - lib/remedy/console.rb
49
51
  - lib/remedy/console_resize.rb
50
- - lib/remedy/content.rb
51
- - lib/remedy/footer.rb
52
- - lib/remedy/header.rb
53
52
  - lib/remedy/interaction.rb
54
53
  - lib/remedy/key.rb
55
54
  - lib/remedy/keyboard.rb
@@ -68,7 +67,7 @@ homepage: http://github.com/acook/remedy
68
67
  licenses:
69
68
  - MIT
70
69
  metadata: {}
71
- post_install_message:
70
+ post_install_message:
72
71
  rdoc_options: []
73
72
  require_paths:
74
73
  - lib
@@ -83,8 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
82
  - !ruby/object:Gem::Version
84
83
  version: '0'
85
84
  requirements: []
86
- rubygems_version: 3.1.2
87
- signing_key:
85
+ rubygems_version: 3.3.7
86
+ signing_key:
88
87
  specification_version: 4
89
88
  summary: Pure Ruby Console Interaction Library
90
89
  test_files:
@@ -1,4 +0,0 @@
1
- require 'remedy/partial'
2
-
3
- class Remedy::Content < Remedy::Partial
4
- end
data/lib/remedy/footer.rb DELETED
@@ -1,4 +0,0 @@
1
- require 'remedy/partial'
2
-
3
- class Remedy::Footer < Remedy::Partial
4
- end
data/lib/remedy/header.rb DELETED
@@ -1,4 +0,0 @@
1
- require 'remedy/partial'
2
-
3
- class Remedy::Header < Remedy::Partial
4
- end