alphred 1.1.0 → 1.1.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 +4 -2
- data/README.md +1 -0
- data/lib/alphred/config.rb +7 -4
- 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: fefc02f560672a6e1b7f981299f3133499e7a2b1
|
4
|
+
data.tar.gz: f5a39b3b8d5848f17ba9b8b0b85ae198e928612d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db37176a6f25e8e49f734c1a99b1c79723fbdb1596e7ce9f663ae5137f68da7fc5b32a53d13d78213ef13b1c45fbb0222d2f0c5416b0efd0eb4dc7fd3b81b073
|
7
|
+
data.tar.gz: 1f5d9d4eb783c4605209882c5c1159d2cefb6b83c0012f28e55c760bd761222569aa67f21eb0967b6ab7c0e5ec963c3552daf70d12c7c1244081a342c385582e
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
-
## [1.1.
|
3
|
+
## [1.1.1] - 2015-11-05
|
4
|
+
### Changed
|
5
|
+
- Don't crash when the config file doesn't exist.
|
4
6
|
|
7
|
+
## [1.1.0] - 2015-11-01
|
5
8
|
### Added
|
6
9
|
- `Config` class for handling persistent configuration across workflow updates.
|
7
10
|
- CHANGELOG
|
8
11
|
|
9
12
|
## [1.0.0] - 2015-10-31
|
10
|
-
|
11
13
|
### Added
|
12
14
|
- Library for making Alfred workflows.
|
data/README.md
CHANGED
data/lib/alphred/config.rb
CHANGED
@@ -2,8 +2,6 @@ require "json"
|
|
2
2
|
|
3
3
|
module Alphred
|
4
4
|
class Config
|
5
|
-
PATH = File.join(ENV["alfred_workflow_data"], 'config.json')
|
6
|
-
|
7
5
|
def self.load(**defaults)
|
8
6
|
config = self.new(**defaults)
|
9
7
|
config.load!
|
@@ -17,12 +15,13 @@ module Alphred
|
|
17
15
|
end
|
18
16
|
|
19
17
|
def load!
|
20
|
-
|
18
|
+
return unless File.exist?(self.path)
|
19
|
+
self.data.merge!(JSON.load(File.open(self.path)))
|
21
20
|
end
|
22
21
|
|
23
22
|
def update!(json)
|
24
23
|
data = self.data.merge(JSON.load(json))
|
25
|
-
File.write(
|
24
|
+
File.write(self.path, JSON.dump(data), mode: ?w)
|
26
25
|
end
|
27
26
|
|
28
27
|
def [](key)
|
@@ -48,5 +47,9 @@ module Alphred
|
|
48
47
|
|
49
48
|
Items.new(*items).to_xml
|
50
49
|
end
|
50
|
+
|
51
|
+
def path
|
52
|
+
File.join(ENV["alfred_workflow_data"], 'config.json')
|
53
|
+
end
|
51
54
|
end
|
52
55
|
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: 1.1.
|
4
|
+
version: 1.1.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: 2015-11-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|