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 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
@@ -31,6 +31,10 @@ Description goes here.
31
31
 
32
32
  item.attribute_names
33
33
 
34
+ == Example Application
35
+
36
+ * https://gist.github.com/4086771
37
+
34
38
  == Note on Patches/Pull Requests
35
39
 
36
40
  * Fork the project.
data/Rakefile CHANGED
@@ -24,8 +24,7 @@ end
24
24
 
25
25
  require 'rspec/core'
26
26
  require 'rspec/core/rake_task'
27
- RSpec::Core::RakeTask.new(:spec) do |spec|
28
- spec.pattern = FileList['spec/**/*_spec.rb']
29
- end
27
+
28
+ RSpec::Core::RakeTask.new(:spec)
30
29
 
31
30
  task :default => :spec
@@ -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
- cfFilename = CString2CFString(StringValuePtr(filename));
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", filename);
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 </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Headers/MDItem.h>
6
- #include </System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFDate.h>
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
 
@@ -1,5 +1,4 @@
1
1
  #include <ruby.h>
2
- #include </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Headers/MDQuery.h>
3
2
  #include "../md_item_native/md_item_native.h"
4
3
 
5
4
  struct QueryObject {
@@ -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 eql('Ruby Source File')
15
- @item.get(:kMDItemKind).should eql('Ruby Source File')
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.6'
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
- hash: 19
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
- date: 2012-11-16 00:00:00 Z
19
- dependencies:
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: *id001
34
- - !ruby/object:Gem::Dependency
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
- hash: 3
41
- segments:
42
- - 0
43
- version: "0"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
44
21
  prerelease: false
45
- type: :development
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: *id002
48
- - !ruby/object:Gem::Dependency
49
- version_requirements: &id003 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
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: *id004
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
- files:
89
- - .document
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
- none: false
119
- requirements:
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
120
107
  - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
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
- hash: 3
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: 1.8.24
117
+ rubygems_version: 2.5.1
139
118
  signing_key:
140
- specification_version: 3
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