ticketmaster 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.6
@@ -40,7 +40,12 @@ end
40
40
  def add(options)
41
41
  require_provider unless options[:provider]
42
42
  provider = options[:provider]
43
- config = YAML.load_file(config_file = File.expand_path(options[:config]))
43
+ config_file = File.expand_path(options[:config])
44
+ config = if File.exists?(config_file)
45
+ YAML.load_file(config_file)
46
+ else
47
+ {}
48
+ end
44
49
  if config[provider]
45
50
  puts "#{provider} has already been specfied in #{options[:config]}. Refusing to add. Use --edit instead."
46
51
  exit 1
@@ -59,7 +64,12 @@ end
59
64
  def edit(options)
60
65
  require_provider unless options[:provider]
61
66
  provider = options[:provider]
62
- config = YAML.load_file(config_file = File.expand_path(options[:config]))
67
+ config_file = File.expand_path(options[:config])
68
+ config = if File.exist?(config_file)
69
+ YAML.load_file(config_file)
70
+ else
71
+ {}
72
+ end
63
73
  config[provider] ||= {}
64
74
  config[provider]['authentication'] = options[:authentication] || {}
65
75
  config[provider]['project'] = options[:project] if options[:project]
@@ -4,6 +4,6 @@ def help(options)
4
4
  page = File.dirname(__FILE__) + '/help/' + cmd
5
5
  if File.exist?(page)
6
6
  puts File.read(page)
7
- puts "\nFor parameter listing and details, try executing the command with --help.\n\tticketmaster #{cmd} --help"
7
+ puts "\nFor parameter listing and details, try executing the command with --help.\n\ttm #{cmd} --help"
8
8
  end
9
9
  end
@@ -7,8 +7,8 @@ This command helps facilitate the creation of a ticketmaster.yml.
7
7
  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.
8
8
 
9
9
  Example:
10
- ticket -c ~/.ticketmaster.yml -p dummy -A username:cheese,password:cakes -P 555 config --add
11
- ticket -p dummy config --set-default-provider
10
+ tm -c ~/.ticketmaster.yml -p dummy -A username:cheese,password:cakes -P 555 config --add
11
+ tm -p dummy config --set-default-provider
12
12
 
13
13
  The format for ticketmaster.yml is:
14
14
  default: <default provider>
@@ -4,9 +4,9 @@ The configuration for this command should mostly be dependent on the ticketmaste
4
4
  See ticketmaster help config for more information on how to set it up.
5
5
 
6
6
  Example:
7
- ticket console
8
- ticket -p dummy console
9
- ticket -p dummy console -d --tracer
7
+ tm console
8
+ tm -p dummy console
9
+ tm -p dummy console -d --tracer
10
10
 
11
11
  By default, it attempts to load all providers listed in the config unless a provider is explicitly given.
12
12
 
@@ -1,7 +1,7 @@
1
- usage: ticket help COMMAND
1
+ usage: tm help COMMAND
2
2
 
3
3
  This is the help command. You can use this command to get more information on other commands.
4
4
 
5
5
  Example:
6
- ticket help config
7
- ticket help console
6
+ tm help config
7
+ tm help console
@@ -2,12 +2,12 @@ This command is used to work with projects.
2
2
 
3
3
  It can be used to do any of the CRUD actions with projects that are provided by the provider.
4
4
 
5
- It will attempt to load data through the config files if they are available. See 'ticket help config' for more information.
5
+ It will attempt to load data through the config files if they are available. See 'tm help config' for more information.
6
6
 
7
7
  Examples:
8
- ticket -p lighthouse -A account:ticketmaster,token:abc project --create name "new project"
9
- ticket project --read 946
10
- ticket --project 946 project --read
11
- ticket -p dummy -A "user:common coder,pass:w3rd out" project --destroy 712
12
- ticket -p dummy -P 712 project --destroy
13
- ticket -p dummy project --update name "new project name" description "this is the project description"
8
+ tm -p lighthouse -A account:ticketmaster,token:abc project --create name "new project"
9
+ tm project --read 946
10
+ tm --project 946 project --read
11
+ tm -p dummy -A "user:common coder,pass:w3rd out" project --destroy 712
12
+ tm -p dummy -P 712 project --destroy
13
+ tm -p dummy project --update name "new project name" description "this is the project description"
@@ -2,13 +2,13 @@ This command is used to work with tickets.
2
2
 
3
3
  It can be used to do any of the CRUD actions with projects that are provided by the provider.
4
4
 
5
- It will attempt to load data through the config files if they are available. See 'ticket help config' for more information.
5
+ It will attempt to load data through the config files if they are available. See 'tm help config' for more information.
6
6
 
7
7
  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'
8
8
 
9
9
  Examples:
10
- ticket -p lighthouse -A account:ticketmaster,token:abc ticket --create name "new ticket" description "this is a new ticket"
11
- ticket --project 946 ticket --read --ticket 2
12
- ticket -p dummy -A "user:common coder,pass: w3rd out" ticket --destroy --ticket 12
13
- ticket -p dummy -P 712 ticket --destroy --ticket 4
14
- ticket -p dummy project --ticket 6 --update attribute value name "free dummies"
10
+ tm -p lighthouse -A account:ticketmaster,token:abc ticket --create name "new ticket" description "this is a new ticket"
11
+ tm --project 946 ticket --read --ticket 2
12
+ tm -p dummy -A "user:common coder,pass: w3rd out" ticket --destroy --ticket 12
13
+ tm -p dummy -P 712 ticket --destroy --ticket 4
14
+ tm -p dummy project --ticket 6 --update attribute value name "free dummies"
@@ -5,7 +5,7 @@ def project(options)
5
5
  ARGV << '--help' if ARGV.length == 0
6
6
  begin
7
7
  OptionParser.new do |opts|
8
- opts.banner = 'Usage: ticket -p PROVIDER [options] project [project_options]'
8
+ opts.banner = 'Usage: tm -p PROVIDER [options] project [project_options]'
9
9
  opts.separator ''
10
10
  opts.separator 'Options:'
11
11
 
@@ -53,7 +53,7 @@ def project(options)
53
53
  end
54
54
  end.order!
55
55
  rescue OptionParser::MissingArgument => exception
56
- puts "ticket #{options[:original_argv].join(' ')}\n\n"
56
+ puts "tm #{options[:original_argv].join(' ')}\n\n"
57
57
  puts "Error: An option was called that requires an argument, but was not given one"
58
58
  puts exception.message
59
59
  end
@@ -5,7 +5,7 @@ def ticket(options)
5
5
  ARGV << '--help' if ARGV.length == 0
6
6
  begin
7
7
  OptionParser.new do |opts|
8
- opts.banner = 'Usage: ticket -p PROVIDER -P PROJECT [options] ticket [ticket_options]'
8
+ opts.banner = 'Usage: tm -p PROVIDER -P PROJECT [options] ticket [ticket_options]'
9
9
  opts.separator ''
10
10
  opts.separator 'Options:'
11
11
 
@@ -53,7 +53,7 @@ def ticket(options)
53
53
  end
54
54
  end.order!
55
55
  rescue OptionParser::MissingArgument => exception
56
- puts "ticket #{options[:original_argv].join(' ')}\n\n"
56
+ puts "tm #{options[:original_argv].join(' ')}\n\n"
57
57
  puts "Error: An option was called that requires an argument, but was not given one"
58
58
  puts exception.message
59
59
  end
@@ -15,7 +15,7 @@ commands ={ 'help' => 'Get the help text for a particular command',
15
15
  helptext = lambda {
16
16
  helpmsg = "\nAvailable commands:\n"
17
17
  commands.sort.inject(helpmsg) { |mem, cmd| mem << "\t#{cmd.join("\t\t")}\n" }
18
- helpmsg << "\nSee 'ticket help COMMAND' for more information on a specific command."
18
+ helpmsg << "\nSee 'tm help COMMAND' for more information on a specific command."
19
19
  }
20
20
 
21
21
  ARGV << '--help' if ARGV.length == 0
@@ -31,7 +31,7 @@ end
31
31
 
32
32
  begin
33
33
  OptionParser.new do |opts|
34
- opts.banner = 'Usage: ticket [options] COMMAND [command_options]'
34
+ opts.banner = 'Usage: tm [options] COMMAND [command_options]'
35
35
  opts.separator ''
36
36
  opts.separator 'Options:'
37
37
 
@@ -59,7 +59,7 @@ begin
59
59
  end
60
60
  end.order!
61
61
  rescue OptionParser::MissingArgument => exception
62
- puts "ticket #{ARGV.join(' ')}\n\n"
62
+ puts "tm #{ARGV.join(' ')}\n\n"
63
63
  puts "Error: An option was called that requires an argument, but was not given one"
64
64
  puts exception.message
65
65
  end
@@ -8,14 +8,14 @@ Spec::Runner.configure do |config| end
8
8
  # I'm not quite sure what the most effective way to test this is...
9
9
  describe "Ticketmaster CLI" do
10
10
  before(:all) do
11
- @ticket = File.dirname(__FILE__) + '/../bin/ticket'
11
+ @ticket = File.dirname(__FILE__) + '/../bin/tm'
12
12
  @cli_dir = File.dirname(__FILE__) + '/../lib/ticketmaster/cli'
13
13
  end
14
14
 
15
15
  it "should output help if no command given" do
16
16
  help = `#{@ticket}`
17
17
  $?.should == 0
18
- help.should include('Usage: ticket [options] COMMAND [command_options]')
18
+ help.should include('Usage: tm [options] COMMAND [command_options]')
19
19
  end
20
20
 
21
21
  it "should be able to show help pages" do
data/ticketmaster.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster}
8
- s.version = "0.3.4"
8
+ s.version = "0.3.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sirupsen", "deadprogrammer"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 4
10
- version: 0.3.4
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sirupsen