omnifocus-redmine 1.0.0

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 ADDED
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2010-11-30
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
data/Manifest.txt ADDED
@@ -0,0 +1,5 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ lib/omnifocus/redmine.rb
data/README.txt ADDED
@@ -0,0 +1,47 @@
1
+ = omnifocus_redmine
2
+
3
+ * http://rubyforg.org/projects/seattlerb
4
+
5
+ == DESCRIPTION:
6
+
7
+ Plugin for the omnifocus gem to provide synchronization with Redmine Issues.
8
+
9
+ The first time this runs it creates a yaml file in your home directory for
10
+ the redmine url and username.
11
+
12
+ == FEATURES/PROBLEMS:
13
+
14
+ * Provides redmine synchronization
15
+
16
+ == REQUIREMENTS:
17
+
18
+ * omnifocus
19
+
20
+ == INSTALL:
21
+
22
+ * sudo gem install omnifocus-redmine
23
+
24
+ == LICENSE:
25
+
26
+ (The MIT License)
27
+
28
+ Copyright (c) 2010 Aja Hammerly
29
+
30
+ Permission is hereby granted, free of charge, to any person obtaining
31
+ a copy of this software and associated documentation files (the
32
+ 'Software'), to deal in the Software without restriction, including
33
+ without limitation the rights to use, copy, modify, merge, publish,
34
+ distribute, sublicense, and/or sell copies of the Software, and to
35
+ permit persons to whom the Software is furnished to do so, subject to
36
+ the following conditions:
37
+
38
+ The above copyright notice and this permission notice shall be
39
+ included in all copies or substantial portions of the Software.
40
+
41
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
42
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
44
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
45
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
46
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
47
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.plugin :seattlerb
7
+
8
+ Hoe.spec 'omnifocus-redmine' do
9
+ developer('aja', 'kushali@rubyforge.org')
10
+
11
+ extra_deps << 'omnifocus'
12
+ self.rubyforge_name = 'seattlerb'
13
+ end
14
+
15
+ # vim: syntax=ruby
@@ -0,0 +1,54 @@
1
+ module OmniFocus::Redmine
2
+ VERSION = '1.0.0'
3
+
4
+ def load_or_create_redmine_config
5
+ path = File.expand_path "~/.omnifocus-redmine.yml"
6
+ config = YAML.load(File.read(path)) rescue nil
7
+
8
+ unless config then
9
+ config = {
10
+ :user => "Admin User",
11
+ :redmine_url => "http://redmine",
12
+ }
13
+
14
+ File.open(path, "w") { |f|
15
+ YAML.dump(config, f)
16
+ }
17
+
18
+ abort "Created default config in #{path}. Go fill it out."
19
+ end
20
+
21
+ config
22
+ end
23
+
24
+ def populate_redmine_tasks
25
+ config = load_or_create_redmine_config
26
+ redmine_url = config[:redmine_url]
27
+ user = config[:user]
28
+
29
+ query = "#{redmine_url}/issues.xml?assigned_to='#{user}'"
30
+
31
+ mechanize.get(query)
32
+ details = Nokogiri.parse(mechanize.current_page.body)
33
+
34
+ issues = details.root.xpath('//issue')
35
+
36
+ issues.each do |i|
37
+ bug_number = i.xpath('./id').text
38
+ ticket_id = "RM##{bug_number}"
39
+
40
+ if existing[ticket_id]
41
+ project = existing[ticket_id]
42
+ bug_db[project][ticket_id] = true
43
+ else
44
+ product = i.xpath('./project/@name').text.downcase
45
+ title = i.xpath('./subject').text
46
+ component = i.xpath('./category/@name').text
47
+ project = "#{product}-#{component}"
48
+ url = "http://#{redmine_url}/issues/#{bug_number}"
49
+
50
+ bug_db[project][ticket_id] = ["#{ticket_id}: #{title}", url]
51
+ end
52
+ end
53
+ end
54
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omnifocus-redmine
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - aja
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-12-07 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: omnifocus
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: minitest
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 15
44
+ segments:
45
+ - 1
46
+ - 7
47
+ - 2
48
+ version: 1.7.2
49
+ type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: hoe
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 19
60
+ segments:
61
+ - 2
62
+ - 7
63
+ - 0
64
+ version: 2.7.0
65
+ type: :development
66
+ version_requirements: *id003
67
+ description: |-
68
+ Plugin for the omnifocus gem to provide synchronization with Redmine Issues.
69
+
70
+ The first time this runs it creates a yaml file in your home directory for
71
+ the redmine url and username.
72
+ email:
73
+ - kushali@rubyforge.org
74
+ executables: []
75
+
76
+ extensions: []
77
+
78
+ extra_rdoc_files:
79
+ - History.txt
80
+ - Manifest.txt
81
+ - README.txt
82
+ files:
83
+ - History.txt
84
+ - Manifest.txt
85
+ - README.txt
86
+ - Rakefile
87
+ - lib/omnifocus/redmine.rb
88
+ has_rdoc: true
89
+ homepage: http://rubyforg.org/projects/seattlerb
90
+ licenses: []
91
+
92
+ post_install_message:
93
+ rdoc_options:
94
+ - --main
95
+ - README.txt
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ hash: 3
113
+ segments:
114
+ - 0
115
+ version: "0"
116
+ requirements: []
117
+
118
+ rubyforge_project: seattlerb
119
+ rubygems_version: 1.3.7
120
+ signing_key:
121
+ specification_version: 3
122
+ summary: Plugin for the omnifocus gem to provide synchronization with Redmine Issues
123
+ test_files: []
124
+