omnifocus-redmine 1.2.0 → 1.2.1
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.
- data/History.txt +3 -0
- data/README.txt +10 -3
- data/Rakefile +1 -1
- data/lib/omnifocus/redmine.rb +19 -11
- metadata +21 -14
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
=
|
1
|
+
= omnifocus-redmine
|
2
2
|
|
3
|
-
|
3
|
+
home :: https://github.com/seattlerb/omnifocus-redmine
|
4
|
+
rdoc :: http://seattlerb.rubyforge.org/omnifocus-redmine
|
4
5
|
|
5
6
|
== DESCRIPTION:
|
6
7
|
|
@@ -28,12 +29,18 @@ the configuration data.
|
|
28
29
|
to a query of the form:
|
29
30
|
"http://redmine_url/issues.xml?assigned_to_id=user_id".
|
30
31
|
|
32
|
+
* just_project is optional. It is used to configure how to name the
|
33
|
+
omnifocus projects used for issues. If just_project is true each redmine
|
34
|
+
project will correspond to an omnifocus project. If it is false the
|
35
|
+
omnifocus projects will be name with redmine_project-redmine_component.
|
36
|
+
|
31
37
|
Example:
|
32
38
|
:user_id: 20
|
33
39
|
:redmine_url: http://redmine/
|
34
40
|
:username: me
|
35
41
|
:password: 1234
|
36
42
|
:queries: ["status_id=1", "status_id=2"]
|
43
|
+
:just_project: false
|
37
44
|
|
38
45
|
== FEATURES/PROBLEMS:
|
39
46
|
|
@@ -51,7 +58,7 @@ Example:
|
|
51
58
|
|
52
59
|
(The MIT License)
|
53
60
|
|
54
|
-
Copyright (c)
|
61
|
+
Copyright (c) Aja Hammerly, seattle.rb
|
55
62
|
|
56
63
|
Permission is hereby granted, free of charge, to any person obtaining
|
57
64
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
data/lib/omnifocus/redmine.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module OmniFocus::Redmine
|
2
|
-
VERSION = '1.2.
|
2
|
+
VERSION = '1.2.1'
|
3
3
|
|
4
4
|
def load_or_create_redmine_config
|
5
5
|
path = File.expand_path "~/.omnifocus-redmine.yml"
|
@@ -10,7 +10,8 @@ module OmniFocus::Redmine
|
|
10
10
|
:user_id => "20",
|
11
11
|
:redmine_url => "http://redmine",
|
12
12
|
:username => "UserName",
|
13
|
-
:password => "Password"
|
13
|
+
:password => "Password",
|
14
|
+
:just_project => false
|
14
15
|
}
|
15
16
|
|
16
17
|
File.open(path, "w") { |f|
|
@@ -24,11 +25,12 @@ module OmniFocus::Redmine
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def populate_redmine_tasks
|
27
|
-
config
|
28
|
-
redmine_url
|
29
|
-
user_id
|
30
|
-
username
|
31
|
-
password
|
28
|
+
config = load_or_create_redmine_config
|
29
|
+
redmine_url = config[:redmine_url]
|
30
|
+
user_id = config[:user_id]
|
31
|
+
username = config[:username]
|
32
|
+
password = config[:password]
|
33
|
+
just_project = config[:just_project]
|
32
34
|
|
33
35
|
# Authenticate if the user name and password are defined
|
34
36
|
if username and password then
|
@@ -38,16 +40,18 @@ module OmniFocus::Redmine
|
|
38
40
|
default_query = "#{redmine_url}/issues.xml?assigned_to_id=#{user_id}"
|
39
41
|
|
40
42
|
unless config[:queries]
|
41
|
-
process_query_results(default_query, redmine_url)
|
43
|
+
process_query_results(default_query, redmine_url, just_project)
|
42
44
|
else
|
43
45
|
queries = config[:queries]
|
44
46
|
queries.each do |q|
|
45
|
-
process_query_results("#{default_query}&#{q}",
|
47
|
+
process_query_results("#{default_query}&#{q}",
|
48
|
+
redmine_url,
|
49
|
+
just_project)
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
50
|
-
def process_query_results(query, redmine_url)
|
54
|
+
def process_query_results(query, redmine_url, just_project)
|
51
55
|
begin
|
52
56
|
mechanize.get(query)
|
53
57
|
rescue Mechanize::ResponseCodeError => e
|
@@ -71,7 +75,11 @@ module OmniFocus::Redmine
|
|
71
75
|
product = i.xpath('./project/@name').text.downcase
|
72
76
|
title = i.xpath('./subject').text
|
73
77
|
component = i.xpath('./category/@name').text
|
74
|
-
|
78
|
+
if just_project then
|
79
|
+
project = "#{product}"
|
80
|
+
else
|
81
|
+
project = "#{product}-#{component}"
|
82
|
+
end
|
75
83
|
url = "#{redmine_url}/issues/#{bug_number}"
|
76
84
|
|
77
85
|
bug_db[project][ticket_id] = ["#{ticket_id}: #{title}", url]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnifocus-redmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- aja
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-16 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,12 +24,14 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 25
|
30
30
|
segments:
|
31
|
-
-
|
32
|
-
|
31
|
+
- 1
|
32
|
+
- 3
|
33
|
+
- 1
|
34
|
+
version: 1.3.1
|
33
35
|
type: :runtime
|
34
36
|
version_requirements: *id001
|
35
37
|
- !ruby/object:Gem::Dependency
|
@@ -54,14 +56,13 @@ dependencies:
|
|
54
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
57
|
none: false
|
56
58
|
requirements:
|
57
|
-
- -
|
59
|
+
- - ~>
|
58
60
|
- !ruby/object:Gem::Version
|
59
|
-
hash:
|
61
|
+
hash: 23
|
60
62
|
segments:
|
61
63
|
- 2
|
62
|
-
-
|
63
|
-
|
64
|
-
version: 2.8.0
|
64
|
+
- 10
|
65
|
+
version: "2.10"
|
65
66
|
type: :development
|
66
67
|
version_requirements: *id003
|
67
68
|
description: |-
|
@@ -89,12 +90,18 @@ description: |-
|
|
89
90
|
to a query of the form:
|
90
91
|
"http://redmine_url/issues.xml?assigned_to_id=user_id".
|
91
92
|
|
93
|
+
* just_project is optional. It is used to configure how to name the
|
94
|
+
omnifocus projects used for issues. If just_project is true each redmine
|
95
|
+
project will correspond to an omnifocus project. If it is false the
|
96
|
+
omnifocus projects will be name with redmine_project-redmine_component.
|
97
|
+
|
92
98
|
Example:
|
93
99
|
:user_id: 20
|
94
100
|
:redmine_url: http://redmine/
|
95
101
|
:username: me
|
96
102
|
:password: 1234
|
97
103
|
:queries: ["status_id=1", "status_id=2"]
|
104
|
+
:just_project: false
|
98
105
|
email:
|
99
106
|
- kushali@rubyforge.org
|
100
107
|
executables: []
|
@@ -112,7 +119,7 @@ files:
|
|
112
119
|
- Rakefile
|
113
120
|
- lib/omnifocus/redmine.rb
|
114
121
|
has_rdoc: true
|
115
|
-
homepage:
|
122
|
+
homepage: https://github.com/seattlerb/omnifocus-redmine
|
116
123
|
licenses: []
|
117
124
|
|
118
125
|
post_install_message:
|