lovely_rufus 1.0.0 → 1.1.0
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 +5 -5
- data/.overcommit.yml +4 -0
- data/.reek.yml +3 -0
- data/.rubocop.yml +18 -6
- data/.tool-versions +1 -0
- data/.travis.yml +11 -3
- data/README.md +1 -1
- data/Rakefile +2 -1
- data/bin/lovely-rufus +0 -1
- data/gems.locked +99 -0
- data/lib/lovely_rufus/cli_wrapper.rb +3 -1
- data/lib/lovely_rufus/layers/basic_wrapper.rb +4 -2
- data/lib/lovely_rufus/layers/code_comment_stripper.rb +1 -3
- data/lib/lovely_rufus/layers/email_quote_stripper.rb +2 -1
- data/lib/lovely_rufus/layers/hangout_wrapper.rb +40 -26
- data/lib/lovely_rufus/layers/layer.rb +5 -3
- data/lib/lovely_rufus/layers/one_letter_gluer.rb +2 -1
- data/lib/lovely_rufus/layers/quote_stripper.rb +3 -3
- data/lib/lovely_rufus/text_wrapper.rb +16 -14
- data/lib/lovely_rufus/wrap.rb +1 -1
- data/lib/lovely_rufus.rb +0 -3
- data/lovely_rufus.gemspec +9 -16
- data/test/lovely_rufus/cli_wrapper_test.rb +4 -4
- data/test/lovely_rufus/layers/basic_wrapper_test.rb +7 -7
- data/test/lovely_rufus/layers/code_comment_stripper_test.rb +17 -17
- data/test/lovely_rufus/layers/email_quote_stripper_test.rb +20 -20
- data/test/lovely_rufus/layers/hangout_wrapper_test.rb +6 -6
- data/test/lovely_rufus/layers/one_letter_gluer_test.rb +3 -3
- data/test/lovely_rufus/settings_test.rb +2 -2
- data/test/lovely_rufus/text_wrapper_test.rb +7 -7
- data/test/lovely_rufus_test.rb +5 -3
- data/test/test_helper.rb +10 -13
- metadata +28 -89
- checksums.yaml.gz.sig +0 -0
- data/.reek +0 -2
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -85
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
- /data/{Gemfile → gems.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be467f0b20918a42ef34081961d5522dcb7eaa6b6d7f2a0c9a8e9c0287642ef1
|
4
|
+
data.tar.gz: d4636e37e170298535f91232c0be8f97d5136b845eae4b3d87e9678130a62875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f2c2b19b693943371a4f2a5c8a5250bf84660442a8f169349f9d6b16ee6820460ffe52feb22deb5ee8c705864879d45fed15639fd6eadddc206b3d3da65bde3
|
7
|
+
data.tar.gz: 3769f17bce00f125f70abef732e6c934c5cdf7a1844296583daa7d1de099eaf155464b271b56c30a770770a167304929d0b9ad6e01c64c4b63e67dde5f85a9c2
|
data/.overcommit.yml
ADDED
data/.reek.yml
ADDED
data/.rubocop.yml
CHANGED
@@ -1,12 +1,24 @@
|
|
1
|
-
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
TargetRubyVersion: 3.0
|
4
|
+
|
5
|
+
Bundler/GemFilename:
|
2
6
|
Enabled: false
|
3
7
|
|
4
|
-
|
8
|
+
Gemspec/DevelopmentDependencies:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Metrics/BlockLength:
|
12
|
+
AllowedMethods: describe
|
13
|
+
|
14
|
+
Naming/HeredocDelimiterCase:
|
5
15
|
Enabled: false
|
6
16
|
|
7
|
-
|
8
|
-
|
9
|
-
|
17
|
+
Naming/HeredocDelimiterNaming:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Style/Documentation:
|
21
|
+
Enabled: false
|
10
22
|
|
11
|
-
Style/
|
23
|
+
Style/FrozenStringLiteralComment:
|
12
24
|
Enabled: false
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.6.6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -64,4 +64,4 @@ Lovely Rufus was created as a [Ruby Mendicant University](http://blog.majesticse
|
|
64
64
|
|
65
65
|
---
|
66
66
|
|
67
|
-
© MMX-
|
67
|
+
© MMX-MMXIX Piotr Szotkowski <chastell@chastell.net>, licensed under AGPL-3.0 (see LICENCE)
|
data/Rakefile
CHANGED
data/bin/lovely-rufus
CHANGED
data/gems.locked
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
lovely_rufus (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.3)
|
10
|
+
bigdecimal (3.1.9)
|
11
|
+
concurrent-ruby (1.3.5)
|
12
|
+
dry-configurable (1.2.0)
|
13
|
+
dry-core (~> 1.0, < 2)
|
14
|
+
zeitwerk (~> 2.6)
|
15
|
+
dry-core (1.0.2)
|
16
|
+
concurrent-ruby (~> 1.0)
|
17
|
+
logger
|
18
|
+
zeitwerk (~> 2.6)
|
19
|
+
dry-inflector (1.1.0)
|
20
|
+
dry-initializer (3.1.1)
|
21
|
+
dry-logic (1.5.0)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-core (~> 1.0, < 2)
|
24
|
+
zeitwerk (~> 2.6)
|
25
|
+
dry-schema (1.13.4)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-configurable (~> 1.0, >= 1.0.1)
|
28
|
+
dry-core (~> 1.0, < 2)
|
29
|
+
dry-initializer (~> 3.0)
|
30
|
+
dry-logic (>= 1.4, < 2)
|
31
|
+
dry-types (>= 1.7, < 2)
|
32
|
+
zeitwerk (~> 2.6)
|
33
|
+
dry-types (1.7.2)
|
34
|
+
bigdecimal (~> 3.0)
|
35
|
+
concurrent-ruby (~> 1.0)
|
36
|
+
dry-core (~> 1.0)
|
37
|
+
dry-inflector (~> 1.0)
|
38
|
+
dry-logic (~> 1.4)
|
39
|
+
zeitwerk (~> 2.6)
|
40
|
+
json (2.12.0)
|
41
|
+
language_server-protocol (3.17.0.5)
|
42
|
+
lint_roller (1.1.0)
|
43
|
+
logger (1.7.0)
|
44
|
+
minitest (5.25.5)
|
45
|
+
minitest-focus (1.4.0)
|
46
|
+
minitest (>= 4, < 6)
|
47
|
+
mocha (2.7.1)
|
48
|
+
ruby2_keywords (>= 0.0.5)
|
49
|
+
parallel (1.27.0)
|
50
|
+
parser (3.3.8.0)
|
51
|
+
ast (~> 2.4.1)
|
52
|
+
racc
|
53
|
+
prism (1.4.0)
|
54
|
+
racc (1.8.1)
|
55
|
+
rainbow (3.1.1)
|
56
|
+
rake (13.2.1)
|
57
|
+
reek (6.4.0)
|
58
|
+
dry-schema (~> 1.13.0)
|
59
|
+
logger (~> 1.6)
|
60
|
+
parser (~> 3.3.0)
|
61
|
+
rainbow (>= 2.0, < 4.0)
|
62
|
+
rexml (~> 3.1)
|
63
|
+
regexp_parser (2.10.0)
|
64
|
+
rexml (3.4.1)
|
65
|
+
rubocop (1.75.6)
|
66
|
+
json (~> 2.3)
|
67
|
+
language_server-protocol (~> 3.17.0.2)
|
68
|
+
lint_roller (~> 1.1.0)
|
69
|
+
parallel (~> 1.10)
|
70
|
+
parser (>= 3.3.0.2)
|
71
|
+
rainbow (>= 2.2.2, < 4.0)
|
72
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
73
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
74
|
+
ruby-progressbar (~> 1.7)
|
75
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
76
|
+
rubocop-ast (1.44.1)
|
77
|
+
parser (>= 3.3.7.2)
|
78
|
+
prism (~> 1.4)
|
79
|
+
ruby-progressbar (1.13.0)
|
80
|
+
ruby2_keywords (0.0.5)
|
81
|
+
unicode-display_width (3.1.4)
|
82
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
83
|
+
unicode-emoji (4.0.4)
|
84
|
+
zeitwerk (2.6.18)
|
85
|
+
|
86
|
+
PLATFORMS
|
87
|
+
ruby
|
88
|
+
|
89
|
+
DEPENDENCIES
|
90
|
+
lovely_rufus!
|
91
|
+
minitest (~> 5.6)
|
92
|
+
minitest-focus (~> 1.1)
|
93
|
+
mocha (~> 2.7)
|
94
|
+
rake (~> 13.0)
|
95
|
+
reek (~> 6.0)
|
96
|
+
rubocop (~> 1.0)
|
97
|
+
|
98
|
+
BUNDLED WITH
|
99
|
+
2.5.23
|
@@ -4,10 +4,12 @@ require_relative 'layer'
|
|
4
4
|
module LovelyRufus
|
5
5
|
module Layers
|
6
6
|
class BasicWrapper < Layer
|
7
|
+
# :reek:FeatureEnvy
|
7
8
|
def call(wrap)
|
9
|
+
width = wrap.width
|
8
10
|
unwrapped = wrap.text.tr("\n", ' ').strip
|
9
|
-
wrapped = unwrapped.gsub(/(.{1,#{
|
10
|
-
next_layer.call(Wrap[wrapped, width:
|
11
|
+
wrapped = unwrapped.gsub(/(.{1,#{width}})( |$\n?)/, "\\1\n")
|
12
|
+
next_layer.call(Wrap[wrapped, width: width])
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -2,13 +2,14 @@ require_relative 'quote_stripper'
|
|
2
2
|
|
3
3
|
module LovelyRufus
|
4
4
|
module Layers
|
5
|
+
# :reek:UnusedPrivateMethod
|
5
6
|
class EmailQuoteStripper < QuoteStripper
|
6
7
|
QUOTES = /^>[> ]*/
|
7
8
|
|
8
9
|
private
|
9
10
|
|
10
11
|
def fixed_quote
|
11
|
-
quote.
|
12
|
+
quote.empty? ? '' : "#{quote.delete(' ')} "
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -11,47 +11,61 @@ module LovelyRufus
|
|
11
11
|
next_layer.call(final)
|
12
12
|
end
|
13
13
|
|
14
|
-
private_attr_reader :wrap
|
15
|
-
|
16
14
|
private
|
17
15
|
|
18
|
-
|
19
|
-
module_function
|
16
|
+
attr_reader :wrap
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
class HangoutFinder
|
19
|
+
def initialize(upper, lower, last)
|
20
|
+
@upper = upper
|
21
|
+
@lower = lower
|
22
|
+
@last = last
|
24
23
|
end
|
25
24
|
|
26
|
-
def
|
27
|
-
|
28
|
-
a_after = line_a[0...cut] + "\n"
|
29
|
-
b_after = line_a[(cut + 1)..-1] + line_b
|
30
|
-
b_after.chomp.rindex(/\p{space}/) > a_after.size
|
25
|
+
def hangout?
|
26
|
+
exists? and useful_fix?
|
31
27
|
end
|
32
|
-
end
|
33
28
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
private
|
30
|
+
|
31
|
+
attr_reader :lower, :upper
|
32
|
+
|
33
|
+
def exists?
|
34
|
+
last_space = upper.chomp.rindex(/\p{space}/)
|
35
|
+
last_space and last_space >= lower.chomp.size
|
36
|
+
end
|
37
|
+
|
38
|
+
def last?
|
39
|
+
@last
|
40
|
+
end
|
41
|
+
|
42
|
+
def useful_fix?
|
43
|
+
return true unless last?
|
44
|
+
|
45
|
+
cut = upper.chomp.rindex(/\p{space}/)
|
46
|
+
upper_after = "#{upper[0...cut]}\n"
|
47
|
+
lower_after = upper[(cut + 1)..] + lower
|
48
|
+
lower_after.chomp.rindex(/\p{space}/) <= upper_after.size
|
39
49
|
end
|
40
50
|
end
|
41
51
|
|
42
|
-
|
43
|
-
|
52
|
+
# :reek:DuplicateMethodCall
|
53
|
+
def hangout_line
|
54
|
+
wrap.lines.each_cons(2).with_index do |(upper, lower), index|
|
55
|
+
finder = HangoutFinder.new(upper, lower, index == wrap.lines.size - 2)
|
56
|
+
return index if finder.hangout?
|
57
|
+
end
|
44
58
|
end
|
45
59
|
|
60
|
+
# :reek:TooManyStatements
|
46
61
|
def rewrapped
|
47
|
-
|
62
|
+
index = hangout_line
|
63
|
+
new_lines = wrap.lines.dup
|
64
|
+
new_lines[index] = "#{new_lines[index][0...-1]} "
|
65
|
+
unfolded = Wrap[new_lines.join, width: wrap.width]
|
66
|
+
wrapped = BasicWrapper.new.call(unfolded)
|
48
67
|
HangoutWrapper.new.call(wrapped)
|
49
68
|
end
|
50
|
-
|
51
|
-
def wrapped
|
52
|
-
unfolded = Wrap[lines.join, width: wrap.width]
|
53
|
-
BasicWrapper.new.call(unfolded)
|
54
|
-
end
|
55
69
|
end
|
56
70
|
end
|
57
71
|
end
|
@@ -1,15 +1,17 @@
|
|
1
1
|
module LovelyRufus
|
2
2
|
module Layers
|
3
3
|
class Layer
|
4
|
-
def initialize(next_layer = ->
|
4
|
+
def initialize(next_layer = ->(wrap) { wrap })
|
5
5
|
@next_layer = next_layer
|
6
6
|
end
|
7
7
|
|
8
8
|
def call(_wrap)
|
9
|
-
|
9
|
+
raise 'Layer subclasses must define #call that takes a Wrap'
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
private
|
13
|
+
|
14
|
+
attr_reader :next_layer
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -4,9 +4,10 @@ require_relative 'layer'
|
|
4
4
|
module LovelyRufus
|
5
5
|
module Layers
|
6
6
|
class OneLetterGluer < Layer
|
7
|
+
# :reek:FeatureEnvy
|
7
8
|
def call(wrap)
|
8
9
|
pattern = /(?<=\p{space})(&|\p{letter})\p{space}/
|
9
|
-
text = wrap.text.gsub(pattern,
|
10
|
+
text = wrap.text.gsub(pattern, '\1\2 ')
|
10
11
|
next_layer.call(Wrap[text, width: wrap.width])
|
11
12
|
end
|
12
13
|
end
|
@@ -11,17 +11,17 @@ module LovelyRufus
|
|
11
11
|
Wrap[quoted, width: wrapped.width + fixed_quote.size]
|
12
12
|
end
|
13
13
|
|
14
|
-
private_attr_reader :wrap
|
15
|
-
|
16
14
|
private
|
17
15
|
|
16
|
+
attr_reader :wrap
|
17
|
+
|
18
18
|
def quote
|
19
19
|
starts = wrap.lines.map { |line| line[self.class::QUOTES] }.uniq
|
20
20
|
starts.size == 1 ? starts.first || '' : ''
|
21
21
|
end
|
22
22
|
|
23
23
|
def stripped_wrap
|
24
|
-
stripped_text = wrap.lines.map { |line| line[quote.size
|
24
|
+
stripped_text = wrap.lines.map { |line| line[quote.size..] }.join
|
25
25
|
Wrap[stripped_text, width: wrap.width - fixed_quote.size]
|
26
26
|
end
|
27
27
|
end
|
@@ -7,33 +7,35 @@ require_relative 'wrap'
|
|
7
7
|
|
8
8
|
module LovelyRufus
|
9
9
|
class TextWrapper
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
class << self
|
11
|
+
def chain
|
12
|
+
layers = [Layers::CodeCommentStripper, Layers::EmailQuoteStripper,
|
13
|
+
Layers::OneLetterGluer, Layers::BasicWrapper,
|
14
|
+
Layers::HangoutWrapper]
|
15
|
+
identity = ->(wrap) { wrap }
|
16
|
+
layers.reverse.reduce(identity) { |inner, outer| outer.new(inner) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def wrap(text, width: 72)
|
20
|
+
new(Wrap[text, width: width]).call
|
21
|
+
end
|
14
22
|
end
|
15
23
|
|
24
|
+
QUOTES = %r{^([>/#])(\1| )*}
|
25
|
+
|
16
26
|
def initialize(wrap)
|
17
27
|
@wrap = wrap
|
18
28
|
end
|
19
29
|
|
20
30
|
def call
|
21
31
|
paras.map do |para|
|
22
|
-
chain.call(Wrap[para, width: wrap.width]).text.tr(
|
32
|
+
self.class.chain.call(Wrap[para, width: wrap.width]).text.tr(' ', ' ')
|
23
33
|
end.join("\n")
|
24
34
|
end
|
25
35
|
|
26
|
-
private_attr_reader :wrap
|
27
|
-
|
28
36
|
private
|
29
37
|
|
30
|
-
|
31
|
-
layers = [Layers::CodeCommentStripper, Layers::EmailQuoteStripper,
|
32
|
-
Layers::OneLetterGluer, Layers::BasicWrapper,
|
33
|
-
Layers::HangoutWrapper]
|
34
|
-
identity = -> (wrap) { wrap }
|
35
|
-
layers.reverse.reduce(identity) { |inner, outer| outer.new(inner) }
|
36
|
-
end
|
38
|
+
attr_reader :wrap
|
37
39
|
|
38
40
|
def paras
|
39
41
|
wrap.text.split(/\n#{QUOTES}?\n/).reject { |par| par[/^(#{QUOTES}| )$/] }
|
data/lib/lovely_rufus/wrap.rb
CHANGED
data/lib/lovely_rufus.rb
CHANGED
data/lovely_rufus.gemspec
CHANGED
@@ -7,29 +7,22 @@ Gem::Specification.new do |gem|
|
|
7
7
|
'paragraphs of text.'
|
8
8
|
gem.email = 'chastell@chastell.net'
|
9
9
|
gem.homepage = 'http://github.com/chastell/lovely_rufus'
|
10
|
-
gem.license = 'AGPL-3.0'
|
10
|
+
gem.license = 'AGPL-3.0-or-later'
|
11
11
|
gem.name = 'lovely_rufus'
|
12
12
|
gem.summary = 'lovely_rufus: text wrapper'
|
13
|
-
gem.version = '1.
|
13
|
+
gem.version = '1.1.0'
|
14
14
|
|
15
|
-
gem.required_ruby_version = '~>
|
15
|
+
gem.required_ruby_version = '~> 3.0'
|
16
16
|
|
17
17
|
gem.files = `git ls-files -z`.split("\0")
|
18
18
|
gem.executables = gem.files.grep(%r{^bin/}).map { |path| File.basename(path) }
|
19
|
-
gem.test_files = gem.files.grep(%r{^test/.*\.rb$})
|
20
19
|
|
21
|
-
gem.cert_chain = ['certs/chastell.pem']
|
22
|
-
if Pathname.new($PROGRAM_NAME).basename == Pathname.new('gem')
|
23
|
-
gem.signing_key = Pathname.new('~/.ssh/gem-private_key.pem').expand_path
|
24
|
-
end
|
25
|
-
|
26
|
-
gem.add_dependency 'private_attr', '~> 1.1'
|
27
|
-
|
28
|
-
gem.add_development_dependency 'bogus', '~> 0.1.4'
|
29
20
|
gem.add_development_dependency 'minitest', '~> 5.6'
|
30
21
|
gem.add_development_dependency 'minitest-focus', '~> 1.1'
|
31
|
-
gem.add_development_dependency '
|
32
|
-
gem.add_development_dependency '
|
33
|
-
gem.add_development_dependency '
|
34
|
-
gem.add_development_dependency 'rubocop', '~>
|
22
|
+
gem.add_development_dependency 'mocha', '~> 2.7'
|
23
|
+
gem.add_development_dependency 'rake', '~> 13.0'
|
24
|
+
gem.add_development_dependency 'reek', '~> 6.0'
|
25
|
+
gem.add_development_dependency 'rubocop', '~> 1.0'
|
26
|
+
|
27
|
+
gem.metadata['rubygems_mfa_required'] = 'true'
|
35
28
|
end
|
@@ -7,20 +7,20 @@ module LovelyRufus
|
|
7
7
|
describe '#run' do
|
8
8
|
let(:stream) { StringIO.new(text) }
|
9
9
|
let(:text) { "all right: stop, collaborate and listen\n" }
|
10
|
-
let(:text_wrapper) {
|
10
|
+
let(:text_wrapper) { mock.quacks_like(TextWrapper) }
|
11
11
|
|
12
12
|
it 'reads the passed stream to TextWrapper and prints the results' do
|
13
|
-
|
13
|
+
text_wrapper.stubs(:wrap).with(text, width: 72).returns(text)
|
14
14
|
_(lambda do
|
15
15
|
CLIWrapper.new(text_wrapper: text_wrapper).run stream
|
16
16
|
end).must_output text
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'accepts the desired width and passes it to TextWrapper' do
|
20
|
+
text_wrapper.expects(:wrap).with(text, width: 22).returns(text)
|
20
21
|
capture_io do
|
21
|
-
CLIWrapper.new(%w
|
22
|
+
CLIWrapper.new(%w[--width=22], text_wrapper: text_wrapper).run stream
|
22
23
|
end
|
23
|
-
_(text_wrapper).must_have_received :wrap, [text, { width: 22 }]
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -8,8 +8,8 @@ module LovelyRufus
|
|
8
8
|
describe '#call' do
|
9
9
|
it 'wraps text to the given width' do
|
10
10
|
text = 'I go crazy when I hear a cymbal and a hi-hat ' \
|
11
|
-
|
12
|
-
wrap =
|
11
|
+
'with a souped-up tempo'
|
12
|
+
wrap = <<~end
|
13
13
|
I go crazy when I hear
|
14
14
|
a cymbal and a hi-hat
|
15
15
|
with a souped-up tempo
|
@@ -20,7 +20,7 @@ module LovelyRufus
|
|
20
20
|
|
21
21
|
it 'extends past the given width when necessary' do
|
22
22
|
text = 'I’m killing your brain like a poisonous mushroom'
|
23
|
-
wrap =
|
23
|
+
wrap = <<~end
|
24
24
|
I’m
|
25
25
|
killing
|
26
26
|
your
|
@@ -35,7 +35,7 @@ module LovelyRufus
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'rewraps a String from zero' do
|
38
|
-
text =
|
38
|
+
text = <<~end
|
39
39
|
turn off
|
40
40
|
the lights and I’ll glow
|
41
41
|
end
|
@@ -44,9 +44,9 @@ module LovelyRufus
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'passes the fixed text to the next layer and returns its outcome' do
|
47
|
-
final =
|
48
|
-
layer =
|
49
|
-
|
47
|
+
final = mock.quacks_like_instance_of(Wrap)
|
48
|
+
layer = mock.quacks_like_instance_of(Layer)
|
49
|
+
layer.expects(:call).with(Wrap["I\nO\nU\n", width: 2]).returns(final)
|
50
50
|
call = BasicWrapper.new(layer).call(Wrap['I O U', width: 2])
|
51
51
|
_(call).must_equal final
|
52
52
|
end
|
@@ -7,20 +7,20 @@ module LovelyRufus
|
|
7
7
|
describe CodeCommentStripper do
|
8
8
|
describe '#call' do
|
9
9
|
it 'strips comments and adjusts width before calling the next layer' do
|
10
|
-
commented =
|
10
|
+
commented = <<~end
|
11
11
|
# to the extreme I rock a mic like a vandal
|
12
12
|
# light up a stage and wax a chump like a candle
|
13
13
|
end
|
14
|
-
uncommented =
|
14
|
+
uncommented = <<~end
|
15
15
|
to the extreme I rock a mic like a vandal
|
16
16
|
light up a stage and wax a chump like a candle
|
17
17
|
end
|
18
|
-
CodeCommentStripper.must_pass_to_next Wrap[commented, width: 72],
|
19
|
-
|
18
|
+
_(CodeCommentStripper).must_pass_to_next Wrap[commented, width: 72],
|
19
|
+
Wrap[uncommented, width: 70]
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'adds comments back in (and adjusts width) before returning' do
|
23
|
-
text =
|
23
|
+
text = <<~end
|
24
24
|
# take heed, ’cause I’m a lyrical poet
|
25
25
|
# Miami’s on the scene just in case you didn’t know it
|
26
26
|
end
|
@@ -29,7 +29,7 @@ module LovelyRufus
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'does not touch non-commented texts' do
|
32
|
-
text =
|
32
|
+
text = <<~end
|
33
33
|
my town, that created all the bass sound
|
34
34
|
enough to shake and kick holes in the ground
|
35
35
|
end
|
@@ -43,46 +43,46 @@ module LovelyRufus
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'strips // code comments' do
|
46
|
-
commented =
|
46
|
+
commented = <<~end
|
47
47
|
// so fast other DJs say ‘damn!’
|
48
48
|
// if my rhyme was a drug I’d sell it by the gram
|
49
49
|
end
|
50
|
-
uncommented =
|
50
|
+
uncommented = <<~end
|
51
51
|
so fast other DJs say ‘damn!’
|
52
52
|
if my rhyme was a drug I’d sell it by the gram
|
53
53
|
end
|
54
|
-
CodeCommentStripper.must_pass_to_next Wrap[commented, width: 72],
|
55
|
-
|
54
|
+
_(CodeCommentStripper).must_pass_to_next Wrap[commented, width: 72],
|
55
|
+
Wrap[uncommented, width: 69]
|
56
56
|
end
|
57
57
|
|
58
58
|
it 'only considers homogenous characters as comments' do
|
59
|
-
commented =
|
59
|
+
commented = <<~end
|
60
60
|
# /if there was a problem,
|
61
61
|
# yo – I’ll solve it!/
|
62
62
|
end
|
63
|
-
uncommented =
|
63
|
+
uncommented = <<~end
|
64
64
|
/if there was a problem,
|
65
65
|
yo – I’ll solve it!/
|
66
66
|
end
|
67
|
-
CodeCommentStripper.must_pass_to_next Wrap[commented, width: 72],
|
68
|
-
|
67
|
+
_(CodeCommentStripper).must_pass_to_next Wrap[commented, width: 72],
|
68
|
+
Wrap[uncommented, width: 70]
|
69
69
|
end
|
70
70
|
|
71
71
|
it 'strips initial space indentation' do
|
72
72
|
indented = Wrap[' // check out the hook', width: 72]
|
73
73
|
passed = Wrap['check out the hook', width: 67]
|
74
|
-
CodeCommentStripper.must_pass_to_next indented, passed
|
74
|
+
_(CodeCommentStripper).must_pass_to_next indented, passed
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'strips initial tab indentation' do
|
78
78
|
indented = Wrap["\t# while my DJ revolves it", width: 72]
|
79
79
|
stripped = Wrap['while my DJ revolves it', width: 69]
|
80
|
-
CodeCommentStripper.must_pass_to_next indented, stripped
|
80
|
+
_(CodeCommentStripper).must_pass_to_next indented, stripped
|
81
81
|
end
|
82
82
|
|
83
83
|
it 'pays proper homage to K&R' do
|
84
84
|
not_commented = Wrap['#define ASSERT(msg, cond) // TODO']
|
85
|
-
CodeCommentStripper.must_pass_to_next not_commented, not_commented
|
85
|
+
_(CodeCommentStripper).must_pass_to_next not_commented, not_commented
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -7,20 +7,20 @@ module LovelyRufus
|
|
7
7
|
describe EmailQuoteStripper do
|
8
8
|
describe '#call' do
|
9
9
|
it 'strips quotes and adjusts width before calling the next layer' do
|
10
|
-
quoted =
|
10
|
+
quoted = <<~end
|
11
11
|
> to the extreme I rock a mic like a vandal
|
12
12
|
> light up a stage and wax a chump like a candle
|
13
13
|
end
|
14
|
-
unquoted =
|
14
|
+
unquoted = <<~end
|
15
15
|
to the extreme I rock a mic like a vandal
|
16
16
|
light up a stage and wax a chump like a candle
|
17
17
|
end
|
18
|
-
EmailQuoteStripper.must_pass_to_next Wrap[quoted, width: 72],
|
19
|
-
|
18
|
+
_(EmailQuoteStripper).must_pass_to_next Wrap[quoted, width: 72],
|
19
|
+
Wrap[unquoted, width: 70]
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'adds quotes back in (and adjusts width) before returning' do
|
23
|
-
quoted =
|
23
|
+
quoted = <<~end
|
24
24
|
> take heed, ’cause I’m a lyrical poet
|
25
25
|
> Miami’s on the scene just in case you didn’t know it
|
26
26
|
end
|
@@ -29,7 +29,7 @@ module LovelyRufus
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'does not touch non-quoted texts' do
|
32
|
-
plain =
|
32
|
+
plain = <<~end
|
33
33
|
my town, that created all the bass sound
|
34
34
|
enough to shake and kick holes in the ground
|
35
35
|
end
|
@@ -43,38 +43,38 @@ module LovelyRufus
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'strips multilevel quotes' do
|
46
|
-
quoted =
|
46
|
+
quoted = <<~end
|
47
47
|
>> ’cause my style’s like a chemical spill
|
48
48
|
>> feasible rhymes that you can vision and feel
|
49
49
|
end
|
50
|
-
unquoted =
|
50
|
+
unquoted = <<~end
|
51
51
|
’cause my style’s like a chemical spill
|
52
52
|
feasible rhymes that you can vision and feel
|
53
53
|
end
|
54
|
-
EmailQuoteStripper.must_pass_to_next Wrap[quoted, width: 72],
|
55
|
-
|
54
|
+
_(EmailQuoteStripper).must_pass_to_next Wrap[quoted, width: 72],
|
55
|
+
Wrap[unquoted, width: 69]
|
56
56
|
end
|
57
57
|
|
58
58
|
it 'strips broken quotes properly' do
|
59
|
-
quoted =
|
59
|
+
quoted = <<~end
|
60
60
|
> > >conducted and formed this is a hell of a concept
|
61
61
|
> > >we make it hype and you want to step with this
|
62
62
|
end
|
63
|
-
unquoted =
|
63
|
+
unquoted = <<~end
|
64
64
|
conducted and formed this is a hell of a concept
|
65
65
|
we make it hype and you want to step with this
|
66
66
|
end
|
67
|
-
EmailQuoteStripper.must_pass_to_next Wrap[quoted, width: 72],
|
68
|
-
|
67
|
+
_(EmailQuoteStripper).must_pass_to_next Wrap[quoted, width: 72],
|
68
|
+
Wrap[unquoted, width: 68]
|
69
69
|
end
|
70
70
|
|
71
71
|
it 'fixes broken quotes when adding them back in' do
|
72
|
-
quoted =
|
72
|
+
quoted = <<~end
|
73
73
|
> > >Shay plays on the fade,
|
74
74
|
> > >slice like a ninja
|
75
75
|
> > >cut like a razor blade
|
76
76
|
end
|
77
|
-
fixed =
|
77
|
+
fixed = <<~end
|
78
78
|
>>> Shay plays on the fade,
|
79
79
|
>>> slice like a ninja
|
80
80
|
>>> cut like a razor blade
|
@@ -84,16 +84,16 @@ module LovelyRufus
|
|
84
84
|
end
|
85
85
|
|
86
86
|
it 'only considers homogenous characters as comments' do
|
87
|
-
quoted =
|
87
|
+
quoted = <<~end
|
88
88
|
> /if there was a problem,
|
89
89
|
> yo – I’ll solve it!/
|
90
90
|
end
|
91
|
-
unquoted =
|
91
|
+
unquoted = <<~end
|
92
92
|
/if there was a problem,
|
93
93
|
yo – I’ll solve it!/
|
94
94
|
end
|
95
|
-
EmailQuoteStripper.must_pass_to_next Wrap[quoted, width: 72],
|
96
|
-
|
95
|
+
_(EmailQuoteStripper).must_pass_to_next Wrap[quoted, width: 72],
|
96
|
+
Wrap[unquoted, width: 70]
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
@@ -7,11 +7,11 @@ module LovelyRufus
|
|
7
7
|
describe HangoutWrapper do
|
8
8
|
describe '#call' do
|
9
9
|
it 'removes hangouts from the text' do
|
10
|
-
text =
|
10
|
+
text = <<~end
|
11
11
|
I go crazy when I hear a cymbal and
|
12
12
|
a hi-hat with a souped-up tempo
|
13
13
|
end
|
14
|
-
wrap =
|
14
|
+
wrap = <<~end
|
15
15
|
I go crazy when I hear a cymbal
|
16
16
|
and a hi-hat with a souped-up tempo
|
17
17
|
end
|
@@ -20,15 +20,15 @@ module LovelyRufus
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'passes the fixed text to the next layer and returns its outcome' do
|
23
|
-
final =
|
24
|
-
layer =
|
25
|
-
|
23
|
+
final = mock.quacks_like_instance_of(Wrap)
|
24
|
+
layer = mock.quacks_like_instance_of(Layer)
|
25
|
+
layer.expects(:call).with(instance_of(Wrap)).returns(final)
|
26
26
|
wrapped = HangoutWrapper.new(layer).call(Wrap["I O\nU", width: 4])
|
27
27
|
_(wrapped).must_equal final
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'doesn’t let the last line to hang out' do
|
31
|
-
text =
|
31
|
+
text = <<~end
|
32
32
|
Just found out the Finnish term for grammar Nazi is pilkunnussija.
|
33
33
|
Direct translation: comma fucker. You’re welcome.
|
34
34
|
end
|
@@ -21,9 +21,9 @@ module LovelyRufus
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'passes the fixed text to the next layer and returns its outcome' do
|
24
|
-
final =
|
25
|
-
layer =
|
26
|
-
|
24
|
+
final = mock.quacks_like_instance_of(Wrap)
|
25
|
+
layer = mock.quacks_like_instance_of(Layer)
|
26
|
+
layer.expects(:call).with(Wrap['I O U', width: 69]).returns(final)
|
27
27
|
glued = OneLetterGluer.new(layer).call(Wrap['I O U', width: 69])
|
28
28
|
_(glued).must_equal final
|
29
29
|
end
|
@@ -9,11 +9,11 @@ module LovelyRufus
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'can be set via --width' do
|
12
|
-
_(Settings.new(%w
|
12
|
+
_(Settings.new(%w[--width=42]).width).must_equal 42
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'can be set via -w' do
|
16
|
-
_(Settings.new(%w
|
16
|
+
_(Settings.new(%w[-w 42]).width).must_equal 42
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -7,8 +7,8 @@ module LovelyRufus
|
|
7
7
|
describe '.wrap' do
|
8
8
|
it 'wraps the passed String to 72 characters by default' do
|
9
9
|
short = 'all right: stop, collaborate and listen'
|
10
|
-
long = short
|
11
|
-
wrap =
|
10
|
+
long = "#{short} – Ice is back with a brand new invention"
|
11
|
+
wrap = <<~end
|
12
12
|
all right: stop, collaborate and listen
|
13
13
|
– Ice is back with a brand new invention
|
14
14
|
end
|
@@ -18,12 +18,12 @@ module LovelyRufus
|
|
18
18
|
|
19
19
|
it 'wraps the passed String to the given number of characters' do
|
20
20
|
input = 'something grabs a hold of me tightly; ' \
|
21
|
-
|
22
|
-
_(TextWrapper.wrap(input, width: 40)).must_equal
|
21
|
+
'flow like a harpoon – daily and nightly'
|
22
|
+
_(TextWrapper.wrap(input, width: 40)).must_equal <<~end
|
23
23
|
something grabs a hold of me tightly;
|
24
24
|
flow like a harpoon – daily and nightly
|
25
25
|
end
|
26
|
-
_(TextWrapper.wrap(input, width: 21)).must_equal
|
26
|
+
_(TextWrapper.wrap(input, width: 21)).must_equal <<~end
|
27
27
|
something grabs
|
28
28
|
a hold of me tightly;
|
29
29
|
flow like a harpoon
|
@@ -32,7 +32,7 @@ module LovelyRufus
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'rewraps a String from zero' do
|
35
|
-
broken =
|
35
|
+
broken = <<~end
|
36
36
|
turn off
|
37
37
|
the lights and I’ll glow
|
38
38
|
end
|
@@ -43,7 +43,7 @@ module LovelyRufus
|
|
43
43
|
it 'supports all the example use-cases' do
|
44
44
|
path = File.expand_path('text_wrapper_test.yml', __dir__)
|
45
45
|
YAML.load_file(path).each do |spec|
|
46
|
-
width = spec.fetch('width'
|
46
|
+
width = spec.fetch('width', 72)
|
47
47
|
wrap = "#{spec['output']}\n"
|
48
48
|
_(TextWrapper.wrap(spec['input'], width: width)).must_equal wrap
|
49
49
|
end
|
data/test/lovely_rufus_test.rb
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
require_relative '../lib/lovely_rufus'
|
3
|
+
require_relative '../lib/lovely_rufus/text_wrapper'
|
3
4
|
|
4
5
|
describe LovelyRufus do
|
5
6
|
describe '.wrap' do
|
6
|
-
let(:text_wrapper) {
|
7
|
+
let(:text_wrapper) { mock.quacks_like(LovelyRufus::TextWrapper) }
|
7
8
|
|
8
9
|
it 'offloads the wrapping to TextWrapper' do
|
9
|
-
|
10
|
+
text_wrapper.stubs(:wrap).with('Ice Ice Baby', width: 7)
|
11
|
+
.returns("Ice Ice\nBaby\n")
|
10
12
|
_(LovelyRufus.wrap('Ice Ice Baby', text_wrapper: text_wrapper, width: 7))
|
11
13
|
.must_equal "Ice Ice\nBaby\n"
|
12
14
|
end
|
13
15
|
|
14
16
|
it 'wraps the passed String to 72 characters by default' do
|
17
|
+
text_wrapper.expects(:wrap).with('Ice Ice Baby', width: 72)
|
15
18
|
LovelyRufus.wrap 'Ice Ice Baby', text_wrapper: text_wrapper
|
16
|
-
_(text_wrapper).must_have_received :wrap, ['Ice Ice Baby', { width: 72 }]
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,28 +1,25 @@
|
|
1
1
|
ENV['MT_NO_EXPECTATIONS'] = 'true'
|
2
|
-
require 'bundler/setup'
|
3
2
|
require 'minitest/autorun'
|
4
3
|
require 'minitest/focus'
|
5
4
|
require 'minitest/pride'
|
6
|
-
require '
|
7
|
-
require 'lovely_rufus'
|
5
|
+
require 'mocha/minitest'
|
8
6
|
require_relative '../lib/lovely_rufus/layers/layer'
|
9
7
|
require_relative '../lib/lovely_rufus/wrap'
|
10
8
|
|
11
|
-
|
12
|
-
config.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
9
|
+
Mocha.configure do |config|
|
10
|
+
config.display_matching_invocations_on_failure = true
|
11
|
+
config.strict_keyword_argument_matching = true
|
12
|
+
config.stubbing_method_on_non_mock_object = :prevent
|
13
|
+
config.stubbing_method_unnecessarily = :prevent
|
14
|
+
config.stubbing_non_existent_method = :prevent
|
15
|
+
config.stubbing_non_public_method = :prevent
|
19
16
|
end
|
20
17
|
|
21
18
|
module CustomAssertions
|
22
19
|
def assert_passes_to_next(subject, called_with, to_be_passed)
|
23
|
-
next_layer =
|
20
|
+
next_layer = mock.quacks_like_instance_of(LovelyRufus::Layers::Layer)
|
21
|
+
next_layer.expects(:call).with(to_be_passed).returns(LovelyRufus::Wrap.new)
|
24
22
|
subject.new(next_layer).call called_with
|
25
|
-
assert_received next_layer, :call, [to_be_passed]
|
26
23
|
end
|
27
24
|
end
|
28
25
|
|
metadata
CHANGED
@@ -1,65 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lovely_rufus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Szotkowski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMREwDwYDVQQDDAhjaGFz
|
14
|
-
dGVsbDEYMBYGCgmSJomT8ixkARkWCGNoYXN0ZWxsMRMwEQYKCZImiZPyLGQBGRYD
|
15
|
-
bmV0MB4XDTE1MTEwOTIxMTMwOVoXDTE2MTEwODIxMTMwOVowQjERMA8GA1UEAwwI
|
16
|
-
Y2hhc3RlbGwxGDAWBgoJkiaJk/IsZAEZFghjaGFzdGVsbDETMBEGCgmSJomT8ixk
|
17
|
-
ARkWA25ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMcf6OF3mi6D
|
18
|
-
UedwY2A6fYEQF2bJVYQxV8fWHA5Q2R6y7Eg0hM80Q0yod7pJxlJTpnAPzuIl1u4y
|
19
|
-
hhfa/Vz0u6PVRhBYQ/Bcj9UEwgiXcy3P4ybINDeDt7GRVs3R9rRoT1aAsb5RCS0z
|
20
|
-
u/JKS2RcAS5XPpFow3Cfs5A/pM2NLsR/zeiaKg8rRB59A/tWw26F+YTaWfPAPFGv
|
21
|
-
d6af29NKWQh+EPkX1JwwtSwjKfVOeFr0csC6QLWKpp1z/7Lla8d3px426Ccjca0I
|
22
|
-
5VwtQeZ5LClTjqaYyH7vSojpOtgRuvVKspZ2jfe1KZq9jz//a/rSUrFcPlEQuXQp
|
23
|
-
i8E3TKoJrW0CAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
24
|
-
BBYEFLi/J921Nb53s8GKtKptC08QmHnwMCAGA1UdEQQZMBeBFWNoYXN0ZWxsQGNo
|
25
|
-
YXN0ZWxsLm5ldDAgBgNVHRIEGTAXgRVjaGFzdGVsbEBjaGFzdGVsbC5uZXQwDQYJ
|
26
|
-
KoZIhvcNAQEFBQADggEBAA+rUbXujzqDv8WE7kkiJadQhxldq/cRhaJDMKSWF3/H
|
27
|
-
6PL/Me8zq8Ok7/pQtxBvAhKcy3DdsH0q5pyPHoMrYySxEo9lNXLvwCPsi21rR53b
|
28
|
-
2w5rBytYCxrhsXISKwCkBYwVwtICafZ8VtRbD3pgnsPv+9NYJJ/rN4Z34doWM7oK
|
29
|
-
CAfY6o0LcY+qmvqLvqpweyoO73wkfKGUSz1a09dJfAP5aIREQDvpYrWx2ZoDrAct
|
30
|
-
srwnZ6g5uTvNbd0I1SnvnCJJ5y5iPvJIBlnGb3QZ77y2XXCOy3Yc0rjK7A8bQt5t
|
31
|
-
xOlyYMPKhWx2IqEip+J7PBpBwMnxIPhTcNlFOj8mSa0=
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2015-11-10 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: private_attr
|
37
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '1.1'
|
42
|
-
type: :runtime
|
43
|
-
prerelease: false
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '1.1'
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: bogus
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: 0.1.4
|
56
|
-
type: :development
|
57
|
-
prerelease: false
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.1.4
|
63
13
|
- !ruby/object:Gem::Dependency
|
64
14
|
name: minitest
|
65
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,61 +39,61 @@ dependencies:
|
|
89
39
|
- !ruby/object:Gem::Version
|
90
40
|
version: '1.1'
|
91
41
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
42
|
+
name: mocha
|
93
43
|
requirement: !ruby/object:Gem::Requirement
|
94
44
|
requirements:
|
95
45
|
- - "~>"
|
96
46
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
47
|
+
version: '2.7'
|
98
48
|
type: :development
|
99
49
|
prerelease: false
|
100
50
|
version_requirements: !ruby/object:Gem::Requirement
|
101
51
|
requirements:
|
102
52
|
- - "~>"
|
103
53
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
54
|
+
version: '2.7'
|
105
55
|
- !ruby/object:Gem::Dependency
|
106
|
-
name:
|
56
|
+
name: rake
|
107
57
|
requirement: !ruby/object:Gem::Requirement
|
108
58
|
requirements:
|
109
59
|
- - "~>"
|
110
60
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
61
|
+
version: '13.0'
|
112
62
|
type: :development
|
113
63
|
prerelease: false
|
114
64
|
version_requirements: !ruby/object:Gem::Requirement
|
115
65
|
requirements:
|
116
66
|
- - "~>"
|
117
67
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
68
|
+
version: '13.0'
|
119
69
|
- !ruby/object:Gem::Dependency
|
120
|
-
name:
|
70
|
+
name: reek
|
121
71
|
requirement: !ruby/object:Gem::Requirement
|
122
72
|
requirements:
|
123
73
|
- - "~>"
|
124
74
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
75
|
+
version: '6.0'
|
126
76
|
type: :development
|
127
77
|
prerelease: false
|
128
78
|
version_requirements: !ruby/object:Gem::Requirement
|
129
79
|
requirements:
|
130
80
|
- - "~>"
|
131
81
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
82
|
+
version: '6.0'
|
133
83
|
- !ruby/object:Gem::Dependency
|
134
84
|
name: rubocop
|
135
85
|
requirement: !ruby/object:Gem::Requirement
|
136
86
|
requirements:
|
137
87
|
- - "~>"
|
138
88
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
89
|
+
version: '1.0'
|
140
90
|
type: :development
|
141
91
|
prerelease: false
|
142
92
|
version_requirements: !ruby/object:Gem::Requirement
|
143
93
|
requirements:
|
144
94
|
- - "~>"
|
145
95
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
96
|
+
version: '1.0'
|
147
97
|
description: An executable and a Ruby library for wrapping paragraphs of text.
|
148
98
|
email: chastell@chastell.net
|
149
99
|
executables:
|
@@ -151,17 +101,18 @@ executables:
|
|
151
101
|
extensions: []
|
152
102
|
extra_rdoc_files: []
|
153
103
|
files:
|
154
|
-
- ".
|
104
|
+
- ".overcommit.yml"
|
105
|
+
- ".reek.yml"
|
155
106
|
- ".rubocop.yml"
|
156
|
-
- ".
|
107
|
+
- ".tool-versions"
|
157
108
|
- ".travis.yml"
|
158
|
-
- Gemfile
|
159
|
-
- Gemfile.lock
|
160
109
|
- LICENCE
|
161
110
|
- README.md
|
162
111
|
- Rakefile
|
163
112
|
- bin/lovely-rufus
|
164
113
|
- certs/chastell.pem
|
114
|
+
- gems.locked
|
115
|
+
- gems.rb
|
165
116
|
- lib/lovely_rufus.rb
|
166
117
|
- lib/lovely_rufus/cli_wrapper.rb
|
167
118
|
- lib/lovely_rufus/layers/basic_wrapper.rb
|
@@ -189,9 +140,10 @@ files:
|
|
189
140
|
- test/test_helper.rb
|
190
141
|
homepage: http://github.com/chastell/lovely_rufus
|
191
142
|
licenses:
|
192
|
-
- AGPL-3.0
|
193
|
-
metadata:
|
194
|
-
|
143
|
+
- AGPL-3.0-or-later
|
144
|
+
metadata:
|
145
|
+
rubygems_mfa_required: 'true'
|
146
|
+
post_install_message:
|
195
147
|
rdoc_options: []
|
196
148
|
require_paths:
|
197
149
|
- lib
|
@@ -199,28 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
199
151
|
requirements:
|
200
152
|
- - "~>"
|
201
153
|
- !ruby/object:Gem::Version
|
202
|
-
version: '
|
154
|
+
version: '3.0'
|
203
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
156
|
requirements:
|
205
157
|
- - ">="
|
206
158
|
- !ruby/object:Gem::Version
|
207
159
|
version: '0'
|
208
160
|
requirements: []
|
209
|
-
|
210
|
-
|
211
|
-
signing_key:
|
161
|
+
rubygems_version: 3.5.23
|
162
|
+
signing_key:
|
212
163
|
specification_version: 4
|
213
164
|
summary: 'lovely_rufus: text wrapper'
|
214
|
-
test_files:
|
215
|
-
- test/lovely_rufus/cli_wrapper_test.rb
|
216
|
-
- test/lovely_rufus/layers/basic_wrapper_test.rb
|
217
|
-
- test/lovely_rufus/layers/code_comment_stripper_test.rb
|
218
|
-
- test/lovely_rufus/layers/email_quote_stripper_test.rb
|
219
|
-
- test/lovely_rufus/layers/hangout_wrapper_test.rb
|
220
|
-
- test/lovely_rufus/layers/one_letter_gluer_test.rb
|
221
|
-
- test/lovely_rufus/settings_test.rb
|
222
|
-
- test/lovely_rufus/text_wrapper_test.rb
|
223
|
-
- test/lovely_rufus/wrap_test.rb
|
224
|
-
- test/lovely_rufus_test.rb
|
225
|
-
- test/test_helper.rb
|
226
|
-
has_rdoc:
|
165
|
+
test_files: []
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data/.reek
DELETED
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.2
|
data/Gemfile.lock
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
lovely_rufus (1.0.0)
|
5
|
-
private_attr (~> 1.1)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
abstract_type (0.0.7)
|
11
|
-
adamantium (0.2.0)
|
12
|
-
ice_nine (~> 0.11.0)
|
13
|
-
memoizable (~> 0.4.0)
|
14
|
-
ast (2.1.0)
|
15
|
-
astrolabe (1.3.1)
|
16
|
-
parser (~> 2.2)
|
17
|
-
bogus (0.1.6)
|
18
|
-
dependor (>= 0.0.4)
|
19
|
-
concord (0.1.5)
|
20
|
-
adamantium (~> 0.2.0)
|
21
|
-
equalizer (~> 0.0.9)
|
22
|
-
dependor (1.0.1)
|
23
|
-
diff-lcs (1.2.5)
|
24
|
-
equalizer (0.0.11)
|
25
|
-
ffi (1.9.10)
|
26
|
-
ice_nine (0.11.1)
|
27
|
-
listen (3.0.4)
|
28
|
-
rb-fsevent (>= 0.9.3)
|
29
|
-
rb-inotify (>= 0.9)
|
30
|
-
memoizable (0.4.2)
|
31
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
32
|
-
minitest (5.8.2)
|
33
|
-
minitest-focus (1.1.2)
|
34
|
-
minitest (>= 4, < 6)
|
35
|
-
parser (2.2.3.0)
|
36
|
-
ast (>= 1.1, < 3.0)
|
37
|
-
powerpack (0.1.1)
|
38
|
-
private_attr (1.1.0)
|
39
|
-
procto (0.0.2)
|
40
|
-
rainbow (2.0.0)
|
41
|
-
rake (10.4.2)
|
42
|
-
rb-fsevent (0.9.6)
|
43
|
-
rb-inotify (0.9.5)
|
44
|
-
ffi (>= 0.5.0)
|
45
|
-
reek (3.6.0)
|
46
|
-
parser (~> 2.2, >= 2.2.2.5)
|
47
|
-
private_attr (~> 1.1)
|
48
|
-
rainbow (~> 2.0)
|
49
|
-
unparser (~> 0.2.2)
|
50
|
-
rerun (0.11.0)
|
51
|
-
listen (~> 3.0)
|
52
|
-
rubocop (0.35.1)
|
53
|
-
astrolabe (~> 1.3)
|
54
|
-
parser (>= 2.2.3.0, < 3.0)
|
55
|
-
powerpack (~> 0.1)
|
56
|
-
rainbow (>= 1.99.1, < 3.0)
|
57
|
-
ruby-progressbar (~> 1.7)
|
58
|
-
tins (<= 1.6.0)
|
59
|
-
ruby-progressbar (1.7.5)
|
60
|
-
thread_safe (0.3.5)
|
61
|
-
tins (1.6.0)
|
62
|
-
unparser (0.2.4)
|
63
|
-
abstract_type (~> 0.0.7)
|
64
|
-
adamantium (~> 0.2.0)
|
65
|
-
concord (~> 0.1.5)
|
66
|
-
diff-lcs (~> 1.2.5)
|
67
|
-
equalizer (~> 0.0.9)
|
68
|
-
parser (~> 2.2.2)
|
69
|
-
procto (~> 0.0.2)
|
70
|
-
|
71
|
-
PLATFORMS
|
72
|
-
ruby
|
73
|
-
|
74
|
-
DEPENDENCIES
|
75
|
-
bogus (~> 0.1.4)
|
76
|
-
lovely_rufus!
|
77
|
-
minitest (~> 5.6)
|
78
|
-
minitest-focus (~> 1.1)
|
79
|
-
rake (~> 10.1)
|
80
|
-
reek (~> 3.1)
|
81
|
-
rerun (~> 0.11.0)
|
82
|
-
rubocop (~> 0.35.0)
|
83
|
-
|
84
|
-
BUNDLED WITH
|
85
|
-
1.10.6
|
data.tar.gz.sig
DELETED
metadata.gz.sig
DELETED
Binary file
|
/data/{Gemfile → gems.rb}
RENAMED
File without changes
|