json_tree 0.0.1 → 0.0.2

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.
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.0.2
4
+
5
+ * Patch from [olly](https://github.com/olly) for a more ruby like array wrap behaviour.
6
+
7
+ ## 0.0.1
8
+
9
+ * Initial release
data/bin/json_tree CHANGED
@@ -4,18 +4,6 @@ require 'rubygems'
4
4
  require 'open-uri'
5
5
  require 'json'
6
6
 
7
- class Array
8
- def self.wrap(object)
9
- if object.nil?
10
- []
11
- elsif object.respond_to?(:to_ary)
12
- object.to_ary || [object]
13
- else
14
- [object]
15
- end
16
- end
17
- end
18
-
19
7
  def input
20
8
  if ARGV.empty?
21
9
  $stdin.read
@@ -39,4 +27,4 @@ def put_hash_keys(hash, indent=1)
39
27
  end
40
28
  end
41
29
 
42
- put_hash_keys(Array.wrap(JSON.parse(input)).first)
30
+ put_hash_keys([*JSON.parse(input)].first)
@@ -1,3 +1,3 @@
1
1
  module JsonTree
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70305490511880 !ruby/object:Gem::Requirement
16
+ requirement: &70201749601100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70305490511880
24
+ version_requirements: *70201749601100
25
25
  description: A simple tool for printing the structure of a JSON object
26
26
  email:
27
27
  - oliver.nightingale1@gmail.com
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - .gitignore
34
+ - CHANGELOG.markdown
34
35
  - Gemfile
35
36
  - Rakefile
36
37
  - bin/json_tree