lovely_rufus 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -1
- data/Gemfile.lock +31 -8
- data/config/reek.yml +12 -0
- data/lib/lovely_rufus/basic_wrapper.rb +1 -12
- data/lovely_rufus.gemspec +4 -2
- data/spec/lovely_rufus/basic_wrapper_spec.rb +4 -7
- data/spec/lovely_rufus/cli_wrapper_spec.rb +1 -1
- data/spec/lovely_rufus/text_wrapper_spec.yml +13 -13
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cf2ab9d43c047840510a68ef5be328bcc4f7d9b
|
4
|
+
data.tar.gz: b00fee7ab10b126911a979b2925b0a761249a4cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c933c2bf749f21e89155c550fe6a63c031a3681bb9f19083209e54d83cf979e64efcfa4e44d024b6e282eb8d61cd03bb5087ce182a89e86dbf08011efbb34a6
|
7
|
+
data.tar.gz: face2858b5d1c8a25fa4a14d88f5aa37c24170a17fc09a3e68fdf6deb113e8dd4ba58ef186dbe602c65110d735c5b399c61cd65b0844fe527328aa13640035f7
|
data/.rubocop.yml
CHANGED
@@ -10,11 +10,15 @@ Documentation:
|
|
10
10
|
EndAlignment:
|
11
11
|
Enabled: false
|
12
12
|
|
13
|
+
FileName:
|
14
|
+
Exclude:
|
15
|
+
- bin/lovely-rufus
|
16
|
+
|
13
17
|
IndentationWidth:
|
14
18
|
Enabled: false
|
15
19
|
|
16
20
|
MethodDefParentheses:
|
17
|
-
|
21
|
+
EnforcedStyle: require_no_parentheses
|
18
22
|
|
19
23
|
SingleLineBlockParams:
|
20
24
|
Enabled: false
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lovely_rufus (0.1.
|
4
|
+
lovely_rufus (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,32 +9,53 @@ GEM
|
|
9
9
|
ast (1.1.0)
|
10
10
|
bogus (0.1.4)
|
11
11
|
dependor (>= 0.0.4)
|
12
|
+
celluloid (0.15.2)
|
13
|
+
timers (~> 1.1.0)
|
14
|
+
celluloid-io (0.15.0)
|
15
|
+
celluloid (>= 0.15.0)
|
16
|
+
nio4r (>= 0.5.0)
|
12
17
|
dependor (1.0.1)
|
18
|
+
ffi (1.9.3)
|
13
19
|
json (1.8.1)
|
14
|
-
|
20
|
+
listen (2.7.1)
|
21
|
+
celluloid (>= 0.15.2)
|
22
|
+
celluloid-io (>= 0.15.0)
|
23
|
+
rb-fsevent (>= 0.9.3)
|
24
|
+
rb-inotify (>= 0.9)
|
25
|
+
minitest (5.3.1)
|
15
26
|
minitest-focus (1.1.0)
|
16
27
|
minitest (>= 4, < 6)
|
17
|
-
|
28
|
+
nio4r (1.0.0)
|
29
|
+
parser (2.1.7)
|
18
30
|
ast (~> 1.1)
|
19
31
|
slop (~> 3.4, >= 3.4.5)
|
20
32
|
powerpack (0.0.9)
|
21
33
|
rainbow (2.0.0)
|
34
|
+
rake (10.1.1)
|
35
|
+
rb-fsevent (0.9.4)
|
36
|
+
rb-inotify (0.9.3)
|
37
|
+
ffi (>= 0.5.0)
|
22
38
|
reek (1.3.6)
|
23
39
|
ruby2ruby (~> 2.0.7)
|
24
40
|
ruby_parser (~> 3.2)
|
25
41
|
sexp_processor
|
26
|
-
|
42
|
+
rerun (0.9.0)
|
43
|
+
listen (~> 2.7)
|
44
|
+
rubocop (0.19.1)
|
27
45
|
json (>= 1.7.7, < 2)
|
28
|
-
parser (~> 2.1.
|
46
|
+
parser (~> 2.1.7)
|
29
47
|
powerpack (~> 0.0.6)
|
30
48
|
rainbow (>= 1.99.1, < 3.0)
|
49
|
+
ruby-progressbar (~> 1.4)
|
50
|
+
ruby-progressbar (1.4.2)
|
31
51
|
ruby2ruby (2.0.7)
|
32
52
|
ruby_parser (~> 3.1)
|
33
53
|
sexp_processor (~> 4.0)
|
34
54
|
ruby_parser (3.4.1)
|
35
55
|
sexp_processor (~> 4.1)
|
36
|
-
sexp_processor (4.4.
|
37
|
-
slop (3.
|
56
|
+
sexp_processor (4.4.2)
|
57
|
+
slop (3.5.0)
|
58
|
+
timers (1.1.0)
|
38
59
|
|
39
60
|
PLATFORMS
|
40
61
|
ruby
|
@@ -44,5 +65,7 @@ DEPENDENCIES
|
|
44
65
|
lovely_rufus!
|
45
66
|
minitest (~> 5.0)
|
46
67
|
minitest-focus (~> 1.1)
|
68
|
+
rake (~> 10.1)
|
47
69
|
reek (~> 1.3)
|
48
|
-
|
70
|
+
rerun (~> 0.9.0)
|
71
|
+
rubocop (~> 0.19.0)
|
data/config/reek.yml
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
DuplicateMethodCall:
|
2
|
+
exclude:
|
3
|
+
- LovelyRufus::BasicWrapper#call
|
4
|
+
- LovelyRufus::HangoutWrapper#rewrapped
|
5
|
+
|
6
|
+
FeatureEnvy:
|
7
|
+
exclude:
|
8
|
+
- LovelyRufus::BasicWrapper#call
|
9
|
+
- LovelyRufus::HangoutWrapper#hangout_line
|
10
|
+
- LovelyRufus::OneLetterGluer#call
|
11
|
+
- LovelyRufus::QuoteStripper#quote
|
12
|
+
|
1
13
|
IrresponsibleModule:
|
2
14
|
enabled: false
|
3
15
|
|
@@ -1,17 +1,6 @@
|
|
1
1
|
module LovelyRufus class BasicWrapper < Layer
|
2
2
|
def call wrap
|
3
|
-
|
4
|
-
wrapped = chopped.gsub(/(.{1,#{wrap.width}})( |$\n?)/, "\\1\n")
|
3
|
+
wrapped = wrap.text.gsub(/(.{1,#{wrap.width}})( |$\n?)/, "\\1\n")
|
5
4
|
next_layer.call Wrap[wrapped, width: wrap.width]
|
6
5
|
end
|
7
|
-
|
8
|
-
attr_reader :wrap
|
9
|
-
private :wrap
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def chopped
|
14
|
-
words = wrap.text.split
|
15
|
-
words.map { |word| word.gsub(/(.{1,#{wrap.width}})/, '\\1 ') }.join.chop
|
16
|
-
end
|
17
6
|
end end
|
data/lovely_rufus.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.license = 'AGPL-3.0'
|
7
7
|
gem.name = 'lovely_rufus'
|
8
8
|
gem.summary = 'lovely_rufus: text wrapper'
|
9
|
-
gem.version = '0.1.
|
9
|
+
gem.version = '0.1.1'
|
10
10
|
|
11
11
|
gem.files = `git ls-files -z`.split "\0"
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map { |path| File.basename path }
|
@@ -15,6 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.add_development_dependency 'bogus', '~> 0.1.4'
|
16
16
|
gem.add_development_dependency 'minitest', '~> 5.0'
|
17
17
|
gem.add_development_dependency 'minitest-focus', '~> 1.1'
|
18
|
+
gem.add_development_dependency 'rake', '~> 10.1'
|
18
19
|
gem.add_development_dependency 'reek', '~> 1.3'
|
19
|
-
gem.add_development_dependency '
|
20
|
+
gem.add_development_dependency 'rerun', '~> 0.9.0'
|
21
|
+
gem.add_development_dependency 'rubocop', '~> 0.19.0'
|
20
22
|
end
|
@@ -14,20 +14,17 @@ module LovelyRufus describe BasicWrapper do
|
|
14
14
|
bw.call(Wrap[text, width: 22]).must_equal Wrap[wrap, width: 22]
|
15
15
|
end
|
16
16
|
|
17
|
-
it '
|
17
|
+
it 'extends past the given width when necessary' do
|
18
18
|
text = 'I’m killing your brain like a poisonous mushroom'
|
19
19
|
wrap = <<-end.dedent
|
20
20
|
I’m
|
21
|
-
|
22
|
-
ng
|
21
|
+
killing
|
23
22
|
your
|
24
23
|
brain
|
25
24
|
like
|
26
25
|
a
|
27
|
-
|
28
|
-
|
29
|
-
mushr
|
30
|
-
oom
|
26
|
+
poisonous
|
27
|
+
mushroom
|
31
28
|
end
|
32
29
|
bw = BasicWrapper.new
|
33
30
|
bw.call(Wrap[text, width: 5]).must_equal Wrap[wrap, width: 5]
|
@@ -20,7 +20,7 @@ module LovelyRufus describe CLIWrapper do
|
|
20
20
|
stub(text_wrapper).wrap(text, width: 22) { wrap }
|
21
21
|
lambda do
|
22
22
|
stream = StringIO.new text
|
23
|
-
CLIWrapper.new(%w
|
23
|
+
CLIWrapper.new(%w(--width 22), text_wrapper: text_wrapper).run stream
|
24
24
|
end.must_output wrap
|
25
25
|
end
|
26
26
|
end
|
@@ -34,9 +34,9 @@
|
|
34
34
|
And SOMERS, who from Eastern shores imported indigo.
|
35
35
|
output: |-
|
36
36
|
Besides the captain and the mate, the owners and the crew,
|
37
|
-
The passengers were also drowned, excepting only two:
|
38
|
-
PETER GRAY, who tasted teas for BAKER, CROOP, AND
|
39
|
-
And SOMERS, who from Eastern shores imported indigo.
|
37
|
+
The passengers were also drowned, excepting only two:
|
38
|
+
Young PETER GRAY, who tasted teas for BAKER, CROOP, AND
|
39
|
+
CO., And SOMERS, who from Eastern shores imported indigo.
|
40
40
|
|
41
41
|
# one-letter words are not left at line ends
|
42
42
|
- width: 39
|
@@ -46,10 +46,10 @@
|
|
46
46
|
They hunted for their meals, as ALEXANDER SELKIRK used,
|
47
47
|
But they couldn’t chat together — they had not been introduced.
|
48
48
|
output: |-
|
49
|
-
These passengers, by reason of
|
50
|
-
clinging to a mast, Upon
|
51
|
-
island were eventually
|
52
|
-
They hunted for their meals,
|
49
|
+
These passengers, by reason of
|
50
|
+
their clinging to a mast, Upon
|
51
|
+
a desert island were eventually
|
52
|
+
cast. They hunted for their meals,
|
53
53
|
as ALEXANDER SELKIRK used, But
|
54
54
|
they couldn’t chat together —
|
55
55
|
they had not been introduced.
|
@@ -107,10 +107,10 @@
|
|
107
107
|
> > >He longed to lay him down upon the shelly bed, and stuff:
|
108
108
|
> > >He had often eaten oysters, but had never had enough.
|
109
109
|
output: |-
|
110
|
-
>>> And SOMERS sighed in sorrow as he settled in the south,
|
111
|
-
>>> the thought of PETER’S oysters brought the water to
|
112
|
-
>>> He longed to lay him down upon the shelly bed,
|
113
|
-
>>> He had often eaten oysters, but had never had enough.
|
110
|
+
>>> And SOMERS sighed in sorrow as he settled in the south,
|
111
|
+
>>> For the thought of PETER’S oysters brought the water to
|
112
|
+
>>> his mouth. He longed to lay him down upon the shelly bed,
|
113
|
+
>>> and stuff: He had often eaten oysters, but had never had enough.
|
114
114
|
|
115
115
|
# quoted paragraph breaks are cleared
|
116
116
|
- input: |-
|
@@ -157,8 +157,8 @@
|
|
157
157
|
|
158
158
|
# ‘I beg your pardon—pray forgive me if I seem too bold,
|
159
159
|
# But you have breathed a name I knew familiarly of old.
|
160
|
-
# You spoke aloud of ROBINSON – I happened to be by—
|
161
|
-
# know him?’ ‘Yes, extremely well.’ ‘Allow me – so do I!’
|
160
|
+
# You spoke aloud of ROBINSON – I happened to be by—
|
161
|
+
# You know him?’ ‘Yes, extremely well.’ ‘Allow me – so do I!’
|
162
162
|
|
163
163
|
It was enough: they felt they could more sociably get on,
|
164
164
|
For (ah, the magic of the fact!) they each knew ROBINSON!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lovely_rufus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Szotkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogus
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: reek
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +80,34 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '1.3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rerun
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.9.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.9.0
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rubocop
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - "~>"
|
74
102
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
103
|
+
version: 0.19.0
|
76
104
|
type: :development
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
108
|
- - "~>"
|
81
109
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
110
|
+
version: 0.19.0
|
83
111
|
description: An executable and a Ruby library for wrapping paragraphs of text.
|
84
112
|
email: chastell@chastell.net
|
85
113
|
executables:
|
@@ -135,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
163
|
version: '0'
|
136
164
|
requirements: []
|
137
165
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.2.
|
166
|
+
rubygems_version: 2.2.2
|
139
167
|
signing_key:
|
140
168
|
specification_version: 4
|
141
169
|
summary: 'lovely_rufus: text wrapper'
|