everyday_thor_util 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/everyday_thor_util/thor-print-fix.rb +27 -0
- data/lib/everyday_thor_util/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19d49fbd6591fd684d5c684ebf9215d7c3507ca
|
4
|
+
data.tar.gz: cdacc891ee3e2fb9255d4d96771e94dd0dba07cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a17147bb09fd04dbc83e4237e1c14cb5fbed22446f55c0fe1475ce0bf6f5c3a8b39a55889f9fbe9b09557d413b8970f7e3b7a12d63b0f37b4b3bb82c5724779
|
7
|
+
data.tar.gz: 7ce042f07c62cd5016a7ed957ec0f8a788bf80c013cb24b4dd4057229bcaddbd6e9d27330ac9d49301d1d8f68440cfef54239477cab1a4f9adf414b4bee48b84
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
everyday_thor_util (2.0.
|
4
|
+
everyday_thor_util (2.0.7)
|
5
5
|
everyday-plugins (~> 1.2, >= 1.2.1)
|
6
6
|
thor (~> 0.19)
|
7
7
|
|
@@ -11,8 +11,8 @@ GEM
|
|
11
11
|
everyday-cli-utils (1.8.7.1)
|
12
12
|
everyday-plugins (1.2.1)
|
13
13
|
everyday-cli-utils (~> 1.8, >= 1.8.6)
|
14
|
-
rake (
|
15
|
-
thor (0.19.
|
14
|
+
rake (12.0.0)
|
15
|
+
thor (0.19.4)
|
16
16
|
|
17
17
|
PLATFORMS
|
18
18
|
ruby
|
@@ -23,4 +23,4 @@ DEPENDENCIES
|
|
23
23
|
rake
|
24
24
|
|
25
25
|
BUNDLED WITH
|
26
|
-
1.
|
26
|
+
1.15.1
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'io/console'
|
2
|
+
class Thor
|
3
|
+
module Shell
|
4
|
+
class Basic
|
5
|
+
def print_wrapped(message, options = {})
|
6
|
+
indent = options[:indent] || 0
|
7
|
+
width = terminal_width - indent
|
8
|
+
paras = message.split("\n\n")
|
9
|
+
min_space_length = paras.map{|para| para.gsub(/^(\s*)\S.*$/, '\1').length }.min
|
10
|
+
|
11
|
+
paras.map! do |unwrapped|
|
12
|
+
unwrapped.gsub(/(^|\005)([ ]+)/) { "#{$1}#{"\0" * ($2.length - min_space_length)}" }.strip.tr("\n", " ").squeeze(" ").gsub(/.{1,#{width}}(?:\s|\Z)/) { ($& + 5.chr).gsub(/\n\005/, "\n").gsub(/\005/, "\n").gsub(/\0/, ' ') }
|
13
|
+
end
|
14
|
+
|
15
|
+
paras.each do |para|
|
16
|
+
para.split("\n").each do |line|
|
17
|
+
stdout.puts line.insert(0, " " * indent)
|
18
|
+
end
|
19
|
+
stdout.puts unless para == paras.last
|
20
|
+
end
|
21
|
+
end
|
22
|
+
def dynamic_width
|
23
|
+
IO.console.winsize[1]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everyday_thor_util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/everyday_thor_util/common.rb
|
94
94
|
- lib/everyday_thor_util/plugin-helper.rb
|
95
95
|
- lib/everyday_thor_util/thor-fix.rb
|
96
|
+
- lib/everyday_thor_util/thor-print-fix.rb
|
96
97
|
- lib/everyday_thor_util/version.rb
|
97
98
|
homepage: https://github.com/henderea/everyday_thor_util
|
98
99
|
licenses:
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: '0'
|
115
116
|
requirements: []
|
116
117
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.6.12
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: 'Two parts: everyday_thor_util/thor-fix has a patch for Thor and everyday_thor_util/plugin-helper
|