filerenamer 0.0.3 → 0.0.4
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.
- data/CHANGES +10 -5
- data/VERSION +1 -1
- data/bin/{classify1stchar → classify} +6 -5
- data/bin/renhash +22 -0
- data/filerenamer.gemspec +11 -7
- data/test/{classify1stchar → classify}/123 +0 -0
- data/test/{classify1stchar → classify}/abc +0 -0
- data/test/{classify1stchar → classify}/def +0 -0
- data/test/classify//346/234/210/347/201/253/346/260/264 +0 -0
- data/test/renhash/)(.txt +0 -0
- data/test/renhash/0.txt +0 -0
- metadata +25 -20
data/CHANGES
CHANGED
@@ -1,19 +1,24 @@
|
|
1
1
|
= filerenamer Changelog
|
2
2
|
|
3
3
|
== Master (for 0.0.4)
|
4
|
+
* Add renhash
|
5
|
+
* Rename bin/classify1stchar to bin/classify
|
6
|
+
* Add function to bin/classify1stchar
|
7
|
+
* Japanese-yomi is indicated to be option.
|
8
|
+
* length of initial characters
|
4
9
|
|
5
10
|
== Version 0.0.3
|
6
11
|
* Restruct class and module name
|
7
|
-
* Add bin/renpad
|
12
|
+
* Add bin/renpad
|
8
13
|
|
9
14
|
== Version 0.0.2
|
10
|
-
* Command name changes
|
11
|
-
* Add bin/renpar
|
15
|
+
* Command name changes; rensub, rennum, etc
|
16
|
+
* Add bin/renpar
|
12
17
|
|
13
18
|
== Version 0.0.1
|
14
|
-
* bin/classifyWith1stChar to classify1stchar and add function of kanji kana inversion using kakasi
|
19
|
+
* bin/classifyWith1stChar to classify1stchar and add function of kanji kana inversion using kakasi
|
15
20
|
|
16
21
|
== Version 0.0.0
|
17
22
|
|
18
|
-
* Initial release
|
23
|
+
* Initial release
|
19
24
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -1,21 +1,22 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
# coding: utf-8
|
3
3
|
|
4
|
-
|
4
|
+
gem "builtinextension"
|
5
|
+
require "string_escape_zsh.rb"
|
5
6
|
require "filerenamer.rb"
|
6
|
-
#require "filerenamer/commander.rb"
|
7
|
-
#require "filerenamer/optionparser.rb"
|
8
7
|
|
9
8
|
OPTIONS = {}
|
10
9
|
op = FileRenamer::OptionParser.new
|
10
|
+
op.on("-j" , "--japanese-yomi", "Use Japanese yomi. (Need kakasi)"){ OPTIONS[:japanese] = true}
|
11
|
+
op.on("-l number", "--length=number", "Indicate length of initial characters."){|v| OPTIONS[:length] = v}
|
12
|
+
#replace character
|
11
13
|
op.parse!(ARGV)
|
12
|
-
#files = ARGV
|
13
14
|
|
14
15
|
fr = FileRenamer::Commander.new(op.options, ARGV)
|
15
16
|
fr.execute do |filename|
|
16
17
|
next if filename.size == 1
|
17
18
|
|
18
|
-
yomi = `echo #{filename} | nkf -e | kakasi -JH | nkf -w`
|
19
|
+
yomi = `echo #{filename.escape_zsh} | nkf -e | kakasi -JH | nkf -w`
|
19
20
|
|
20
21
|
char = yomi[0]
|
21
22
|
case char
|
data/bin/renhash
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# coding: utf-8
|
3
|
+
|
4
|
+
require "pp"
|
5
|
+
gem "builtinextension"
|
6
|
+
require "string_escape_zsh.rb"
|
7
|
+
require "filerenamer.rb"
|
8
|
+
#require "filerenamer/commander.rb"
|
9
|
+
#require "filerenamer/optionparser.rb"
|
10
|
+
|
11
|
+
HASH_COMMAND = "sha256sum"
|
12
|
+
op = FileRenamer::OptionParser.new
|
13
|
+
op.parse!(ARGV)
|
14
|
+
|
15
|
+
fr = FileRenamer::Commander.new(op.options, ARGV)
|
16
|
+
fr.execute do |filename|
|
17
|
+
extname = File.extname filename
|
18
|
+
oldname = filename.escape_zsh
|
19
|
+
basename = `#{HASH_COMMAND} #{oldname}`.sub(/ *#{oldname}$/, '').chomp
|
20
|
+
newname = basename + extname
|
21
|
+
newname
|
22
|
+
end
|
data/filerenamer.gemspec
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "filerenamer"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["ippei94da"]
|
12
|
-
s.date = "2012-08-
|
12
|
+
s.date = "2012-08-28"
|
13
13
|
s.description = "This library provide common dealing to rename many files with safe method. Automatically mkdir if need and rmdir when empty."
|
14
14
|
s.email = "ippei94da@gmail.com"
|
15
|
-
s.executables = ["
|
15
|
+
s.executables = ["classify", "renhash", "rennum", "renpad", "renpar", "renreg", "rensub"]
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE.txt",
|
18
18
|
"README.rdoc"
|
@@ -25,7 +25,8 @@ Gem::Specification.new do |s|
|
|
25
25
|
"README.rdoc",
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
|
-
"bin/
|
28
|
+
"bin/classify",
|
29
|
+
"bin/renhash",
|
29
30
|
"bin/rennum",
|
30
31
|
"bin/renpad",
|
31
32
|
"bin/renpar",
|
@@ -35,12 +36,15 @@ Gem::Specification.new do |s|
|
|
35
36
|
"lib/filerenamer.rb",
|
36
37
|
"lib/filerenamer/commander.rb",
|
37
38
|
"lib/filerenamer/optionparser.rb",
|
38
|
-
"test/
|
39
|
-
"test/
|
40
|
-
"test/
|
39
|
+
"test/classify/123",
|
40
|
+
"test/classify/abc",
|
41
|
+
"test/classify/def",
|
42
|
+
"test/classify/月火水",
|
41
43
|
"test/filerenamer/a0.txt",
|
42
44
|
"test/filerenamer/dummy.txt",
|
43
45
|
"test/helper.rb",
|
46
|
+
"test/renhash/)(.txt",
|
47
|
+
"test/renhash/0.txt",
|
44
48
|
"test/rennum/a",
|
45
49
|
"test/rennum/b",
|
46
50
|
"test/rennum/c",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/renhash/)(.txt
ADDED
File without changes
|
data/test/renhash/0.txt
ADDED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filerenamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
16
|
-
requirement: &
|
16
|
+
requirement: &73804310 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.12'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *73804310
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &73804040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.1.4
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *73804040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &73803800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.8.3
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *73803800
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &73803510 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *73803510
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: builtinextension
|
60
|
-
requirement: &
|
60
|
+
requirement: &73802970 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.0.5
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *73802970
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: capture_stdout
|
71
|
-
requirement: &
|
71
|
+
requirement: &73802590 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,12 +76,13 @@ dependencies:
|
|
76
76
|
version: '0.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *73802590
|
80
80
|
description: This library provide common dealing to rename many files with safe method.
|
81
81
|
Automatically mkdir if need and rmdir when empty.
|
82
82
|
email: ippei94da@gmail.com
|
83
83
|
executables:
|
84
|
-
-
|
84
|
+
- classify
|
85
|
+
- renhash
|
85
86
|
- rennum
|
86
87
|
- renpad
|
87
88
|
- renpar
|
@@ -99,7 +100,8 @@ files:
|
|
99
100
|
- README.rdoc
|
100
101
|
- Rakefile
|
101
102
|
- VERSION
|
102
|
-
- bin/
|
103
|
+
- bin/classify
|
104
|
+
- bin/renhash
|
103
105
|
- bin/rennum
|
104
106
|
- bin/renpad
|
105
107
|
- bin/renpar
|
@@ -109,12 +111,15 @@ files:
|
|
109
111
|
- lib/filerenamer.rb
|
110
112
|
- lib/filerenamer/commander.rb
|
111
113
|
- lib/filerenamer/optionparser.rb
|
112
|
-
- test/
|
113
|
-
- test/
|
114
|
-
- test/
|
114
|
+
- test/classify/123
|
115
|
+
- test/classify/abc
|
116
|
+
- test/classify/def
|
117
|
+
- test/classify/月火水
|
115
118
|
- test/filerenamer/a0.txt
|
116
119
|
- test/filerenamer/dummy.txt
|
117
120
|
- test/helper.rb
|
121
|
+
- test/renhash/)(.txt
|
122
|
+
- test/renhash/0.txt
|
118
123
|
- test/rennum/a
|
119
124
|
- test/rennum/b
|
120
125
|
- test/rennum/c
|
@@ -159,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
164
|
version: '0'
|
160
165
|
segments:
|
161
166
|
- 0
|
162
|
-
hash:
|
167
|
+
hash: -379057359
|
163
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
169
|
none: false
|
165
170
|
requirements:
|