spotlight 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +4 -0
- data/Rakefile +2 -3
- data/ext/md_item_native/md_item_native.c +5 -3
- data/ext/md_item_native/md_item_native.h +2 -3
- data/ext/md_query_native/md_query_native.c +0 -1
- data/spec/md_item_native_spec.rb +20 -2
- data/spotlight.gemspec +2 -2
- metadata +73 -94
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2948a92d2c2c4a1394a3909b3d3901fefe808301
|
4
|
+
data.tar.gz: 6f10bdf77e8e477ff588e02e40483381b16e4fb8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9342257a8ddea1ef8c00db2c3c87e729d2af7af2bd59a5da1b64ffd0d1c4d20638d747850ad39b538ac0344ed67bfd9caa938d8d72b11934f86305eaf5ba6b35
|
7
|
+
data.tar.gz: 46c2aacc0e4c404af9f263ba4ad41102203ef1f168b8852524507e5cb8e84a1123966d161db6f41e88f777325686ada8c6a81aaabbc1130feb33ad05f51a89bf
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -110,17 +110,19 @@ static VALUE cMDItemNative_new(int argc, VALUE *argv, VALUE klass)
|
|
110
110
|
{
|
111
111
|
VALUE filename, obj;
|
112
112
|
MDItemRef item;
|
113
|
+
char *filenameString;
|
113
114
|
CFStringRef cfFilename;
|
114
115
|
|
115
116
|
rb_scan_args(argc, argv, "1", &filename);
|
116
117
|
|
117
|
-
|
118
|
+
filenameString = StringValuePtr(filename);
|
119
|
+
cfFilename = CString2CFString(filenameString);
|
118
120
|
item = MDItemCreate(kCFAllocatorDefault, cfFilename);
|
119
121
|
|
120
122
|
if(item != NULL) {
|
121
123
|
obj = createInstanceFromMDItem(item);
|
122
124
|
} else {
|
123
|
-
rb_raise(rb_eArgError, "no such file or directory: %s",
|
125
|
+
rb_raise(rb_eArgError, "no such file or directory: %s", filenameString);
|
124
126
|
}
|
125
127
|
|
126
128
|
CFRelease(cfFilename);
|
@@ -138,7 +140,7 @@ static VALUE cMDItemNative_get(int argc, VALUE *argv, VALUE self)
|
|
138
140
|
rb_scan_args(argc, argv, "1", &attrName);
|
139
141
|
|
140
142
|
if(TYPE(attrName) == T_SYMBOL) {
|
141
|
-
cfAttrName = (CFStringRef)CString2CFString(rb_id2name(SYM2ID(attrName)));
|
143
|
+
cfAttrName = (CFStringRef)CString2CFString((char *)rb_id2name(SYM2ID(attrName)));
|
142
144
|
} else {
|
143
145
|
cfAttrName = (CFStringRef)CString2CFString(StringValuePtr(attrName));
|
144
146
|
}
|
@@ -2,9 +2,8 @@
|
|
2
2
|
#define MD_ITEM_NATIVE_H
|
3
3
|
|
4
4
|
#include <ruby.h>
|
5
|
-
#include
|
6
|
-
#include
|
7
|
-
#include </System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFNumber.h>
|
5
|
+
#include <CoreServices/CoreServices.h>
|
6
|
+
#include <CoreFoundation/CoreFoundation.h>
|
8
7
|
|
9
8
|
VALUE createInstanceFromMDItem(MDItemRef item);
|
10
9
|
|
data/spec/md_item_native_spec.rb
CHANGED
@@ -6,13 +6,31 @@ describe Spotlight::MDItemNative do
|
|
6
6
|
@filename = File.basename(__FILE__)
|
7
7
|
end
|
8
8
|
|
9
|
+
context 'file not found' do
|
10
|
+
it 'raises error' do
|
11
|
+
filename = __FILE__ + 'aaa'
|
12
|
+
|
13
|
+
expect {
|
14
|
+
Spotlight::MDItemNative.new(filename)
|
15
|
+
}.to(
|
16
|
+
raise_error(
|
17
|
+
ArgumentError,
|
18
|
+
format(
|
19
|
+
'no such file or directory: %<filename>s',
|
20
|
+
filename: filename
|
21
|
+
)
|
22
|
+
)
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
9
27
|
it "should instanciate" do
|
10
28
|
@item.should be_an_instance_of(Spotlight::MDItemNative)
|
11
29
|
end
|
12
30
|
|
13
31
|
it "should get attribute by name" do
|
14
|
-
@item.get('kMDItemKind').should
|
15
|
-
@item.get(:kMDItemKind).should
|
32
|
+
@item.get('kMDItemKind').should match('Ruby Source')
|
33
|
+
@item.get(:kMDItemKind).should match('Ruby Source')
|
16
34
|
@item.get(:kMDItemFSName).should eql(@filename)
|
17
35
|
@item.get(:kMDItemFSCreationDate).should be_an_instance_of(Time)
|
18
36
|
@item.get(:kMDItemFSOwnerUserID).should be_an_instance_of(Fixnum)
|
data/spotlight.gemspec
CHANGED
@@ -14,11 +14,11 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "spotlight"
|
15
15
|
gem.extensions = ["ext/md_item_native/extconf.rb", "ext/md_query_native/extconf.rb"]
|
16
16
|
gem.require_paths = ["lib"]
|
17
|
-
gem.version = '0.0.
|
17
|
+
gem.version = '0.0.7'
|
18
18
|
|
19
19
|
gem.add_dependency('plist')
|
20
20
|
|
21
|
-
gem.add_development_dependency('rake')
|
21
|
+
gem.add_development_dependency('rake', '< 11.0')
|
22
22
|
gem.add_development_dependency('rspec', ['~> 2.8.0'])
|
23
23
|
gem.add_development_dependency('spotlight')
|
24
24
|
end
|
metadata
CHANGED
@@ -1,93 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotlight
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 6
|
10
|
-
version: 0.0.6
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.7
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- youpy
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 3
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
30
|
-
prerelease: false
|
31
|
-
type: :runtime
|
11
|
+
date: 2018-11-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
32
14
|
name: plist
|
33
|
-
requirement:
|
34
|
-
|
35
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
38
17
|
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
|
42
|
-
- 0
|
43
|
-
version: "0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
44
21
|
prerelease: false
|
45
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
46
28
|
name: rake
|
47
|
-
requirement:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
hash: 47
|
55
|
-
segments:
|
56
|
-
- 2
|
57
|
-
- 8
|
58
|
-
- 0
|
59
|
-
version: 2.8.0
|
60
|
-
prerelease: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '11.0'
|
61
34
|
type: :development
|
62
|
-
name: rspec
|
63
|
-
requirement: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
|
-
requirements:
|
68
|
-
- - ">="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
hash: 3
|
71
|
-
segments:
|
72
|
-
- 0
|
73
|
-
version: "0"
|
74
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '11.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.8.0
|
75
48
|
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.8.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
76
56
|
name: spotlight
|
77
|
-
requirement:
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
78
69
|
description: Library to use Spotlight from Ruby
|
79
|
-
email:
|
70
|
+
email:
|
80
71
|
- youpy@buycheapviagraonlinenow.com
|
81
72
|
executables: []
|
82
|
-
|
83
|
-
extensions:
|
73
|
+
extensions:
|
84
74
|
- ext/md_item_native/extconf.rb
|
85
75
|
- ext/md_query_native/extconf.rb
|
86
76
|
extra_rdoc_files: []
|
87
|
-
|
88
|
-
|
89
|
-
- .
|
90
|
-
- .gitignore
|
77
|
+
files:
|
78
|
+
- ".document"
|
79
|
+
- ".gitignore"
|
91
80
|
- Gemfile
|
92
81
|
- LICENSE
|
93
82
|
- README.rdoc
|
@@ -106,40 +95,30 @@ files:
|
|
106
95
|
- spec/spec_helper.rb
|
107
96
|
- spec/spotlight_query_spec.rb
|
108
97
|
- spotlight.gemspec
|
109
|
-
homepage:
|
98
|
+
homepage: ''
|
110
99
|
licenses: []
|
111
|
-
|
100
|
+
metadata: {}
|
112
101
|
post_install_message:
|
113
102
|
rdoc_options: []
|
114
|
-
|
115
|
-
require_paths:
|
103
|
+
require_paths:
|
116
104
|
- lib
|
117
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
-
|
119
|
-
requirements:
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
120
107
|
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
version: "0"
|
126
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
|
-
requirements:
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
129
112
|
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
|
132
|
-
segments:
|
133
|
-
- 0
|
134
|
-
version: "0"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
135
115
|
requirements: []
|
136
|
-
|
137
116
|
rubyforge_project:
|
138
|
-
rubygems_version:
|
117
|
+
rubygems_version: 2.5.1
|
139
118
|
signing_key:
|
140
|
-
specification_version:
|
119
|
+
specification_version: 4
|
141
120
|
summary: Library to use Spotlight from Ruby
|
142
|
-
test_files:
|
121
|
+
test_files:
|
143
122
|
- spec/fixtures/test.savedSearch
|
144
123
|
- spec/md_item_native_spec.rb
|
145
124
|
- spec/md_query_native_spec.rb
|