filename_cleaner 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/filename_cleaner.gemspec +2 -2
- data/lib/filename_cleaner/version.rb +1 -1
- data/lib/filename_cleaner.rb +0 -1
- metadata +6 -7
- data/lib/filename_cleaner/core_ext/object/blank.rb +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6e7c4d2b74bf70c0ebc691636411eba582774f0
|
4
|
+
data.tar.gz: dcdab750202edc88dafb11bc4f06b403ec384e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3291eae4d4f047ef25fda3a86ec963471f4fe258f4124394ff77fa461d36a2b20b5bb59c4da5c577b579ec027e48bc7ddf35ff624f8ccd3798e07f691923a2d
|
7
|
+
data.tar.gz: 901dca9581b8e59844f05768fbf4de51cbed3079024d81e18cec6fae89c83dd108495f8580c9e9fc07925204c91959165f8ed87a4abd2cac8693f7282868bad2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/filename_cleaner.svg)][gem]
|
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
|
-
[![Build Status](https://
|
6
|
+
[![Build Status](https://travis-ci.org/agilecreativity/filename_cleaner.svg?branch=master)][travis-ci]
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/agilecreativity/filename_cleaner/badge.png?branch=master)][coveralls]
|
8
8
|
|
9
9
|
[gem]: http://badge.fury.io/rb/filename_cleaner
|
10
10
|
[gemnasium]: https://gemnasium.com/agilecreativity/filename_cleaner
|
11
11
|
[codeclimate]: https://codeclimate.com/github/agilecreativity/filename_cleaner
|
12
|
-
[travis-ci]:
|
12
|
+
[travis-ci]: https://travis-ci.org/agilecreativity/filename_cleaner
|
13
13
|
[coveralls]: https://coveralls.io/r/agilecreativity/filename_cleaner?branch=master
|
14
14
|
|
15
15
|
Quickly rename list of files with extension and replace any special characters with
|
data/filename_cleaner.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
31
|
-
spec.add_runtime_dependency "agile_utils", "~> 0.1"
|
32
|
-
spec.add_runtime_dependency "code_lister", "~> 0.1"
|
31
|
+
spec.add_runtime_dependency "agile_utils", "~> 0.1.5"
|
32
|
+
spec.add_runtime_dependency "code_lister", "~> 0.1.7"
|
33
33
|
spec.add_development_dependency "bundler", "~> 1.5"
|
34
34
|
spec.add_development_dependency "rake", "~> 10.1"
|
35
35
|
spec.add_development_dependency "awesome_print", "~> 1.2"
|
data/lib/filename_cleaner.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.1.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.1.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: code_lister
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.1.7
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.1.7
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,7 +241,6 @@ files:
|
|
241
241
|
- filename_cleaner.gemspec
|
242
242
|
- lib/filename_cleaner.rb
|
243
243
|
- lib/filename_cleaner/cli.rb
|
244
|
-
- lib/filename_cleaner/core_ext/object/blank.rb
|
245
244
|
- lib/filename_cleaner/filename_cleaner.rb
|
246
245
|
- lib/filename_cleaner/version.rb
|
247
246
|
homepage: https://github.com/agilecreativity/filename_cleaner
|
@@ -1,105 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# from: active_support/core_ext/object/blank.rb
|
3
|
-
class Object
|
4
|
-
# An object is blank if it's false, empty, or a whitespace string.
|
5
|
-
# For example, '', ' ', +nil+, [], and {} are all blank.
|
6
|
-
#
|
7
|
-
# This simplifies:
|
8
|
-
#
|
9
|
-
# if address.nil? || address.empty?
|
10
|
-
#
|
11
|
-
# ...to:
|
12
|
-
#
|
13
|
-
# if address.blank?
|
14
|
-
def blank?
|
15
|
-
respond_to?(:empty?) ? empty? : !self
|
16
|
-
end
|
17
|
-
|
18
|
-
# An object is present if it's not <tt>blank?</tt>.
|
19
|
-
def present?
|
20
|
-
!blank?
|
21
|
-
end
|
22
|
-
|
23
|
-
# Returns object if it's <tt>present?</tt> otherwise returns +nil+.
|
24
|
-
# <tt>object.presence</tt> is equivalent to <tt>object.present? ? object : nil</tt>.
|
25
|
-
#
|
26
|
-
# This is handy for any representation of objects where blank is the same
|
27
|
-
# as not present at all. For example, this simplifies a common check for
|
28
|
-
# HTTP POST/query parameters:
|
29
|
-
#
|
30
|
-
# state = params[:state] if params[:state].present?
|
31
|
-
# country = params[:country] if params[:country].present?
|
32
|
-
# region = state || country || 'US'
|
33
|
-
#
|
34
|
-
# ...becomes:
|
35
|
-
#
|
36
|
-
# region = params[:state].presence || params[:country].presence || 'US'
|
37
|
-
def presence
|
38
|
-
self if present?
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
class NilClass
|
43
|
-
# +nil+ is blank:
|
44
|
-
#
|
45
|
-
# nil.blank? # => true
|
46
|
-
def blank?
|
47
|
-
true
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class FalseClass
|
52
|
-
# +false+ is blank:
|
53
|
-
#
|
54
|
-
# false.blank? # => true
|
55
|
-
def blank?
|
56
|
-
true
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
class TrueClass
|
61
|
-
# +true+ is not blank:
|
62
|
-
#
|
63
|
-
# true.blank? # => false
|
64
|
-
def blank?
|
65
|
-
false
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
class Array
|
70
|
-
# An array is blank if it's empty:
|
71
|
-
#
|
72
|
-
# [].blank? # => true
|
73
|
-
# [1,2,3].blank? # => false
|
74
|
-
alias_method :blank?, :empty?
|
75
|
-
end
|
76
|
-
|
77
|
-
class Hash
|
78
|
-
# A hash is blank if it's empty:
|
79
|
-
#
|
80
|
-
# {}.blank? # => true
|
81
|
-
# { key: 'value' }.blank? # => false
|
82
|
-
alias_method :blank?, :empty?
|
83
|
-
end
|
84
|
-
|
85
|
-
class String
|
86
|
-
# A string is blank if it's empty or contains whitespaces only:
|
87
|
-
#
|
88
|
-
# ''.blank? # => true
|
89
|
-
# ' '.blank? # => true
|
90
|
-
# ' '.blank? # => true
|
91
|
-
# ' something here '.blank? # => false
|
92
|
-
def blank?
|
93
|
-
self !~ /[^[:space:]]/
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
class Numeric #:nodoc:
|
98
|
-
# No number is blank:
|
99
|
-
#
|
100
|
-
# 1.blank? # => false
|
101
|
-
# 0.blank? # => false
|
102
|
-
def blank?
|
103
|
-
false
|
104
|
-
end
|
105
|
-
end
|