-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added in stuff for testing, and started on grabbing events
- Loading branch information
Showing
13 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
.config | ||
.yardoc | ||
.DS_Store | ||
.rvmrc | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env ruby | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
require 'rubygems' | ||
require 'bundler' | ||
begin | ||
Bundler.setup(:default, :development) | ||
rescue Bundler::BundlerError => e | ||
$stderr.puts e.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit e.status_code | ||
end | ||
|
||
require 'pathname' | ||
$LOAD_PATH.unshift(Pathname.getwd.join('lib').to_s) | ||
require 'ticketsnow-ruby' | ||
|
||
def reload! | ||
Dir["#{Dir.pwd}/lib/**/*.rb"].each { |f| load f } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--color --format nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--title 'ticketsnow-ruby Documentation' | ||
--charset utf-8 | ||
--markup markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
guard 'bundler' do | ||
watch('Gemfile') | ||
watch('ticketsnow-ruby.gemspec') | ||
end | ||
|
||
guard 'rspec' do | ||
watch(%r{^spec/.+_spec\.rb$}) | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { "spec" } | ||
end | ||
|
||
guard 'yard' do | ||
watch(%r{app/.+\.rb}) | ||
watch(%r{lib/.+\.rb}) | ||
watch(%r{ext/.+\.c}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
#!/usr/bin/env rake | ||
require "bundler/gem_tasks" | ||
require 'rubygems' | ||
require 'bundler' | ||
begin | ||
Bundler.setup(:default, :development) | ||
rescue Bundler::BundlerError => e | ||
$stderr.puts e.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit e.status_code | ||
end | ||
require 'rake' | ||
require 'bundler/gem_tasks' | ||
|
||
require 'rspec/core' | ||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new(:spec) do |spec| | ||
spec.pattern = FileList['spec/**/*_spec.rb'] | ||
end | ||
|
||
task :default => :spec | ||
|
||
require 'yard' | ||
YARD::Rake::YardocTask.new | ||
|
||
desc 'Start Pry with all runtime dependencies loaded' | ||
task :console, :script do |t, args| | ||
command = 'bundle exec pry' | ||
command += "-r #{args[:script]}" if args[:script] | ||
sh command | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
require 'ticketsnow/version' | ||
require 'ticketsnow/exceptions' | ||
require 'ticketsnow/base' | ||
require 'ticketsnow/connection' | ||
|
||
module Ticketnow | ||
module Ticketsnow | ||
|
||
class << self | ||
attr_accessor :test_mode, :api_key | ||
|
||
def configure | ||
yield self | ||
self.test_mode ||= false | ||
Base.token = api_key | ||
Base.endpoint = "http://services.#{ test_mode ? 'preview.' : '' }eventinventory.com/webservices/ticketsearch.asmx?wsdl" | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'savon' | ||
|
||
module Ticketsnow | ||
class Base | ||
@@current_connection = nil | ||
|
||
DEFAULT_OPTIONS = {:body => {"APPCLIENT_ID" => token}} | ||
|
||
class << self | ||
attr_accessor :token, :endpoint | ||
end | ||
|
||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Ticketsnow | ||
|
||
class Connection < Ticketsnow::Base | ||
|
||
def self.ensure_connection! | ||
new unless @@current_connection | ||
end | ||
|
||
def initialize | ||
raise ConnectionError, "You must Configure Ticketsnow first." if Base.endpoint.nil? | ||
@url = Base.endpoint | ||
@client = Savon.client(@url) | ||
@@current_connection = @client if @client.wsdl.document? | ||
end | ||
|
||
def client | ||
@client | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Ticketsnow | ||
class Event < Ticketsnow::Connection | ||
|
||
class << self | ||
|
||
def all | ||
ensure_connection! | ||
@@current_connection.client.request(:wsdl, :get_event_list, DEFAULT_OPTIONS) | ||
end | ||
|
||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Ticketsnow | ||
|
||
class ConnectionError < StandardError; end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters