cmessages 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -8
- data/VERSION.txt +1 -1
- data/lib/cmessages.rb +6 -6
- data/lib/cmessages/version.rb +1 -1
- data/spec/cmessages_spec.rb +90 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf8d8399c5dd90c0e1088fb5bdf4a9d38be1f3c68f9ec006de8e61cd118ca26e
|
4
|
+
data.tar.gz: b95caf49a0ea8a07cb0e2097aaae66e9c0533cef57c506f8eb079ebe12c53a5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d598e4d9f8b7b5c7f483655340706388630de32895b766ac5eab0854a5e98428bc31fb92493c0befda20ce28b8550646ab8e1b061f8baf9ad77f3da3e882b401
|
7
|
+
data.tar.gz: b932d00fc45bdf1deb08cbf61ed4e51da937890d983d93aeb3eaa57c4a78758a61eccff1a471cf86a88d59ffb6715bcdf4e44769bbbd964d3c5ebcbd9da42fc6
|
data/CHANGELOG.md
CHANGED
@@ -3,23 +3,33 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
5
|
|
6
|
-
This changelog was automatically generated using [Caretaker](https://github.com/WSRubyGems/cmessages
|
6
|
+
This changelog was automatically generated using [Caretaker](https://github.com/WSRubyGems/cmessages) by [Wolf Software](https://github.com/WolfSoftware)
|
7
7
|
|
8
|
-
### [v1.0.
|
8
|
+
### [v1.0.1](https://github.com/WSRubyGems/cmessages/compare/v1.0.0...v1.0.1)
|
9
|
+
|
10
|
+
> Released on August, 10th 2020
|
11
|
+
|
12
|
+
- Pre-release version bump [`[head]`](https://github.com/WSRubyGems/cmessages/commit/) [`[TGWolf]`](https://github.com/TGWolf)
|
13
|
+
|
14
|
+
- Fix rubocop errors in the spec files [`[67b4cf2]`](https://github.com/WSRubyGems/cmessages/commit/67b4cf26cb0c2d0acba9a03ba1679b9b327e4c7e) [`[TGWolf]`](https://github.com/TGWolf)
|
15
|
+
|
16
|
+
- Fix an error in the regex which caused messages with embedded blank lines to be ignored [`[6a6275f]`](https://github.com/WSRubyGems/cmessages/commit/6a6275f8575d95fbd1830d307753cdbccb3ebb4a) [`[TGWolf]`](https://github.com/TGWolf)
|
17
|
+
|
18
|
+
### [v1.0.0](https://github.com/WSRubyGems/cmessages/compare/v0.1.0...v1.0.0)
|
9
19
|
|
10
20
|
> Released on March, 12th 2020
|
11
21
|
|
12
|
-
- Update the gem version.rb [`[
|
22
|
+
- Update the gem version.rb [`[5d14c18]`](https://github.com/WSRubyGems/cmessages/commit/5d14c18bef1d6fdec917aa13b542ffc74f7437a6) [`[TGWolf]`](https://github.com/TGWolf)
|
13
23
|
|
14
|
-
- Update the README and tag for release [`[5e35b9f]`](https://github.com/WSRubyGems/cmessages
|
24
|
+
- Update the README and tag for release [`[5e35b9f]`](https://github.com/WSRubyGems/cmessages/commit/5e35b9f10bba1b5125ddd7b6ec58029e2ba6f454) [`[TGWolf]`](https://github.com/TGWolf)
|
15
25
|
|
16
|
-
- Remove Ruby 2.4 support and add 2.7, also change the organisation [`[4ac44c9]`](https://github.com/WSRubyGems/cmessages
|
26
|
+
- Remove Ruby 2.4 support and add 2.7, also change the organisation [`[4ac44c9]`](https://github.com/WSRubyGems/cmessages/commit/4ac44c9ae9409f1feb436a04029fcdb8f7bf267b) [`[TGWolf]`](https://github.com/TGWolf)
|
17
27
|
|
18
|
-
### [v0.1.0](https://github.com/WSRubyGems/cmessages
|
28
|
+
### [v0.1.0](https://github.com/WSRubyGems/cmessages/releases/v0.1.0)
|
19
29
|
|
20
30
|
> Released on March, 3rd 2020
|
21
31
|
|
22
|
-
- Update the README to include the valid colour names [`[d947cee]`](https://github.com/WSRubyGems/cmessages
|
32
|
+
- Update the README to include the valid colour names [`[d947cee]`](https://github.com/WSRubyGems/cmessages/commit/d947cee322cbe16da819b6cd0b4ff5432aef96dd) [`[TGWolf]`](https://github.com/TGWolf)
|
23
33
|
|
24
|
-
- Initial push [`[0c9abc0]`](https://github.com/WSRubyGems/cmessages
|
34
|
+
- Initial push [`[0c9abc0]`](https://github.com/WSRubyGems/cmessages/commit/0c9abc03283147140df28ec8719927b5150ba9fb) [`[TGWolf]`](https://github.com/TGWolf)
|
25
35
|
|
data/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/cmessages.rb
CHANGED
@@ -41,34 +41,34 @@ class Cmessages
|
|
41
41
|
def error(message = nil)
|
42
42
|
return if message.nil?
|
43
43
|
|
44
|
-
|
44
|
+
real_show_message(@error_prefix, message, @error_colour)
|
45
45
|
end
|
46
46
|
|
47
47
|
def warning(message = nil)
|
48
48
|
return if message.nil?
|
49
49
|
|
50
|
-
|
50
|
+
real_show_message(@warning_prefix, message, @warning_colour)
|
51
51
|
end
|
52
52
|
|
53
53
|
def success(message = nil)
|
54
54
|
return if message.nil?
|
55
55
|
|
56
|
-
|
56
|
+
real_show_message(@success_prefix, message, @success_colour)
|
57
57
|
end
|
58
58
|
|
59
59
|
def info(message = nil)
|
60
60
|
return if message.nil?
|
61
61
|
|
62
|
-
|
62
|
+
real_show_message(@info_prefix, message, @info_colour)
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
65
|
+
def real_show_message(prefix, message, colour)
|
66
66
|
return if message.nil?
|
67
67
|
|
68
68
|
return if message.empty?
|
69
69
|
|
70
70
|
# String contains 0 or more white-space character and nothing else.
|
71
|
-
return if message =~
|
71
|
+
return if message =~ /\A\s*\z/
|
72
72
|
|
73
73
|
message = "#{prefix} #{message}" if @use_prefixes
|
74
74
|
|
data/lib/cmessages/version.rb
CHANGED
data/spec/cmessages_spec.rb
CHANGED
@@ -106,6 +106,51 @@ RSpec.describe Cmessages do
|
|
106
106
|
specify { expect { Cmessages.new(:info_colour => :magenta).info('foo') }.to output("\e[0;35;49m[ Info ] foo\e[0m\n").to_stdout }
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
context 'Multi-line Strings' do
|
111
|
+
context 'error' do
|
112
|
+
specify { expect { @cmnc.error("This has multiple\nlines in it") }.to output("[ Error ] This has multiple\nlines in it\n").to_stdout }
|
113
|
+
end
|
114
|
+
context 'warning' do
|
115
|
+
specify { expect { @cmnc.warning("This has multiple\nlines in it") }.to output("[ Warning ] This has multiple\nlines in it\n").to_stdout }
|
116
|
+
end
|
117
|
+
context 'success' do
|
118
|
+
specify { expect { @cmnc.success("This has multiple\nlines in it") }.to output("[ Success ] This has multiple\nlines in it\n").to_stdout }
|
119
|
+
end
|
120
|
+
context 'info' do
|
121
|
+
specify { expect { @cmnc.info("This has multiple\nlines in it") }.to output("[ Info ] This has multiple\nlines in it\n").to_stdout }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
context 'Multi-line Strings (including blank lines)' do
|
126
|
+
context 'error' do
|
127
|
+
specify { expect { @cmnc.error("This has multiple\n\nlines in it") }.to output("[ Error ] This has multiple\n\nlines in it\n").to_stdout }
|
128
|
+
end
|
129
|
+
context 'warning' do
|
130
|
+
specify { expect { @cmnc.warning("This has multiple\n\nlines in it") }.to output("[ Warning ] This has multiple\n\nlines in it\n").to_stdout }
|
131
|
+
end
|
132
|
+
context 'success' do
|
133
|
+
specify { expect { @cmnc.success("This has multiple\n\nlines in it") }.to output("[ Success ] This has multiple\n\nlines in it\n").to_stdout }
|
134
|
+
end
|
135
|
+
context 'info' do
|
136
|
+
specify { expect { @cmnc.info("This has multiple\n\nlines in it") }.to output("[ Info ] This has multiple\n\nlines in it\n").to_stdout }
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
context 'Empty Strings' do
|
141
|
+
context 'error' do
|
142
|
+
specify { expect { @cm.error('') }.to output('').to_stdout }
|
143
|
+
end
|
144
|
+
context 'warning' do
|
145
|
+
specify { expect { @cm.warning('') }.to output('').to_stdout }
|
146
|
+
end
|
147
|
+
context 'success' do
|
148
|
+
specify { expect { @cm.success('') }.to output('').to_stdout }
|
149
|
+
end
|
150
|
+
context 'info' do
|
151
|
+
specify { expect { @cm.info('') }.to output('').to_stdout }
|
152
|
+
end
|
153
|
+
end
|
109
154
|
end
|
110
155
|
|
111
156
|
context 'String Accessor Method' do
|
@@ -198,5 +243,50 @@ RSpec.describe Cmessages do
|
|
198
243
|
specify { expect { 'foo'.info(:info_colour => :magenta) }.to output("\e[0;35;49m[ Info ] foo\e[0m\n").to_stdout }
|
199
244
|
end
|
200
245
|
end
|
246
|
+
|
247
|
+
context 'Multi-line Strings' do
|
248
|
+
context 'error' do
|
249
|
+
specify { expect { "This has multiple\nlines in it".error(:use_colours => false) }.to output("[ Error ] This has multiple\nlines in it\n").to_stdout }
|
250
|
+
end
|
251
|
+
context 'warning' do
|
252
|
+
specify { expect { "This has multiple\nlines in it".warning(:use_colours => false) }.to output("[ Warning ] This has multiple\nlines in it\n").to_stdout }
|
253
|
+
end
|
254
|
+
context 'success' do
|
255
|
+
specify { expect { "This has multiple\nlines in it".success(:use_colours => false) }.to output("[ Success ] This has multiple\nlines in it\n").to_stdout }
|
256
|
+
end
|
257
|
+
context 'info' do
|
258
|
+
specify { expect { "This has multiple\nlines in it".info(:use_colours => false) }.to output("[ Info ] This has multiple\nlines in it\n").to_stdout }
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
context 'Multi-line Strings (including blank lines)' do
|
263
|
+
context 'error' do
|
264
|
+
specify { expect { "This has multiple\n\nlines in it".error(:use_colours => false) }.to output("[ Error ] This has multiple\n\nlines in it\n").to_stdout }
|
265
|
+
end
|
266
|
+
context 'warning' do
|
267
|
+
specify { expect { "This has multiple\n\nlines in it".warning(:use_colours => false) }.to output("[ Warning ] This has multiple\n\nlines in it\n").to_stdout }
|
268
|
+
end
|
269
|
+
context 'success' do
|
270
|
+
specify { expect { "This has multiple\n\nlines in it".success(:use_colours => false) }.to output("[ Success ] This has multiple\n\nlines in it\n").to_stdout }
|
271
|
+
end
|
272
|
+
context 'info' do
|
273
|
+
specify { expect { "This has multiple\n\nlines in it".info(:use_colours => false) }.to output("[ Info ] This has multiple\n\nlines in it\n").to_stdout }
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
context 'Empty Strings' do
|
278
|
+
context 'error' do
|
279
|
+
specify { expect { ''.error }.to output('').to_stdout }
|
280
|
+
end
|
281
|
+
context 'warning' do
|
282
|
+
specify { expect { ''.warning }.to output('').to_stdout }
|
283
|
+
end
|
284
|
+
context 'success' do
|
285
|
+
specify { expect { ''.success }.to output('').to_stdout }
|
286
|
+
end
|
287
|
+
context 'info' do
|
288
|
+
specify { expect { ''.info }.to output('').to_stdout }
|
289
|
+
end
|
290
|
+
end
|
201
291
|
end
|
202
292
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmessages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Gurney aka Wolf
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,7 +114,7 @@ homepage: https://github.com/WSRubyGems/cmessages
|
|
114
114
|
licenses:
|
115
115
|
- MIT
|
116
116
|
metadata: {}
|
117
|
-
post_install_message:
|
117
|
+
post_install_message:
|
118
118
|
rdoc_options: []
|
119
119
|
require_paths:
|
120
120
|
- lib
|
@@ -129,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.1.
|
133
|
-
signing_key:
|
132
|
+
rubygems_version: 3.1.4
|
133
|
+
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: A simple gem for outputting console errors/warnings/success/info messages.
|
136
136
|
test_files: []
|