json_cat 0.1.2 → 0.1.3

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: c85bbe2eaf7e7864c651518dd06808c7154e04fe
4
- data.tar.gz: 283627cc99f79c29e915a9725eef4df9356176bd
3
+ metadata.gz: 38eecb28c9b9794f17c67ddc1ea11f151d93c4ab
4
+ data.tar.gz: 9f3a587f1f6347df95e972c927dbeb1ca87f8e6d
5
5
  SHA512:
6
- metadata.gz: e92ec93685d139c8924414e7b8ae94f58fbd3c6266bc18dc2837904331daa7b5ec6cec855fe34db3e587012a3dec61956b4381bea9332604cb4d0372e586f562
7
- data.tar.gz: 76652b97d4c3b3160ea0474619dca218c8d98e25ccb44868ef806faa659056536c35cca4c8348fe16a9b17710a9827ba8fa0b3b3a6c2cf8e1aabfc52ae7c5f9e
6
+ metadata.gz: db4fdcf3e1588dfdfe57f20bfc2f84ecad33e2fd75ee142adbbfacff40490098bfdeaab36dc7b6db0dbde83da6ff33b69aa67ce170697d3c59dd9e9ca2874565
7
+ data.tar.gz: adb2874e4200741432d504e5d6214ea60a2e1d5f2c2ceba730dfee785909ca4b547f49021aedf19ad21a6cdd80a3b53b5b018cd650c360d403311a89cdd695be
data/.rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+
4
+ Lint/HandleExceptions:
5
+ Enabled: false
6
+
7
+ Style/AccessModifierIndentation:
8
+ EnforcedStyle: outdent
9
+
10
+ Style/Documentation:
11
+ Exclude:
12
+ - 'lib/json_cat/ext/*'
13
+ - 'test/**/*'
14
+
15
+ Style/Encoding:
16
+ Enabled: true
17
+ EnforcedStyle: always
18
+
19
+ Style/SpaceAroundEqualsInParameterDefault:
20
+ Enabled: true
21
+ EnforcedStyle: no_space
22
+
23
+ Style/SymbolArray:
24
+ Enabled: true
25
+
26
+ Style/TrailingCommaInLiteral:
27
+ Enabled: false
28
+
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/json_cat.svg)](https://badge.fury.io/rb/json_cat)
2
+
1
3
  # JsonCat
2
4
 
3
5
  Pretty print JSON files and standard input
@@ -10,6 +10,12 @@ class Array
10
10
  rainbow_print_build(level)
11
11
  end
12
12
 
13
+ if RUBY_VERSION < '2.1'
14
+ def to_h
15
+ Hash[*flatten]
16
+ end
17
+ end
18
+
13
19
  private
14
20
 
15
21
  def rainbow_print_open_bracket(level)
@@ -1,7 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Kernel
4
- def bow_print(obj)
5
- puts obj.rainbow_print
4
+ def bow_print(*objs)
5
+ objs.each do |obj|
6
+ puts obj.rainbow_print
7
+ end
8
+ objs.size <= 1 ? objs.first : objs
6
9
  end
10
+ module_function :bow_print
7
11
  end
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  class Object
4
- def rainbow_print(level = 0)
4
+ def rainbow_print(level=0)
5
5
  Rainbow(to_json).color(JsonCat::COLORS[level])
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module JsonCat
4
- VERSION = '0.1.2'.freeze
4
+ VERSION = '0.1.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_cat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Welch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -89,6 +89,7 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
+ - ".rubocop.yml"
92
93
  - ".travis.yml"
93
94
  - Gemfile
94
95
  - LICENSE