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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12fcb9c3694e8635ad45b26bafd7faac57ec8d3a
4
- data.tar.gz: a1cc670ce8c4228839773e9a7ab558e0134eb349
3
+ metadata.gz: 0846a077cff833dd595180e45c4969e1da3f125d
4
+ data.tar.gz: 3e25e99ceef2e739c84a54318536846a092077c0
5
5
  SHA512:
6
- metadata.gz: 0822f449140aa93522664c37ba76f9c85872b5c944a432ce758decfd67bda44b33f3eaf6801391bcb6f46c619e740d07090449bb23a437d078b8b04e39beb570
7
- data.tar.gz: b244668c9b2dae2c5e400e71104d6e05b0df9b5c2e8593ca2b69857a558a301aa6f6b2c7d6dd24fa4b59ac18e64777dbc754558b8d0cb43bbfde163e8c779446
6
+ metadata.gz: 5f403e6cd02c257135e189adf29382e287037e1a93c66ebe7cb6079015b36a9005a96da116eeb434f70c44357be1fd5a3cac1183047e5b9f7211b0f1e911a447
7
+ data.tar.gz: ad662065cc1d460d104496e95b96e3c5c87d9a21515b3281fb81a0025c99ebbb20fdc7d1f2025f2c1da0d4855f82c80a43ae76e7faffd4976781f8e54b7b7c04
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Kazus gem
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
- Add this line to your application's Gemfile:
37
+ Run
38
38
 
39
- ```ruby
40
- gem 'kazus', git: 'git://github.com/esBeee/kazus.git'
39
+ ```sh
40
+ $ gem install kazus
41
41
  ```
42
42
 
43
- And then execute:
43
+ or add this line to your application's Gemfile
44
+
45
+ ```ruby
46
+ gem 'kazus'
47
+ ```
44
48
 
45
- $ bundle
49
+ and run `$ bundle install`.
46
50
 
47
51
  ## Configuration
48
52
 
@@ -1,4 +1,4 @@
1
1
  module Kazus
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  LOG_LEVELS = [:debug, :info, :warn, :error, :fatal, :unknown] # Note that the order is important! (Ensures e.g. :warn corresponds to 2).
4
4
  end
@@ -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.length == 0 ? "[]" : error_messages.join(", ")
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.0
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-07-20 00:00:00.000000000 Z
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.2
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: