omnifocus-bugzilla 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2009-08-04
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
@@ -0,0 +1,6 @@
1
+ .autotest
2
+ History.txt
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ lib/omnifocus/bugzilla.rb
@@ -0,0 +1,47 @@
1
+ = omnifocus_bugzilla
2
+
3
+ * http://rubyforge.org/projects/seattlerb
4
+
5
+ == DESCRIPTION:
6
+
7
+ Plugin for omnifocus gem to provide bugzilla BTS synchronization.
8
+
9
+ The first time this runs it creates a yaml file in your home directory
10
+ for the bugzilla url and username.
11
+
12
+ == FEATURES/PROBLEMS:
13
+
14
+ * Provides bugzilla BTS synchronization.
15
+
16
+ == REQUIREMENTS:
17
+
18
+ * omnifocus
19
+
20
+ == INSTALL:
21
+
22
+ * sudo gem install omnifocus-bugzilla
23
+
24
+ == LICENSE:
25
+
26
+ (The MIT License)
27
+
28
+ Copyright (c) 2009 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.
@@ -0,0 +1,15 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.plugin :seattlerb
7
+
8
+ Hoe.spec 'omnifocus-bugzilla' do
9
+ developer('aja', 'kushali@rubyforge.org')
10
+
11
+ self.rubyforge_name = 'seattlerb'
12
+ extra_deps << 'omnifocus'
13
+ end
14
+
15
+ # vim: syntax=ruby
@@ -0,0 +1,52 @@
1
+ module OmniFocus::Bugzilla
2
+ VERSION = '1.0.0'
3
+
4
+ def load_or_create_config
5
+ path = File.expand_path "~/.omnifocus-bugzilla.yml"
6
+ config = YAML.load(File.read(path)) rescue nil
7
+
8
+ unless config then
9
+ config = {
10
+ :username => "USERNAME",
11
+ :bugzilla_url => "http://example.com/cgi-bin/buglist.cgi"
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_bugzilla_tasks
25
+ config = load_or_create_config
26
+ bugzilla_url = config[:bugzilla_url]
27
+ username = config[:username]
28
+
29
+ results = mechanize.get "#{bugzilla_url}?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=#{username}"
30
+
31
+ bugs = results.root.xpath "//table[@class='bz_buglist']/tr[td]"
32
+ bugs.each do |bug|
33
+ bug_number = $1 if bug.inner_html =~ /show_bug.cgi\?id=(\d*)/
34
+ ticket_id = "BZ##{bug_number}"
35
+
36
+ if existing[ticket_id]
37
+ project = existing[ticket_id]
38
+ bug_db[project][ticket_id] = true
39
+ else
40
+ url = "http://bugs/show_bug.cgi?id=#{bug_number}"
41
+ warn "url #{url}"
42
+ details = Nokogiri.parse(mechanize.get("#{url}&ctype=xml").body)
43
+ product = details.root.xpath('//product/text()').text.downcase
44
+ title = details.root.xpath('//short_desc/text()').text
45
+ component = details.root.xpath('//component/text()').text.downcase
46
+ project = "#{product}-#{component}"
47
+
48
+ bug_db[project][ticket_id] = ["#{ticket_id}: #{title}", url]
49
+ end
50
+ end
51
+ end
52
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omnifocus-bugzilla
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - aja
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-04 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: omnifocus
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.2
34
+ version:
35
+ description: |-
36
+ Plugin for omnifocus gem to provide bugzilla BTS synchronization.
37
+
38
+ The first time this runs it creates a yaml file in your home directory
39
+ for the bugzilla url and username.
40
+ email:
41
+ - kushali@rubyforge.org
42
+ executables: []
43
+
44
+ extensions: []
45
+
46
+ extra_rdoc_files:
47
+ - History.txt
48
+ - Manifest.txt
49
+ - README.txt
50
+ files:
51
+ - .autotest
52
+ - History.txt
53
+ - Manifest.txt
54
+ - README.txt
55
+ - Rakefile
56
+ - lib/omnifocus/bugzilla.rb
57
+ has_rdoc: true
58
+ homepage: http://rubyforge.org/projects/seattlerb
59
+ licenses: []
60
+
61
+ post_install_message:
62
+ rdoc_options:
63
+ - --main
64
+ - README.txt
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project: seattlerb
82
+ rubygems_version: 1.3.5
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Plugin for omnifocus gem to provide bugzilla BTS synchronization
86
+ test_files: []
87
+