paul_bunyan 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Dockerfile +3 -4
- data/build.sh +1 -2
- data/lib/paul_bunyan.rb +9 -0
- data/lib/paul_bunyan/json_formatter.rb +1 -10
- data/lib/paul_bunyan/version.rb +1 -1
- data/paul_bunyan.gemspec +0 -1
- data/spec/lib/paul_bunyan_spec.rb +6 -0
- data/spec/spec_helper.rb +0 -1
- metadata +2 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9faf88c896e659a4e197204602b9a74ad16e1ed6
|
4
|
+
data.tar.gz: c2eeb9d27331dba0843e9c4f0a0dc1aeafbf04dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb99a1f146a20ef706ced17bc9909568696bb8190d994dd12f309d739179adfec7715019291d69f29a3c1b9127d30bf09c5303444c5d6917d6db731253792b47
|
7
|
+
data.tar.gz: 645fa919eb06097ebf2b4695262fb7fb8b78427366156818e876bf8848f5728860b0a5f5a66a5714cfed75b9b656e382fcee8ccdcfaeaf8845525efabaf35862
|
data/.travis.yml
CHANGED
data/Dockerfile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
FROM
|
2
|
-
MAINTAINER
|
1
|
+
FROM instructure/ruby:2.1
|
2
|
+
MAINTAINER Instructure
|
3
3
|
|
4
|
-
WORKDIR /usr/src/app
|
5
4
|
COPY Gemfile* *.gemspec /usr/src/app/
|
6
5
|
COPY lib/paul_bunyan/version.rb /usr/src/app/lib/paul_bunyan/
|
7
6
|
RUN bundle install
|
@@ -10,4 +9,4 @@ COPY . /usr/src/app
|
|
10
9
|
USER root
|
11
10
|
RUN chown -R docker:docker /usr/src/app/*
|
12
11
|
USER docker
|
13
|
-
CMD bundle exec wwtd --parallel
|
12
|
+
CMD ["bundle", "exec", "wwtd", "--parallel"]
|
data/build.sh
CHANGED
data/lib/paul_bunyan.rb
CHANGED
@@ -32,6 +32,15 @@ module PaulBunyan
|
|
32
32
|
attr_accessor :default_formatter_type
|
33
33
|
PaulBunyan.default_formatter_type = :json
|
34
34
|
|
35
|
+
ANSI_REGEX = /(?:\e\[|\u009b)(?:\d{1,3}(?:;\d{0,3})*)?[0-9A-MRcf-npqrsuy]/.freeze
|
36
|
+
def strip_ansi(value)
|
37
|
+
if value.respond_to?(:to_str)
|
38
|
+
value.to_str.gsub(ANSI_REGEX, '')
|
39
|
+
elsif value
|
40
|
+
value.gsub(ANSI_REGEX, '')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
35
44
|
def logger
|
36
45
|
create_logger(STDOUT) unless @logger
|
37
46
|
@logger
|
@@ -80,7 +80,7 @@ module PaulBunyan
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def format_string(message)
|
83
|
-
{ "message" => strip_ansi(message.strip) }
|
83
|
+
{ "message" => PaulBunyan.strip_ansi(message.strip) }
|
84
84
|
end
|
85
85
|
|
86
86
|
def format_generic_object(object)
|
@@ -109,14 +109,5 @@ module PaulBunyan
|
|
109
109
|
clean
|
110
110
|
}
|
111
111
|
end
|
112
|
-
|
113
|
-
ANSI_REGEX = /(?:\e\[|\u009b)(?:\d{1,3}(?:;\d{0,3})*)?[0-9A-MRcf-npqrsuy]/
|
114
|
-
def strip_ansi(value)
|
115
|
-
if value.respond_to?(:to_str)
|
116
|
-
value.to_str.gsub(ANSI_REGEX, '')
|
117
|
-
elsif value
|
118
|
-
value.gsub(ANSI_REGEX, '')
|
119
|
-
end
|
120
|
-
end
|
121
112
|
end
|
122
113
|
end
|
data/lib/paul_bunyan/version.rb
CHANGED
data/paul_bunyan.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
24
24
|
spec.add_development_dependency 'rake'
|
25
25
|
spec.add_development_dependency 'rspec'
|
26
|
-
spec.add_development_dependency 'guard-rspec'
|
27
26
|
spec.add_development_dependency 'wwtd'
|
28
27
|
spec.add_development_dependency 'rails'
|
29
28
|
spec.add_development_dependency 'sqlite3'
|
@@ -134,4 +134,10 @@ describe PaulBunyan do
|
|
134
134
|
PaulBunyan.remove_logger(PaulBunyan.logger.primary_logger)
|
135
135
|
end
|
136
136
|
end
|
137
|
+
|
138
|
+
describe '::strip_ansi' do
|
139
|
+
it 'removes ANSI color codes' do
|
140
|
+
expect(PaulBunyan.strip_ansi("\e[36;46mcolored message!")).to eq 'colored message!'
|
141
|
+
end
|
142
|
+
end
|
137
143
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paul_bunyan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duane Johnson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: request_store
|
@@ -69,20 +69,6 @@ dependencies:
|
|
69
69
|
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: guard-rspec
|
74
|
-
requirement: !ruby/object:Gem::Requirement
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '0'
|
79
|
-
type: :development
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - ">="
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
72
|
- !ruby/object:Gem::Dependency
|
87
73
|
name: wwtd
|
88
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -301,4 +287,3 @@ test_files:
|
|
301
287
|
- spec/lib/paul_bunyan_spec.rb
|
302
288
|
- spec/spec_helper.rb
|
303
289
|
- spec/support/notification_helpers.rb
|
304
|
-
has_rdoc:
|