pitle 0.1.0 → 0.2.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +22 -0
- data/lib/pitle.rb +7 -2
- data/lib/pitle/version.rb +1 -1
- data/pitle.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 73956423d0c5baacfb4c84c059aefbdbe92e1c231dc031151fa0be492a44a528
|
|
4
|
+
data.tar.gz: fbc7721db575db82c3a0e4c882def31651d7dc55653fb457b46e6b81727eeff7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1b53a47ba94fde0b4688d119b3015655845c432cb7e13eed6ce341c8075901455389c4331ad24cf722b6b5f218b42e7e1760660fad51549aece02f609572d78
|
|
7
|
+
data.tar.gz: f973ebf735ab091bafb76cbdf1035e0e7d04fa472c91742f6693d0dca59e3cc8909f20fdba7528e1d2e5f1ade17b15ab0ec9ff287bb4abdaa223eb5966b43908
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -26,6 +26,28 @@ For example:
|
|
|
26
26
|
|
|
27
27
|
$ pitle -e epub,pdf,mobi
|
|
28
28
|
|
|
29
|
+
### Command Options
|
|
30
|
+
|
|
31
|
+
`--extension, -e`
|
|
32
|
+
|
|
33
|
+
Specify the target extensions. Do not put a space after the colon.
|
|
34
|
+
|
|
35
|
+
For example:
|
|
36
|
+
|
|
37
|
+
$ pitle -e epub,pdf,mobi
|
|
38
|
+
|
|
39
|
+
`--print0, -0`
|
|
40
|
+
|
|
41
|
+
Print the full file name, followed by a null character instead of a newline.
|
|
42
|
+
|
|
43
|
+
For example:
|
|
44
|
+
|
|
45
|
+
$ pitle -e epub,pdf,mobi --print0
|
|
46
|
+
|
|
47
|
+
Advanced usage:
|
|
48
|
+
|
|
49
|
+
$ pitle -e epub,pdf,mobi --print0 | xargs -0 -J % cp % ./dst
|
|
50
|
+
|
|
29
51
|
## Development
|
|
30
52
|
|
|
31
53
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
data/lib/pitle.rb
CHANGED
|
@@ -65,14 +65,19 @@ module Pitle
|
|
|
65
65
|
|
|
66
66
|
desc "epub,pdf", "Pick the one filename from duplicate filenames that have different extensions."
|
|
67
67
|
method_option :extension, type: :string, default: "", aliases: "-e"
|
|
68
|
+
method_option :print0, type: :boolean, aliases: "-0"
|
|
68
69
|
def do()
|
|
69
|
-
extensions = options[:extension].split(
|
|
70
|
+
extensions = options[:extension].split(",")
|
|
70
71
|
|
|
71
72
|
Dir.open(Dir.pwd){ |d|
|
|
72
73
|
fileNameOperator = FileNameOperator.new(d.children, extensions)
|
|
73
74
|
origin_filenames = fileNameOperator.pick_files()
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
if options[:print0]
|
|
77
|
+
print "./#{origin_filenames.join("\0./")}"
|
|
78
|
+
else
|
|
79
|
+
origin_filenames.each { |f| puts f }
|
|
80
|
+
end
|
|
76
81
|
}
|
|
77
82
|
end
|
|
78
83
|
end
|
data/lib/pitle/version.rb
CHANGED
data/pitle.gemspec
CHANGED
|
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = ["hnmx4"]
|
|
9
9
|
spec.email = ["hnmnty@gmail.com"]
|
|
10
10
|
|
|
11
|
-
spec.summary = ""
|
|
12
|
-
spec.description = ""
|
|
13
|
-
spec.homepage = "
|
|
11
|
+
spec.summary = "Pick the one filename from duplicate filenames that have different extensions."
|
|
12
|
+
spec.description = "Pick the one filename from duplicate filenames that have different extensions."
|
|
13
|
+
spec.homepage = "https://github.com/hnmx4/pitle"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
|
16
16
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pitle
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hnmx4
|
|
@@ -24,7 +24,7 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
|
-
description:
|
|
27
|
+
description: Pick the one filename from duplicate filenames that have different extensions.
|
|
28
28
|
email:
|
|
29
29
|
- hnmnty@gmail.com
|
|
30
30
|
executables:
|
|
@@ -44,11 +44,11 @@ files:
|
|
|
44
44
|
- lib/pitle.rb
|
|
45
45
|
- lib/pitle/version.rb
|
|
46
46
|
- pitle.gemspec
|
|
47
|
-
homepage:
|
|
47
|
+
homepage: https://github.com/hnmx4/pitle
|
|
48
48
|
licenses:
|
|
49
49
|
- MIT
|
|
50
50
|
metadata:
|
|
51
|
-
homepage_uri:
|
|
51
|
+
homepage_uri: https://github.com/hnmx4/pitle
|
|
52
52
|
post_install_message:
|
|
53
53
|
rdoc_options: []
|
|
54
54
|
require_paths:
|
|
@@ -67,5 +67,5 @@ requirements: []
|
|
|
67
67
|
rubygems_version: 3.2.3
|
|
68
68
|
signing_key:
|
|
69
69
|
specification_version: 4
|
|
70
|
-
summary:
|
|
70
|
+
summary: Pick the one filename from duplicate filenames that have different extensions.
|
|
71
71
|
test_files: []
|