rubyfocus 0.5.3 → 0.5.4

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: 70297c5dac917c7b8a6f0c5341bddb4587456c4f
4
- data.tar.gz: a99ec2c4d65a7c36ed70f022ea8229e7d4ccec35
3
+ metadata.gz: f0e0262c3cf6abfc04f58c73c86f08241fc7173b
4
+ data.tar.gz: 902d1bdeb21ef74cfeef68c98aa553099c3be1c3
5
5
  SHA512:
6
- metadata.gz: 7309cae4cbe610eb65f30ec46b6bef8359db5bcb76eb0023f4ab779f4d3ceec78fc3fe9ea8a2b1dc5035694660cb3504ff542b1ecad782680f4f7598c701775a
7
- data.tar.gz: 637d8a4edd2f2531ebfe084e114ce7532554313e6bec4c9f0ea5d91b64f026a6fc5877b1ad3a63bdd85627afb0d828025d214aee7292891f0772b6871ec372d7
6
+ metadata.gz: 471231676b0538b7f5a6efec824d52c05f5d5017d4ff4b230ac8530ae32b669a81a51af08949b0eca6a4a18e69d17951293913ef22d11d8989a162f9e6c5ce05
7
+ data.tar.gz: 77bba4659add4bc7d8dc08e818c4361dcc8816e9ae1b8f6bec48f257951f3be21e9caf375ba8fb5920640574e77f18c8a9406d80487198195130cb9d6fd77015
@@ -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 +Documet::apply_xml(doc)+, which takes all children of the root
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 || 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.3
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.3
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-04 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri