object_inspector 0.5.0 → 0.5.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
  SHA256:
3
- metadata.gz: 9f4c63d6d3fafd3a58a9d2b5044b4d815e4778b762aa5ed38702e4ec79fcd4ec
4
- data.tar.gz: 7aebf8ecc7b5ec9de2cb0b95d11b70cfdc1f91e69d306aa930843c90f7803571
3
+ metadata.gz: '0239fa0f437f4adba26fc4e851432bd52a2281e111e18adadb08193e0e8211eb'
4
+ data.tar.gz: 2c3b6c55c0abe681c0714909df5c78763389fbc3ea635a704a2643adc14b9701
5
5
  SHA512:
6
- metadata.gz: d2552d039748335690f1d3e95382232e644d875c43823d7bbb81cc5acaff3437549027e6119ee8dc1236e270bdea96e26ebd0130329d6e149bb01feac67d6c95
7
- data.tar.gz: 3414d335667867d81c96701fd07bad0b71025f750c127db218915cb5e8f23116619fcfb347494aa9bc1b07b9fa5bf9056af0db82871eb029013c0417cb1bb387
6
+ metadata.gz: 3f57d2cf29f436f587a30dc29cca58db4ca735504a3f73c18f79e618960627acb948ac382e9f78372455c90d8e956ad3082643c23e69b224f3ebb515e446513f
7
+ data.tar.gz: af46679e2a81eb89d4c14743f1632219f5f8e30106257e8a4e716a396d3ada87e6c8dc86e9cc83df39f7b057767b1f56aec9dc1f20a64955345ef2ac6831edee
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.5.1 - 2018-06-12
2
+ - Don't include empty strings from Scope#join_* methods when applicable.
3
+
1
4
  ### 0.5.0 - 2018-06-11
2
5
  - Add `inspect_issues` to ObjectInspector::TemplatingFormatter.
3
6
  - Add ObjectInspector::Scope#join_name.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- object_inspector (0.5.0)
4
+ object_inspector (0.5.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -33,6 +33,10 @@ module ObjectInspector
33
33
  @flags_and_info_template ||= "<%s(%s) %s>".freeze
34
34
  end
35
35
 
36
+ def self.flags_and_issues_template
37
+ @flags_and_issues_template ||= "<%s(%s) !!%s!!>".freeze
38
+ end
39
+
36
40
  def self.issues_and_info_template
37
41
  @issues_and_info_template ||= "<%s !!%s!! %s>".freeze
38
42
  end
@@ -149,16 +153,6 @@ module ObjectInspector
149
153
  end
150
154
  end
151
155
 
152
- def build_string_with_flags_and_maybe_info_and_name
153
- if info
154
- build_string_with_flags_and_info_and_maybe_name
155
- elsif name
156
- build_string_with_flags_and_name
157
- else
158
- build_string_with_flags
159
- end
160
- end
161
-
162
156
  def build_string_with_flags_and_info_and_maybe_name
163
157
  if name
164
158
  build_string_with_flags_and_info_and_name
@@ -200,6 +194,10 @@ module ObjectInspector
200
194
  [identification, flags, issues, info]
201
195
  end
202
196
 
197
+ def build_string_with_flags_and_issues
198
+ self.class.flags_and_issues_template % [identification, flags, issues]
199
+ end
200
+
203
201
  def build_string_with_flags_and_info
204
202
  self.class.flags_and_info_template % [identification, flags, info]
205
203
  end
@@ -25,7 +25,8 @@ module ObjectInspector
25
25
  # @param separator [#to_s] (ObjectInspector.configuration.flags_separator)
26
26
  def join_name(parts,
27
27
  separator: ObjectInspector.configuration.name_separator)
28
- Array(parts).join(separator)
28
+ the_parts = Array(parts)
29
+ the_parts.join(separator) if the_parts.any?
29
30
  end
30
31
 
31
32
  # Join the passed-in flags with the passed in separator.
@@ -34,7 +35,8 @@ module ObjectInspector
34
35
  # @param separator [#to_s] (ObjectInspector.configuration.flags_separator)
35
36
  def join_flags(flags,
36
37
  separator: ObjectInspector.configuration.flags_separator)
37
- Array(flags).join(separator)
38
+ the_flags = Array(flags)
39
+ the_flags.join(separator) if the_flags.any?
38
40
  end
39
41
 
40
42
  # Join the passed-in issues with the passed in separator.
@@ -43,7 +45,8 @@ module ObjectInspector
43
45
  # @param separator [#to_s] (ObjectInspector.configuration.issues_separator)
44
46
  def join_issues(issues,
45
47
  separator: ObjectInspector.configuration.issues_separator)
46
- Array(issues).join(separator)
48
+ the_issues = Array(issues)
49
+ the_issues.join(separator) if the_issues.any?
47
50
  end
48
51
 
49
52
  # Join the passed-in items with the passed in separator.
@@ -52,7 +55,8 @@ module ObjectInspector
52
55
  # @param separator [#to_s] (ObjectInspector.configuration.info_separator)
53
56
  def join_info(items,
54
57
  separator: ObjectInspector.configuration.info_separator)
55
- Array(items).join(separator)
58
+ the_items = Array(items)
59
+ the_items.join(separator) if the_items.any?
56
60
  end
57
61
 
58
62
  # Compare self with the passed in object.
@@ -1,3 +1,3 @@
1
1
  module ObjectInspector
2
- VERSION = "0.5.0".freeze
2
+ VERSION = "0.5.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dobbins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips