folders_renamer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/folders_renamer.gemspec +3 -2
- data/lib/folders_renamer/cli.rb +1 -0
- data/lib/folders_renamer/version.rb +1 -1
- data/lib/folders_renamer.rb +0 -1
- metadata +20 -7
- data/lib/folders_renamer/core_ext/hash/keys.rb +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f44bbb2d7f2483f4583f20144fd5f06cea81638
|
4
|
+
data.tar.gz: b76f99ab18236e2f6f7f8caf3db20bd0e746da06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 437429eb60eff3ed44b84de37b4dccf62ff7608fc8256f2ef4a560ad92dced3bb3e60c7f203fb67506d3f7501bf611a946d74f194e66f9ab32cc44d8112d0a69
|
7
|
+
data.tar.gz: 07d7dfda1b8ed001894ed7e57034ed7ae5774b2937703a3a98bd99c3d82635920f78d3c5bdc8fd052bb5a883ce42c9ac19650bad21d372d3c3ae86d91dfd2bf6
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Features
|
|
21
21
|
- Following the [Semantic Versioning][] for release schedule
|
22
22
|
- Quickly rename bad folder names to good folder names with one command.
|
23
23
|
|
24
|
-
TL;DR
|
24
|
+
TL;DR;
|
25
25
|
-----
|
26
26
|
Turn these directories (if your OS allow you to have these names)
|
27
27
|
|
@@ -65,7 +65,7 @@ gem install folders_renamer
|
|
65
65
|
|
66
66
|
### Usage/Synopsis
|
67
67
|
|
68
|
-
Type the `
|
68
|
+
Type the `folders_renamer` without any options, which will give the following output
|
69
69
|
|
70
70
|
```
|
71
71
|
Usage:
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ end
|
|
20
20
|
|
21
21
|
require "rubocop/rake_task"
|
22
22
|
desc "Run RuboCop on the lib directory"
|
23
|
-
|
23
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
24
24
|
task.patterns = ["lib/**/*.rb"]
|
25
25
|
# only show the files with failures
|
26
26
|
task.formatters = ["files"]
|
data/folders_renamer.gemspec
CHANGED
@@ -24,7 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.test_files = Dir.glob("{test}/**/*")
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
27
|
-
spec.add_runtime_dependency "
|
27
|
+
spec.add_runtime_dependency "agile_utils", "~> 0.1.5"
|
28
|
+
spec.add_runtime_dependency "filename_cleaner", "~> 0.3.11"
|
28
29
|
spec.add_development_dependency "awesome_print", "~> 1.2"
|
29
30
|
spec.add_development_dependency "bundler", "~> 1.5"
|
30
31
|
spec.add_development_dependency "gem-ctags", "~> 1.0"
|
@@ -35,6 +36,6 @@ Gem::Specification.new do |spec|
|
|
35
36
|
spec.add_development_dependency "minitest-filesystem"
|
36
37
|
spec.add_development_dependency "pry", "~> 0.9"
|
37
38
|
spec.add_development_dependency "rake", "~> 10.1"
|
38
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
39
|
+
spec.add_development_dependency "rubocop", "~> 0.23"
|
39
40
|
spec.add_development_dependency "yard", "~> 0.8"
|
40
41
|
end
|
data/lib/folders_renamer/cli.rb
CHANGED
data/lib/folders_renamer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: folders_renamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
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-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.19'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: agile_utils
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.5
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.5
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: filename_cleaner
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 0.3.11
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 0.3.11
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: awesome_print
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +198,14 @@ dependencies:
|
|
184
198
|
requirements:
|
185
199
|
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: '0.
|
201
|
+
version: '0.23'
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: '0.
|
208
|
+
version: '0.23'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
210
|
name: yard
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,7 +240,6 @@ files:
|
|
226
240
|
- folders_renamer.gemspec
|
227
241
|
- lib/folders_renamer.rb
|
228
242
|
- lib/folders_renamer/cli.rb
|
229
|
-
- lib/folders_renamer/core_ext/hash/keys.rb
|
230
243
|
- lib/folders_renamer/folders_renamer.rb
|
231
244
|
- lib/folders_renamer/logger.rb
|
232
245
|
- lib/folders_renamer/version.rb
|
@@ -1,54 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
# File activesupport/lib/active_support/core_ext/hash/keys.rb
|
3
|
-
#
|
4
|
-
# hash = { name: 'Rob', age: '28' }
|
5
|
-
# hash.transform_keys{ |key| key.to_s.upcase }
|
6
|
-
# => { "NAME" => "Rob", "AGE" => "28" }
|
7
|
-
def transform_keys
|
8
|
-
result = {}
|
9
|
-
each_key do |key|
|
10
|
-
result[yield(key)] = self[key]
|
11
|
-
end
|
12
|
-
result
|
13
|
-
end
|
14
|
-
|
15
|
-
def transform_keys!(&block)
|
16
|
-
keys.each do |key|
|
17
|
-
value = delete(key)
|
18
|
-
self[yield(key)] = value.is_a?(Hash) ? value.transform_keys!(&block) : value
|
19
|
-
end
|
20
|
-
self
|
21
|
-
end
|
22
|
-
|
23
|
-
# hash = { 'name' => 'Rob', 'age' => '28' }
|
24
|
-
# hash.symbolize_keys
|
25
|
-
# => { name: "Rob", age: "28" }
|
26
|
-
def symbolize_keys
|
27
|
-
transform_keys { |key| key.to_sym rescue key }
|
28
|
-
end
|
29
|
-
|
30
|
-
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 135
|
31
|
-
def symbolize_keys!
|
32
|
-
transform_keys! { |key| key.to_sym rescue key }
|
33
|
-
end
|
34
|
-
|
35
|
-
# Merges the caller into +other_hash+. For example,
|
36
|
-
#
|
37
|
-
# options = options.reverse_merge(size: 25, velocity: 10)
|
38
|
-
#
|
39
|
-
# is equivalent to
|
40
|
-
#
|
41
|
-
# options = { size: 25, velocity: 10 }.merge(options)
|
42
|
-
#
|
43
|
-
# This is particularly useful for initializing an options hash
|
44
|
-
# with default values.
|
45
|
-
def reverse_merge(other_hash)
|
46
|
-
other_hash.merge(self)
|
47
|
-
end
|
48
|
-
|
49
|
-
# Destructive +reverse_merge+.
|
50
|
-
def reverse_merge!(other_hash)
|
51
|
-
# right wins if there is no left
|
52
|
-
merge!(other_hash) { |_key, left, _right| left }
|
53
|
-
end
|
54
|
-
end
|