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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 468f7428faab98095790f082053845477f5ae4ba58d86ccd9894fcfb1f44d860
4
- data.tar.gz: 52b9e7c29c3e83014b73b6f778f9757b25214efec07eff2b1dc62e73de3c236d
3
+ metadata.gz: 64e998e9da498ada7d1677c20e2ce2ce3ee25ea73d8c37c767b4bacb1adba16c
4
+ data.tar.gz: c50b69d171cc4a9d1b928edfc712034068e138f6e69020dedcfca465c8b1fbd6
5
5
  SHA512:
6
- metadata.gz: 701293b4ba6403db96af03f94cece7475b4bba76f6336dd3945966d0311b04d11df9de6b9f643fcc7599d608d669eae700635e907053aee2f64f504c763a7d5c
7
- data.tar.gz: bafe22204493b6decc72379fb9da7469ec200ccdf22cf5ca9b63ff13f5719c5bfafe7bd6b0f633e205d7d8805c52444bb958bd49f28ad72edada57a35c4bb3f0
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 rename(in_name, in_new_name)
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
@@ -1,5 +1,5 @@
1
1
  module Nx
2
2
  class FileUtils
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
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-18 00:00:00.000000000 Z
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