kazus 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -6
- data/lib/kazus/constants.rb +1 -1
- data/lib/kazus/inspectable.rb +10 -4
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0846a077cff833dd595180e45c4969e1da3f125d
|
4
|
+
data.tar.gz: 3e25e99ceef2e739c84a54318536846a092077c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f403e6cd02c257135e189adf29382e287037e1a93c66ebe7cb6079015b36a9005a96da116eeb434f70c44357be1fd5a3cac1183047e5b9f7211b0f1e911a447
|
7
|
+
data.tar.gz: ad662065cc1d460d104496e95b96e3c5c87d9a21515b3281fb81a0025c99ebbb20fdc7d1f2025f2c1da0d4855f82c80a43ae76e7faffd4976781f8e54b7b7c04
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Kazus
|
1
|
+
# Kazus
|
2
2
|
|
3
3
|
Kazus provides a simple logging helper. It accepts any amount or type of arguments and logs everything well readable, while including eventually given information like backtraces, validation errors of ActiveModel instances (the gem doesn't depend on rails, though) or the object's length (of an array or a hash). It is designed to not throw errors whatever the arguments are.
|
4
4
|
|
@@ -34,15 +34,19 @@ to log
|
|
34
34
|
|
35
35
|
## Installation
|
36
36
|
|
37
|
-
|
37
|
+
Run
|
38
38
|
|
39
|
-
```
|
40
|
-
gem
|
39
|
+
```sh
|
40
|
+
$ gem install kazus
|
41
41
|
```
|
42
42
|
|
43
|
-
|
43
|
+
or add this line to your application's Gemfile
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
gem 'kazus'
|
47
|
+
```
|
44
48
|
|
45
|
-
|
49
|
+
and run `$ bundle install`.
|
46
50
|
|
47
51
|
## Configuration
|
48
52
|
|
data/lib/kazus/constants.rb
CHANGED
data/lib/kazus/inspectable.rb
CHANGED
@@ -20,7 +20,7 @@ module Kazus
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# Returns a formatted string that gives a good insight on the object.
|
23
|
-
# Takes a title as first argument optionally, currently used in case
|
23
|
+
# Takes a title as first argument optionally, currently used in case
|
24
24
|
# this object is a value to a key of a hash (then the key is the title).
|
25
25
|
def inspection title=nil
|
26
26
|
# If this object is a hash and options[:detailed] is true,
|
@@ -117,8 +117,8 @@ module Kazus
|
|
117
117
|
# Rescue in case this object doesn't implement the required methods.
|
118
118
|
begin
|
119
119
|
error_messages = @object.errors.full_messages
|
120
|
-
message = error_messages.
|
121
|
-
pick_up_data("ERRORS", message)
|
120
|
+
message = error_messages.join(", ")
|
121
|
+
pick_up_data("ERRORS", message) if message.length > 0
|
122
122
|
rescue
|
123
123
|
# Don't really care.
|
124
124
|
end
|
@@ -130,8 +130,14 @@ module Kazus
|
|
130
130
|
|
131
131
|
# Don't collect if string is blank or it's the same as #inspect
|
132
132
|
# delivered.
|
133
|
-
unless s.length == 0 || @data["INSPECT"] == s
|
133
|
+
unless s.length == 0 || @data["INSPECT"].gsub(/(\A"|"\Z)/, '') == s
|
134
134
|
pick_up_data("TO_S", @object.to_s)
|
135
|
+
|
136
|
+
# If #inspect delivered the same content, remove
|
137
|
+
# the result of #inspect.
|
138
|
+
# if @data["INSPECT"].gsub(/(\A"|"\Z)/, '') == s
|
139
|
+
# @data.delete("INSPECT")
|
140
|
+
# end
|
135
141
|
end
|
136
142
|
end
|
137
143
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kazus
|
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
|
- esBeee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,10 +101,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.5
|
104
|
+
rubygems_version: 2.4.5
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Provides a method that logs a given message along with detailed inspections
|
108
108
|
of all further given objects in a well readable format.
|
109
109
|
test_files: []
|
110
|
-
has_rdoc:
|