filename_cleaner 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +1 -1
- data/filename_cleaner.gemspec +9 -1
- data/lib/filename_cleaner/version.rb +1 -1
- metadata +4 -12
- data/.ruby-version +0 -1
- data/.travis.yml +0 -6
- data/.yardopts +0 -2
- data/CHANGELOGS.md +0 -47
- data/Guardfile +0 -13
- data/test/lib/filename_cleaner/test_filename_cleaner.rb +0 -66
- data/test/test_helper.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb4e1811c30cbb8ad40689b572ff4d7a099b83db
|
4
|
+
data.tar.gz: 1e5a886c58413e20778a95c66146cf53b480fc27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec9807e0e7e6e657054cd58e096ea07f40e39a17d4f724e07844eea203e568d972796b4770374a72be7d5d688906171491d299edebbb0b80f0cf5b434088512b
|
7
|
+
data.tar.gz: c8f46961051f5be1e0b7842bf1bd4ee20ee1bb5f666b9b0a20ec920d4e60f0ffc7c1d579d84210e2cde7a5a6d091453e0e4d527bf520a919197e7fb3fd374007
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
### 0.3.3
|
2
|
+
* Update gemspec not to use git for include of files
|
3
|
+
* Rename 'CHANGELOGS.md' to 'CHANGELOG.md'
|
4
|
+
|
5
|
+
### 0.3.2
|
6
|
+
* Add coveralls badges
|
7
|
+
|
8
|
+
### 0.3.1
|
9
|
+
* Correct the sample usage in README.md
|
10
|
+
|
11
|
+
### 0.3.0
|
12
|
+
* Cleanup and simplify the apis
|
13
|
+
* Rename `--dry-run` to `--commit`
|
14
|
+
* Remove the `--non-exts` options to only support file with extension
|
15
|
+
|
16
|
+
### 0.2.0
|
17
|
+
* Cleanup the APIs
|
18
|
+
* rename `sanitize_filename` to `sanitize_name_with_extension`
|
19
|
+
* add `sanitize_name` for name that does not have any extension
|
20
|
+
* Make non-public apis private
|
21
|
+
* Add core_ext/object/blank.rb
|
22
|
+
|
23
|
+
### 0.1.1
|
24
|
+
* Remove the last char from the filename if it is not numbers or letters
|
25
|
+
|
26
|
+
### 0.1.0
|
27
|
+
* First [Semantic Versioning][] version.
|
28
|
+
|
29
|
+
### 0.0.3
|
30
|
+
* Remove the namespace and code refactoring
|
31
|
+
|
32
|
+
### 0.0.2
|
33
|
+
* Update gem dependencies to the latest version
|
34
|
+
* Update gemspec to reflect the actual feature of the gem
|
35
|
+
* Update and cleanup README.md
|
36
|
+
|
37
|
+
### 0.0.1
|
38
|
+
* Initial release
|
39
|
+
|
40
|
+
[Semantic Versioning]: http://semver.org
|
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[![Dependency Status](https://gemnasium.com/agilecreativity/filename_cleaner.png)][gemnasium]
|
5
5
|
[![Code Climate](https://codeclimate.com/github/agilecreativity/filename_cleaner.png)][codeclimate]
|
6
6
|
[![Build Status](https://secure.travis-ci.org/agilecreativity/filename_cleaner.png)][travis-ci]
|
7
|
-
[![Coverage Status](https://
|
7
|
+
[![Coverage Status](https://img.shields.io/coveralls/agilecreativity/filename_cleaner.svg)][coveralls]
|
8
8
|
|
9
9
|
[gem]: http://badge.fury.io/rb/filename_cleaner
|
10
10
|
[gemnasium]: https://gemnasium.com/agilecreativity/filename_cleaner
|
data/filename_cleaner.gemspec
CHANGED
@@ -12,7 +12,15 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = %q{Bulk rename and remove unwanted characters from list of files in any directory recursively}
|
13
13
|
spec.homepage = 'https://github.com/agilecreativity/filename_cleaner'
|
14
14
|
spec.license = 'MIT'
|
15
|
-
spec.files =
|
15
|
+
spec.files = Dir.glob('{bin,lib}/**/*') + %w(Gemfile
|
16
|
+
Rakefile
|
17
|
+
filename_cleaner.gemspec
|
18
|
+
README.md
|
19
|
+
CHANGELOG.md
|
20
|
+
LICENSE
|
21
|
+
.rubocop.yml
|
22
|
+
.gitignore
|
23
|
+
rubocop-todo.yml)
|
16
24
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
25
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
26
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filename_cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
@@ -217,13 +217,9 @@ extra_rdoc_files: []
|
|
217
217
|
files:
|
218
218
|
- ".gitignore"
|
219
219
|
- ".rubocop.yml"
|
220
|
-
-
|
221
|
-
- ".travis.yml"
|
222
|
-
- ".yardopts"
|
223
|
-
- CHANGELOGS.md
|
220
|
+
- CHANGELOG.md
|
224
221
|
- Gemfile
|
225
|
-
-
|
226
|
-
- LICENSE.txt
|
222
|
+
- LICENSE
|
227
223
|
- README.md
|
228
224
|
- Rakefile
|
229
225
|
- bin/filename_cleaner
|
@@ -234,8 +230,6 @@ files:
|
|
234
230
|
- lib/filename_cleaner/filename_cleaner.rb
|
235
231
|
- lib/filename_cleaner/version.rb
|
236
232
|
- rubocop-todo.yml
|
237
|
-
- test/lib/filename_cleaner/test_filename_cleaner.rb
|
238
|
-
- test/test_helper.rb
|
239
233
|
homepage: https://github.com/agilecreativity/filename_cleaner
|
240
234
|
licenses:
|
241
235
|
- MIT
|
@@ -261,7 +255,5 @@ signing_key:
|
|
261
255
|
specification_version: 4
|
262
256
|
summary: Bulk rename/remove unwanted characters from list of files in any directory
|
263
257
|
recursively
|
264
|
-
test_files:
|
265
|
-
- test/lib/filename_cleaner/test_filename_cleaner.rb
|
266
|
-
- test/test_helper.rb
|
258
|
+
test_files: []
|
267
259
|
has_rdoc:
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.2
|
data/.travis.yml
DELETED
data/.yardopts
DELETED
data/CHANGELOGS.md
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
### Changelogs
|
2
|
-
|
3
|
-
#### 0.3.2
|
4
|
-
|
5
|
-
- Add coveralls badges
|
6
|
-
|
7
|
-
#### 0.3.1
|
8
|
-
|
9
|
-
- Correct the sample usage in README.md
|
10
|
-
|
11
|
-
#### 0.3.0
|
12
|
-
|
13
|
-
- Cleanup and simplify the apis
|
14
|
-
- Rename `--dry-run` to `--commit`
|
15
|
-
- Remove the `--non-exts` options to only support file with extension
|
16
|
-
|
17
|
-
#### 0.2.0
|
18
|
-
|
19
|
-
- Cleanup the APIs
|
20
|
-
* rename `sanitize_filename` to `sanitize_name_with_extension`
|
21
|
-
* add `sanitize_name` for name that does not have any extension
|
22
|
-
- Make non-public apis private
|
23
|
-
- Add core_ext/object/blank.rb
|
24
|
-
|
25
|
-
#### 0.1.1
|
26
|
-
|
27
|
-
- Remove the last char from the filename if it is not numbers or letters
|
28
|
-
|
29
|
-
#### 0.1.0
|
30
|
-
|
31
|
-
- First [Semantic Versioning][] version.
|
32
|
-
|
33
|
-
#### 0.0.3
|
34
|
-
|
35
|
-
- Remove the namespace and code refactoring
|
36
|
-
|
37
|
-
#### 0.0.2
|
38
|
-
|
39
|
-
- Update gem dependencies to the latest version
|
40
|
-
- Update gemspec to reflect the actual feature of the gem
|
41
|
-
- Update and cleanup README.md
|
42
|
-
|
43
|
-
#### 0.0.1
|
44
|
-
|
45
|
-
- Initial release
|
46
|
-
|
47
|
-
[Semantic Versioning]: http://semver.org
|
data/Guardfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
guard 'minitest' do
|
4
|
-
# with Minitest::Unit
|
5
|
-
watch(%r|^test/(.*)\/?test_(.*)\.rb|)
|
6
|
-
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
7
|
-
watch(%r|^test/test_helper\.rb|) { "test" }
|
8
|
-
|
9
|
-
# with Minitest::Spec
|
10
|
-
# watch(%r|^spec/(.*)_spec\.rb|)
|
11
|
-
# watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
-
# watch(%r|^spec/spec_helper\.rb|) { "spec" }
|
13
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require_relative '../../test_helper'
|
2
|
-
describe FilenameCleaner do
|
3
|
-
context '#sanitize' do
|
4
|
-
describe 'without extension' do
|
5
|
-
it 'works with simple input' do
|
6
|
-
FilenameCleaner.sanitize('any txt').must_equal 'any.txt'
|
7
|
-
FilenameCleaner.sanitize('any txt', '-').must_equal 'any-txt'
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'works with text containing the dot' do
|
11
|
-
FilenameCleaner.sanitize('text with a dot.txt').must_equal 'text.with.a.dot.txt'
|
12
|
-
FilenameCleaner.sanitize('text with a dot.txt', '_').must_equal 'text_with_a_dot_txt'
|
13
|
-
end
|
14
|
-
it 'replaces many consecutive special characters with one' do
|
15
|
-
FilenameCleaner.sanitize('text with!@**! multiple chars').must_equal 'text.with.multiple.chars'
|
16
|
-
FilenameCleaner.sanitize('text with!@**! multiple chars', '_').must_equal 'text_with_multiple_chars'
|
17
|
-
end
|
18
|
-
it 'strips all special characters at the end' do
|
19
|
-
FilenameCleaner.sanitize('filename .txt_').must_equal 'filename.txt'
|
20
|
-
FilenameCleaner.sanitize('filename .txt_!$#$#', '_').must_equal 'filename_txt'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
describe 'with extension' do
|
24
|
-
context 'file with extension' do
|
25
|
-
it 'replaces mutilple consecutive chars with one' do
|
26
|
-
FilenameCleaner.sanitize('some!!!$file$:%.txt', '.', true).must_equal 'some.file.txt'
|
27
|
-
end
|
28
|
-
it 'works with default separator' do
|
29
|
-
FilenameCleaner.sanitize('some file.txt', '.', true).must_equal 'some.file.txt'
|
30
|
-
end
|
31
|
-
it 'works with non-default separator' do
|
32
|
-
FilenameCleaner.sanitize('some file.txt', '_', true).must_equal 'some_file.txt'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
context'file without extension' do
|
36
|
-
it 'replaces mutilple consecutive chars with one' do
|
37
|
-
FilenameCleaner.sanitize('some!!!$file$:%', '.', true).must_equal 'some.file'
|
38
|
-
end
|
39
|
-
context 'using default separator' do
|
40
|
-
it 'works with simple input' do
|
41
|
-
FilenameCleaner.sanitize('Gemfile', '.', true).must_equal 'Gemfile'
|
42
|
-
end
|
43
|
-
it 'works with complex input' do
|
44
|
-
FilenameCleaner.sanitize('File$without!extension', '.', true).must_equal 'File.without.extension'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
context 'with non-default separator char' do
|
48
|
-
it 'works with simple input' do
|
49
|
-
FilenameCleaner.sanitize('Gemfile', '_', true).must_equal 'Gemfile'
|
50
|
-
end
|
51
|
-
it 'works with complex input' do
|
52
|
-
FilenameCleaner.sanitize('File$without!extension', '-', true).must_equal 'File-without-extension'
|
53
|
-
end
|
54
|
-
end
|
55
|
-
context 'special characters at boundary' do
|
56
|
-
it 'does not strip special characters that from extension' do
|
57
|
-
FilenameCleaner.sanitize('filename!!#@.txt!!', '.', true).must_equal 'filename.txt!!'
|
58
|
-
end
|
59
|
-
it 'strips the special characters that come before the extension' do
|
60
|
-
FilenameCleaner.sanitize('filename !#@!.txt', '_', true).must_equal 'filename.txt'
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
require 'minitest'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'minitest/pride'
|
4
|
-
require 'minitest-spec-context'
|
5
|
-
require 'coveralls'
|
6
|
-
require 'pry'
|
7
|
-
require 'awesome_print'
|
8
|
-
require_relative '../lib/filename_cleaner'
|
9
|
-
include FilenameCleaner
|
10
|
-
Coveralls.wear!
|