rubyfocus 0.5.15 → 0.5.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f5a4c91ed0928fd76122bd1a73aac09cd7865910
4
- data.tar.gz: c0b84fe38a026dec491cacb779d1af6711c113e4
2
+ SHA256:
3
+ metadata.gz: a5d202cfe72692a61bbc8a64095b20bff39a7bf9ce1925e8cfa9cb868c06c0ba
4
+ data.tar.gz: 4a476d1c8acbe3ea05435ec43151c063b4c3b3f7417464fb8f18deaf08b92adc
5
5
  SHA512:
6
- metadata.gz: e310985eb7a3abb07c71659308b02e819db7ca8d833d543b3bf6c050ceda74ad009a22008c5d55b1bb9938db02def736ad749c94dfdc92cf3d45e6c7be47a469
7
- data.tar.gz: ab34e7acef67d5c7a4892a71065ae98200398027d9698d2630bc502987c136bfba55db773e7c6b5ec73e235bfdfe4cff5a15614f8066d60e07aa2ff5227342fe
6
+ metadata.gz: 8a9e39b6683470c437d020f7f4cd054e4331f74408c097161ac6fa6ab7d536dfc6f0916362b8fca8d7a19f4fe39918da0b2196ec5fea4d80c3a47dd55a098a64
7
+ data.tar.gz: 44c688ddf537a88e6fec2bb5d0d40f9c13f113e830d7f8d69dd9e3edfc136ee1d8a6b70f082f5cf2bda743501ffb5692724dd37b0de0d8a49a04eac88cf3ab6d
@@ -2,9 +2,16 @@
2
2
 
3
3
  The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.5.16] - 2019-04-05
6
+
7
+ ### Changed
8
+
9
+ * Updated OmniFocus locations code, to deal with current and future versions of OmniFocus
10
+ * Updated gem dependencies, to address security issues.
11
+
5
12
  ## [0.5.15]
6
13
 
7
- ## Changed
14
+ ### Changed
8
15
 
9
16
  * Fixed further bugs related to Rubyfocus' not being able to pick the base file from OmniFocus' local file store.
10
17
 
data/README.md CHANGED
@@ -20,7 +20,7 @@ Now build and install it!
20
20
 
21
21
  ```
22
22
  gem build rubyfocus.gemspec
23
- gem install rubyfocus-0.5.15.gem
23
+ gem install rubyfocus-0.5.16.gem
24
24
  ```
25
25
 
26
26
  # Usage
@@ -65,18 +65,71 @@ class Rubyfocus::LocalFetcher < Rubyfocus::Fetcher
65
65
  #---------------------------------------
66
66
  # Location file setters and getters
67
67
 
68
- # Default (non app-store) file location
68
+ # Where do we expect OS X to store containers?
69
+ def container_location
70
+ @container_location ||= File.join(ENV["HOME"], "Library/Containers/")
71
+ end
72
+
73
+ attr_writer :container_location
74
+
75
+ # Default (non app-store) file location. Will look for "com.omnigroup.Omnifocus###"
76
+ # (where ### is a number) and pick the most recent.
77
+ #
78
+ # If it cannot find any directories matching this pattern, will return ""
79
+ # (empty string). Note that File.exists?("") returns `false`.
69
80
  def default_location
70
- @default_location ||= File.join(ENV["HOME"],
71
- "/Library/Containers/com.omnigroup.OmniFocus2",
72
- "Data/Library/Application Support/OmniFocus/OmniFocus.ofocus")
81
+ if @default_location.nil?
82
+ omnifocus_directories = Dir[File.join(container_location, "com.omnigroup.OmniFocus*")]
83
+
84
+ default_omnifocus_directories = omnifocus_directories.select{ |path|
85
+ File.basename(path) =~ /com\.omnigroup\.OmniFocus\d+$/
86
+ }
87
+
88
+ if (default_omnifocus_directories.size == 0)
89
+ # If none match the regexp, we return ""
90
+ @default_location = ""
91
+ else
92
+ # Otherwise, match highest
93
+ last_omnifocus_directory = default_omnifocus_directories.sort().last()
94
+
95
+ @default_location = File.join(
96
+ last_omnifocus_directory,
97
+ "Data/Library/Application Support/OmniFocus/OmniFocus.ofocus"
98
+ )
99
+ end
100
+ end
101
+
102
+ return @default_location
73
103
  end
74
104
 
75
- # Default app-store file location
105
+ # App store file location. Will look for "com.omnigroup.Omnifocus###.MacAppStore"
106
+ # (where ### is a number) and pick the most recent.
107
+ #
108
+ # If it cannot find any directories matching this pattern, will return ""
109
+ # (empty string). Note that File.exists?("") returns `false`.
76
110
  def appstore_location
77
- @appstore_location ||= File.join(ENV["HOME"],
78
- "/Library/Containers/com.omnigroup.OmniFocus2.MacAppStore",
79
- "Data/Library/Application Support/OmniFocus/OmniFocus.ofocus")
111
+ if @appstore_location.nil?
112
+ omnifocus_directories = Dir[File.join(container_location, "com.omnigroup.OmniFocus*")]
113
+
114
+ appstore_omnifocus_directories = omnifocus_directories.select{ |path|
115
+ File.basename(path) =~ /com\.omnigroup\.OmniFocus\d+\.MacAppStore$/
116
+ }
117
+
118
+ if (appstore_omnifocus_directories.size == 0)
119
+ # If none match the regexp, we return ""
120
+ @appstore_location = ""
121
+ else
122
+ # Otherwise, match highest
123
+ last_omnifocus_directory = appstore_omnifocus_directories.sort().last()
124
+
125
+ @appstore_location = File.join(
126
+ last_omnifocus_directory,
127
+ "Data/Library/Application Support/OmniFocus/OmniFocus.ofocus"
128
+ )
129
+ end
130
+ end
131
+
132
+ return @appstore_location
80
133
  end
81
134
 
82
135
  # Determine location based on assigned and default values. Returns +nil+
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.extra_rdoc_files = ["README.md"]
18
18
 
19
19
  # Add runtime dependencies here
20
- s.add_runtime_dependency "nokogiri", "~> 1.6", ">= 1.6.6"
21
- s.add_runtime_dependency "rubyzip", "~> 1.2", ">= 1.2.1"
20
+ s.add_runtime_dependency "nokogiri", "~> 1.8", ">= 1.8.5"
21
+ s.add_runtime_dependency "rubyzip", "~> 1.2", ">= 1.2.2"
22
22
  s.add_runtime_dependency "httparty", "~> 0.13", ">= 0.13.7"
23
23
  end
@@ -1 +1 @@
1
- 0.5.15
1
+ 0.5.16
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.15
4
+ version: 0.5.16
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: 2018-01-06 00:00:00.000000000 Z
11
+ date: 2019-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '1.8'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.6.6
22
+ version: 1.8.5
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '1.6'
29
+ version: '1.8'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.6.6
32
+ version: 1.8.5
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubyzip
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '1.2'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.2.1
42
+ version: 1.2.2
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '1.2'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.2.1
52
+ version: 1.2.2
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: httparty
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.5.1
129
+ rubygems_version: 2.7.3
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Pure ruby bridge to OmniFocus.