ticketmaster-basecamp 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,6 +1,47 @@
1
- = ticketmaster-basecamp
1
+ # ticketmaster-basecamp
2
2
 
3
- Description goes here.
3
+ This is the provider for interaction with (basecamp)[http://www.basecamphq.com] using (ticketmaster)[http://ticketrb.com]
4
+
5
+ # Basecamp Setup
6
+
7
+ Basecamp's API access is disabled by default on their accounts. You will have to go to the account page and enable it.
8
+
9
+ 1. From the dashboard, click the "Account (Upgrade/Invoices)" tab in the right hand side.
10
+ 2. Scroll down to the Basecamp API section. (It should be near the bottom, second-to-last.)
11
+ 3. Enable it. Once it's enabled, you'll see: "The API is currently enabled for this account."
12
+
13
+ ## Token
14
+
15
+ It is recommended that you use the authentication token instead of a username and password to authenticate with basecamp. The token can be found from the "My Info" link at the top right hand corner next to the "Sign out" link.
16
+
17
+ At the bottom of that page is the "Authentication tokens" section. Click on the "Show your tokens" link for your API token. It's the first one.
18
+
19
+ # Usage
20
+
21
+ Initialize the basecamp ticketmaster instance using a token or username and password:
22
+ basecamp = TicketMaster.new(:basecamp, :domain => 'yourdomain.basecamphq.com', :token => 'abc000...')
23
+ basecamp = TicketMaster.new(:basecamp, :domain => 'yourdomain.basecamphq.com', :username => 'you', :password => 'pass')
24
+
25
+ ## Find projects
26
+
27
+ projects = basecamp.projects
28
+ project = basecamp.project(id)
29
+
30
+ ## Find tickets
31
+
32
+ Since basecamp does not have the conventional "tickets", ticketmaster-basecamp considers a TodoItem as a ticket, but will prepend the TodoList's title to the TodoItem's title.
33
+ tickets = project.tickets
34
+ ticket = project.ticket(<todoitem_id>)
35
+
36
+ ## Find comments
37
+
38
+ comments = ticket.comments
39
+
40
+ ## More
41
+
42
+ For more usage information, see (ticketmaster)[http://github.com/hybridgroup/ticketmaster]. This provider should implement all the ticketmaster functionality. If it does not, please notify us.
43
+
44
+ Thanks for using ticketmaster!
4
45
 
5
46
  == Note on Patches/Pull Requests
6
47
 
data/Rakefile CHANGED
@@ -10,6 +10,7 @@ begin
10
10
  gem.email = "hong.quach@abigfisch.com"
11
11
  gem.homepage = "http://github.com/kiafaldorius/ticketmaster-basecamp"
12
12
  gem.authors = ["HybridGroup"]
13
+ gem.add_dependency "ticketmaster", ">= 0.4.0"
13
14
  gem.add_development_dependency "rspec", ">= 1.2.9"
14
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
16
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -147,7 +147,7 @@ end
147
147
  # person = session.person(93832) # => #<Record(person)..>
148
148
  # person.first_name # => "Jason"
149
149
  #
150
- class Basecamp
150
+ class BasecampAPI
151
151
  class Connection #:nodoc:
152
152
  def initialize(master)
153
153
  @master = master
@@ -17,9 +17,9 @@ module TicketMaster::Provider
17
17
  end
18
18
  unless auth.token.nil?
19
19
  auth.username = auth.token
20
- auth.password = 'Basecamp lamo'
20
+ auth.password = 'Basecamp'
21
21
  end
22
- Kernel::Basecamp.establish_connection!(auth.domain, auth.username, auth.password, auth.ssl)
22
+ BasecampAPI.establish_connection!(auth.domain, auth.username, auth.password, auth.ssl)
23
23
  end
24
24
 
25
25
  end
@@ -7,7 +7,7 @@ module TicketMaster::Provider
7
7
  #
8
8
  class Comment < TicketMaster::Provider::Base::Comment
9
9
  # declare needed overloaded methods here
10
- API = Kernel::Basecamp::Comment
10
+ API = BasecampAPI::Comment
11
11
 
12
12
  def self.find_by_id(project_id, ticket_id, id)
13
13
  self.new self::API.find(id)
@@ -8,7 +8,7 @@ module TicketMaster::Provider
8
8
  # created_at => created_on
9
9
  # updated_at => last_changed_on
10
10
  class Project < TicketMaster::Provider::Base::Project
11
- API = Kernel::Basecamp::Project
11
+ API = BasecampAPI::Project
12
12
 
13
13
  def description
14
14
  announcement
@@ -23,7 +23,7 @@ module TicketMaster::Provider
23
23
  end
24
24
 
25
25
  def self.search(project_id, options = {}, limit = 1000)
26
- tickets = Kernel::Basecamp::TodoList.find(:all, :params => {:project_id => project_id}).collect do |list|
26
+ tickets = BasecampAPI::TodoList.find(:all, :params => {:project_id => project_id}).collect do |list|
27
27
  list.todo_items.collect { |item|
28
28
  item.attributes['list'] = list
29
29
  item
@@ -38,11 +38,11 @@ module TicketMaster::Provider
38
38
  list_id = options[0].delete(:todo_list_id) || options[0].delete('todo_list_id')
39
39
  project_id = options[0].delete(:project_id) || options[0].delete('project_id')
40
40
  if list_id.nil? and project_id
41
- list_id = Kernel::Basecamp::TodoList.create(:project_id => project_id, :name => 'New List').id
41
+ list_id = BasecampAPI::TodoList.create(:project_id => project_id, :name => 'New List').id
42
42
  end
43
43
  options[0][:todo_list_id] = list_id
44
44
  end
45
- something = Kernel::Basecamp::TodoItem.new(*options)
45
+ something = BasecampAPI::TodoItem.new(*options)
46
46
  something.save
47
47
  self.new something
48
48
  end
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Basecamp::Comment" do
4
4
  before(:all) do
5
- headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1wIGxhbW8='}
5
+ headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'}
6
6
  wheaders = headers.merge('Content-Type' => 'application/xml')
7
7
  ActiveResource::HttpMock.respond_to do |mock|
8
8
  mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Basecamp::Project" do
4
4
  before(:all) do
5
- headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1wIGxhbW8='}
5
+ headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'}
6
6
  wheaders = headers.merge('Content-Type' => 'application/xml')
7
7
  @project_id = 5220065
8
8
  ActiveResource::HttpMock.respond_to do |mock|
data/spec/tickets_spec.rb CHANGED
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Basecamp::Ticket" do
4
4
  before(:all) do
5
- headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1wIGxhbW8='}
5
+ headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'}
6
6
  wheaders = headers.merge('Content-Type' => 'application/xml')
7
7
  ActiveResource::HttpMock.respond_to do |mock|
8
8
  mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
@@ -0,0 +1,78 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ticketmaster-basecamp}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["HybridGroup"]
12
+ s.date = %q{2010-09-23}
13
+ s.description = %q{This gem provides an interface to basecamp through the ticketmaster gem}
14
+ s.email = %q{hong.quach@abigfisch.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/basecamp/basecamp.rb",
27
+ "lib/provider/basecamp.rb",
28
+ "lib/provider/comment.rb",
29
+ "lib/provider/project.rb",
30
+ "lib/provider/ticket.rb",
31
+ "lib/ticketmaster-basecamp.rb",
32
+ "spec/comments_spec.rb",
33
+ "spec/fixtures/comments.xml",
34
+ "spec/fixtures/comments/74197051.xml",
35
+ "spec/fixtures/comments/74197096.xml",
36
+ "spec/fixtures/projects.xml",
37
+ "spec/fixtures/projects/5220065.xml",
38
+ "spec/fixtures/projects/create.xml",
39
+ "spec/fixtures/todo_lists.xml",
40
+ "spec/fixtures/todo_lists/9972756_items.xml",
41
+ "spec/fixtures/todo_lists/9973518_items.xml",
42
+ "spec/projects_spec.rb",
43
+ "spec/spec.opts",
44
+ "spec/spec_helper.rb",
45
+ "spec/ticketmaster-basecamp_spec.rb",
46
+ "spec/tickets_spec.rb",
47
+ "ticketmaster-basecamp.gemspec"
48
+ ]
49
+ s.homepage = %q{http://github.com/kiafaldorius/ticketmaster-basecamp}
50
+ s.rdoc_options = ["--charset=UTF-8"]
51
+ s.require_paths = ["lib"]
52
+ s.rubygems_version = %q{1.3.7}
53
+ s.summary = %q{The basecamp provider for ticketmaster}
54
+ s.test_files = [
55
+ "spec/comments_spec.rb",
56
+ "spec/projects_spec.rb",
57
+ "spec/spec_helper.rb",
58
+ "spec/ticketmaster-basecamp_spec.rb",
59
+ "spec/tickets_spec.rb"
60
+ ]
61
+
62
+ if s.respond_to? :specification_version then
63
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
64
+ s.specification_version = 3
65
+
66
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
67
+ s.add_runtime_dependency(%q<ticketmaster>, [">= 0.4.0"])
68
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
69
+ else
70
+ s.add_dependency(%q<ticketmaster>, [">= 0.4.0"])
71
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
72
+ end
73
+ else
74
+ s.add_dependency(%q<ticketmaster>, [">= 0.4.0"])
75
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
76
+ end
77
+ end
78
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-basecamp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - HybridGroup
@@ -15,13 +15,29 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-23 00:00:00 -07:00
18
+ date: 2010-09-23 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: rspec
22
+ name: ticketmaster
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 0
32
+ - 4
33
+ - 0
34
+ version: 0.4.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
25
41
  none: false
26
42
  requirements:
27
43
  - - ">="
@@ -33,7 +49,7 @@ dependencies:
33
49
  - 9
34
50
  version: 1.2.9
35
51
  type: :development
36
- version_requirements: *id001
52
+ version_requirements: *id002
37
53
  description: This gem provides an interface to basecamp through the ticketmaster gem
38
54
  email: hong.quach@abigfisch.com
39
55
  executables: []
@@ -71,6 +87,7 @@ files:
71
87
  - spec/spec_helper.rb
72
88
  - spec/ticketmaster-basecamp_spec.rb
73
89
  - spec/tickets_spec.rb
90
+ - ticketmaster-basecamp.gemspec
74
91
  has_rdoc: true
75
92
  homepage: http://github.com/kiafaldorius/ticketmaster-basecamp
76
93
  licenses: []