rspeckled 0.0.9 → 0.0.10

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: 178efa9c4f724e77d3054ce513c2e4d983e1e70e
4
- data.tar.gz: 4538a90ae240aade243dcab15bf55ed01bd92690
3
+ metadata.gz: bdecbbe20d9fa4d3d5ee167a8f7274362fc92811
4
+ data.tar.gz: 052f40be03a6413715d396cb15b26ade89f9302b
5
5
  SHA512:
6
- metadata.gz: 5e96ea4a422ccfb7147b548271cb807eccba12fcc302fa1767812712b69b4b32217d666f60d4820938a8ff17c1f13d47044eb55354e79be1d3c8fb8c52a99bef
7
- data.tar.gz: 4ff8b38c3fb9c493de7fd8caf2f0092447084a887a12033c0772fd316c4f96001cc261952ffd0e989e9cfd0810835add8b1ed9f10156ace845db706b1ab6b9ad
6
+ metadata.gz: f8e88abbfbb72f7c8a406275d4677fe8c38c2c4cd7df605df1dc45e5d1933b641a324d5b29d2ef68f5ff3db125c36595ca0b40425065411eb8743e21cb50ed6a
7
+ data.tar.gz: c2f74123afafd80674fbfee817309da7132a9f61975a4b73bb673a71110b7de988e57b0d6c9feaec7993a5b25c3bd327b0248141b978933d1ee49f8a8b89207f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -14,6 +14,7 @@ require 'rspeckled/plugins/fakeredis'
14
14
  require 'rspeckled/plugins/features'
15
15
  require 'rspeckled/plugins/omniauth'
16
16
  require 'rspeckled/plugins/mocks'
17
+ require 'rspeckled/plugins/pretty_print'
17
18
  require 'rspeckled/plugins/rails/engine'
18
19
  require 'rspeckled/plugins/rails/strong_parameters'
19
20
  require 'rspeckled/plugins/recaptcha'
@@ -2,31 +2,57 @@
2
2
  # Awesome Print Plugin
3
3
  ##############################################################################
4
4
 
5
+ # rubocop:disable Metrics/AbcSize
5
6
  begin
6
7
  require 'awesome_print'
8
+ require 'io/console'
7
9
 
10
+ # :reek:DuplicateMethodCall
8
11
  module Kernel
9
- def sap(msg)
10
- puts
11
- puts
12
- ap "************************** #{Time.now} **************************", :color => { :string => :white }
12
+ def sap(*messages)
13
+ _rows, columns = IO.console.winsize
14
+
13
15
  puts
14
- ap(msg.class, :color => { :class => :yellowish }) if msg.respond_to?(:class)
16
+ print "\e[1;37m"
17
+ print " #{Time.now} ".center(columns, '*')
18
+ print "\e[0m\n"
15
19
  puts
16
- root_path = defined?(Rails) ? Rails.root.to_s : ''
20
+ root_path = if defined?(Rails)
21
+ Rails.root.to_s
22
+ else
23
+ `git rev-parse --show-toplevel`
24
+ end
17
25
 
18
- lines = caller[0...3].map do |line|
19
- line.gsub(root_path + '/', '')
26
+ caller[0...5].each do |line|
27
+ relative_line = line.gsub!(root_path.strip, '.')
28
+
29
+ color = if relative_line == line
30
+ '35'
31
+ else
32
+ '1;30'
33
+ end
34
+
35
+ print "\e[#{color}m"
36
+ print line
37
+ print "\e[0m\n"
20
38
  end
21
39
 
22
- lines.each { |line| ap line, :color => { :string => :purpleish } }
23
- puts
24
- ap msg
25
- puts
26
- ap '************************************* END **************************************', :color => { :string => :white }
27
- puts
28
40
  puts
41
+
42
+ Array(messages).each_with_index do |message, index|
43
+ if message.respond_to?(:class)
44
+ print "\e[32m"
45
+ print message.class
46
+ print "\e[0m\n"
47
+ puts
48
+ end
49
+
50
+ ap(message)
51
+
52
+ puts unless index + 1 == Array(messages).length
53
+ end
29
54
  end
30
55
  end
31
56
  rescue LoadError
32
57
  end
58
+ # rubocop:enable Metrics/AbcSize
@@ -0,0 +1 @@
1
+ require 'pp'
@@ -1,3 +1,3 @@
1
1
  module Rspeckled
2
- VERSION = '0.0.9'.freeze
2
+ VERSION = '0.0.10'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspeckled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
@@ -31,7 +31,7 @@ cert_chain:
31
31
  zRIv8lqQM8QFT76rzP5SBCERwN+ltKAFbQ5/FwmZNGWYnmCP3RZMQiRnbh+9H9lh
32
32
  mlbwaYZTjgsXq6cy8N38EecewgBbZYS1IYJraE/M
33
33
  -----END CERTIFICATE-----
34
- date: 2016-06-06 00:00:00.000000000 Z
34
+ date: 2016-06-12 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
@@ -112,6 +112,7 @@ files:
112
112
  - lib/rspeckled/plugins/garbage_collection.rb
113
113
  - lib/rspeckled/plugins/mocks.rb
114
114
  - lib/rspeckled/plugins/omniauth.rb
115
+ - lib/rspeckled/plugins/pretty_print.rb
115
116
  - lib/rspeckled/plugins/rails/engine.rb
116
117
  - lib/rspeckled/plugins/rails/strong_parameters.rb
117
118
  - lib/rspeckled/plugins/recaptcha.rb
metadata.gz.sig CHANGED
Binary file