omnifocus 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +12 -0
- data/Rakefile +3 -2
- data/bin/omnifocus_new +7 -2
- data/lib/omnifocus.rb +25 -37
- metadata +15 -16
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 1.5.0 / 2011-08-11
|
2
|
+
|
3
|
+
* 2 minor enhancements:
|
4
|
+
|
5
|
+
* Rewrote all the task accesses to be a single fetch.
|
6
|
+
* Updated mechanize and rb-appscript deps.
|
7
|
+
|
8
|
+
* 2 bug fixes:
|
9
|
+
|
10
|
+
* Fixed a bug with rb-appscript caused by ruby 1.9. :( (turadg)
|
11
|
+
* Project names with '.' in them were being ignored by my regexp
|
12
|
+
|
1
13
|
=== 1.4.0 / 2011-07-20
|
2
14
|
|
3
15
|
* 1 minor enhancement:
|
data/Rakefile
CHANGED
@@ -4,13 +4,14 @@ require 'rubygems'
|
|
4
4
|
require 'hoe'
|
5
5
|
|
6
6
|
Hoe.plugin :seattlerb
|
7
|
+
Hoe.plugin :isolate
|
7
8
|
|
8
9
|
Hoe.spec "omnifocus" do
|
9
10
|
developer "aja", "kushali@rubyforge.org"
|
10
11
|
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
11
12
|
|
12
|
-
dependency "rb-appscript", "~> 0.
|
13
|
-
dependency "mechanize", "~>
|
13
|
+
dependency "rb-appscript", "~> 0.6.1"
|
14
|
+
dependency "mechanize", "~> 2.0.0"
|
14
15
|
|
15
16
|
self.rubyforge_name = "seattlerb"
|
16
17
|
|
data/bin/omnifocus_new
CHANGED
@@ -7,12 +7,17 @@ require 'appscript'
|
|
7
7
|
project_name = ARGV.shift
|
8
8
|
title = ($stdin.tty? ? ARGV.join(" ") : $stdin.read).strip
|
9
9
|
|
10
|
-
abort "need project and title" unless project_name && ! title.empty?
|
11
|
-
|
12
10
|
include Appscript
|
13
11
|
|
14
12
|
omnifocus = app('OmniFocus').documents[1]
|
15
13
|
|
14
|
+
unless project_name && ! title.empty? then
|
15
|
+
cmd = File.basename $0
|
16
|
+
projects = omnifocus.sections.projects.name.get.flatten.sort
|
17
|
+
|
18
|
+
abort "usage: #{cmd} project title\n\nprojects = #{projects.join ", "}"
|
19
|
+
end
|
20
|
+
|
16
21
|
projects = omnifocus.sections.projects[its.name.eq(project_name)]
|
17
22
|
project = projects.get.flatten.grep(Appscript::Reference).first
|
18
23
|
project.make :new => :task, :with_properties => {:name => title}
|
data/lib/omnifocus.rb
CHANGED
@@ -1,7 +1,19 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'mechanize'
|
3
2
|
require 'appscript'
|
4
3
|
|
4
|
+
class Appscript::Reference # :nodoc:
|
5
|
+
# HACK: There is apparently a bug in ruby 1.9 where if you have
|
6
|
+
# method_missing defined and do some action that calls to_ary, then
|
7
|
+
# to_ary will be called on your instance REGARDLESS of whether
|
8
|
+
# respond_to_(:to_ary) returns true or not.
|
9
|
+
#
|
10
|
+
# http://tenderlovemaking.com/2011/06/28/til-its-ok-to-return-nil-from-to_ary/
|
11
|
+
|
12
|
+
def to_ary # :nodoc:
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
end if RUBY_VERSION >= "1.9"
|
16
|
+
|
5
17
|
##
|
6
18
|
# Synchronizes bug tracking systems to omnifocus.
|
7
19
|
#
|
@@ -12,7 +24,7 @@ require 'appscript'
|
|
12
24
|
# bts_id: a string uniquely identifying a task: SYSTEM(-projectname)?#id
|
13
25
|
|
14
26
|
class OmniFocus
|
15
|
-
VERSION = '1.
|
27
|
+
VERSION = '1.5.0'
|
16
28
|
|
17
29
|
##
|
18
30
|
# bug_db = {
|
@@ -66,38 +78,13 @@ class OmniFocus
|
|
66
78
|
|
67
79
|
def omnifocus
|
68
80
|
unless defined? @omnifocus then
|
69
|
-
@omnifocus = Appscript.app('OmniFocus').
|
81
|
+
@omnifocus = Appscript.app('OmniFocus').default_document
|
70
82
|
end
|
71
83
|
@omnifocus
|
72
84
|
end
|
73
85
|
|
74
|
-
def walk_queue_deep queue, msg
|
75
|
-
result = []
|
76
|
-
|
77
|
-
until queue.empty? do
|
78
|
-
item = queue.shift
|
79
|
-
result << item
|
80
|
-
subitems = item.send(msg).get
|
81
|
-
queue.push(*subitems)
|
82
|
-
end
|
83
|
-
|
84
|
-
result
|
85
|
-
end
|
86
|
-
|
87
|
-
def all_folders
|
88
|
-
queue = omnifocus.folders.get
|
89
|
-
|
90
|
-
walk_queue_deep queue, :folders
|
91
|
-
end
|
92
|
-
|
93
|
-
def all_projects
|
94
|
-
all_folders.map { |folder| folder.projects }
|
95
|
-
end
|
96
|
-
|
97
86
|
def all_tasks
|
98
|
-
|
99
|
-
|
100
|
-
walk_queue_deep queue, :tasks
|
87
|
+
omnifocus.flattened_projects[its.status.eq(:active)].tasks.get.flatten
|
101
88
|
end
|
102
89
|
|
103
90
|
##
|
@@ -130,19 +117,19 @@ class OmniFocus
|
|
130
117
|
|
131
118
|
def prepopulate_existing_tasks
|
132
119
|
prefixen = self.class.plugins.map { |klass| klass::PREFIX rescue nil }
|
120
|
+
of_tasks = nil
|
133
121
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
task.name.get =~ /^(#{Regexp.union prefixen}(?:-[\w-]+)?\#\d+)/
|
122
|
+
if prefixen.all? then
|
123
|
+
of_tasks = all_tasks.find_all { |task|
|
124
|
+
task.name.get =~ /^(#{Regexp.union prefixen}(?:-[\w.-]+)?\#\d+)/
|
138
125
|
}
|
139
|
-
|
140
|
-
|
126
|
+
else
|
127
|
+
warn "WA"+"RN: Older plugins installed. Falling back to The Old Ways"
|
141
128
|
|
142
|
-
|
129
|
+
of_tasks = all_tasks.find_all { |task|
|
143
130
|
task.name.get =~ /^([A-Z]+(?:-[\w-]+)?\#\d+)/
|
144
131
|
}
|
145
|
-
|
132
|
+
end
|
146
133
|
|
147
134
|
of_tasks.each do |of_task|
|
148
135
|
ticket_id = of_task.name.get[/^([A-Z]+(?:-[\w-]+)?\#\d+)/, 1]
|
@@ -156,6 +143,7 @@ class OmniFocus
|
|
156
143
|
# Returns the mechanize agent
|
157
144
|
|
158
145
|
def mechanize
|
146
|
+
require 'mechanize'
|
159
147
|
@mechanize ||= Mechanize.new
|
160
148
|
end
|
161
149
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnifocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- aja
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
FBHgymkyj/AOSqKRIpXPhjC6
|
38
38
|
-----END CERTIFICATE-----
|
39
39
|
|
40
|
-
date: 2011-
|
40
|
+
date: 2011-08-12 00:00:00 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rb-appscript
|
@@ -47,12 +47,12 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - ~>
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
hash:
|
50
|
+
hash: 5
|
51
51
|
segments:
|
52
52
|
- 0
|
53
|
-
-
|
54
|
-
-
|
55
|
-
version: 0.
|
53
|
+
- 6
|
54
|
+
- 1
|
55
|
+
version: 0.6.1
|
56
56
|
type: :runtime
|
57
57
|
version_requirements: *id001
|
58
58
|
- !ruby/object:Gem::Dependency
|
@@ -63,12 +63,12 @@ dependencies:
|
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
hash:
|
66
|
+
hash: 15
|
67
67
|
segments:
|
68
|
-
-
|
68
|
+
- 2
|
69
69
|
- 0
|
70
70
|
- 0
|
71
|
-
version:
|
71
|
+
version: 2.0.0
|
72
72
|
type: :runtime
|
73
73
|
version_requirements: *id002
|
74
74
|
- !ruby/object:Gem::Dependency
|
@@ -77,14 +77,13 @@ dependencies:
|
|
77
77
|
requirement: &id003 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
hash:
|
82
|
+
hash: 5
|
83
83
|
segments:
|
84
84
|
- 2
|
85
85
|
- 3
|
86
|
-
|
87
|
-
version: 2.3.1
|
86
|
+
version: "2.3"
|
88
87
|
type: :development
|
89
88
|
version_requirements: *id003
|
90
89
|
- !ruby/object:Gem::Dependency
|
@@ -156,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
155
|
requirements: []
|
157
156
|
|
158
157
|
rubyforge_project: seattlerb
|
159
|
-
rubygems_version: 1.8.
|
158
|
+
rubygems_version: 1.8.5
|
160
159
|
signing_key:
|
161
160
|
specification_version: 3
|
162
161
|
summary: Synchronizes bug tracking systems to omnifocus.
|
metadata.gz.sig
CHANGED
Binary file
|