alphred 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +114 -68
- data/lib/alphred/tasks.rb +48 -9
- data/lib/alphred/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d77538c0ab6babe0166db3c1d3760560a581b72
|
4
|
+
data.tar.gz: ff87faf19a7aab67ef5efb519ce09d8090cfff43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3619e36d3aa9bf3b3187121e6566c1945c60ec2628207693b932afa895242d0c1bdf59caa5ccf555a43cecaa67167466c7dbf4c97e6ecfebf5982fad0ad02757
|
7
|
+
data.tar.gz: a942a94bf4e8bcbbbbc7b6a752d9400c5215ccb68838b2f0171f05f3ac60e60d2998f8431bfc3502b1b414edfbb601c0c9b028526ea33a24091c7bc066c6ae79
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## [2.0.1] - 2016-07-28
|
2
|
+
### Fixed
|
3
|
+
- Rake task now cleans `Don't Export`-ed environment vars.
|
4
|
+
|
5
|
+
## [2.0.0] - 2016-05-15
|
6
|
+
### Added
|
7
|
+
- `Alphred::Items[...]` convenience method.
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
- `to_xml` has been deprecated in favor of `to_json`.
|
11
|
+
- `mods` in an `Alphred::Item` are declared differently now.
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
- `Alphred::Config` has been deprecated since Alfred 3 supports environment
|
15
|
+
variables.
|
16
|
+
|
1
17
|
## [1.2.2] - 2016-04-17
|
2
18
|
### Fixed
|
3
19
|
- Require FileUtils for Config.
|
data/README.md
CHANGED
@@ -14,76 +14,122 @@ The [example script filter][scriptfilter] would look like this using Alphred:
|
|
14
14
|
[scriptfilter]: https://www.alfredapp.com/help/workflows/inputs/script-filter/
|
15
15
|
|
16
16
|
``` ruby
|
17
|
-
items =
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
17
|
+
items = Items[
|
18
|
+
Item.new(
|
19
|
+
uid: 'desktop',
|
20
|
+
type: 'file',
|
21
|
+
title: 'Desktop',
|
22
|
+
subtitle: '~/Desktop',
|
23
|
+
arg: '~/Desktop',
|
24
|
+
autocomplete: 'Desktop',
|
25
|
+
icon: { type: :fileicon, path: '~/Desktop' },
|
26
|
+
),
|
27
|
+
Item.new(
|
28
|
+
valid: false,
|
29
|
+
uid: 'flickr',
|
30
|
+
title: 'Flickr',
|
31
|
+
icon: 'flickr.png'
|
32
|
+
),
|
33
|
+
Item.new(
|
34
|
+
uid: 'image',
|
35
|
+
type: 'file',
|
36
|
+
title: 'My holiday photo',
|
37
|
+
subtitle: '~/Pictures/My holiday photo.jpg',
|
38
|
+
autocomplete: 'My holiday photo',
|
39
|
+
icon: { type: :filetype, path: 'public.jpeg' },
|
40
|
+
),
|
41
|
+
Item.new(
|
42
|
+
valid: false,
|
43
|
+
uid: 'alfredapp',
|
44
|
+
title: 'Alfred Website',
|
45
|
+
subtitle: 'https://www.alfredapp.com/',
|
46
|
+
arg: 'alfredapp.com',
|
47
|
+
autocomplete: 'Alfred Website',
|
48
|
+
quicklookurl: 'https://www.alfredapp.com/',
|
49
|
+
mods: {
|
50
|
+
alt: {
|
51
|
+
valid: true,
|
52
|
+
arg: 'alfredapp.com/powerpack',
|
53
|
+
subtitle: 'https://www.alfredapp.com/powerpack/',
|
54
|
+
},
|
55
|
+
cmd: {
|
56
|
+
valid: true,
|
57
|
+
arg: 'alfredapp.com/powerpack/buy/',
|
58
|
+
subtitle: 'https://www.alfredapp.com/powerpack/buy/',
|
59
|
+
},
|
60
|
+
},
|
61
|
+
text: {
|
62
|
+
copy: 'https://www.alfredapp.com/ (text here to copy)',
|
63
|
+
largetype: 'https://www.alfredapp.com/ (text here for large type)',
|
64
|
+
},
|
65
|
+
),
|
66
|
+
]
|
67
|
+
items.to_json
|
53
68
|
```
|
54
69
|
|
55
|
-
This produces the following
|
56
|
-
|
57
|
-
```
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
70
|
+
This produces the following JSON:
|
71
|
+
|
72
|
+
``` json
|
73
|
+
{
|
74
|
+
"items": [
|
75
|
+
{
|
76
|
+
"uid": "desktop",
|
77
|
+
"type": "file",
|
78
|
+
"title": "Desktop",
|
79
|
+
"subtitle": "~/Desktop",
|
80
|
+
"arg": "~/Desktop",
|
81
|
+
"autocomplete": "Desktop",
|
82
|
+
"icon": {
|
83
|
+
"type": "fileicon",
|
84
|
+
"path": "~/Desktop"
|
85
|
+
}
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"valid": false,
|
89
|
+
"uid": "flickr",
|
90
|
+
"title": "Flickr",
|
91
|
+
"icon": {
|
92
|
+
"path": "flickr.png"
|
93
|
+
}
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"uid": "image",
|
97
|
+
"type": "file",
|
98
|
+
"title": "My holiday photo",
|
99
|
+
"subtitle": "~/Pictures/My holiday photo.jpg",
|
100
|
+
"autocomplete": "My holiday photo",
|
101
|
+
"icon": {
|
102
|
+
"type": "filetype",
|
103
|
+
"path": "public.jpeg"
|
104
|
+
}
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"valid": false,
|
108
|
+
"uid": "alfredapp",
|
109
|
+
"title": "Alfred Website",
|
110
|
+
"subtitle": "https://www.alfredapp.com/",
|
111
|
+
"arg": "alfredapp.com",
|
112
|
+
"autocomplete": "Alfred Website",
|
113
|
+
"quicklookurl": "https://www.alfredapp.com/",
|
114
|
+
"mods": {
|
115
|
+
"alt": {
|
116
|
+
"valid": true,
|
117
|
+
"arg": "alfredapp.com/powerpack",
|
118
|
+
"subtitle": "https://www.alfredapp.com/powerpack/"
|
119
|
+
},
|
120
|
+
"cmd": {
|
121
|
+
"valid": true,
|
122
|
+
"arg": "alfredapp.com/powerpack/buy/",
|
123
|
+
"subtitle": "https://www.alfredapp.com/powerpack/buy/"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"text": {
|
127
|
+
"copy": "https://www.alfredapp.com/ (text here to copy)",
|
128
|
+
"largetype": "https://www.alfredapp.com/ (text here for large type)"
|
129
|
+
}
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}
|
87
133
|
```
|
88
134
|
|
89
135
|
### Releasing
|
data/lib/alphred/tasks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
|
1
3
|
require 'rake'
|
2
4
|
|
3
5
|
namespace :alphred do
|
@@ -20,22 +22,59 @@ Can't tag #{version}: dirty working directory.
|
|
20
22
|
desc 'Create an alfredworkflow package with vendored dependencies'
|
21
23
|
task :package do
|
22
24
|
restore_bundler_config do
|
23
|
-
|
24
|
-
sh "chruby-exec 2.0.0 -- #{cmd}"
|
25
|
-
end
|
26
|
-
sh "zip -r #{application_dir.pathmap('%n.alfredworkflow')} *"
|
27
|
-
rm_rf 'vendor'
|
28
|
-
end
|
25
|
+
vendor_deps
|
29
26
|
|
30
|
-
|
31
|
-
|
27
|
+
Dir.mktmpdir do |tmp_dir|
|
28
|
+
cp_r FileList[File.join(workflow_dir, ?*)], tmp_dir, verbose: false
|
29
|
+
|
30
|
+
clean_vars(tmp_dir)
|
31
|
+
zip_workflow(tmp_dir)
|
32
|
+
end
|
33
|
+
|
34
|
+
rm_r 'vendor'
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
38
|
def restore_bundler_config
|
35
|
-
path = File.join(
|
39
|
+
path = File.join(workflow_dir, '.bundle', 'config')
|
36
40
|
config = File.read(path)
|
37
41
|
yield
|
38
42
|
ensure
|
39
43
|
File.write(path, config, mode: ?w)
|
40
44
|
end
|
45
|
+
|
46
|
+
def vendor_deps
|
47
|
+
args = %w[ --standalone
|
48
|
+
--path vendor/bundle
|
49
|
+
--without development test ]
|
50
|
+
cmd = "bundle install #{args.join(' ')}"
|
51
|
+
sh "chruby-exec 2.0.0 -- #{cmd}"
|
52
|
+
end
|
53
|
+
|
54
|
+
def clean_vars(dir)
|
55
|
+
info_plist = File.join(dir, 'info.plist')
|
56
|
+
|
57
|
+
vars = `/usr/libexec/PlistBuddy -c "Print :variablesdontexport" #{info_plist}`
|
58
|
+
vars = vars.split("\n")[1..-2].map(&:strip)
|
59
|
+
|
60
|
+
vars.each do |var|
|
61
|
+
sh "/usr/libexec/PlistBuddy -c \"Set :variables:#{var} ''\" #{info_plist}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def zip_workflow(dir)
|
66
|
+
cd dir do
|
67
|
+
output = File.join(workflow_dir,
|
68
|
+
workflow_name.pathmap('%n.alfredworkflow'))
|
69
|
+
sh "zip -rq #{output} *"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def workflow_name
|
74
|
+
workflow_dir.pathmap('%f')
|
75
|
+
end
|
76
|
+
|
77
|
+
def workflow_dir
|
78
|
+
Rake.application.original_dir
|
79
|
+
end
|
41
80
|
end
|
data/lib/alphred/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphred
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alpha Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|