buggy 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/LICENSE +7 -0
  2. data/README.rdoc +12 -0
  3. data/Rakefile +109 -0
  4. data/lib/buggy.rb +132 -0
  5. metadata +77 -0
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2006 Concentration Studios
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ = Buggy Bug Tracker
2
+
3
+ Buggy is a ruby based bug tracking application built around a simple XML
4
+ and RESTful API. It supports HTTP based reads, creation, closing, and
5
+ annotation through the GET, POST, DELETE, and PUT verbs. The system
6
+ uses a simple XML format for displaying data and the standard API has a
7
+ very easy way to import and export bugs. It also allows for "social bug
8
+ sharing". The system is also easy to implement as a to-do list. Buggy
9
+ is built to be accessed by API clients and not a web interface, although
10
+ an AJAX based interface is planned for a future version. The first
11
+ official clients will be a MatzBot plugin and a set of simple bash
12
+ scripts for administration, until the full commandline client can be done.
@@ -0,0 +1,109 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/rdoctask'
4
+ require 'rake/testtask'
5
+ require 'rake/gempackagetask'
6
+ require 'rake/contrib/rubyforgepublisher'
7
+ require 'rake/clean'
8
+ require 'rote'
9
+ require 'rote/filters'
10
+ require 'rote/format/html'
11
+
12
+ include Rote
13
+
14
+
15
+ #desc "Generate documentation for Buggy"
16
+ #Rake::RDocTask.new("rdoc") { |rdoc|
17
+ # rdoc.rdoc_dir = 'doc'
18
+ # rdoc.title = "Buggy Documentation"
19
+ # rdoc.rdoc_files.include('README.rdoc')
20
+ #}
21
+
22
+ # Buiild the GEM -------------------------------------------------------
23
+
24
+ PKG_NAME = 'buggy'
25
+ PKG_VERSION = '0.1'
26
+ RUBY_FORGE_PROJECT = "buggy"
27
+ RUBY_FORGE_USER = "cdcarter"
28
+
29
+ PKG_FILES = FileList[
30
+ '[a-zA-Z]*',
31
+ 'lib/**/*'
32
+ ]
33
+
34
+ spec = Gem::Specification.new do |s|
35
+ s.name = 'buggy'
36
+ s.version = PKG_VERSION
37
+ s.summary = "Buggy!"
38
+ s.description = <<-EOF
39
+ Buggy! A simple bugtraker
40
+ EOF
41
+
42
+ s.add_dependency('hpricot')
43
+ s.add_dependency('camping')
44
+ s.add_dependency('activerecord')
45
+
46
+ s.rdoc_options << '--exclude' << '.'
47
+ s.has_rdoc = false
48
+
49
+ s.files = PKG_FILES.to_a.delete_if {|f| f.include?('.svn')}
50
+ s.require_path = 'lib'
51
+
52
+ # s.bindir = "bin" # Use these for applications.
53
+ # s.executables = ["buggy"]
54
+ # s.default_executable = "buggy"
55
+
56
+ s.author = "Christian Carter"
57
+ s.email = "cdcarter@concentrationstudios.com"
58
+ s.homepage = "http://buggy.rubyforge.org"
59
+ s.rubyforge_project = "#{RUBY_FORGE_PROJECT}"
60
+ end
61
+
62
+ Rake::GemPackageTask.new(spec) do |pkg|
63
+ end
64
+
65
+ # Build the Website -------------------------------------------------
66
+
67
+ Rote::DocTask.new(:doc) do |site|
68
+ site.output_dir = 'docs/html'
69
+ site.layout_dir = 'docs/doc/layouts'
70
+
71
+ site.pages.dir = 'docs/doc/pages'
72
+ site.pages.include('**/*')
73
+
74
+ site.res.dir = 'docs/doc/res'
75
+ site.res.include('**/*')
76
+
77
+ site.ext_mapping(/thtml|textile/, 'html') do |page|
78
+ page.extend Format::HTML
79
+ page.page_filter Filters::RedCloth.new
80
+ end
81
+
82
+ site.ext_mapping(/mhtml|markdown/, 'html') do |page|
83
+ page.extend Format::HTML
84
+ page.page_filter Filters::BlueCloth.new
85
+ end
86
+
87
+ site.ext_mapping(/rdhtml|rdoc/, 'html') do |page|
88
+ page.extend Format::HTML
89
+ page.page_filter Filters::RDoc.new
90
+ end
91
+
92
+ site.ext_mapping(/html/, 'html') do |page|
93
+ page.extend Format::HTML
94
+ end
95
+ end
96
+
97
+ # Publishing -------------------------------------------------------
98
+ desc "Publish the release files to RubyForge."
99
+ task :release => [ :gem ] do
100
+ `rubyforge login`
101
+ release_command = "rubyforge add_release 2177 2590 'Buggy #{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
102
+ puts release_command
103
+ system(release_command)
104
+ end
105
+
106
+ desc "Publish the website"
107
+ task :publish => [:doc] do
108
+ Rake::SshDirPublisher.new("#{RUBY_FORGE_USER}@rubyforge.org", "/var/www/gforge-projects/buggy/", "docs/html").upload
109
+ end
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/ruby
2
+ $:.unshift File.dirname(__FILE__) + "/../../lib"
3
+ %w(rubygems camping camping/db hpricot).each { |lib| require lib }
4
+
5
+ Camping.goes :Buggy
6
+
7
+ module Buggy::Models
8
+
9
+ class Bug < Base
10
+ def close
11
+ self.closed = 1
12
+ self.save
13
+ end
14
+
15
+ def status
16
+ "Closed" if self.closed == 1
17
+ "Open" if self.closed == 0
18
+ end
19
+ end
20
+
21
+ class CreateBuggy < V 1.0
22
+ def self.up
23
+ create_table :buggy_bugs, :force => true do |t|
24
+ t.column :priority, :integer
25
+ t.column :project, :string
26
+ t.column :body, :text
27
+
28
+ # 1 is true, 0 is false
29
+ t.column :closed, :integer
30
+ end
31
+
32
+ end
33
+ def self.down
34
+ drop_table :buggy_bugs
35
+ end
36
+ end
37
+
38
+ end
39
+
40
+ module Buggy::Controllers
41
+ class Show < R '/(\w+)'
42
+ def get id
43
+ @headers['Content-Type'] = 'text/xml charset=utf8'
44
+ @bug = Bug.find(id)
45
+ render :apishow
46
+ end
47
+
48
+ def delete id
49
+ @bug = Bug.find(id)
50
+ @bug.close
51
+ render :apideleted
52
+ end
53
+ end
54
+
55
+ class Resource < R '/'
56
+ FIELDS = %w[priority project body]
57
+ def get
58
+ @headers['Content-Type'] = 'text/xml charset=utf8'
59
+ @bugs = Bug.find(:all, :limit => 10, :conditions => ["closed=?",0])
60
+ render :apilist
61
+ end
62
+
63
+ def post
64
+ @status = 201
65
+ @bugs = []
66
+ doc = Hpricot.parse(input.keys.first)
67
+ (doc/:bug).each do |xml_bug|
68
+ bug = Bug.new
69
+ for field in FIELDS
70
+ bug[field] = (xml_bug/field).first.innerHTML
71
+ end
72
+ bug.closed = 0
73
+ bug.save
74
+ @bugs << bug
75
+ end
76
+ render :apilist
77
+ end
78
+ end
79
+ end
80
+
81
+ module Buggy::Views
82
+ def apilist
83
+ xml = Builder::XmlMarkup.new(:target => self)
84
+ xml.instruct!
85
+ xml.buglist do
86
+ for bug in @bugs
87
+ xml.bug do
88
+ xml.id bug.id
89
+ xml.project bug.project
90
+ xml.priority bug.priority
91
+ xml.body bug.body
92
+ end
93
+ end
94
+ end
95
+ end
96
+
97
+ def apideleted
98
+ xml = Builder::XmlMarkup.new(:target => self)
99
+ xml.instruct!
100
+
101
+ xml.buglist do
102
+ xml.bug do
103
+ xml.id @bug.id
104
+ xml.status @bug.status
105
+ xml.project @bug.project
106
+ xml.body @bug.body
107
+ end
108
+ end
109
+ end
110
+
111
+ def apishow
112
+ @headers['Content-Type'] = 'text/xml'
113
+
114
+ xml = Builder::XmlMarkup.new(:target => self)
115
+ xml.instruct!
116
+
117
+ xml.buglist do
118
+ xml.bug do
119
+ xml.id @bug.id
120
+ xml.project @bug.project
121
+ xml.priority @bug.priority
122
+ xml.body @bug.body
123
+ end
124
+ end
125
+ end
126
+ end
127
+
128
+ def Buggy.create
129
+ Buggy::Models.create_schema :assume => (Buggy::Models::Bug.table_exists? ? 1.0 : 0.0)
130
+ end
131
+
132
+
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: buggy
5
+ version: !ruby/object:Gem::Version
6
+ version: "0.1"
7
+ date: 2006-09-10 00:00:00 -05:00
8
+ summary: Buggy!
9
+ require_paths:
10
+ - lib
11
+ email: cdcarter@concentrationstudios.com
12
+ homepage: http://buggy.rubyforge.org
13
+ rubyforge_project: buggy
14
+ description: Buggy! A simple bugtraker
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: false
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Christian Carter
30
+ files:
31
+ - docs
32
+ - lib
33
+ - LICENSE
34
+ - Rakefile
35
+ - README.rdoc
36
+ - lib/buggy.rb
37
+ test_files: []
38
+
39
+ rdoc_options:
40
+ - --exclude
41
+ - .
42
+ extra_rdoc_files: []
43
+
44
+ executables: []
45
+
46
+ extensions: []
47
+
48
+ requirements: []
49
+
50
+ dependencies:
51
+ - !ruby/object:Gem::Dependency
52
+ name: hpricot
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Version::Requirement
55
+ requirements:
56
+ - - ">"
57
+ - !ruby/object:Gem::Version
58
+ version: 0.0.0
59
+ version:
60
+ - !ruby/object:Gem::Dependency
61
+ name: camping
62
+ version_requirement:
63
+ version_requirements: !ruby/object:Gem::Version::Requirement
64
+ requirements:
65
+ - - ">"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.0.0
68
+ version:
69
+ - !ruby/object:Gem::Dependency
70
+ name: activerecord
71
+ version_requirement:
72
+ version_requirements: !ruby/object:Gem::Version::Requirement
73
+ requirements:
74
+ - - ">"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.0.0
77
+ version: