gecko-ruby 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rubocop.yml +9 -0
  4. data/.travis.yml +5 -0
  5. data/CHANGELOG.md +41 -0
  6. data/CONTRIBUTING.md +0 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +144 -0
  10. data/Rakefile +19 -0
  11. data/gecko-ruby.gemspec +34 -0
  12. data/generate.thor +81 -0
  13. data/lib/gecko-ruby.rb +1 -0
  14. data/lib/gecko.rb +31 -0
  15. data/lib/gecko/client.rb +132 -0
  16. data/lib/gecko/helpers/association_helper.rb +69 -0
  17. data/lib/gecko/helpers/inspection_helper.rb +51 -0
  18. data/lib/gecko/helpers/record_helper.rb +29 -0
  19. data/lib/gecko/helpers/serialization_helper.rb +61 -0
  20. data/lib/gecko/helpers/validation_helper.rb +91 -0
  21. data/lib/gecko/record/account.rb +66 -0
  22. data/lib/gecko/record/address.rb +33 -0
  23. data/lib/gecko/record/base.rb +66 -0
  24. data/lib/gecko/record/base_adapter.rb +365 -0
  25. data/lib/gecko/record/company.rb +41 -0
  26. data/lib/gecko/record/contact.rb +25 -0
  27. data/lib/gecko/record/currency.rb +23 -0
  28. data/lib/gecko/record/exceptions.rb +15 -0
  29. data/lib/gecko/record/fulfillment.rb +42 -0
  30. data/lib/gecko/record/fulfillment_line_item.rb +26 -0
  31. data/lib/gecko/record/image.rb +38 -0
  32. data/lib/gecko/record/invoice.rb +29 -0
  33. data/lib/gecko/record/invoice_line_item.rb +18 -0
  34. data/lib/gecko/record/location.rb +23 -0
  35. data/lib/gecko/record/order.rb +50 -0
  36. data/lib/gecko/record/order_line_item.rb +35 -0
  37. data/lib/gecko/record/product.rb +27 -0
  38. data/lib/gecko/record/purchase_order.rb +43 -0
  39. data/lib/gecko/record/purchase_order_line_item.rb +29 -0
  40. data/lib/gecko/record/tax_type.rb +21 -0
  41. data/lib/gecko/record/user.rb +44 -0
  42. data/lib/gecko/record/variant.rb +96 -0
  43. data/lib/gecko/version.rb +3 -0
  44. data/test/client_test.rb +29 -0
  45. data/test/fixtures/vcr_cassettes/accounts.yml +57 -0
  46. data/test/fixtures/vcr_cassettes/accounts_current.yml +57 -0
  47. data/test/fixtures/vcr_cassettes/addresses.yml +68 -0
  48. data/test/fixtures/vcr_cassettes/addresses_count.yml +58 -0
  49. data/test/fixtures/vcr_cassettes/companies.yml +62 -0
  50. data/test/fixtures/vcr_cassettes/companies_count.yml +58 -0
  51. data/test/fixtures/vcr_cassettes/contacts.yml +60 -0
  52. data/test/fixtures/vcr_cassettes/contacts_count.yml +58 -0
  53. data/test/fixtures/vcr_cassettes/currencies.yml +62 -0
  54. data/test/fixtures/vcr_cassettes/currencies_count.yml +58 -0
  55. data/test/fixtures/vcr_cassettes/fulfillments.yml +59 -0
  56. data/test/fixtures/vcr_cassettes/fulfillments_count.yml +58 -0
  57. data/test/fixtures/vcr_cassettes/images.yml +59 -0
  58. data/test/fixtures/vcr_cassettes/images_count.yml +58 -0
  59. data/test/fixtures/vcr_cassettes/invoice_line_items.yml +63 -0
  60. data/test/fixtures/vcr_cassettes/invoice_line_items_count.yml +62 -0
  61. data/test/fixtures/vcr_cassettes/invoices.yml +63 -0
  62. data/test/fixtures/vcr_cassettes/invoices_count.yml +62 -0
  63. data/test/fixtures/vcr_cassettes/locations.yml +65 -0
  64. data/test/fixtures/vcr_cassettes/locations_count.yml +58 -0
  65. data/test/fixtures/vcr_cassettes/order_line_items.yml +63 -0
  66. data/test/fixtures/vcr_cassettes/order_line_items_count.yml +62 -0
  67. data/test/fixtures/vcr_cassettes/orders.yml +62 -0
  68. data/test/fixtures/vcr_cassettes/orders_count.yml +58 -0
  69. data/test/fixtures/vcr_cassettes/products.yml +79 -0
  70. data/test/fixtures/vcr_cassettes/products_count.yml +58 -0
  71. data/test/fixtures/vcr_cassettes/products_new_invalid.yml +54 -0
  72. data/test/fixtures/vcr_cassettes/products_new_valid.yml +58 -0
  73. data/test/fixtures/vcr_cassettes/purchase_order_line_items.yml +64 -0
  74. data/test/fixtures/vcr_cassettes/purchase_order_line_items_count.yml +62 -0
  75. data/test/fixtures/vcr_cassettes/purchase_orders.yml +63 -0
  76. data/test/fixtures/vcr_cassettes/purchase_orders_count.yml +62 -0
  77. data/test/fixtures/vcr_cassettes/tax_types.yml +74 -0
  78. data/test/fixtures/vcr_cassettes/tax_types_count.yml +62 -0
  79. data/test/fixtures/vcr_cassettes/users.yml +60 -0
  80. data/test/fixtures/vcr_cassettes/users_count.yml +58 -0
  81. data/test/fixtures/vcr_cassettes/users_current.yml +54 -0
  82. data/test/fixtures/vcr_cassettes/variants.yml +60 -0
  83. data/test/fixtures/vcr_cassettes/variants_count.yml +58 -0
  84. data/test/gecko_test.rb +7 -0
  85. data/test/helpers/association_helper_test.rb +56 -0
  86. data/test/helpers/inspection_helper_test.rb +27 -0
  87. data/test/helpers/serialization_helper_test.rb +30 -0
  88. data/test/helpers/validation_helper_test.rb +24 -0
  89. data/test/record/account_adapter_test.rb +43 -0
  90. data/test/record/address_adapter_test.rb +14 -0
  91. data/test/record/address_test.rb +18 -0
  92. data/test/record/company_adapter_test.rb +14 -0
  93. data/test/record/company_test.rb +18 -0
  94. data/test/record/contact_adapter_test.rb +14 -0
  95. data/test/record/contact_test.rb +18 -0
  96. data/test/record/currency_adapter_test.rb +14 -0
  97. data/test/record/currency_test.rb +18 -0
  98. data/test/record/fulfillment_adapter_test.rb +24 -0
  99. data/test/record/fulfillment_line_item_adapter_test.rb +21 -0
  100. data/test/record/fulfillment_line_item_test.rb +18 -0
  101. data/test/record/fulfillment_test.rb +27 -0
  102. data/test/record/image_adapter_test.rb +14 -0
  103. data/test/record/image_test.rb +25 -0
  104. data/test/record/invoice_adapter_test.rb +14 -0
  105. data/test/record/invoice_line_item_adapter_test.rb +20 -0
  106. data/test/record/invoice_line_item_test.rb +18 -0
  107. data/test/record/invoice_test.rb +18 -0
  108. data/test/record/location_adapter_test.rb +14 -0
  109. data/test/record/location_test.rb +18 -0
  110. data/test/record/order_adapter_test.rb +14 -0
  111. data/test/record/order_line_item_adapter_test.rb +14 -0
  112. data/test/record/order_line_item_test.rb +18 -0
  113. data/test/record/order_test.rb +18 -0
  114. data/test/record/product_adapter_test.rb +32 -0
  115. data/test/record/product_test.rb +18 -0
  116. data/test/record/purchase_order_adapter_test.rb +14 -0
  117. data/test/record/purchase_order_line_item_adapter_test.rb +14 -0
  118. data/test/record/purchase_order_line_item_test.rb +18 -0
  119. data/test/record/purchase_order_test.rb +18 -0
  120. data/test/record/tax_type_adapter_test.rb +14 -0
  121. data/test/record/tax_type_test.rb +18 -0
  122. data/test/record/user_adapter_test.rb +27 -0
  123. data/test/record/user_test.rb +18 -0
  124. data/test/record/variant_adapter_test.rb +14 -0
  125. data/test/record/variant_test.rb +44 -0
  126. data/test/support/let.rb +10 -0
  127. data/test/support/shared_adapter_examples.rb +159 -0
  128. data/test/support/shared_record_examples.rb +21 -0
  129. data/test/support/testing_adapter.rb +11 -0
  130. data/test/support/vcr_support.rb +7 -0
  131. data/test/test_helper.rb +21 -0
  132. metadata +430 -0
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class Gecko::UserTest < Minitest::Test
4
+ include VCRHelper
5
+ include SharedRecordExamples
6
+
7
+ let(:plural_name) { 'users' }
8
+ let(:record_class) { Gecko::Record::User }
9
+
10
+ def setup
11
+ @json = load_vcr_hash('users', 'users').first
12
+ @record = record_class.new(client, @json)
13
+ end
14
+
15
+ def test_initializes_record
16
+ assert_instance_of(Gecko::Record::User, @record)
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class Gecko::Record::VariantAdapterTest < Minitest::Test
4
+ include TestingAdapter
5
+ include SharedAdapterExamples
6
+
7
+ let(:adapter) { @client.Variant }
8
+ let(:plural_name) { 'variants' }
9
+ let(:record_class) { Gecko::Record::Variant }
10
+
11
+ def test_initializes_adapter
12
+ assert_instance_of(Gecko::Record::VariantAdapter, @client.Variant)
13
+ end
14
+ end
@@ -0,0 +1,44 @@
1
+ require 'test_helper'
2
+
3
+ class Gecko::VariantTest < Minitest::Test
4
+ include VCRHelper
5
+ include SharedRecordExamples
6
+
7
+ let(:plural_name) { 'variants' }
8
+ let(:record_class) { Gecko::Record::Variant }
9
+
10
+ def setup
11
+ @json = load_vcr_hash('variants', 'variants').first
12
+ @record = record_class.new(client, @json)
13
+ end
14
+
15
+ def test_initializes_record
16
+ assert_instance_of(Gecko::Record::Variant, @record)
17
+ end
18
+
19
+ def test_blank_display_name
20
+ record = record_class.new(client, {})
21
+ assert_equal(record.display_name, "")
22
+ end
23
+
24
+ def test_variant_prices
25
+ json = {variant_prices: [{price_list_id: "buy", value: "12.50"}, {price_list_id: 123, value: "14.00"}]}
26
+ variant_prices = record_class.new(client, json).variant_prices
27
+ assert_instance_of(Gecko::Record::Variant::VariantPrice, variant_prices.first)
28
+ assert_equal(variant_prices[0].price_list_id, "buy")
29
+ assert_equal(variant_prices[1].price_list_id, "123")
30
+ assert_equal(variant_prices[1].value, 14.0)
31
+ end
32
+
33
+ def test_variant_locations
34
+ json = {locations: [
35
+ {location_id: 1, stock_on_hand: "12.50", committed_stock: "0", bin_location: "AB-123"},
36
+ ]}
37
+ locations = record_class.new(client, json).locations
38
+ assert_instance_of(Gecko::Record::Variant::VariantLocation, locations.first)
39
+ assert_equal(1, locations[0].location_id)
40
+ assert_equal(12.5, locations[0].stock_on_hand)
41
+ assert_equal(0, locations[0].committed_stock)
42
+ assert_equal("AB-123", locations[0].bin_location)
43
+ end
44
+ end
@@ -0,0 +1,10 @@
1
+ module Minitest
2
+ module Let
3
+ def let(name, &block)
4
+ define_method(name) do
5
+ @_memoized ||= {}
6
+ @_memoized.fetch(name) { |k| @_memoized[k] = instance_eval(&block) }
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,159 @@
1
+ # Shared tests for Gecko::Record Adapters
2
+ # requires definition of several variables
3
+ # - adapter
4
+ # - plural_name
5
+ # - record_class
6
+
7
+ require 'json'
8
+ module SharedAdapterExamples
9
+ def test_adapter_all
10
+ VCR.use_cassette(plural_name) do
11
+ collection = adapter.where(limit: 5)
12
+ assert_instance_of(Array, collection)
13
+ assert_equal(5, collection.size)
14
+ assert_instance_of(record_class, collection[0])
15
+ end
16
+ end
17
+
18
+ def test_adapter_count
19
+ VCR.use_cassette(plural_name + '_count') do
20
+ assert(adapter.count > 10)
21
+ end
22
+ end
23
+
24
+ def test_adapter_uses_identity_map
25
+ VCR.use_cassette(plural_name) do
26
+ collection = adapter.where(limit: 5)
27
+ assert_equal(collection.first, adapter.find(collection.first.id))
28
+ end
29
+ end
30
+
31
+ def test_record_for_id
32
+ mock_record = Object.new
33
+ adapter.instance_variable_set(:@identity_map, 12 => mock_record)
34
+ assert_equal(mock_record, adapter.record_for_id(12))
35
+ end
36
+
37
+ def test_record_for_id_miss
38
+ ex = assert_raises Gecko::Record::RecordNotInIdentityMap do
39
+ adapter.record_for_id(12_345)
40
+ end
41
+ assert_equal("Couldn't find #{record_class.name} with id=12345", ex.message)
42
+ end
43
+
44
+ def test_has_record_for_id
45
+ mock_record = Object.new
46
+ adapter.instance_variable_set(:@identity_map, {12 => mock_record})
47
+ assert adapter.has_record_for_id?(12)
48
+ assert !adapter.has_record_for_id?(12345)
49
+ end
50
+
51
+ def test_fetch
52
+ request_stub = stub_request(:get, /#{plural_name}\/\d+/)
53
+ .to_return({
54
+ headers: {"Content-Type" => "application/json"},
55
+ body: JSON.dump({plural_name.singularize => {id: 12345}})
56
+ })
57
+ record = adapter.fetch(12345)
58
+ assert_equal(12345, record.id)
59
+ assert_requested(request_stub)
60
+ end
61
+
62
+ def test_fetch_miss
63
+ request_stub = stub_request(:get, /#{plural_name}\/\d+/)
64
+ .to_return({
65
+ status: 404,
66
+ headers: {"Content-Type" => "application/json"},
67
+ body: JSON.dump({
68
+ type: "Not Found",
69
+ message: "Couldn't find #{plural_name.singularize} with id 12345"
70
+ })
71
+ })
72
+ exception = assert_raises Gecko::Record::RecordNotFound do
73
+ adapter.fetch(12345)
74
+ end
75
+
76
+ assert_equal("Couldn't find #{record_class.name} with id=12345", exception.message)
77
+ end
78
+
79
+ def test_find_without_id
80
+ exception = assert_raises Gecko::Record::RecordNotFound do
81
+ adapter.find(nil)
82
+ end
83
+
84
+ assert_equal("Couldn't find #{record_class.name} without an ID", exception.message)
85
+ end
86
+
87
+ def test_build
88
+ record = adapter.build
89
+ assert_instance_of(record_class, record)
90
+ assert !record.persisted?
91
+ end
92
+
93
+ def test_build_with_attributes
94
+ record = adapter.build(random_attribute => "Max Power")
95
+ assert_equal(record.attributes[random_attribute], "Max Power")
96
+ assert !record.persisted?
97
+ end
98
+
99
+ def test_saving_new_record
100
+ record = adapter.build
101
+ mock_api_request(record,
102
+ [:post, plural_name],
103
+ [200, {plural_name.singularize => {id: 123}}]
104
+ )
105
+ adapter.save(record)
106
+ assert_equal(record.id, 123)
107
+ assert(record.valid?)
108
+ end
109
+
110
+ def test_saving_new_invalid_record
111
+ record = adapter.build
112
+ mock_api_request(record,
113
+ [:post, plural_name],
114
+ [422, {"errors" => {title: ["can not be bounced"]}}]
115
+ )
116
+ adapter.save(record)
117
+ assert_nil(record.id)
118
+ assert(!record.valid?)
119
+ end
120
+
121
+ def test_saving_existing_record
122
+ record = existing_record
123
+ mock_api_request(record,
124
+ [:put, "#{plural_name}/#{record.id}"],
125
+ [204, '']
126
+ )
127
+ adapter.save(record)
128
+ assert(record.valid?)
129
+ end
130
+
131
+ def test_saving_existing_invalid_record
132
+ record = existing_record
133
+ mock_api_request(record,
134
+ [:put, "#{plural_name}/#{record.id}"],
135
+ [422, {"errors" => {title: ["can not be bounced"]}}]
136
+ )
137
+ adapter.save(record)
138
+ assert(!record.valid?)
139
+ assert(record.errors[:title].any?)
140
+ end
141
+
142
+ private
143
+ def mock_api_request(record, request, response)
144
+ mock_token = mock
145
+ mock_response = mock(status: response[0], parsed: response[1])
146
+ mock_token.expects(:request)
147
+ .with(request[0], request[1], body: record.as_json, raise_errors: false)
148
+ .returns(mock_response)
149
+ adapter.client.access_token = mock_token
150
+ end
151
+
152
+ def existing_record
153
+ record_class.new(@client, id: 123)
154
+ end
155
+
156
+ def random_attribute
157
+ @rattr ||= record_class.attribute_set.find { |att| att.type == Axiom::Types::String }.name
158
+ end
159
+ end
@@ -0,0 +1,21 @@
1
+ module SharedRecordExamples
2
+ def test_sets_up_id
3
+ assert_instance_of(Fixnum, @record.id)
4
+ assert_equal(@json['id'], @record.id)
5
+ end
6
+
7
+ def test_persisted?
8
+ assert record_class.new(client, id: 123).persisted?
9
+ assert !record_class.new(client, {}).persisted?
10
+ assert !record_class.new(client).persisted?
11
+ end
12
+
13
+ def test_saving
14
+ @client.adapter_for(record_class.demodulized_name).expects(:save).with(@record)
15
+ @record.save
16
+ end
17
+
18
+ def client
19
+ @client ||= Gecko::Client.new('ABC', 'DEF')
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ module TestingAdapter
2
+ require 'dotenv'
3
+ def setup
4
+ Dotenv.load
5
+ @client = Gecko::Client.new(ENV["OAUTH_ID"], ENV["OAUTH_SECRET"], {
6
+ site: 'http://api.lvh.me:3000',
7
+ authorize_url: 'http://go.lvh.me:3000/oauth/authorize'
8
+ })
9
+ @client.authorize_from_existing(ENV["ACCESS_TOKEN"], ENV["REFRESH_TOKEN"], Time.at(ENV["EXPIRES_AT"].to_i))
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module VCRHelper
2
+ def load_vcr_hash(fixture, key)
3
+ yaml = YAML.load_file(VCR.configuration.cassette_library_dir + "/#{fixture}.yml")
4
+ response = VCR::HTTPInteraction.from_hash(yaml["http_interactions"][0]).response.decompress.body
5
+ JSON.parse(response)[key]
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ require 'gecko'
2
+ require 'minitest/autorun'
3
+ require 'minitest/pride'
4
+ require 'mocha/mini_test'
5
+ require 'vcr'
6
+ require 'webmock/minitest'
7
+
8
+ require 'support/let'
9
+ require 'support/shared_adapter_examples'
10
+ require 'support/shared_record_examples'
11
+ require 'support/testing_adapter'
12
+ require 'support/vcr_support'
13
+
14
+ VCR.configure do |c|
15
+ c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
16
+ c.hook_into :webmock
17
+ end
18
+
19
+ class Minitest::Test
20
+ extend Minitest::Let
21
+ end
metadata ADDED
@@ -0,0 +1,430 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gecko-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Bradley Priest
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mocha
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: dotenv
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: thor
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: oauth2
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: virtus
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: activesupport
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: A Ruby interface to the TradeGecko API.
182
+ email:
183
+ - bradley@tradegecko.com
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files: []
187
+ files:
188
+ - ".gitignore"
189
+ - ".rubocop.yml"
190
+ - ".travis.yml"
191
+ - CHANGELOG.md
192
+ - CONTRIBUTING.md
193
+ - Gemfile
194
+ - LICENSE.txt
195
+ - README.md
196
+ - Rakefile
197
+ - gecko-ruby.gemspec
198
+ - generate.thor
199
+ - lib/gecko-ruby.rb
200
+ - lib/gecko.rb
201
+ - lib/gecko/client.rb
202
+ - lib/gecko/helpers/association_helper.rb
203
+ - lib/gecko/helpers/inspection_helper.rb
204
+ - lib/gecko/helpers/record_helper.rb
205
+ - lib/gecko/helpers/serialization_helper.rb
206
+ - lib/gecko/helpers/validation_helper.rb
207
+ - lib/gecko/record/account.rb
208
+ - lib/gecko/record/address.rb
209
+ - lib/gecko/record/base.rb
210
+ - lib/gecko/record/base_adapter.rb
211
+ - lib/gecko/record/company.rb
212
+ - lib/gecko/record/contact.rb
213
+ - lib/gecko/record/currency.rb
214
+ - lib/gecko/record/exceptions.rb
215
+ - lib/gecko/record/fulfillment.rb
216
+ - lib/gecko/record/fulfillment_line_item.rb
217
+ - lib/gecko/record/image.rb
218
+ - lib/gecko/record/invoice.rb
219
+ - lib/gecko/record/invoice_line_item.rb
220
+ - lib/gecko/record/location.rb
221
+ - lib/gecko/record/order.rb
222
+ - lib/gecko/record/order_line_item.rb
223
+ - lib/gecko/record/product.rb
224
+ - lib/gecko/record/purchase_order.rb
225
+ - lib/gecko/record/purchase_order_line_item.rb
226
+ - lib/gecko/record/tax_type.rb
227
+ - lib/gecko/record/user.rb
228
+ - lib/gecko/record/variant.rb
229
+ - lib/gecko/version.rb
230
+ - test/client_test.rb
231
+ - test/fixtures/vcr_cassettes/accounts.yml
232
+ - test/fixtures/vcr_cassettes/accounts_current.yml
233
+ - test/fixtures/vcr_cassettes/addresses.yml
234
+ - test/fixtures/vcr_cassettes/addresses_count.yml
235
+ - test/fixtures/vcr_cassettes/companies.yml
236
+ - test/fixtures/vcr_cassettes/companies_count.yml
237
+ - test/fixtures/vcr_cassettes/contacts.yml
238
+ - test/fixtures/vcr_cassettes/contacts_count.yml
239
+ - test/fixtures/vcr_cassettes/currencies.yml
240
+ - test/fixtures/vcr_cassettes/currencies_count.yml
241
+ - test/fixtures/vcr_cassettes/fulfillments.yml
242
+ - test/fixtures/vcr_cassettes/fulfillments_count.yml
243
+ - test/fixtures/vcr_cassettes/images.yml
244
+ - test/fixtures/vcr_cassettes/images_count.yml
245
+ - test/fixtures/vcr_cassettes/invoice_line_items.yml
246
+ - test/fixtures/vcr_cassettes/invoice_line_items_count.yml
247
+ - test/fixtures/vcr_cassettes/invoices.yml
248
+ - test/fixtures/vcr_cassettes/invoices_count.yml
249
+ - test/fixtures/vcr_cassettes/locations.yml
250
+ - test/fixtures/vcr_cassettes/locations_count.yml
251
+ - test/fixtures/vcr_cassettes/order_line_items.yml
252
+ - test/fixtures/vcr_cassettes/order_line_items_count.yml
253
+ - test/fixtures/vcr_cassettes/orders.yml
254
+ - test/fixtures/vcr_cassettes/orders_count.yml
255
+ - test/fixtures/vcr_cassettes/products.yml
256
+ - test/fixtures/vcr_cassettes/products_count.yml
257
+ - test/fixtures/vcr_cassettes/products_new_invalid.yml
258
+ - test/fixtures/vcr_cassettes/products_new_valid.yml
259
+ - test/fixtures/vcr_cassettes/purchase_order_line_items.yml
260
+ - test/fixtures/vcr_cassettes/purchase_order_line_items_count.yml
261
+ - test/fixtures/vcr_cassettes/purchase_orders.yml
262
+ - test/fixtures/vcr_cassettes/purchase_orders_count.yml
263
+ - test/fixtures/vcr_cassettes/tax_types.yml
264
+ - test/fixtures/vcr_cassettes/tax_types_count.yml
265
+ - test/fixtures/vcr_cassettes/users.yml
266
+ - test/fixtures/vcr_cassettes/users_count.yml
267
+ - test/fixtures/vcr_cassettes/users_current.yml
268
+ - test/fixtures/vcr_cassettes/variants.yml
269
+ - test/fixtures/vcr_cassettes/variants_count.yml
270
+ - test/gecko_test.rb
271
+ - test/helpers/association_helper_test.rb
272
+ - test/helpers/inspection_helper_test.rb
273
+ - test/helpers/serialization_helper_test.rb
274
+ - test/helpers/validation_helper_test.rb
275
+ - test/record/account_adapter_test.rb
276
+ - test/record/address_adapter_test.rb
277
+ - test/record/address_test.rb
278
+ - test/record/company_adapter_test.rb
279
+ - test/record/company_test.rb
280
+ - test/record/contact_adapter_test.rb
281
+ - test/record/contact_test.rb
282
+ - test/record/currency_adapter_test.rb
283
+ - test/record/currency_test.rb
284
+ - test/record/fulfillment_adapter_test.rb
285
+ - test/record/fulfillment_line_item_adapter_test.rb
286
+ - test/record/fulfillment_line_item_test.rb
287
+ - test/record/fulfillment_test.rb
288
+ - test/record/image_adapter_test.rb
289
+ - test/record/image_test.rb
290
+ - test/record/invoice_adapter_test.rb
291
+ - test/record/invoice_line_item_adapter_test.rb
292
+ - test/record/invoice_line_item_test.rb
293
+ - test/record/invoice_test.rb
294
+ - test/record/location_adapter_test.rb
295
+ - test/record/location_test.rb
296
+ - test/record/order_adapter_test.rb
297
+ - test/record/order_line_item_adapter_test.rb
298
+ - test/record/order_line_item_test.rb
299
+ - test/record/order_test.rb
300
+ - test/record/product_adapter_test.rb
301
+ - test/record/product_test.rb
302
+ - test/record/purchase_order_adapter_test.rb
303
+ - test/record/purchase_order_line_item_adapter_test.rb
304
+ - test/record/purchase_order_line_item_test.rb
305
+ - test/record/purchase_order_test.rb
306
+ - test/record/tax_type_adapter_test.rb
307
+ - test/record/tax_type_test.rb
308
+ - test/record/user_adapter_test.rb
309
+ - test/record/user_test.rb
310
+ - test/record/variant_adapter_test.rb
311
+ - test/record/variant_test.rb
312
+ - test/support/let.rb
313
+ - test/support/shared_adapter_examples.rb
314
+ - test/support/shared_record_examples.rb
315
+ - test/support/testing_adapter.rb
316
+ - test/support/vcr_support.rb
317
+ - test/test_helper.rb
318
+ homepage: https://github.com/tradegecko/gecko/
319
+ licenses:
320
+ - MIT
321
+ metadata: {}
322
+ post_install_message:
323
+ rdoc_options: []
324
+ require_paths:
325
+ - lib
326
+ required_ruby_version: !ruby/object:Gem::Requirement
327
+ requirements:
328
+ - - ">="
329
+ - !ruby/object:Gem::Version
330
+ version: '0'
331
+ required_rubygems_version: !ruby/object:Gem::Requirement
332
+ requirements:
333
+ - - ">="
334
+ - !ruby/object:Gem::Version
335
+ version: '0'
336
+ requirements: []
337
+ rubyforge_project:
338
+ rubygems_version: 2.4.5
339
+ signing_key:
340
+ specification_version: 4
341
+ summary: A Ruby interface to the TradeGecko API.
342
+ test_files:
343
+ - test/client_test.rb
344
+ - test/fixtures/vcr_cassettes/accounts.yml
345
+ - test/fixtures/vcr_cassettes/accounts_current.yml
346
+ - test/fixtures/vcr_cassettes/addresses.yml
347
+ - test/fixtures/vcr_cassettes/addresses_count.yml
348
+ - test/fixtures/vcr_cassettes/companies.yml
349
+ - test/fixtures/vcr_cassettes/companies_count.yml
350
+ - test/fixtures/vcr_cassettes/contacts.yml
351
+ - test/fixtures/vcr_cassettes/contacts_count.yml
352
+ - test/fixtures/vcr_cassettes/currencies.yml
353
+ - test/fixtures/vcr_cassettes/currencies_count.yml
354
+ - test/fixtures/vcr_cassettes/fulfillments.yml
355
+ - test/fixtures/vcr_cassettes/fulfillments_count.yml
356
+ - test/fixtures/vcr_cassettes/images.yml
357
+ - test/fixtures/vcr_cassettes/images_count.yml
358
+ - test/fixtures/vcr_cassettes/invoice_line_items.yml
359
+ - test/fixtures/vcr_cassettes/invoice_line_items_count.yml
360
+ - test/fixtures/vcr_cassettes/invoices.yml
361
+ - test/fixtures/vcr_cassettes/invoices_count.yml
362
+ - test/fixtures/vcr_cassettes/locations.yml
363
+ - test/fixtures/vcr_cassettes/locations_count.yml
364
+ - test/fixtures/vcr_cassettes/order_line_items.yml
365
+ - test/fixtures/vcr_cassettes/order_line_items_count.yml
366
+ - test/fixtures/vcr_cassettes/orders.yml
367
+ - test/fixtures/vcr_cassettes/orders_count.yml
368
+ - test/fixtures/vcr_cassettes/products.yml
369
+ - test/fixtures/vcr_cassettes/products_count.yml
370
+ - test/fixtures/vcr_cassettes/products_new_invalid.yml
371
+ - test/fixtures/vcr_cassettes/products_new_valid.yml
372
+ - test/fixtures/vcr_cassettes/purchase_order_line_items.yml
373
+ - test/fixtures/vcr_cassettes/purchase_order_line_items_count.yml
374
+ - test/fixtures/vcr_cassettes/purchase_orders.yml
375
+ - test/fixtures/vcr_cassettes/purchase_orders_count.yml
376
+ - test/fixtures/vcr_cassettes/tax_types.yml
377
+ - test/fixtures/vcr_cassettes/tax_types_count.yml
378
+ - test/fixtures/vcr_cassettes/users.yml
379
+ - test/fixtures/vcr_cassettes/users_count.yml
380
+ - test/fixtures/vcr_cassettes/users_current.yml
381
+ - test/fixtures/vcr_cassettes/variants.yml
382
+ - test/fixtures/vcr_cassettes/variants_count.yml
383
+ - test/gecko_test.rb
384
+ - test/helpers/association_helper_test.rb
385
+ - test/helpers/inspection_helper_test.rb
386
+ - test/helpers/serialization_helper_test.rb
387
+ - test/helpers/validation_helper_test.rb
388
+ - test/record/account_adapter_test.rb
389
+ - test/record/address_adapter_test.rb
390
+ - test/record/address_test.rb
391
+ - test/record/company_adapter_test.rb
392
+ - test/record/company_test.rb
393
+ - test/record/contact_adapter_test.rb
394
+ - test/record/contact_test.rb
395
+ - test/record/currency_adapter_test.rb
396
+ - test/record/currency_test.rb
397
+ - test/record/fulfillment_adapter_test.rb
398
+ - test/record/fulfillment_line_item_adapter_test.rb
399
+ - test/record/fulfillment_line_item_test.rb
400
+ - test/record/fulfillment_test.rb
401
+ - test/record/image_adapter_test.rb
402
+ - test/record/image_test.rb
403
+ - test/record/invoice_adapter_test.rb
404
+ - test/record/invoice_line_item_adapter_test.rb
405
+ - test/record/invoice_line_item_test.rb
406
+ - test/record/invoice_test.rb
407
+ - test/record/location_adapter_test.rb
408
+ - test/record/location_test.rb
409
+ - test/record/order_adapter_test.rb
410
+ - test/record/order_line_item_adapter_test.rb
411
+ - test/record/order_line_item_test.rb
412
+ - test/record/order_test.rb
413
+ - test/record/product_adapter_test.rb
414
+ - test/record/product_test.rb
415
+ - test/record/purchase_order_adapter_test.rb
416
+ - test/record/purchase_order_line_item_adapter_test.rb
417
+ - test/record/purchase_order_line_item_test.rb
418
+ - test/record/purchase_order_test.rb
419
+ - test/record/tax_type_adapter_test.rb
420
+ - test/record/tax_type_test.rb
421
+ - test/record/user_adapter_test.rb
422
+ - test/record/user_test.rb
423
+ - test/record/variant_adapter_test.rb
424
+ - test/record/variant_test.rb
425
+ - test/support/let.rb
426
+ - test/support/shared_adapter_examples.rb
427
+ - test/support/shared_record_examples.rb
428
+ - test/support/testing_adapter.rb
429
+ - test/support/vcr_support.rb
430
+ - test/test_helper.rb