sq 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sq +23 -2
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9011404522da6bbfe9174b817f01f042951082c
|
4
|
+
data.tar.gz: 099d846bd7e759e5b75cc55fcb5204bb310c40f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f06843d84adfaaa51d122872dc863a587bfd840f97dbe0c3e4867f544d4124063d3081dd89df1cb7b71db422f77ef09ef67523805e42f786101d4e4646085e0
|
7
|
+
data.tar.gz: a0154949e8708283ce6cf4c6d0014459fee5e70a3284ffebfe2a3a1729e7955e109dbe210ff3c80664d95f7bed860346a1ba39b2813ae2033a943fb8685b6ef9
|
data/bin/sq
CHANGED
@@ -14,16 +14,37 @@ Usage:
|
|
14
14
|
where [options] are:
|
15
15
|
EOS
|
16
16
|
|
17
|
-
opt :directory, 'Choose the output directory', :short => '-o', :type => :string, :default => '.'
|
18
17
|
opt :verbose, 'Print more info', :short => '-V', :type => :bool, :default => false
|
18
|
+
opt :directory, 'Choose the output directory', :short => '-o', :type => :string, :default => '.'
|
19
19
|
opt :format, 'Filename format', :short => '-F', :type => :string, :default => '%s.pdf'
|
20
|
+
opt :formats, 'List available formats', :type => :bool, :default => false
|
20
21
|
end
|
21
22
|
|
22
|
-
if ARGV.empty?
|
23
|
+
if ARGV.empty? && !opts[:formats]
|
23
24
|
puts 'Error: No URI provided. Use -h or --help to see the help.'
|
24
25
|
exit 1
|
25
26
|
end
|
26
27
|
|
28
|
+
if opts[:formats]
|
29
|
+
puts <<-EOFMTS
|
30
|
+
A format is a string with zero or more placeholders, shown below. The default
|
31
|
+
is '%s.pdf'.
|
32
|
+
|
33
|
+
%n - PDF number, starting at 0
|
34
|
+
%N - PDF number, starting at 1
|
35
|
+
%z - same as %n, but zero-padded
|
36
|
+
%Z - same as %Z, but zero-padded
|
37
|
+
%c - total number of PDFs
|
38
|
+
%s - name of the PDF, extracted from its URI, without `.pdf`
|
39
|
+
%S - name of the PDF, extracted from the link text
|
40
|
+
%_ - same as %S, but spaces are replaced with underscores
|
41
|
+
%- - same as %S, but spaces are replaced with hyphens
|
42
|
+
%% - litteral %
|
43
|
+
|
44
|
+
EOFMTS
|
45
|
+
exit(0)
|
46
|
+
end
|
47
|
+
|
27
48
|
url, *regex_parts = ARGV
|
28
49
|
regex = regex_parts.join(' ')
|
29
50
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Baptiste Fontaine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|