mac-spotlight 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/ext/spotlight/spotlight.c +12 -2
- data/lib/spotlight.rb +1 -1
- data/mac-spotlight.gemspec +10 -11
- metadata +68 -55
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rubygems'
|
|
5
5
|
require 'echoe'
|
6
6
|
require 'rake/extensiontask'
|
7
7
|
|
8
|
-
Echoe.new('mac-spotlight', '0.0.
|
8
|
+
Echoe.new('mac-spotlight', '0.0.4') do |p|
|
9
9
|
p.description = "Spotlight - Ruby interface to Mac OSX Spotlight"
|
10
10
|
p.url = "https://github.com/xli/spotlight"
|
11
11
|
p.author = "Li Xiao"
|
data/ext/spotlight/spotlight.c
CHANGED
@@ -11,6 +11,12 @@
|
|
11
11
|
|
12
12
|
#define RELEASE_IF_NOT_NULL(ref) { if (ref) { CFRelease(ref); } }
|
13
13
|
|
14
|
+
#ifndef RUBY_19
|
15
|
+
#ifndef RARRAY_LEN
|
16
|
+
#define RARRAY_LEN(v) (RARRAY(v)->len)
|
17
|
+
#endif
|
18
|
+
#endif
|
19
|
+
|
14
20
|
Boolean MDItemSetAttribute(MDItemRef item, CFStringRef name, CFTypeRef value);
|
15
21
|
|
16
22
|
static VALUE cfstring2rbstr(CFStringRef str) {
|
@@ -118,7 +124,7 @@ static CFTypeRef convert2cf_type(VALUE obj) {
|
|
118
124
|
}
|
119
125
|
break;
|
120
126
|
case T_ARRAY:
|
121
|
-
len =
|
127
|
+
len = RARRAY_LEN(obj);
|
122
128
|
array_result = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
|
123
129
|
for (i = 0; i < len; i++) {
|
124
130
|
tmp[0] = INT2NUM(i);
|
@@ -135,7 +141,7 @@ static CFTypeRef convert2cf_type(VALUE obj) {
|
|
135
141
|
|
136
142
|
static void set_search_scope(MDQueryRef query, VALUE scopeDirectories) {
|
137
143
|
int i;
|
138
|
-
int len =
|
144
|
+
int len = RARRAY_LEN(scopeDirectories);
|
139
145
|
CFMutableArrayRef scopesRef = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
|
140
146
|
for (i=0; i<len; i++) {
|
141
147
|
CFArrayAppendValue(scopesRef, rbstr2cfstring(rb_ary_pop(scopeDirectories)));
|
@@ -193,6 +199,8 @@ static int each_attribute(VALUE name, VALUE value, MDItemRef mdi) {
|
|
193
199
|
|
194
200
|
RELEASE_IF_NOT_NULL(valueRef);
|
195
201
|
RELEASE_IF_NOT_NULL(nameRef);
|
202
|
+
|
203
|
+
return ST_CONTINUE;
|
196
204
|
}
|
197
205
|
|
198
206
|
|
@@ -251,6 +259,8 @@ VALUE method_set_attributes(VALUE self, VALUE path, VALUE attributes) {
|
|
251
259
|
MDItemRef mdi = createMDItemByPath(path);
|
252
260
|
rb_hash_foreach(attributes, each_attribute, (VALUE) mdi);
|
253
261
|
RELEASE_IF_NOT_NULL(mdi);
|
262
|
+
|
263
|
+
return Qnil;
|
254
264
|
}
|
255
265
|
|
256
266
|
void Init_spotlight (void)
|
data/lib/spotlight.rb
CHANGED
data/mac-spotlight.gemspec
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.0.
|
4
|
+
s.name = "mac-spotlight"
|
5
|
+
s.version = "0.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Li Xiao"]
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
9
|
+
s.date = "2012-11-27"
|
10
|
+
s.description = "Spotlight - Ruby interface to Mac OSX Spotlight"
|
11
|
+
s.email = "iam@li-xiao.com"
|
12
12
|
s.extensions = ["ext/spotlight/extconf.rb"]
|
13
13
|
s.extra_rdoc_files = ["README.rdoc", "TODO", "ext/spotlight/extconf.rb", "ext/spotlight/spotlight.c", "lib/spotlight.rb"]
|
14
14
|
s.files = ["MIT-LICENSE.txt", "Manifest", "README.rdoc", "Rakefile", "TODO", "ext/spotlight/extconf.rb", "ext/spotlight/spotlight.c", "lib/spotlight.rb", "test/test_file.txt", "test/test_spotlight.rb", "mac-spotlight.gemspec"]
|
15
|
-
s.homepage =
|
15
|
+
s.homepage = "https://github.com/xli/spotlight"
|
16
16
|
s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers", "--charset", "UTF-8"]
|
17
17
|
s.require_paths = ["lib", "ext"]
|
18
|
-
s.rubyforge_project =
|
19
|
-
s.rubygems_version =
|
20
|
-
s.summary =
|
18
|
+
s.rubyforge_project = "mac-spotlight"
|
19
|
+
s.rubygems_version = "1.8.24"
|
20
|
+
s.summary = "Spotlight - Ruby interface to Mac OSX Spotlight"
|
21
21
|
s.test_files = ["test/test_spotlight.rb"]
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
24
|
s.specification_version = 3
|
26
25
|
|
27
|
-
if Gem::Version.new(Gem::
|
26
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
27
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
29
28
|
s.add_development_dependency(%q<echoe>, [">= 0"])
|
30
29
|
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
metadata
CHANGED
@@ -1,60 +1,76 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mac-spotlight
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Li Xiao
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-11-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
17
22
|
type: :development
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
26
31
|
name: echoe
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
27
38
|
type: :development
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- !ruby/object:Gem::Dependency
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
36
47
|
name: rake-compiler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
37
54
|
type: :development
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
45
62
|
description: Spotlight - Ruby interface to Mac OSX Spotlight
|
46
63
|
email: iam@li-xiao.com
|
47
64
|
executables: []
|
48
|
-
|
49
|
-
extensions:
|
65
|
+
extensions:
|
50
66
|
- ext/spotlight/extconf.rb
|
51
|
-
extra_rdoc_files:
|
67
|
+
extra_rdoc_files:
|
52
68
|
- README.rdoc
|
53
69
|
- TODO
|
54
70
|
- ext/spotlight/extconf.rb
|
55
71
|
- ext/spotlight/spotlight.c
|
56
72
|
- lib/spotlight.rb
|
57
|
-
files:
|
73
|
+
files:
|
58
74
|
- MIT-LICENSE.txt
|
59
75
|
- Manifest
|
60
76
|
- README.rdoc
|
@@ -66,39 +82,36 @@ files:
|
|
66
82
|
- test/test_file.txt
|
67
83
|
- test/test_spotlight.rb
|
68
84
|
- mac-spotlight.gemspec
|
69
|
-
has_rdoc: true
|
70
85
|
homepage: https://github.com/xli/spotlight
|
71
86
|
licenses: []
|
72
|
-
|
73
87
|
post_install_message:
|
74
|
-
rdoc_options:
|
88
|
+
rdoc_options:
|
75
89
|
- --main
|
76
90
|
- README.rdoc
|
77
91
|
- --inline-source
|
78
92
|
- --line-numbers
|
79
93
|
- --charset
|
80
94
|
- UTF-8
|
81
|
-
require_paths:
|
95
|
+
require_paths:
|
82
96
|
- lib
|
83
97
|
- ext
|
84
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.2'
|
96
110
|
requirements: []
|
97
|
-
|
98
111
|
rubyforge_project: mac-spotlight
|
99
|
-
rubygems_version: 1.
|
112
|
+
rubygems_version: 1.8.24
|
100
113
|
signing_key:
|
101
114
|
specification_version: 3
|
102
115
|
summary: Spotlight - Ruby interface to Mac OSX Spotlight
|
103
|
-
test_files:
|
116
|
+
test_files:
|
104
117
|
- test/test_spotlight.rb
|