jy 1.0
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 +7 -0
- data/bin/jy +24 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 611c3b8ec81a8e22e8486f3f32024fd02d65787f
|
4
|
+
data.tar.gz: 24a8cfb2b219c446b97998fe4dec94e36892c82d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d7715841be75c8e0a5505a3e056b95af1202b353b626285ec21598418ccb9323a40b6e6c1b9cc2da15483296e27a151543c9a31cdfef2dda84e616a7050a2113
|
7
|
+
data.tar.gz: 114f5f956063dac539b7009ae5f440e029097dfb7aed672ee1958ec9b8907dc224d7172b5dfbfdd6985a3d5de83646b38f46ab7e30d887f5f599687745cf80a3
|
data/bin/jy
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems' if RUBY_VERSION < '1.9.0'
|
4
|
+
require 'yaml'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
begin
|
8
|
+
# read the data
|
9
|
+
input = ARGF.read
|
10
|
+
begin
|
11
|
+
# first try JSON parsing and printing YAML
|
12
|
+
puts JSON.parse(input).to_yaml
|
13
|
+
exit 0
|
14
|
+
rescue
|
15
|
+
# if it fails, try to parse YAML and print JSON
|
16
|
+
puts JSON.generate(YAML.load(input))
|
17
|
+
exit 0
|
18
|
+
end
|
19
|
+
rescue
|
20
|
+
# if all steps fail...
|
21
|
+
puts 'Couln\'t parse data.'
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Radek 'blufor' Slavicinsky
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.6.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.6'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.6.0
|
33
|
+
description: JSON2YAML/YAML2JSON transcoder
|
34
|
+
email: radek.slavicinsky@gmail.com
|
35
|
+
executables:
|
36
|
+
- jy
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- bin/jy
|
41
|
+
homepage: https://github.com/blufor/jy
|
42
|
+
licenses:
|
43
|
+
- GPL-3.0
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.9.3
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 2.5.1
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: JSON2YAML/YAML2JSON transcoder
|
65
|
+
test_files: []
|