spektrix 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/CONDUCT.md +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +84 -0
- data/Rakefile +2 -0
- data/lib/models/events/event.rb +16 -0
- data/lib/models/events/instance.rb +38 -0
- data/lib/models/events/instance_status.rb +8 -0
- data/lib/models/seating/plan.rb +10 -0
- data/lib/models/tickets/band.rb +12 -0
- data/lib/models/tickets/price.rb +7 -0
- data/lib/models/tickets/price_list.rb +20 -0
- data/lib/models/tickets/type.rb +8 -0
- data/lib/spektrix.rb +79 -0
- data/lib/spektrix/base.rb +44 -0
- data/lib/spektrix/deep_symbolize.rb +82 -0
- data/lib/spektrix/response_parser.rb +46 -0
- data/lib/spektrix/version.rb +3 -0
- data/spektrix.gemspec +29 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 75142429ee35e702751b0232e999e40c4b74eaa9
|
4
|
+
data.tar.gz: 65db3438fe53e2d16d1faac76d479aec8c2a697c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 02ab04c7ed14fc993da1e51a1818d071113e239d31e3e767a65793f90a1450fb05f7e96d25c0e901e7c505605380ab416045fad888c4d775229596fdfec0d270
|
7
|
+
data.tar.gz: 28a70513c8d31ce64fd4714cfdcdc262a1fb338992881ae9c5a5107b42b84b5df765e3d4ca6aadca53fee91900e6c41cd2e24f7865c3881ab607ca1f9bc09c82
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.idea
|
data/CONDUCT.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Ed Jones
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Spektrix client library for Ruby
|
2
|
+
This is a client library for the [Spektrix ticketing platform](https://www.spektrix.com/). You'll need a user account / client name, a private/public keypair and an API ID.
|
3
|
+
|
4
|
+
This library covers most of the stuff you might need to do to pull events and prices from the database to include on your own website. It doesn't write back to the API, and doesn't include other endpoints (although feel free to add these and send us a PR!).
|
5
|
+
|
6
|
+
# Setup
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
You can either install using [bundler](http://bundler.io) or just from the command line.
|
11
|
+
|
12
|
+
### Bundler
|
13
|
+
Include this in your gemfile
|
14
|
+
|
15
|
+
`gem 'spektrix'`
|
16
|
+
|
17
|
+
That's it! this is in active development so you might prefer:
|
18
|
+
|
19
|
+
`gem 'spektrix', github: "errorstudio/spektrix"`
|
20
|
+
|
21
|
+
### Using Gem
|
22
|
+
As simple as:
|
23
|
+
|
24
|
+
`gem install spektrix`
|
25
|
+
|
26
|
+
## Configuration
|
27
|
+
You need to configure spektrix with a block, like this:
|
28
|
+
|
29
|
+
```
|
30
|
+
Spektrix.configure do |config|
|
31
|
+
config.client_name = "yourclientname"
|
32
|
+
config.client_key_path = File.join(Rails.root,"config","certs","your.private.key") # don't commit this into version control.
|
33
|
+
config.client_cert_path = File.join(Rails.root,"config","certs","your.signed.cert.crt") #the cert you get back from the Spektrix team
|
34
|
+
config.api_key = "your API key from the spektrix interface"
|
35
|
+
# config.proxy = "https://localhost:9998" #a proxy if you want to use it. Proxies don't usually forward client certs so YMMV.
|
36
|
+
# config.base_url = "http://localhost:8000" #if you don't want to hit the Spektrix API for some reason - e.g. locally hosted XML for testing.
|
37
|
+
# config.api_path = "" # defaults to /api/v2 - only here for testing really.
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
# Use
|
42
|
+
|
43
|
+
## Events, instances and prices
|
44
|
+
Events have instances, which in turn have seating plans and a price list. Seating plans aren't catered for, but bands and ticket types are.
|
45
|
+
|
46
|
+
```
|
47
|
+
include Spektrix #You don't have to do this, just prefix all the calls with `Spektrix::` otherwise
|
48
|
+
Events::Event.first #get the first event in the list
|
49
|
+
e = Events::Event.find(123) #or get a specific event by ID
|
50
|
+
instances = e.instances # A list of Spektrix::Event::Instance objects
|
51
|
+
i = instance.first
|
52
|
+
i.prices #a list of Spektrix::Ticket::Price objects
|
53
|
+
p = i.prices.first #a Price object
|
54
|
+
p.band #a Spektrix::Tickets::Band object - this just has a name
|
55
|
+
p.ticket_type #a Spektrix::Tickets::Type object - this just has a name
|
56
|
+
p.price #a string representation of the price
|
57
|
+
```
|
58
|
+
|
59
|
+
### Getting a list of lower-level objects directly
|
60
|
+
Because the API doesn't follow REST, we actually make a bunch of HTTP calls in the example above. That has an advantage that you can call a collection of lower-level entities without having to get the 'parent'.
|
61
|
+
|
62
|
+
```
|
63
|
+
Spektrix::Tickets::Band.all #a collection of bands
|
64
|
+
Spektrix::Tickets::PriceList.where(event_id: 123) #the prices for event 123, without calling the Event itself.
|
65
|
+
```
|
66
|
+
|
67
|
+
# Contributing
|
68
|
+
We'd love to have your input if you're making use of this:
|
69
|
+
|
70
|
+
1. Fork the repo
|
71
|
+
2. Make any changes in a branch
|
72
|
+
3. Squash your changes into sensible commits
|
73
|
+
4. Make a PR on your fork
|
74
|
+
|
75
|
+
# Licence
|
76
|
+
Licensed under MIT - see LICENCE.txt. Have fun!
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Spektrix
|
2
|
+
module Events
|
3
|
+
# An event. This hits the events endpoint on Spektrix and returns a collection.
|
4
|
+
class Event
|
5
|
+
include Spektrix::Base
|
6
|
+
collection_path "events"
|
7
|
+
|
8
|
+
after_find -> (r) { r.duration = r.duration.to_i.minutes }
|
9
|
+
|
10
|
+
def instances
|
11
|
+
Instance.where(event_id: self.id).to_a
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Spektrix
|
2
|
+
module Events
|
3
|
+
# An event instance.
|
4
|
+
class Instance
|
5
|
+
include Spektrix::Base
|
6
|
+
collection_path "instances"
|
7
|
+
|
8
|
+
after_find ->(r) do
|
9
|
+
[:start,
|
10
|
+
:start_utc,
|
11
|
+
:start_selling_at,
|
12
|
+
:start_selling_at_utc,
|
13
|
+
:stop_selling_at,
|
14
|
+
:stop_selling_at_utc
|
15
|
+
].each do |field|
|
16
|
+
if r.respond_to?(field)
|
17
|
+
time = Time.parse(r.send(field))
|
18
|
+
if field.to_s =~ /_utc$/
|
19
|
+
time = time.in_time_zone('UTC')
|
20
|
+
else
|
21
|
+
time = time.in_time_zone('London')
|
22
|
+
end
|
23
|
+
|
24
|
+
r.send(:"#{field}=",time)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def status
|
30
|
+
InstanceStatus.where(instance_id: self.id).first
|
31
|
+
end
|
32
|
+
|
33
|
+
def prices
|
34
|
+
Tickets::PriceList.where(instance_id: self.id).first.prices
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Spektrix
|
2
|
+
module Tickets
|
3
|
+
class PriceList
|
4
|
+
include Spektrix::Base
|
5
|
+
collection_path "price-lists"
|
6
|
+
|
7
|
+
after_find ->(r) do
|
8
|
+
bands = Band.all.to_a
|
9
|
+
ticket_types = Type.all.to_a
|
10
|
+
if r.respond_to?(:price)
|
11
|
+
r.prices = r.price.collect do |price|
|
12
|
+
price[:band] = bands.find {|b| b.id == price[:band][:id]}
|
13
|
+
price[:ticket_type] = ticket_types.find {|t| t.id == price[:ticket_type][:id]}
|
14
|
+
Price.new(price)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/spektrix.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'her'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'require_all'
|
4
|
+
require_rel "spektrix/deep_symbolize"
|
5
|
+
require_rel '.'
|
6
|
+
class Hash; include DeepSymbolizable; end
|
7
|
+
module Spektrix
|
8
|
+
class << self
|
9
|
+
attr_accessor :configuration
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.configure
|
13
|
+
self.configuration ||= Configuration.new
|
14
|
+
yield(configuration)
|
15
|
+
self.configuration.configure_connection
|
16
|
+
end
|
17
|
+
|
18
|
+
class Configuration
|
19
|
+
attr_accessor :client_name,
|
20
|
+
:client_key_path, #your private RSA key
|
21
|
+
:client_cert_path, # the cert signed by Spektrix
|
22
|
+
:api_key, #the key you get from the spektrix interface.
|
23
|
+
:proxy, #note that proxying requests with a client cert might break some stuff.
|
24
|
+
:base_url,
|
25
|
+
:api_path
|
26
|
+
|
27
|
+
attr_reader :connection,
|
28
|
+
:ssl_options
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
@connection ||= Her::API.new
|
32
|
+
@user_agent = "Spektrix Ruby client #{Spektrix::VERSION} (http://github.com/errorstudio/spektrix-ruby)",
|
33
|
+
@base_url = "https://api.system.spektrix.com"
|
34
|
+
@api_path = "api/v2"
|
35
|
+
end
|
36
|
+
|
37
|
+
def user_agent=(agent)
|
38
|
+
@user_agent = agent || @user_agent
|
39
|
+
end
|
40
|
+
|
41
|
+
# Return the Configuration object as a hash, with symbols as keys.
|
42
|
+
# @return [Hash]
|
43
|
+
def to_hash
|
44
|
+
Hash[instance_variables.map { |name| [name.to_s.gsub("@","").to_sym, instance_variable_get(name)] } ]
|
45
|
+
end
|
46
|
+
|
47
|
+
def configure_connection
|
48
|
+
if @client_name.nil? || @client_key_path.nil? || @client_cert_path.nil? || @api_key.nil?
|
49
|
+
raise ArgumentError, "You need to configure the Spektrix gem with a client name, private and public keys before making a call to Spektrix"
|
50
|
+
end
|
51
|
+
|
52
|
+
@connection_path = "#{@base_url}/#{@client_name}/#{@api_path}"
|
53
|
+
# @connection_path = "http://localhost:8000"
|
54
|
+
@ssl_options = {
|
55
|
+
:client_cert => OpenSSL::X509::Certificate.new(File.read(@client_cert_path)),
|
56
|
+
:client_key => OpenSSL::PKey::RSA.new(File.read(@client_key_path)),
|
57
|
+
:verify => false
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
@connection.setup url: @connection_path, ssl: @ssl_options, proxy: @proxy do |c|
|
62
|
+
|
63
|
+
#Api Auth
|
64
|
+
c.params[:api_key] = @api_key
|
65
|
+
|
66
|
+
# Request
|
67
|
+
c.use Faraday::Request::UrlEncoded
|
68
|
+
|
69
|
+
# Response
|
70
|
+
# c.use Spektrix::DebugMiddleware
|
71
|
+
c.use Spektrix::ResponseParser
|
72
|
+
|
73
|
+
|
74
|
+
# Adapter
|
75
|
+
c.use Faraday::Adapter::NetHttp
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Spektrix
|
2
|
+
# This is a mixin which allows any class to get data from a Spektrix endpoint
|
3
|
+
module Base
|
4
|
+
def self.included(base)
|
5
|
+
# Include Her::Model. Her does most of the heavy lifting.
|
6
|
+
base.include Her::Model
|
7
|
+
|
8
|
+
# Extend class methods (below)
|
9
|
+
base.extend ClassMethods
|
10
|
+
|
11
|
+
# Use the connection we set up in the configuration.
|
12
|
+
base.send(:use_api,->{Spektrix.configuration.connection})
|
13
|
+
end
|
14
|
+
|
15
|
+
# Define method_missing here to allow us to inspect the custom attributes on the object and return as normal attributes.
|
16
|
+
def method_missing(method, *args, &block)
|
17
|
+
if attributes.has_key?(:custom_attributes) && custom_attributes.has_key?(method.to_sym)
|
18
|
+
custom_attributes[method.to_sym]
|
19
|
+
else
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module ClassMethods
|
25
|
+
# Spektrix expects the ID for an entity to be passed as a querystring parameter, as opposed to an instance being on its own url
|
26
|
+
# @param id [Integer] the ID you want to find
|
27
|
+
# @return [Object] the entity
|
28
|
+
def find(id)
|
29
|
+
where("#{entity_name}_id" => id).first
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get the entity name; used in other places (like find())
|
33
|
+
# @return [String] the entity name
|
34
|
+
def entity_name
|
35
|
+
self.to_s.demodulize.underscore
|
36
|
+
end
|
37
|
+
|
38
|
+
def first
|
39
|
+
all.first
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
# Symbolizes all of hash's keys and subkeys.
|
24
|
+
# Also allows for custom pre-processing of keys (e.g. downcasing, etc)
|
25
|
+
# if the block is given:
|
26
|
+
#
|
27
|
+
# somehash.deep_symbolize { |key| key.downcase }
|
28
|
+
#
|
29
|
+
# Usage: either include it into global Hash class to make it available to
|
30
|
+
# to all hashes, or extend only your own hash objects with this
|
31
|
+
# module.
|
32
|
+
# E.g.:
|
33
|
+
# 1) class Hash; include DeepSymbolizable; end
|
34
|
+
# 2) myhash.extend DeepSymbolizable
|
35
|
+
|
36
|
+
module DeepSymbolizable
|
37
|
+
def deep_symbolize(&block)
|
38
|
+
method = self.class.to_s.downcase.to_sym
|
39
|
+
syms = DeepSymbolizable::Symbolizers
|
40
|
+
syms.respond_to?(method) ? syms.send(method, self, &block) : self
|
41
|
+
end
|
42
|
+
|
43
|
+
module Symbolizers
|
44
|
+
extend self
|
45
|
+
|
46
|
+
# the primary method - symbolizes keys of the given hash,
|
47
|
+
# preprocessing them with a block if one was given, and recursively
|
48
|
+
# going into all nested enumerables
|
49
|
+
def hash(hash, &block)
|
50
|
+
hash.inject({}) do |result, (key, value)|
|
51
|
+
# Recursively deep-symbolize subhashes
|
52
|
+
value = _recurse_(value, &block)
|
53
|
+
|
54
|
+
# Pre-process the key with a block if it was given
|
55
|
+
key = yield key if block_given?
|
56
|
+
# Symbolize the key string if it responds to to_sym
|
57
|
+
sym_key = key.to_sym rescue key
|
58
|
+
|
59
|
+
# write it back into the result and return the updated hash
|
60
|
+
result[sym_key] = value
|
61
|
+
result
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# walking over arrays and symbolizing all nested elements
|
66
|
+
def array(ary, &block)
|
67
|
+
ary.map { |v| _recurse_(v, &block) }
|
68
|
+
end
|
69
|
+
|
70
|
+
# handling recursion - any Enumerable elements (except String)
|
71
|
+
# is being extended with the module, and then symbolized
|
72
|
+
def _recurse_(value, &block)
|
73
|
+
if value.is_a?(Enumerable) && !value.is_a?(String)
|
74
|
+
# support for a use case without extended core Hash
|
75
|
+
value.extend DeepSymbolizable unless value.class.include?(DeepSymbolizable)
|
76
|
+
value = value.deep_symbolize(&block)
|
77
|
+
end
|
78
|
+
value
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Spektrix
|
2
|
+
# A custom response parser to handle the XML format returned by Spektrix.
|
3
|
+
# We clean up the XML to remove namespaces, then get the collection itself. The XML includes an attribute called 'attribute' which explodes Ruby, so we reassign this to 'custom_attributes', and clean up the key/value pairs so the attribute name is the key and the value is the value.
|
4
|
+
class ResponseParser < ::Faraday::Response::Middleware
|
5
|
+
def on_complete(env)
|
6
|
+
|
7
|
+
# Parse the XML
|
8
|
+
doc = Nokogiri::XML(env[:body])
|
9
|
+
doc.remove_namespaces!
|
10
|
+
|
11
|
+
# Hash has DeepSymbolizable mixed in, which goes through the hash fixing up the CamelCase.
|
12
|
+
data = Hash.from_xml(doc.to_s).deep_symbolize {|k| k.underscore.to_sym}
|
13
|
+
|
14
|
+
begin
|
15
|
+
# Get the array inside the XML. TODO: this is a bit hacky. Should use xpath.
|
16
|
+
data = data.values.first.values.flatten
|
17
|
+
rescue
|
18
|
+
# Rescue with an empty array, for now.
|
19
|
+
data = []
|
20
|
+
end
|
21
|
+
|
22
|
+
# Traverse the array, fixing up any attributes called 'attribute'
|
23
|
+
data.each do |item|
|
24
|
+
if item.has_key?(:attribute)
|
25
|
+
item[:custom_attributes] = {}
|
26
|
+
item[:attribute].each do |attribute_pair|
|
27
|
+
next unless attribute_pair.is_a?(Hash)
|
28
|
+
key = attribute_pair.values.first.underscore.downcase.parameterize("_").to_sym
|
29
|
+
value = attribute_pair.values.last
|
30
|
+
value = false if value == "0"
|
31
|
+
value = true if value == "1"
|
32
|
+
item[:custom_attributes][key] = value
|
33
|
+
end
|
34
|
+
|
35
|
+
#Remove the 'attribute' attribute because, y'know.
|
36
|
+
item.delete(:attribute)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Set up the hash as Her expects.
|
41
|
+
env[:body] = {
|
42
|
+
data: data
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/spektrix.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'spektrix/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "spektrix"
|
8
|
+
spec.version = Spektrix::VERSION
|
9
|
+
spec.authors = ["Ed Jones", "Paul Hendrick"]
|
10
|
+
spec.email = ["hosting@error.agency"]
|
11
|
+
spec.summary = %q{A client library for the Spektrix ticketing system}
|
12
|
+
spec.description = %q{A client library for the Spektrix ticketing system. Requires a Spektrix user account.}
|
13
|
+
spec.homepage = "https://github.com/errorstudio/spektrix-ruby"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
spec.add_dependency "her", "~> 0.8"
|
25
|
+
spec.add_dependency "require_all", "~> 1.3"
|
26
|
+
# spec.add_dependency "multi_xml", "~> 0.5"
|
27
|
+
# spec.add_dependency "faraday_middleware", "~> 0.10"
|
28
|
+
spec.add_dependency "nokogiri"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spektrix
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ed Jones
|
8
|
+
- Paul Hendrick
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.6'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: her
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0.8'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0.8'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: require_all
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.3'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: nokogiri
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
description: A client library for the Spektrix ticketing system. Requires a Spektrix
|
85
|
+
user account.
|
86
|
+
email:
|
87
|
+
- hosting@error.agency
|
88
|
+
executables: []
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- CONDUCT.md
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- lib/models/events/event.rb
|
99
|
+
- lib/models/events/instance.rb
|
100
|
+
- lib/models/events/instance_status.rb
|
101
|
+
- lib/models/seating/plan.rb
|
102
|
+
- lib/models/tickets/band.rb
|
103
|
+
- lib/models/tickets/price.rb
|
104
|
+
- lib/models/tickets/price_list.rb
|
105
|
+
- lib/models/tickets/type.rb
|
106
|
+
- lib/spektrix.rb
|
107
|
+
- lib/spektrix/base.rb
|
108
|
+
- lib/spektrix/deep_symbolize.rb
|
109
|
+
- lib/spektrix/response_parser.rb
|
110
|
+
- lib/spektrix/version.rb
|
111
|
+
- spektrix.gemspec
|
112
|
+
homepage: https://github.com/errorstudio/spektrix-ruby
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.4.5.1
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: A client library for the Spektrix ticketing system
|
136
|
+
test_files: []
|