nx-file-utils 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/__tests__/api.rb +4 -2
- data/lib/nx/file-utils.rb +5 -1
- data/lib/nx/version.rb +1 -1
- data/nx-file-utils-0.1.3.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64e998e9da498ada7d1677c20e2ce2ce3ee25ea73d8c37c767b4bacb1adba16c
|
4
|
+
data.tar.gz: c50b69d171cc4a9d1b928edfc712034068e138f6e69020dedcfca465c8b1fbd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a44538a960dd6743709db1dd74fe56a4c46b184526ef83420e9bb0291f69793a30e4d0955b760c64cc18cd71665b2cba49df5a3031fef6f624a74a6533a31f
|
7
|
+
data.tar.gz: 97f7dbc49a870656889b52b7646cffa0ac55b22fabb8c2a6461d37f0700d8360d882f1c23f16f0f6bc5639236552b46daa787cd7987c07163262191cdb54c9a3
|
data/__tests__/api.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require_relative "../lib/nx-file-utils"
|
2
2
|
|
3
|
-
puts Nx::FileUtils.sanitize("HTML5 Canvas核心技术/图形、动画与游戏开发.pdf")
|
4
|
-
puts Nx::FileUtils.ordinal("HTML5 Canvas核心技术/图形、动画与游戏开发.pdf")
|
3
|
+
# puts Nx::FileUtils.sanitize("HTML5 Canvas核心技术/图形、动画与游戏开发.pdf")
|
4
|
+
# puts Nx::FileUtils.ordinal("HTML5 Canvas核心技术/图形、动画与游戏开发.pdf")
|
5
|
+
|
6
|
+
Nx::FileUtils.strip_name("./__tests__/etst-<b>(pdf).pdf")
|
5
7
|
# HTML5Canvas核心技术_图形_动画与游戏开发.pdf
|
6
8
|
# 000_HTML5 Canvas核心技术/图形、动画与游戏开发.pdf
|
data/lib/nx/file-utils.rb
CHANGED
@@ -21,9 +21,13 @@ module Nx
|
|
21
21
|
prefix + options[:separator] + in_name
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def strip_name(in_name)
|
25
25
|
file = File.basename in_name
|
26
26
|
dir = File.dirname in_name
|
27
|
+
puts file
|
28
|
+
puts dir
|
29
|
+
new_filename = File.join(dir, sanitize(file))
|
30
|
+
File.rename(in_name, new_filename)
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
data/lib/nx/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nx-file-utils
|
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
|
- afeiship
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/nx/version.rb
|
64
64
|
- nx-file-utils-0.1.1.gem
|
65
65
|
- nx-file-utils-0.1.2.gem
|
66
|
+
- nx-file-utils-0.1.3.gem
|
66
67
|
- nx-file-utils.gemspec
|
67
68
|
- package.json
|
68
69
|
homepage: https://github.com/afeiship/nx-file-utils
|