rubyfocus 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubyfocus/document.rb +1 -1
- data/lib/rubyfocus/fetchers/local_fetcher.rb +26 -3
- data/version.txt +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: f0e0262c3cf6abfc04f58c73c86f08241fc7173b
|
4
|
+
data.tar.gz: 902d1bdeb21ef74cfeef68c98aa553099c3be1c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471231676b0538b7f5a6efec824d52c05f5d5017d4ff4b230ac8530ae32b669a81a51af08949b0eca6a4a18e69d17951293913ef22d11d8989a162f9e6c5ce05
|
7
|
+
data.tar.gz: 77bba4659add4bc7d8dc08e818c4361dcc8816e9ae1b8f6bec48f257951f3be21e9caf375ba8fb5920640574e77f18c8a9406d80487198195130cb9d6fd77015
|
data/lib/rubyfocus/document.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# a Nokogiri XML document (or +nil+). Alternatively, you can initialize through +Document.from_file(file)+,
|
7
7
|
# which reads the file and parses it as XML
|
8
8
|
#
|
9
|
-
# You add XML to the document by running +
|
9
|
+
# You add XML to the document by running +Document::apply_xml(doc)+, which takes all children of the root
|
10
10
|
# XML node, tries to turn each child into a relevant object, and adds it to the document. This is done using
|
11
11
|
# the private +ivar_for+ method, as well as +add_element(e)+, which you can use to add individual objects.
|
12
12
|
class Rubyfocus::Document
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class Rubyfocus::LocalFetcher < Rubyfocus::Fetcher
|
2
|
-
# This is where the files are usually stored
|
3
|
-
LOCATION = File.join(ENV["HOME"], "/Library/Containers/com.omnigroup.OmniFocus2/Data/Library/Application Support/OmniFocus/OmniFocus.ofocus")
|
4
2
|
|
5
3
|
#---------------------------------------
|
6
4
|
# Parent method overrides
|
@@ -56,8 +54,33 @@ class Rubyfocus::LocalFetcher < Rubyfocus::Fetcher
|
|
56
54
|
|
57
55
|
#---------------------------------------
|
58
56
|
# Location file setters and getters
|
57
|
+
|
58
|
+
# Default (non app-store) file location
|
59
|
+
def default_location
|
60
|
+
@default_location ||= File.join(ENV["HOME"],
|
61
|
+
"/Library/Containers/com.omnigroup.OmniFocus2",
|
62
|
+
"Data/Library/Application Support/OmniFocus/OmniFocus.ofocus")
|
63
|
+
end
|
64
|
+
|
65
|
+
# Default app-store file location
|
66
|
+
def appstore_location
|
67
|
+
@appstore_location ||= File.join(ENV["HOME"],
|
68
|
+
"/Library/Containers/com.omnigroup.OmniFocus2.MacAppStore",
|
69
|
+
"Data/Library/Application Support/OmniFocus/OmniFocus.ofocus")
|
70
|
+
end
|
71
|
+
|
72
|
+
# Determine location based on assigned and default values. Returns +nil+
|
73
|
+
# if no assigned location and default locations don't exist.
|
59
74
|
def location
|
60
|
-
@location
|
75
|
+
if @location
|
76
|
+
@location
|
77
|
+
elsif File.exists?(default_location)
|
78
|
+
default_location
|
79
|
+
elsif File.exists?(appstore_location)
|
80
|
+
appstore_location
|
81
|
+
else
|
82
|
+
nil
|
83
|
+
end
|
61
84
|
end
|
62
85
|
|
63
86
|
def location= l
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.4
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyfocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan-Yves Ruzicka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|