ppcommand 0.2.1 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/ppcommand/cli.rb +1 -1
- data/lib/ppcommand/main.rb +13 -3
- data/lib/ppcommand/version.rb +1 -1
- metadata +1 -3
- data/.document +0 -5
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc5f1798e35e50bb6ebac57472146a7988152c6
|
4
|
+
data.tar.gz: 0a36a4e856fd39645d7fe29286daf6d632c8626a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5504626665165ed31c4d502188baf19a9bf9f52aaa928f1e0d7be762afcc54eb2979f52b78a5b24bf75d4dc504d3562c27e9ae4d97287094d050efca76be9eb
|
7
|
+
data.tar.gz: d2d3feefdbcc92d1eda899c9da42b42b3680e247abeb1ade3f086b1bda4e8966263e3e5bb886160c7dafe4cec83c75c4717369101c73e5f731bd86a9a53058f3
|
data/lib/ppcommand/cli.rb
CHANGED
@@ -28,7 +28,7 @@ module PPCommand
|
|
28
28
|
opp.on("-x", "--xml", "parse XML using REXML and pp."){|x| opts[:type] = "xml"}
|
29
29
|
opp.on("-X", "--xmlsimple", "parse XML using XMLSimple and pp."){|x| opts[:type] = "xmlsimple"}
|
30
30
|
opp.on("-y", "--yaml", "parse YAML and pp."){|x| opts[:type] = "yaml"}
|
31
|
-
|
31
|
+
opp.on("-Y", "--syck", "parse YAML using Syck and pp."){|x| opts[:type] = 'syck'}
|
32
32
|
opp.on("-t", "--text", "do not parse. print plain text."){|x| opts[:type] = "text"}
|
33
33
|
|
34
34
|
opp.parse!(argv)
|
data/lib/ppcommand/main.rb
CHANGED
@@ -60,6 +60,8 @@ module PPCommand
|
|
60
60
|
pp_html(source)
|
61
61
|
when "text"
|
62
62
|
puts source
|
63
|
+
when 'syck'
|
64
|
+
pp_syck(source)
|
63
65
|
else "yaml"
|
64
66
|
pp_yaml(source)
|
65
67
|
end
|
@@ -84,9 +86,17 @@ module PPCommand
|
|
84
86
|
end
|
85
87
|
|
86
88
|
def pp_yaml(source)
|
87
|
-
YAML.
|
88
|
-
|
89
|
-
|
89
|
+
objs = YAML.load_stream(source)
|
90
|
+
objs = objs[0] if objs.length == 1
|
91
|
+
ap objs
|
92
|
+
end
|
93
|
+
|
94
|
+
def pp_syck(source)
|
95
|
+
require 'syck'
|
96
|
+
YAML::ENGINE.yamler = 'syck'
|
97
|
+
objs = YAML.load_document(StringIO.new(source))
|
98
|
+
objs = objs[0] if objs.length == 1
|
99
|
+
ap objs
|
90
100
|
end
|
91
101
|
|
92
102
|
def pp_csv(source)
|
data/lib/ppcommand/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppcommand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOSEKI Kengo
|
@@ -88,13 +88,11 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .document
|
92
91
|
- .gitignore
|
93
92
|
- Gemfile
|
94
93
|
- LICENSE.txt
|
95
94
|
- README.md
|
96
95
|
- Rakefile
|
97
|
-
- VERSION
|
98
96
|
- bin/pp
|
99
97
|
- lib/ppcommand.rb
|
100
98
|
- lib/ppcommand/cli.rb
|
data/.document
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.5
|