nxxd 1.2 → 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 +4 -4
- data/bin/nxxd +12 -6
- data/lib/nxxd/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 685050d033e011d2247f30c73a30f0e2c96b6b25627bc7802a8b55c74b627080
|
|
4
|
+
data.tar.gz: c1036f1b327e53e1df7dd3e02c0667ceb98c17e3ede00e6f3a6a3392df73d5f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72c1a0197350fb05b79154fa96d1b6b3a9081d4c8f644c10e2cfbd7641b76794c457566ceaaa192e8157b98b62912953f61ec21ea34eaf24ab347fcf24fa7830
|
|
7
|
+
data.tar.gz: c268077a3660aa76323673d17fffeb48424c36d31767c55bfd243b68e05dddb0f91550dca12a26f0391ae65f5d585fac92d19aacaa0a0e5edcf0770fe83ddd36
|
data/bin/nxxd
CHANGED
|
@@ -18,6 +18,7 @@ module Nxxd
|
|
|
18
18
|
"r" => [ :reverse, true, "Reverse operation, pack"],
|
|
19
19
|
"o" => [ :output, :NAME, "Output file (- = stdout)"],
|
|
20
20
|
"output" => "o",
|
|
21
|
+
"n" => [ :noclobber, true, "Don't overwrite existing files"],
|
|
21
22
|
"f" => [ :full, true, "Full output (no squeeze)"],
|
|
22
23
|
"full" => "f",
|
|
23
24
|
"a" => [ :full, false, "Abbreviate (squeeze duplicate lines)"],
|
|
@@ -148,10 +149,7 @@ module Nxxd
|
|
|
148
149
|
def initialize params
|
|
149
150
|
o = Options.new params
|
|
150
151
|
@opts, @args = o.opts, o.args
|
|
151
|
-
@
|
|
152
|
-
@inputs.push @args.shift
|
|
153
|
-
@output = (@opts.delete :output) || @args.pop
|
|
154
|
-
@inputs.push @args.shift until @args.empty?
|
|
152
|
+
@output = (@opts.delete :output) || last_arg_if_not_existing
|
|
155
153
|
end
|
|
156
154
|
|
|
157
155
|
def run
|
|
@@ -189,9 +187,14 @@ module Nxxd
|
|
|
189
187
|
|
|
190
188
|
private
|
|
191
189
|
|
|
190
|
+
def last_arg_if_not_existing
|
|
191
|
+
return if File.exist? @args.last
|
|
192
|
+
@args.pop
|
|
193
|
+
end
|
|
194
|
+
|
|
192
195
|
def open_inputs
|
|
193
196
|
plain = @opts.delete :plain
|
|
194
|
-
@
|
|
197
|
+
@args.each do |i|
|
|
195
198
|
i = nil if i == "-"
|
|
196
199
|
if i then
|
|
197
200
|
@opts[ :input] = i unless plain or @opts[ :reverse]
|
|
@@ -208,9 +211,12 @@ module Nxxd
|
|
|
208
211
|
end
|
|
209
212
|
|
|
210
213
|
def open_output
|
|
214
|
+
nc = @opts.delete :noclobber
|
|
211
215
|
o = @output unless @output == "-"
|
|
212
216
|
if o then
|
|
213
|
-
|
|
217
|
+
mode = "w"
|
|
218
|
+
mode << "x" if nc
|
|
219
|
+
File.open o, mode do |f| yield f end
|
|
214
220
|
else
|
|
215
221
|
yield $stdout
|
|
216
222
|
end
|
data/lib/nxxd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nxxd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bertram Scharpf
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: 'Yet another Xxd reimplementation.
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
45
45
|
version: '0'
|
|
46
46
|
requirements:
|
|
47
47
|
- Just Ruby
|
|
48
|
-
rubygems_version: 3.
|
|
48
|
+
rubygems_version: 3.7.1
|
|
49
49
|
specification_version: 4
|
|
50
50
|
summary: Hex Dump Tool
|
|
51
51
|
test_files: []
|