alphred 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +4 -1
- data/Gemfile +2 -0
- data/README.md +3 -5
- data/assets/close.png +0 -0
- data/assets/more.png +0 -0
- data/lib/alphred.rb +1 -0
- data/lib/alphred/error.rb +47 -0
- data/lib/alphred/tasks.rb +1 -0
- data/lib/alphred/version.rb +1 -1
- metadata +19 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfd87f875f1f39ed9df8ff68e63f918cd4f3b12c
|
4
|
+
data.tar.gz: 066aa6f960e00010add62e614582c3048c5f2eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc31c9647c85f5d8b258b857bbca6f29b7c115dfb488f7ae7e8ba0adae65194151a328086783811d30db84a1e6ae507f3785940b29a52cc9be61407c176b7534
|
7
|
+
data.tar.gz: 9e3798623971d2f8dc3ad7df2d897264910632bb799dd497d0a139baa362650944fc9f6ec24415bffb56f7530108da4b93c4cf49050790ee3c0281aebf57c639
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -121,11 +121,6 @@ Rake tasks for releasing a workflow. `release` will tag the current commit with
|
|
121
121
|
the provided version and create a .alfredworkflow package with vendored gem
|
122
122
|
dependencies.
|
123
123
|
|
124
|
-
## TODO
|
125
|
-
|
126
|
-
- Add development mode for easier debugging. (Nicer errors, etc.)
|
127
|
-
- Rake task for installing to Alfred
|
128
|
-
|
129
124
|
## Development
|
130
125
|
|
131
126
|
After checking out the repo, run `bundle install` to install dependencies.
|
@@ -150,3 +145,6 @@ the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
|
150
145
|
The gem is available as open source under the terms of the [MIT
|
151
146
|
License](http://opensource.org/licenses/MIT).
|
152
147
|
|
148
|
+
## Credits
|
149
|
+
|
150
|
+
- [Close]() by Berkay Sargın from the Noun Project
|
data/assets/close.png
ADDED
Binary file
|
data/assets/more.png
ADDED
Binary file
|
data/lib/alphred.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative "item"
|
2
|
+
require_relative "items"
|
3
|
+
|
4
|
+
module Alphred
|
5
|
+
class Error < StandardError
|
6
|
+
ASSETS = File.expand_path("../../../assets", __FILE__)
|
7
|
+
|
8
|
+
def self.try
|
9
|
+
yield
|
10
|
+
rescue Exception => e
|
11
|
+
puts self.new(e).to_xml
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :error
|
15
|
+
|
16
|
+
def initialize(error)
|
17
|
+
@error = error
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_items
|
21
|
+
icon = File.join(ASSETS, "close.png")
|
22
|
+
items = [ Alphred::Item.new(title: "#{self.error.class}: #{self.error}",
|
23
|
+
icon: icon) ]
|
24
|
+
items.concat(self.backtrace_items)
|
25
|
+
Alphred::Items.new(*items)
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_xml
|
29
|
+
self.to_items.to_xml
|
30
|
+
end
|
31
|
+
|
32
|
+
def backtrace_items
|
33
|
+
icon = File.join(ASSETS, "more.png")
|
34
|
+
|
35
|
+
base_dirs = $LOAD_PATH + [ENV["alfred_preferences"]]
|
36
|
+
to_delete = /^#{base_dirs.join(?|)}/
|
37
|
+
|
38
|
+
self.error.backtrace.map {|line|
|
39
|
+
title = line.sub(to_delete, "...")
|
40
|
+
Alphred::Item.new(title: title,
|
41
|
+
subtitle: line,
|
42
|
+
arg: line,
|
43
|
+
icon: icon)
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/alphred/tasks.rb
CHANGED
data/lib/alphred/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphred
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alpha Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.10'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.10'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '10.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description:
|
@@ -73,8 +73,9 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
-
|
77
|
-
-
|
76
|
+
- .gitignore
|
77
|
+
- .ruby-version
|
78
|
+
- .travis.yml
|
78
79
|
- CHANGELOG.md
|
79
80
|
- CODE_OF_CONDUCT.md
|
80
81
|
- Gemfile
|
@@ -83,8 +84,11 @@ files:
|
|
83
84
|
- README.md
|
84
85
|
- Rakefile
|
85
86
|
- alphred.gemspec
|
87
|
+
- assets/close.png
|
88
|
+
- assets/more.png
|
86
89
|
- lib/alphred.rb
|
87
90
|
- lib/alphred/config.rb
|
91
|
+
- lib/alphred/error.rb
|
88
92
|
- lib/alphred/icon.rb
|
89
93
|
- lib/alphred/item.rb
|
90
94
|
- lib/alphred/items.rb
|
@@ -102,17 +106,17 @@ require_paths:
|
|
102
106
|
- lib
|
103
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
108
|
requirements:
|
105
|
-
- -
|
109
|
+
- - '>='
|
106
110
|
- !ruby/object:Gem::Version
|
107
111
|
version: '0'
|
108
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
113
|
requirements:
|
110
|
-
- -
|
114
|
+
- - '>='
|
111
115
|
- !ruby/object:Gem::Version
|
112
116
|
version: '0'
|
113
117
|
requirements: []
|
114
118
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.0.14.1
|
116
120
|
signing_key:
|
117
121
|
specification_version: 4
|
118
122
|
summary: Helper utilities for making Alfred workflows.
|