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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fefc02f560672a6e1b7f981299f3133499e7a2b1
4
- data.tar.gz: f5a39b3b8d5848f17ba9b8b0b85ae198e928612d
3
+ metadata.gz: dfd87f875f1f39ed9df8ff68e63f918cd4f3b12c
4
+ data.tar.gz: 066aa6f960e00010add62e614582c3048c5f2eb1
5
5
  SHA512:
6
- metadata.gz: db37176a6f25e8e49f734c1a99b1c79723fbdb1596e7ce9f663ae5137f68da7fc5b32a53d13d78213ef13b1c45fbb0222d2f0c5416b0efd0eb4dc7fd3b81b073
7
- data.tar.gz: 1f5d9d4eb783c4605209882c5c1159d2cefb6b83c0012f28e55c760bd761222569aa67f21eb0967b6ab7c0e5ec963c3552daf70d12c7c1244081a342c385582e
6
+ metadata.gz: dc31c9647c85f5d8b258b857bbca6f29b7c115dfb488f7ae7e8ba0adae65194151a328086783811d30db84a1e6ae507f3785940b29a52cc9be61407c176b7534
7
+ data.tar.gz: 9e3798623971d2f8dc3ad7df2d897264910632bb799dd497d0a139baa362650944fc9f6ec24415bffb56f7530108da4b93c4cf49050790ee3c0281aebf57c639
@@ -0,0 +1 @@
1
+ 2.0.0
@@ -1,4 +1,7 @@
1
- ## Unreleased
1
+ ## [1.2.0] - 2016-04-04
2
+ ### Added
3
+ - Push tags when releasing.
4
+ - Add better error handling.
2
5
 
3
6
  ## [1.1.1] - 2015-11-05
4
7
  ### Changed
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby "2.0.0"
4
+
3
5
  # Specify your gem's dependencies in alphred.gemspec
4
6
  gemspec
5
7
 
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
Binary file
Binary file
@@ -3,6 +3,7 @@ require "builder"
3
3
  require_relative "alphred/version"
4
4
 
5
5
  require_relative "alphred/config"
6
+ require_relative "alphred/error"
6
7
  require_relative "alphred/icon"
7
8
  require_relative "alphred/item"
8
9
  require_relative "alphred/items"
@@ -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
@@ -14,6 +14,7 @@ Can't tag #{version}: dirty working directory.
14
14
  FAIL
15
15
 
16
16
  sh "git tag #{version}"
17
+ sh "git push --tags"
17
18
  end
18
19
 
19
20
  desc "Create an alfredworkflow package with vendored dependencies"
@@ -1,3 +1,3 @@
1
1
  module Alphred
2
- VERSION = "1.1.1"
2
+ VERSION = '1.2.0'
3
3
  end
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.1.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: 2015-11-05 00:00:00.000000000 Z
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
- - ".gitignore"
77
- - ".travis.yml"
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.4.5
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.