fancy_irb 1.1.0 → 1.4.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
- SHA1:
3
- metadata.gz: 2a97871a844939aa181c7e03bbf1054c74d1e97e
4
- data.tar.gz: 04ef4e6f02a68d4b4971c4264ff6521383d827d6
2
+ SHA256:
3
+ metadata.gz: 40508c0d3a64506b5878d27b75d223fa1b645ec0982ada74b79b8b9253a60a0c
4
+ data.tar.gz: dbd263da91f17746e6206445f7cba2e3d1f000e90e8afe729188a9c661b44d92
5
5
  SHA512:
6
- metadata.gz: d769722f7cfba9e17932458884fb41dfb46a498dee86dd79081ace353c59b0c4cbf0726cabe00dc6507da14eb4cee4aa6b35a5aaf1919653aa909cb09b5a9974
7
- data.tar.gz: 0f51d36feac350499e31835c60772f48304d4f60a1b4c6cef7ca345cecf0441df6c1434a44bba565750fe74e993a9a2192e3a15c4f1bcdd6e46065c761e8bd7a
6
+ metadata.gz: e69ece654e7fcf989e9e29fb934c4766a397cd45a1596134e91727985f79c7e8d09f4f493b10a13cbbea3cd84fac2384b9c1e75d423908c6a362ebc801b5d824
7
+ data.tar.gz: 445abebc2567df925338440eb143e51f314987a0803f0930d24acb708cd25f11dba6bcef7f06b180c1e42f2785c46a0e6df7494435842a2d8bd55926b3ecfe79
@@ -1,5 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.1
4
+ * Relax unicode-display_width requirement
5
+
6
+ ## 1.4.0
7
+ * Full support for non-ttys
8
+
9
+ ## 1.3.0
10
+ * Use `script` wrapper on linux in case we are not on a tty
11
+
12
+ ## 1.2.1
13
+ * Fix 2.7 keyword warning
14
+
15
+ ## 1.2.0
16
+ * Read indentation level directly so it won't fail on newer Rubies
17
+
3
18
  ## 1.1.0
4
19
  * Rename `east_asian_width` option to `unicode_display_width` and activate by default
5
20
  * Relax paint dependency
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2012, 2015-2017 Jan Lelis
1
+ Copyright (c) 2010-2012, 2015-2021 Jan Lelis
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
- # FancyIrb [![version](https://badge.fury.io/rb/fancy_irb.svg)](http://badge.fury.io/rb/fancy_irb)
1
+ # FancyIrb [![version](https://badge.fury.io/rb/fancy_irb.svg)](https://badge.fury.io/rb/fancy_irb) [![[ci]](https://github.com/janlelis/fancy_irb/workflows/Test/badge.svg)](https://github.com/janlelis/fancy_irb/actions?query=workflow%3ATest)
2
2
 
3
3
  * Colorizes IRB prompts, errors, `$stderr` and `$stdout`
4
4
  * Uses "Hash Rockets" (# =>) to display IRB results
5
5
 
6
-
7
6
  ## Usage
8
7
 
9
8
  require 'fancy_irb'
@@ -32,9 +31,7 @@ Rocket mode means: Output result as comment if there is enough space left on
32
31
  the terminal line and `stdout` does not output more than the current terminal
33
32
  height.
34
33
 
35
- For more information on which colors can be used, see the [paint
36
- documentation](https://github.com/janlelis/paint).
37
-
34
+ For more information on which colors can be used, see the [paint documentation](https://github.com/janlelis/paint).
38
35
 
39
36
  ## Troubleshooting
40
37
  ### Windows Support
@@ -49,9 +46,8 @@ lookup of every character. You can deactivate this check by setting
49
46
  Not all stdin methods are patched properly to work with the rocket: The gems
50
47
  focuses on the often used ones
51
48
 
52
-
53
49
  ## J-_-L
54
50
  Inspired by the irb_rocket gem by genki.
55
51
 
56
- Copyright (c) 2010-2012, 2015-2017 Jan Lelis <http://janlelis.com> released under
52
+ Copyright (c) 2010-2012, 2015-2021 Jan Lelis <https://janlelis.com> released under
57
53
  the MIT license.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  desc "Install the gem locally (without docs)"
17
17
  task :install => :gem do
18
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-rdoc --no-ri --local}
18
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-doc --local}
19
19
  end
20
20
 
21
21
  desc "Generate the gemspec"
@@ -6,15 +6,15 @@ Gem::Specification.new do |s|
6
6
  s.name = "fancy_irb"
7
7
  s.version = FancyIrb::VERSION
8
8
  s.authors = ["Jan Lelis"]
9
- s.email = "mail@janlelis.de"
10
- s.homepage = "http://github.com/janlelis/fancy_irb"
11
- s.summary = "FancyIrb makes IRB friendly."
12
- s.description = "FancyIrb makes IRB # => friendly."
9
+ s.email = ["hi@ruby.consulting"]
10
+ s.homepage = "https://github.com/janlelis/fancy_irb"
11
+ s.summary = "FancyIrb makes IRB # => friendly."
12
+ s.description = "A fancy IRB has a colorful input prompt and profiles rocket-style #=> return values"
13
13
  s.required_ruby_version = '>= 1.9.3'
14
14
  s.license = 'MIT'
15
15
  s.requirements = ['Windows: ansicon <https://github.com/adoxa/ansicon>']
16
16
  s.add_dependency 'paint', '>= 0.9', '< 3.0'
17
- s.add_dependency 'unicode-display_width', "~> 1.1"
17
+ s.add_dependency 'unicode-display_width', ">= 1.1"
18
18
  s.add_development_dependency 'rspec', "~> 3.2"
19
19
  s.add_development_dependency 'rake', "~> 10.4"
20
20
  s.files = [
@@ -8,7 +8,7 @@ module IRB
8
8
  def prompt(*args, &block)
9
9
  FancyIrb.handle_prompt(
10
10
  prompt_non_fancy(*args, &block),
11
- IRB.conf[:AUTO_INDENT] ? @scanner.indent * 2 : 0,
11
+ IRB.conf[:AUTO_INDENT] ? @scanner.instance_variable_get(:@indent) * 2 : 0,
12
12
  IRB.conf[:AUTO_INDENT] && IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]][:PROMPT_C] == args[0]
13
13
  )
14
14
  end
@@ -27,8 +27,8 @@ module IRB
27
27
  class Context
28
28
  alias evaluate_non_fancy evaluate
29
29
 
30
- def evaluate(*args)
31
- evaluate_non_fancy(*args)
30
+ def evaluate(*args, **kwargs)
31
+ evaluate_non_fancy(*args, **kwargs)
32
32
  rescue Exception
33
33
  FancyIrb.register_error_capturer!
34
34
  raise
@@ -4,25 +4,45 @@ module FancyIrb
4
4
  module TerminalInfo
5
5
  def self.lines
6
6
  STDOUT.winsize[0]
7
+ rescue Errno::ENOTTY
8
+ ENV['LINES'] || ENV['ROWS'] || 25
7
9
  end
8
10
 
9
11
  def self.cols
10
12
  STDOUT.winsize[1]
13
+ rescue Errno::ENOTTY
14
+ ENV['COLUMNS'] || 80
11
15
  end
12
16
 
13
- if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
17
+ begin
18
+ if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
19
+ TPUT = {
20
+ :sc => "\e[s",
21
+ :rc => "\e[u",
22
+ :cuu1 => "\e[1A",
23
+ :cuf1 => "\e[1C",
24
+ }
25
+ elsif RbConfig::CONFIG['host_os'] =~ /linux/
26
+ TPUT = {
27
+ :sc => `script -q -e -t /dev/null -c 'tput sc'`,
28
+ :rc => `script -q -e -t /dev/null -c 'tput rc'`,
29
+ :cuu1 => `script -q -e -t /dev/null -c 'tput cuu1'`,
30
+ :cuf1 => `script -q -e -t /dev/null -c 'tput cuf1'`,
31
+ }
32
+ else
33
+ TPUT = {
34
+ :sc => `tput sc`,
35
+ :rc => `tput rc`,
36
+ :cuu1 => `tput cuu1`,
37
+ :cuf1 => `tput cuf1`,
38
+ }
39
+ end
40
+ rescue Errno::ENOTTY
14
41
  TPUT = {
15
- :sc => "\e[s",
16
- :rc => "\e[u",
17
- :cuu1 => "\e[1A",
18
- :cuf1 => "\e[1C",
19
- }
20
- else
21
- TPUT = {
22
- :sc => `tput sc`,
23
- :rc => `tput rc`,
24
- :cuu1 => `tput cuu1`,
25
- :cuf1 => `tput cuf1`,
42
+ :sc => "\e7",
43
+ :rc => "\e8",
44
+ :cuu1 => "\e[A",
45
+ :cuf1 => "\e[C",
26
46
  }
27
47
  end
28
48
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FancyIrb
2
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.4.1'
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancy_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-18 00:00:00.000000000 Z
11
+ date: 2021-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -34,14 +34,14 @@ dependencies:
34
34
  name: unicode-display_width
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.1'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.1'
47
47
  - !ruby/object:Gem::Dependency
@@ -72,8 +72,10 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '10.4'
75
- description: 'FancyIrb makes IRB # => friendly.'
76
- email: mail@janlelis.de
75
+ description: 'A fancy IRB has a colorful input prompt and profiles rocket-style #=>
76
+ return values'
77
+ email:
78
+ - hi@ruby.consulting
77
79
  executables: []
78
80
  extensions: []
79
81
  extra_rdoc_files: []
@@ -95,7 +97,7 @@ files:
95
97
  - lib/fancy_irb/version.rb
96
98
  - spec/fixtures.rb
97
99
  - spec/size_detector_spec.rb
98
- homepage: http://github.com/janlelis/fancy_irb
100
+ homepage: https://github.com/janlelis/fancy_irb
99
101
  licenses:
100
102
  - MIT
101
103
  metadata: {}
@@ -115,9 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
117
  version: '0'
116
118
  requirements:
117
119
  - 'Windows: ansicon <https://github.com/adoxa/ansicon>'
118
- rubyforge_project:
119
- rubygems_version: 2.6.8
120
+ rubygems_version: 3.2.3
120
121
  signing_key:
121
122
  specification_version: 4
122
- summary: FancyIrb makes IRB friendly.
123
+ summary: 'FancyIrb makes IRB # => friendly.'
123
124
  test_files: []