highline 3.0.1 → 3.1.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: 77aabe8e1a9f098383f7bdee9fb2fb985fe46ecd9faf59c676753bd59fef9da4
4
- data.tar.gz: b7c90d18ba2adbdbab4ce5e20dd166ba812f506d7755429c12a955acc34bdfee
3
+ metadata.gz: a711e47ab4e364e5f470dfd8bb716028fce1eaf32134470b4f355d9323a5eb60
4
+ data.tar.gz: 931ccc44047bba2fa2c52521ce8eed9183cbe27fffc1a652ef79c7ed9f406443
5
5
  SHA512:
6
- metadata.gz: d708e26cdac5cd985562e57290cdfd8fecb3f6ca2d81bdff0c1e0c2c4ab006c98668b2c4346e0fdd24acd74f05db14f30d2cb5f870906538b9b1af44b0a3ed31
7
- data.tar.gz: b0d5453c17c7ed667bd68b9ea208c4f5b78da1a0d101d01f69ec0299fb8eb8a234a5491053e148422542ed502ac7406711b6e6a30343c46be1c1eb611b159135
6
+ metadata.gz: 14ccf0f79acbebd05e46b8ec4c598356bf6d64eeb4808b471e8df61f5fa056656a27c2d029a13fb3a82f3f04c979f75a7578ceed3e5848b1165a237648816e60
7
+ data.tar.gz: 2bd934d2e17bf4f4e4fe180317962c1eeddebdae80ac423d54ba689579ee2ed25ea81cbf2a106bcab705297d6866effb8faece92c6d76ec268cfa2a4b2bec367
@@ -36,7 +36,7 @@ jobs:
36
36
  ruby-version: '3.3'
37
37
  runs-on: ${{ matrix.os }}
38
38
  steps:
39
- - uses: actions/checkout@v3
39
+ - uses: actions/checkout@v4
40
40
  - name: Set up Ruby ${{ matrix.ruby-version }}
41
41
  uses: ruby/setup-ruby@v1
42
42
  with:
data/.rubocop.yml CHANGED
@@ -4,7 +4,8 @@
4
4
  # https://github.com/bbatsov/rubocop/tree/master/config
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.1
7
+ TargetRubyVersion: 3.3
8
+ NewCops: enable
8
9
 
9
10
  # General
10
11
 
@@ -58,7 +59,7 @@ Style/OptionalArguments:
58
59
  - 'lib/highline/list_renderer.rb'
59
60
 
60
61
  # TemplateRenderer should never fail on method missing.
61
- Style/MethodMissing:
62
+ Style/MissingRespondToMissing:
62
63
  Exclude:
63
64
  - 'lib/highline/template_renderer.rb'
64
65
 
@@ -73,7 +74,7 @@ Style/SymbolArray:
73
74
  # Cop supports --auto-correct.
74
75
  # Configuration parameters: EnforcedStyle, SupportedStyles.
75
76
  # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
76
- Layout/IndentHeredoc:
77
+ Layout/HeredocIndentation:
77
78
  Exclude:
78
79
  - 'examples/page_and_wrap.rb'
79
80
  - 'highline.gemspec'
data/Changelog.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Below is a complete listing of changes for each revision of HighLine.
4
4
 
5
+ ### 3.1.1 / 2024-08-18
6
+ * PR #276 - Update #say to always flush the output after a #puts (@blipper)
7
+ * PR #274 / I #273 (@costa)
8
+ * Add Highline#add_to_color_scheme
9
+ * Dockerize the test environment. Just run `bin/test` and voilá!
10
+
11
+ ### 3.1.0 / 2024-07-15
12
+ * PR #272 / I #271 - Readline is now completed deprecated over Reline (@abinoam, issue by @64kramsystem)
13
+ * PR #269 - Provide a 'Changelog' link on rubygems.org/gems/highline (@mark-young-atg)
14
+
5
15
  ### 3.0.1 / 2024-01-20
6
16
  * PR #268 - Remove unused abbrev dependency (@zvkemp)
7
17
 
data/Gemfile CHANGED
@@ -13,6 +13,7 @@ group :code_quality do
13
13
  gem "flog", require: false
14
14
  gem "pronto", require: false, platform: :ruby
15
15
  gem "pronto-flay", require: false, platform: :ruby
16
+ gem "path_expander", "1.1.1", require: false # Remove this lock when path_expander > 1.1.2 and flay > 2.13.3 is released.
16
17
  # gem "pronto-poper", require: false, platform: :ruby
17
18
  gem "pronto-reek", require: false, platform: :ruby
18
19
  gem "pronto-rubocop", require: false, platform: :ruby
data/README.md CHANGED
@@ -206,6 +206,9 @@ Contributing
206
206
  - ```rake acceptance```
207
207
  - ```pronto run```
208
208
 
209
+ Alternatively, if you're in a [Docker](https://www.docker.com)ised environment,
210
+ don't care about installing anything locally -- just run `bin/test` instead.
211
+
209
212
  8. Commit your changes
210
213
  - ```git commit -am "Your commit message"```
211
214
 
data/bin/test ADDED
@@ -0,0 +1,11 @@
1
+ #!/bin/bash -e
2
+ test "$#" -ne 0 && echo "Unsupported args: $@" >&2 && exit 145
3
+ cd "$( dirname "${BASH_SOURCE[0]}" )"/..
4
+
5
+ export COMPOSE_FILE=test/docker-compose.yml
6
+ export COMPOSE_PROJECT_NAME=highline_dev
7
+
8
+ docker compose rm -svf
9
+ docker compose build --force-rm
10
+
11
+ docker compose run --rm tester && docker compose rm -svf || ( docker compose logs && exit 1 )
data/highline.gemspec CHANGED
@@ -33,5 +33,8 @@ DESCRIPTION
33
33
  spec.add_development_dependency "rake"
34
34
  spec.add_development_dependency "minitest"
35
35
  spec.add_development_dependency "dry-types"
36
- spec.add_development_dependency "reline"
36
+
37
+ spec.add_runtime_dependency "reline"
38
+
39
+ spec.metadata["changelog_uri"] = spec.homepage + "/blob/master/Changelog.md"
37
40
  end
@@ -112,7 +112,7 @@ class HighLine
112
112
  def readline_read(question, highline)
113
113
  # prep auto-completion
114
114
  unless question.selection.empty?
115
- Readline.completion_proc = lambda do |str|
115
+ Reline.completion_proc = lambda do |str|
116
116
  question.selection.grep(/\A#{Regexp.escape(str)}/)
117
117
  end
118
118
  end
@@ -124,7 +124,7 @@ class HighLine
124
124
 
125
125
  raw_answer = run_preserving_stty do
126
126
  prompt = highline.render_and_ident_statement(question)
127
- Readline.readline(prompt, true)
127
+ Reline.readline(prompt, true)
128
128
  end
129
129
 
130
130
  $VERBOSE = old_verbose
@@ -2,5 +2,5 @@
2
2
 
3
3
  class HighLine
4
4
  # The version of the installed library.
5
- VERSION = "3.0.1".freeze
5
+ VERSION = "3.1.1".freeze
6
6
  end
data/lib/highline.rb CHANGED
@@ -61,6 +61,14 @@ class HighLine
61
61
  true if @color_scheme
62
62
  end
63
63
 
64
+ # Pass a +Hash+ to add +new+ colors to the current scheme.
65
+ def add_to_color_scheme(hash)
66
+ old_hash = (color_scheme || {}).to_hash
67
+ fail "Overlapping color schemes: #{old_hash.keys & hash.keys}" unless
68
+ (old_hash.keys & hash.keys).empty?
69
+ self.color_scheme = ColorScheme.new(old_hash.merge hash)
70
+ end
71
+
64
72
  # Reset color scheme to default (+nil+)
65
73
  def reset_color_scheme
66
74
  self.color_scheme = nil
@@ -377,10 +385,10 @@ class HighLine
377
385
  # if statement ends with whitespace before a color escape code.
378
386
  if /[ \t](\e\[\d+(;\d+)*m)?\Z/ =~ statement
379
387
  output.print(statement)
380
- output.flush
381
388
  else
382
389
  output.puts(statement)
383
390
  end
391
+ output.flush # See: https://github.com/JEG2/highline/pull/276
384
392
  end
385
393
 
386
394
  # Renders and indents a statement.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highline
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edward Gray II
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-20 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,7 +73,7 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
- type: :development
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -106,6 +106,7 @@ files:
106
106
  - README.md
107
107
  - Rakefile
108
108
  - TODO
109
+ - bin/test
109
110
  - doc/.cvsignore
110
111
  - examples/ansi_colors.rb
111
112
  - examples/asking_for_arrays.rb
@@ -156,7 +157,8 @@ files:
156
157
  homepage: https://github.com/JEG2/highline
157
158
  licenses:
158
159
  - Ruby
159
- metadata: {}
160
+ metadata:
161
+ changelog_uri: https://github.com/JEG2/highline/blob/master/Changelog.md
160
162
  post_install_message:
161
163
  rdoc_options: []
162
164
  require_paths:
@@ -172,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
174
  - !ruby/object:Gem::Version
173
175
  version: '0'
174
176
  requirements: []
175
- rubygems_version: 3.5.3
177
+ rubygems_version: 3.5.11
176
178
  signing_key:
177
179
  specification_version: 4
178
180
  summary: HighLine is a high-level command-line IO library.