highline 3.1.0 → 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: 68bd1dba0eea8f51020e4b42bf027a432313b312efcf1365c20a6d5ca2b13244
4
- data.tar.gz: d1dd90401ba1b29581afe8e89ef5a2ad3b443184e61f73dd7a60252404c30172
3
+ metadata.gz: a711e47ab4e364e5f470dfd8bb716028fce1eaf32134470b4f355d9323a5eb60
4
+ data.tar.gz: 931ccc44047bba2fa2c52521ce8eed9183cbe27fffc1a652ef79c7ed9f406443
5
5
  SHA512:
6
- metadata.gz: b7bcd45c71419a9e90c9cdc9f1dba9c42be76618068cadc8e30e41600272413b16df3cd95d95266fc4d24d70c00c53668f6fe7134fb1e5cee4780740eabc2378
7
- data.tar.gz: 20cfca01c3f433766f9d0884b5ea32dcfa690e6b3652fc6aeb9e691f5eb62f1ffc99ec9941fe724603684b660d374af23b8819054a1e5dfffb5655ff8107df1e
6
+ metadata.gz: 14ccf0f79acbebd05e46b8ec4c598356bf6d64eeb4808b471e8df61f5fa056656a27c2d029a13fb3a82f3f04c979f75a7578ceed3e5848b1165a237648816e60
7
+ data.tar.gz: 2bd934d2e17bf4f4e4fe180317962c1eeddebdae80ac423d54ba689579ee2ed25ea81cbf2a106bcab705297d6866effb8faece92c6d76ec268cfa2a4b2bec367
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,12 @@
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
+
5
11
  ### 3.1.0 / 2024-07-15
6
12
  * PR #272 / I #271 - Readline is now completed deprecated over Reline (@abinoam, issue by @64kramsystem)
7
13
  * PR #269 - Provide a 'Changelog' link on rubygems.org/gems/highline (@mark-young-atg)
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 )
@@ -2,5 +2,5 @@
2
2
 
3
3
  class HighLine
4
4
  # The version of the installed library.
5
- VERSION = "3.1.0".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.1.0
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-07-15 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
@@ -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
@@ -173,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
174
  - !ruby/object:Gem::Version
174
175
  version: '0'
175
176
  requirements: []
176
- rubygems_version: 3.5.9
177
+ rubygems_version: 3.5.11
177
178
  signing_key:
178
179
  specification_version: 4
179
180
  summary: HighLine is a high-level command-line IO library.