mfd 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +118 -15
- data/lib/mfd/asset.rb +81 -1322
- data/lib/mfd/cli.rb +5 -17
- data/lib/mfd/version.rb +1 -1
- metadata +6 -6
data/lib/mfd/cli.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'mfd/asset'
|
2
1
|
require 'optparse'
|
2
|
+
require 'mfd/asset'
|
3
3
|
|
4
4
|
module Mfd
|
5
5
|
class Cli
|
@@ -129,23 +129,11 @@ module Mfd
|
|
129
129
|
#{' ' * 35}来指定要搜索的文件的后缀名, 可以使用\"-l\"选项查看所有支持的后
|
130
130
|
#{' ' * 35}缀名以及关联
|
131
131
|
") do |type|
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
if Mfd::Asset::KIND_MAP[type]
|
133
|
+
@predicates << '(kMDItemFSName == "*.%s" || kMDItemKind == "%s"cdw)' % [type, escape(Mfd::Asset::KIND_MAP[type])]
|
134
|
+
else
|
135
|
+
@predicates << 'kMDItemFSName == "*.%s"' % type
|
135
136
|
end
|
136
|
-
@predicates << 'kMDItemKind == "*%s*"cdw' % escape(Mfd::Asset::KIND_MAP[type])
|
137
|
-
end
|
138
|
-
|
139
|
-
@opt.on('-l', '--list-types', "kMDItemKind 字符串不便记忆,为了方便使用,本程序将常用的
|
140
|
-
#{' ' * 35}文件类型的后缀名和 kMDItemKind 字符串建立关联,使用本选项
|
141
|
-
#{' ' * 35}看所有支持的后缀名以及关联
|
142
|
-
") do
|
143
|
-
puts
|
144
|
-
Mfd::Asset::KIND_MAP.keys.sort.each do |e|
|
145
|
-
printf "\t%-10s : %s\n", e, Mfd::Asset::KIND_MAP[e]
|
146
|
-
end
|
147
|
-
puts
|
148
|
-
exit
|
149
137
|
end
|
150
138
|
|
151
139
|
@opt.on('-k kind', '--kind kind', "e.g. --kind \"HTML Document\"
|
data/lib/mfd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mfd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,7 +95,7 @@ homepage: https://github.com/lululau/mfd
|
|
95
95
|
licenses:
|
96
96
|
- MIT
|
97
97
|
metadata: {}
|
98
|
-
post_install_message:
|
98
|
+
post_install_message:
|
99
99
|
rdoc_options: []
|
100
100
|
require_paths:
|
101
101
|
- lib
|
@@ -110,8 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
114
|
-
signing_key:
|
113
|
+
rubygems_version: 3.4.1
|
114
|
+
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: ''
|
117
117
|
test_files: []
|