Permalink
Browse files

removed references in code to ticketmaster and renamed file names to …

…taskmapper
  • Loading branch information...
1 parent 8f6288d commit 67878e86ce44b283b9ac434e07d56d234a6fdfd4 @cored cored committed May 9, 2012
Showing with 213 additions and 53 deletions.
  1. +1 −1 bin/tm
  2. +3 −3 examples/tm_example.rb
  3. +3 −3 examples/tm_example_2.rb
  4. +5 −5 examples/tm_example_3.rb
  5. +5 −5 examples/tm_example_4.rb
  6. +1 −1 lib/{ticketmaster.rb → taskmapper.rb}
  7. 0 lib/{ticketmaster → taskmapper}/authenticator.rb
  8. 0 lib/{ticketmaster → taskmapper}/cli/commands/config.rb
  9. 0 lib/{ticketmaster → taskmapper}/cli/commands/console.rb
  10. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate.rb
  11. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate/provider.rb
  12. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate/provider/comment.rb
  13. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate/provider/project.rb
  14. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate/provider/provider.rb
  15. 0 lib/{ticketmaster → taskmapper}/cli/commands/generate/provider/ticket.rb
  16. 0 lib/{ticketmaster → taskmapper}/cli/commands/help.rb
  17. +27 −0 lib/taskmapper/cli/commands/help/config
  18. +3 −3 lib/{ticketmaster → taskmapper}/cli/commands/help/console
  19. +1 −1 lib/{ticketmaster → taskmapper}/cli/commands/help/generate
  20. 0 lib/{ticketmaster → taskmapper}/cli/commands/help/help
  21. +1 −1 lib/{ticketmaster → taskmapper}/cli/commands/help/project
  22. +1 −1 lib/{ticketmaster → taskmapper}/cli/commands/help/ticket
  23. 0 lib/{ticketmaster → taskmapper}/cli/commands/project.rb
  24. 0 lib/{ticketmaster → taskmapper}/cli/commands/ticket.rb
  25. 0 lib/{ticketmaster → taskmapper}/cli/common.rb
  26. 0 lib/{ticketmaster → taskmapper}/cli/init.rb
  27. 0 lib/{ticketmaster → taskmapper}/comment.rb
  28. 0 lib/{ticketmaster → taskmapper}/common.rb
  29. 0 lib/{ticketmaster → taskmapper}/dummy/comment.rb
  30. 0 lib/{ticketmaster → taskmapper}/dummy/dummy.rb
  31. 0 lib/{ticketmaster → taskmapper}/dummy/project.rb
  32. 0 lib/{ticketmaster → taskmapper}/dummy/ticket.rb
  33. 0 lib/{ticketmaster → taskmapper}/exception.rb
  34. 0 lib/{ticketmaster → taskmapper}/helper.rb
  35. 0 lib/{ticketmaster → taskmapper}/project.rb
  36. 0 lib/{ticketmaster → taskmapper}/provider.rb
  37. 0 lib/{ticketmaster → taskmapper}/tester/comment.rb
  38. 0 lib/{ticketmaster → taskmapper}/tester/project.rb
  39. 0 lib/{ticketmaster → taskmapper}/tester/tester.rb
  40. 0 lib/{ticketmaster → taskmapper}/tester/ticket.rb
  41. 0 lib/{ticketmaster → taskmapper}/ticket.rb
  42. +0 −27 lib/ticketmaster/cli/commands/help/config
  43. +2 −2 spec/spec_helper.rb
  44. 0 spec/{ticketmaster-cli_spec.rb → taskmapper-cli_spec.rb}
  45. +160 −0 spec/taskmapper-exception_spec.rb
  46. 0 spec/{ticketmaster_spec.rb → taskmapper_spec.rb}
View
2 bin/tm
@@ -3,5 +3,5 @@
# The 'ticketmaster' gem was installed using rubygems
# This file is the CLI application to use with 'ticketmaster'
-require File.dirname(__FILE__) + '/../lib/ticketmaster/cli/init.rb'
+require File.dirname(__FILE__) + '/../lib/taskmapper/cli/init.rb'
View
@@ -1,9 +1,9 @@
require 'rubygems'
-require 'ticketmaster'
-require 'ticketmaster-lighthouse'
+require 'taskmapper'
+require 'taskmapper-lighthouse'
# display list of projects
-tm = TicketMaster.new(:lighthouse)
+tm = TaskMapper.new(:lighthouse)
tm.projects.each {|project|
puts "#{project.id} - #{project.name}"
}
View
@@ -1,9 +1,9 @@
require 'rubygems'
-require 'ticketmaster'
-require 'ticketmaster-pivotal'
+require 'taskmapper'
+require 'taskmapper-pivotal'
# display list of tickets for last project
-tm = TicketMaster.new(:pivotal)
+tm = TaskMapper.new(:pivotal)
project = tm.projects.last
project.tickets.each {|ticket|
puts "#{ticket.id} - #{ticket.title}"
View
@@ -1,11 +1,11 @@
require 'rubygems'
-require 'ticketmaster'
-require 'ticketmaster-pivotal'
-require 'ticketmaster-lighthouse'
+require 'taskmapper'
+require 'taskmapper-pivotal'
+require 'taskmapper-lighthouse'
# copy all tickets and comments from pivotal tracker to new lighthouse project (the hard way)
-pivotal = TicketMaster.new(:pivotal)
-lighthouse = TicketMaster.new(:lighthouse)
+pivotal = TaskMapper.new(:pivotal)
+lighthouse = TaskMapper.new(:lighthouse)
from = pivotal.project(97107)
View
@@ -1,11 +1,11 @@
require 'rubygems'
-require 'ticketmaster'
-require 'ticketmaster-pivotal'
-require 'ticketmaster-lighthouse'
+require 'taskmapper'
+require 'taskmapper-pivotal'
+require 'taskmapper-lighthouse'
# copy all tickets and comments from pivotal tracker to new lighthouse project (the easy way)
-pivotal = TicketMaster.new(:pivotal)
-lighthouse = TicketMaster.new(:lighthouse)
+pivotal = TaskMapper.new(:pivotal)
+lighthouse = TaskMapper.new(:lighthouse)
from = pivotal.project(97107)
to = lighthouse.project!(:name => "Copy Test on #{Time.now}",
@@ -36,7 +36,7 @@ class TaskMapper
def initialize(system = nil, authentication = nil)
if system.nil? or authentication.nil?
require 'yaml'
- data = YAML.load_file File.expand_path(ENV['TICKETMASTER_CONFIG'] || '~/.ticketmaster.yml')
+ data = YAML.load_file File.expand_path(ENV['TASKMAPPER_CONFIG'] || '~/.taskmapper.yml')
system = system.nil? ? data['default'] || data.first.first : system.to_s
authentication = data[system]['authentication'] if authentication.nil? and data[system]['authentication']
end
File renamed without changes.
@@ -0,0 +1,27 @@
+This command is used to configure taskmapper settings for use in your terminal.
+
+By default, taskmapper searches for the config information in a file named 'taskmapper.yml' in the current directory. Next it searches for 'config/taskmapper.yml' and if that fails, it uses the home directory's ~/.taskmapper.yml (note the . in front on this one). There is also the TASKMAPPER environment variable that you can set to point to another configuration file anywhere if necessary.
+
+This command helps facilitate the creation of a taskmapper.yml.
+
+Warning: Due to the way the authentication is parsed, if any keys or values contain a comma (,) or colin (:), it can not be parsed through the -A command. Usually this isn't a problem, and if it is, it can be resolved though putting the values in a config file.
+
+Example:
+ tm -c ~/.taskmapper.yml -p dummy -A username:cheese,password:cakes -P 555 config --add
+ tm -p dummy config --set-default-provider
+
+The format for taskmapper.yml is:
+ default: <default provider>
+ <provider name>:
+ authentication:
+ <authentication information>
+ project: <project>
+ [...]
+
+For example, a taskmapper.yml with the Dummy provider would look something like this:
+ default: dummy
+ dummy:
+ authentication:
+ username: name
+ password: doesnt-matter
+ project: 555
@@ -1,7 +1,7 @@
-This command is used to open an irb session with the ticketmaster.
+This command is used to open an irb session with the taskmapper.
-The configuration for this command should mostly be dependent on the ticketmaster.yml files.
-See ticketmaster help config for more information on how to set it up.
+The configuration for this command should mostly be dependent on the taskmapper.yml files.
+See taskmapper help config for more information on how to set it up.
Example:
tm console
@@ -2,7 +2,7 @@ This command is used to generate a new provider.
It generates some basic files to get you started on creating your own provider.
-NOTE: This command, in an attempt to keep provider names consistent, will prepend 'ticketmaster-' to the given provider name. You can cancel this by prepending a _ before your provider name, which will be removed if found.
+NOTE: This command, in an attempt to keep provider names consistent, will prepend 'taskmapper-' to the given provider name. You can cancel this by prepending a _ before your provider name, which will be removed if found.
If you have not created a gem directory or skeleton and want to use Jeweler (http://github.com/technicalpickles/jeweler) you can execute:
@@ -5,7 +5,7 @@ It can be used to do any of the CRUD actions with projects that are provided by
It will attempt to load data through the config files if they are available. See 'tm help config' for more information.
Examples:
- tm -p lighthouse -A account:ticketmaster,token:abc project --create name "new project"
+ tm -p lighthouse -A account:taskmapper,token:abc project --create name "new project"
tm project --read 946
tm --project 946 project --read
tm -p dummy -A "user:common coder,pass:w3rd out" project --destroy 712
@@ -7,7 +7,7 @@ It will attempt to load data through the config files if they are available. See
If any of the keys or values contain a space, you will have to enclose that key or value in quotes. For example, if you set name to ProjectName it does not need to be quoted, but if you set name to Project Name it will have to be quoted to "Project Name" or 'Project Name'
Examples:
- tm -p lighthouse -A account:ticketmaster,token:abc ticket --create name "new ticket" description "this is a new ticket"
+ tm -p lighthouse -A account:taskmapper,token:abc ticket --create name "new ticket" description "this is a new ticket"
tm --project 946 ticket --read --ticket 2
tm -p dummy -A "user:common coder,pass: w3rd out" ticket --destroy --ticket 12
tm -p dummy -P 712 ticket --destroy --ticket 4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,27 +0,0 @@
-This command is used to configure ticketmaster settings for use in your terminal.
-
-By default, ticketmaster searches for the config information in a file named 'ticketmaster.yml' in the current directory. Next it searches for 'config/ticketmaster.yml' and if that fails, it uses the home directory's ~/.ticketmaster.yml (note the . in front on this one). There is also the TICKETMASTER_CONFIG environment variable that you can set to point to another configuration file anywhere if necessary.
-
-This command helps facilitate the creation of a ticketmaster.yml.
-
-Warning: Due to the way the authentication is parsed, if any keys or values contain a comma (,) or colin (:), it can not be parsed through the -A command. Usually this isn't a problem, and if it is, it can be resolved though putting the values in a config file.
-
-Example:
- tm -c ~/.ticketmaster.yml -p dummy -A username:cheese,password:cakes -P 555 config --add
- tm -p dummy config --set-default-provider
-
-The format for ticketmaster.yml is:
- default: <default provider>
- <provider name>:
- authentication:
- <authentication information>
- project: <project>
- [...]
-
-For example, a ticketmaster.yml with the Dummy provider would look something like this:
- default: dummy
- dummy:
- authentication:
- username: name
- password: doesnt-matter
- project: 555
View
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'ticketmaster.rb'
-require 'ticketmaster/dummy/dummy.rb'
+require 'taskmapper.rb'
+require 'taskmapper/dummy/dummy.rb'
require 'rspec'
RSpec.configure do |config|
File renamed without changes.
@@ -0,0 +1,160 @@
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'rubygems'
+require 'ticketmaster'
+
+describe "TaskMapper Exception Messages" do
+ let(:exception) { TaskMapper::Exception }
+ let(:tm) { TaskMapper.new(:tester, {}) }
+ let(:validation_error) { "TaskMapper::Provider::Base::valid? method must be implemented by the provider" }
+ let(:easy_finder_error) { "TaskMapper::Provider::Helper::easy_finder method must be implemented by the provider" }
+
+ describe TaskMapper::Provider::Base do
+ context "when calling #valid? method" do
+ subject { lambda { tm.valid? } }
+ it { should raise_error(exception, validation_error) }
+ end
+ end
+
+ describe TaskMapper::Provider::Helper do
+ context "when calling #easy_finder" do
+ subject { lambda { tm.easy_finder(1, :test, {}) } }
+ it { should raise_error(exception, easy_finder_error) }
+ end
+ end
+
+ describe TaskMapper::Provider::Tester::Project do
+ let(:find_by_id_error) { "TaskMapper::Provider::Tester::Project::find_by_id method must be implemented by the provider" }
+ let(:find_by_attributes_error) { "TaskMapper::Provider::Tester::Project::find_by_attributes method must be implemented by the provider" }
+ let(:search_error) { "TaskMapper::Provider::Tester::Project::search method must be implemented by the provider"}
+ let(:create_error) { "TaskMapper::Provider::Tester::Project::create method must be implemented by the provider"}
+ let(:save_error) { "TaskMapper::Provider::Tester::Project::save method must be implemented by the provider"}
+ let(:destroy_error) { "TaskMapper::Provider::Tester::Project::destroy method must be implemented by the provider" }
+
+ context "when calling #find_by_id" do
+ subject { lambda { tm.project([1]) } }
+ it { should raise_error(exception, find_by_id_error) }
+ end
+
+ context "when calling #find_by_attributes" do
+ subject { lambda { tm.project.find :all, :name => 'Test Project' } }
+ it { should raise_error(exception, find_by_attributes_error) }
+ end
+
+ context "when calling #search" do
+ subject { lambda { tm.project.search :tag => 'testing' } }
+ it { should raise_error(exception, search_error) }
+ end
+
+ context "when calling #create" do
+ subject { lambda { tm.project.create :name => 'Foo Bar' } }
+ it { should raise_error(exception, create_error) }
+ end
+
+ context "when calling #save" do
+ subject { lambda { tm.project.save } }
+ pending { should raise_error(exception, save_error) }
+ end
+
+ context "when calling #destroy" do
+ let(:project) { TaskMapper::Provider::Tester::Project.new }
+ subject { lambda { project.destroy } }
+ it { should raise_error(exception, destroy_error) }
+ end
+ end
+
+ describe TaskMapper::Provider::Tester::Ticket do
+ let(:ticket) { TaskMapper::Provider::Tester::Ticket.new(1) }
+ let(:find_by_id_error) { "TaskMapper::Provider::Tester::Ticket::find_by_id method must be implemented by the provider" }
+ let(:find_by_attributes_error) { "TaskMapper::Provider::Tester::Ticket::find_by_attributes method must be implemented by the provider" }
+ let(:search_error) { "TaskMapper::Provider::Tester::Ticket::search method must be implemented by the provider" }
+ let(:create_error) { "TaskMapper::Provider::Tester::Ticket::create method must be implemented by the provider" }
+ let(:save_error) { "TaskMapper::Provider::Tester::Ticket::save method must be implemented by the provider" }
+ let(:destroy_error) { "TaskMapper::Provider::Tester::Ticket::destroy method must be implemented by the provider" }
+ let(:close_error) { "TaskMapper::Provider::Tester::Ticket::close method must be implemented by the provider" }
+ let(:reload_error) { "TaskMapper::Provider::Tester::Ticket::reload! method must be implemented by the provider" }
+
+ context "when #find_by_id" do
+ subject { lambda { tm.tickets(:id => 22) } }
+ it { should raise_error(exception, find_by_id_error) }
+ end
+
+ context "when #find_by_attributes" do
+ subject { lambda { tm.ticket.find(1, :all, :title => 'Test ticket') } }
+ it { should raise_error(exception, find_by_attributes_error) }
+ end
+
+ context "when #search" do
+ subject { lambda { tm.ticket.search :tag => 'testing' } }
+ it { should raise_error(exception, search_error) }
+ end
+
+ context "when #create" do
+ subject { lambda { tm.ticket.create :name => 'Foo Bar' } }
+ it { should raise_error(exception, create_error) }
+ end
+
+ context "when #save" do
+ subject { lambda { ticket.save } }
+ it { should raise_error(exception, save_error) }
+ end
+
+ context "when #destroy" do
+ subject { lambda { ticket.destroy } }
+ it { should raise_error(exception, destroy_error) }
+ end
+
+ context "when #close" do
+ subject { lambda { ticket.close } }
+ it { should raise_error(exception, close_error) }
+ end
+
+ context "when #reload!" do
+ subject { lambda { ticket.reload! } }
+ it { should raise_error(exception, reload_error) }
+ end
+ end
+
+ describe TaskMapper::Provider::Tester::Comment do
+ let(:ticket_with_comments) { TaskMapper::Provider::Tester::Ticket.new(1) }
+ let(:comment) { TaskMapper::Provider::Tester::Comment.new(1, 1) }
+ let(:find_by_id_error) { "TaskMapper::Provider::Tester::Comment::find_by_id method must be implemented by the provider" }
+ let(:find_by_attributes_error) { "TaskMapper::Provider::Tester::Comment::find_by_attributes method must be implemented by the provider" }
+ let(:search_error) { "TaskMapper::Provider::Tester::Comment::search method must be implemented by the provider" }
+ let(:create_error) { "TaskMapper::Provider::Tester::Comment::create method must be implemented by the provider" }
+ let(:save_error) { "TaskMapper::Provider::Tester::Comment::save method must be implemented by the provider" }
+ let(:destroy_error) { "TaskMapper::Provider::Tester::Comment::destroy method must be implemented by the provider" }
+
+ context "when #find_by_id" do
+ subject { lambda { ticket_with_comments.comment.find(1,1,[1,2]) } }
+ it { should raise_error(exception, find_by_id_error) }
+ end
+
+ context "when #find_by_attributes" do
+ subject { lambda { ticket_with_comments.comment.find(1, 1, :all, :tag => 'tag') } }
+ it { should raise_error(exception, find_by_attributes_error) }
+ end
+
+ context "when #search" do
+ subject { lambda { ticket_with_comments.comment.search(1, 1, :tag => 'testing') } }
+ it { should raise_error(exception, search_error) }
+ end
+
+ context "when #create" do
+ subject { lambda { ticket_with_comments.comment.create :name => 'Foo Bar' } }
+ it { should raise_error(exception, create_error) }
+ end
+
+ context "when #save" do
+ subject { lambda { comment.save } }
+ it { should raise_error(exception, save_error) }
+ end
+
+ context "when #destroy" do
+ subject { lambda { comment.destroy } }
+ it { should raise_error(exception, destroy_error) }
+ end
+ end
+end
+
File renamed without changes.

0 comments on commit 67878e8

Please sign in to comment.