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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 956ccef06d46e5dfffa5d275b380f268a6de7bd2
4
- data.tar.gz: 2c69762bb62009f0a60284b007853ffd724db02b
3
+ metadata.gz: 9faf88c896e659a4e197204602b9a74ad16e1ed6
4
+ data.tar.gz: c2eeb9d27331dba0843e9c4f0a0dc1aeafbf04dd
5
5
  SHA512:
6
- metadata.gz: b8ee48f85b919d37e8d9381f6b078204f51d8ee73e6202727e5e6ac22f8789a3597c17ba86b6749aa014e8516fe7e2078caf23ff4070f88088c52a0cf0ad7dfa
7
- data.tar.gz: 4227bdd9d9f14e611a32a5f6cfdeda41324115c8bbe289e9b17dfa1c3117b475156d8d8e59c40fbb3af78f8d53faaf17503f59c7aaf55dba1f996d7b0ce01ebd
6
+ metadata.gz: eb99a1f146a20ef706ced17bc9909568696bb8190d994dd12f309d739179adfec7715019291d69f29a3c1b9127d30bf09c5303444c5d6917d6db731253792b47
7
+ data.tar.gz: 645fa919eb06097ebf2b4695262fb7fb8b78427366156818e876bf8848f5728860b0a5f5a66a5714cfed75b9b656e382fcee8ccdcfaeaf8845525efabaf35862
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  bundler_args: ''
2
2
  language: ruby
3
3
  gemfile:
4
+ - Gemfile
4
5
  - spec/gemfiles/40.gemfile
5
6
  - spec/gemfiles/41.gemfile
6
7
  - spec/gemfiles/42.gemfile
data/Dockerfile CHANGED
@@ -1,7 +1,6 @@
1
- FROM docker.insops.net/instructure/instructure-ruby:2.1
2
- MAINTAINER Tyler Pickett <tpickett@instructure.com>
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
@@ -2,6 +2,5 @@
2
2
 
3
3
  set -e
4
4
 
5
- docker pull docker.insops.net/instructure/instructure-ruby:2.1
6
- docker-compose build
5
+ docker-compose build --pull
7
6
  docker-compose run test
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
@@ -1,3 +1,3 @@
1
1
  module PaulBunyan
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.0'
3
3
  end
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
@@ -14,7 +14,6 @@ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
14
14
  ActiveSupport::TestCase.fixtures :all
15
15
  end
16
16
 
17
- require 'pry'
18
17
  require 'securerandom'
19
18
  require 'stringio'
20
19
  require 'paul_bunyan'
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.1
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: 2015-09-09 00:00:00.000000000 Z
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: