inspect 0.0.0 → 0.0.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 +4 -4
- data/bin/inspect +3 -4
- data/lib/inspect.rb +1 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8afe602d804fccbdb7bc7d445561e368bfe86c47
|
4
|
+
data.tar.gz: 48b41a4b77fbc4fc64fa20a3872724d25f4eb258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a4d7bad714a09b447862ca101703bcd651e6b7563cbaebcc5c7fb5aecdfbf339bda4390a36171e303858b198ee824bf20c352a2729b339a771e1a6b2808401
|
7
|
+
data.tar.gz: 8c18d8d06e7a72fce1980be4a88c4eb4fc924d3adf9d2830383e7f705159e5c849e1e1cc3f1ef0fd0758b24fba42a1b555c0a3895d8ddd2ee7e6156ce6c19508
|
data/bin/inspect
CHANGED
@@ -4,12 +4,11 @@ require 'inspect'
|
|
4
4
|
data = read_data
|
5
5
|
x = parse_data(ARGV.shift, data)
|
6
6
|
if x.nil?
|
7
|
-
puts 'ERROR: Could not parse data.'
|
8
|
-
puts 'ERROR: Try explicit formating, e.g. cat file | inspect json'
|
9
|
-
puts "ERROR: Here is the first line: #{data.lines.first}"
|
7
|
+
STDERR.puts 'ERROR: Could not parse data.'
|
8
|
+
STDERR.puts 'ERROR: Try explicit formating, e.g. cat file | inspect json'
|
9
|
+
STDERR.puts "ERROR: Here is the first line: #{data.lines.first}"
|
10
10
|
exit 1
|
11
11
|
end
|
12
|
-
puts 'x is ready.'
|
13
12
|
|
14
13
|
require 'readline'
|
15
14
|
require 'pry'
|
data/lib/inspect.rb
CHANGED
@@ -9,7 +9,6 @@ def parse_data(format, data)
|
|
9
9
|
else
|
10
10
|
x = parse('json', data)
|
11
11
|
x = parse('csv', data) if x.nil?
|
12
|
-
x = parse('tsv', data) if x.nil?
|
13
12
|
end
|
14
13
|
else
|
15
14
|
x = parse(format, data)
|
@@ -18,7 +17,7 @@ def parse_data(format, data)
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def read_data
|
21
|
-
puts "Reading from STDIN..."
|
20
|
+
# puts "Reading from STDIN..."
|
22
21
|
ARGF.read
|
23
22
|
end
|
24
23
|
|
@@ -26,8 +25,6 @@ def parse(format, data)
|
|
26
25
|
case format
|
27
26
|
when 'json'
|
28
27
|
JSON.parse(data)
|
29
|
-
when 'tsv'
|
30
|
-
CSV.parse(data, col_sep: "\t")
|
31
28
|
when 'csv'
|
32
29
|
CSV.parse(data)
|
33
30
|
when 'html'
|