alfred-workflow 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  History.txt
2
2
  Manifest.txt
3
- README.txt
3
+ README.md
4
4
  Rakefile
5
5
  lib/alfred.rb
6
6
  lib/alfred/version.rb
@@ -1,35 +1,32 @@
1
- = alfred-workflow
1
+ # alfred-workflow
2
2
 
3
3
  * https://github.com/zhaocai/alfred-workflow
4
4
 
5
- == DESCRIPTION:
5
+ Ruby Gem helper for building [Alfred](http://www.alfredapp.com) workflow.
6
6
 
7
- Ruby Gem helper for building Alfred workflow (http://www.alfredapp.com).
7
+ ## FEATURES:
8
8
 
9
- == FEATURES/PROBLEMS:
10
-
11
- * Functions for finding your bundle ID, cache and storage paths, and query arguments.
12
- * Functions for reading and writing plist files.
9
+ * Functions for finding the bundle ID, cache and storage paths, and query arguments.
13
10
  * Shows exceptions and debug output in the Mac OS X Console
14
- * A class to simplify generating feedback XML for Alfred.
11
+ * Functions for reading and writing plist files.
12
+ * Functions to simplify generating feedback XML for Alfred.
15
13
  * Adds ruby gems repositories to the workflow bundle so you can package gems with your workflow.
16
- * A class to simplify saving and retrieving settings.
17
-
14
+ * Functions to simplify saving and retrieving settings.
18
15
 
19
- == SYNOPSIS:
20
16
 
17
+ ## REQUIREMENTS:
21
18
 
22
- == REQUIREMENTS:
23
19
 
20
+ ## INSTALL:
24
21
 
25
- == INSTALL:
22
+ `gem install alfred-workflow`
26
23
 
27
- * gem install alfred-workflow
24
+ ## USAGE:
28
25
 
29
- == USAGE:
26
+ * Refer to [alfred2-ruby-template]( https://github.com/zhaocai/alfred2-ruby-template ) for example and detailed instruction.
30
27
 
31
28
 
32
- == DEVELOPERS:
29
+ ## DEVELOPERS:
33
30
 
34
31
  After checking out the source, run:
35
32
 
@@ -38,7 +35,7 @@ After checking out the source, run:
38
35
  This task will install any missing dependencies, run the tests/specs,
39
36
  and generate the RDoc.
40
37
 
41
- == LICENSE:
38
+ ## LICENSE:
42
39
 
43
40
  (The MIT License)
44
41
 
@@ -74,7 +74,7 @@ module Alfred
74
74
  raise NoBundleIDError unless bundle_id
75
75
  path = "#{ENV['HOME']}/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/#{bundle_id}"
76
76
  unless Dir.exist?(path)
77
- FileUtils.makdir_p(path)
77
+ FileUtils.mkdir_p(path)
78
78
  end
79
79
  path
80
80
  end
@@ -84,7 +84,7 @@ module Alfred
84
84
  raise NoBundleIDError unless bundle_id
85
85
  path = "#{ENV['HOME']}/Library/Application Support/Alfred 2/Workflow Data/#{bundle_id}"
86
86
  unless Dir.exist?(path)
87
- FileUtils.makdir_p(path)
87
+ FileUtils.mkdir_p(path)
88
88
  end
89
89
  path
90
90
  end
@@ -160,6 +160,25 @@ module Alfred
160
160
  @items << opts unless opts[:title].nil?
161
161
  end
162
162
 
163
+ def add_file_item(path)
164
+ item = {}
165
+ if ['.ennote', '.webbookmark'].include? File.extname(path)
166
+ item[:title] = %x{mdls mdls -name kMDItemDisplayName -raw '#{path}'}
167
+ else
168
+ item[:title] = File.basename(path)
169
+ end
170
+ item[:subtitle] = path
171
+ item[:uid] = path
172
+ item[:arg] = path
173
+ item[:icon] = {:type => "fileicon", :name => path}
174
+ item[:valid] = 'yes'
175
+ item[:autocomplete] = item[:title]
176
+ item[:type] = 'file'
177
+
178
+ @items << item
179
+ end
180
+
181
+
163
182
  def to_xml(items = @items)
164
183
  document = REXML::Element.new("items")
165
184
  items.each do |item|
@@ -1,3 +1,3 @@
1
1
  module Alfred
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alfred-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '3.3'
69
+ version: '3.5'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,8 +74,8 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '3.3'
78
- description: Ruby Gem helper for building Alfred workflow (http://www.alfredapp.com).
77
+ version: '3.5'
78
+ description: ''
79
79
  email:
80
80
  - caizhaoff@gmail.com
81
81
  executables: []
@@ -83,11 +83,10 @@ extensions: []
83
83
  extra_rdoc_files:
84
84
  - History.txt
85
85
  - Manifest.txt
86
- - README.txt
87
86
  files:
88
87
  - History.txt
89
88
  - Manifest.txt
90
- - README.txt
89
+ - README.md
91
90
  - Rakefile
92
91
  - lib/alfred.rb
93
92
  - lib/alfred/version.rb
@@ -97,7 +96,7 @@ licenses: []
97
96
  post_install_message:
98
97
  rdoc_options:
99
98
  - --main
100
- - README.txt
99
+ - README.md
101
100
  require_paths:
102
101
  - lib
103
102
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -117,5 +116,5 @@ rubyforge_project: alfred-workflow
117
116
  rubygems_version: 1.8.24
118
117
  signing_key:
119
118
  specification_version: 3
120
- summary: Ruby Gem helper for building Alfred workflow (http://www.alfredapp.com).
119
+ summary: ''
121
120
  test_files: []