advantage_quickbase 0.9.6 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/quickbase.rb +21 -11
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffb814a2f8128d11e1c377eee049ee2761783dad
4
- data.tar.gz: d6a7656eb8cbf6c6f1b908fa98f4946759431dee
3
+ metadata.gz: 79b67daa346ab6c3025a085e8afdde32560d0411
4
+ data.tar.gz: 0dd4e8247c219b4fe5acfbff0b4b8325bd76307b
5
5
  SHA512:
6
- metadata.gz: d3927f43d45916662943ba6e96607986a52314ddd086e3dfbac94144e41e8c5b673ae4f70380ed5560a18d74e2a9f6fff09addd239a6340993a9bc4a40095f73
7
- data.tar.gz: 04ce27363b61b37d58d925b24f01279b8c3a574b68f78d3157e6f0fd89f769f12c4cac59d3ba1235fbb0f6e38fd00bab2171776df45585448486faec6a1a2cc2
6
+ metadata.gz: ed0e291916d58029d2c23f5d687aad31b37ec0cb8dca09c2cfd6131e6bcf925be980ecb276aafe0198696524e0e2b35b4a2be75ffac4b8661cee6fab3d1efe0f
7
+ data.tar.gz: 38b49993d2972f2890a736ab24736aae3e12a67a18e1af0a7c9159cd55e146ed95bec159922b91883d0633edf34c533afaf05a378b039b529249dc8900a691e7
data/lib/quickbase.rb CHANGED
@@ -10,12 +10,12 @@ require_relative 'table'
10
10
  module AdvantageQuickbase
11
11
  class API
12
12
 
13
- attr_accessor :ticket, :app_token
13
+ attr_accessor :ticket, :app_token, :user_token
14
14
 
15
15
  include User
16
16
  include Table
17
17
 
18
- def initialize( domain, username, password, app_token=nil, ticket=nil)
18
+ def initialize( domain, username, password, app_token=nil, ticket=nil, user_token=nil)
19
19
  @domain = domain
20
20
  @app_token = app_token if app_token
21
21
 
@@ -25,9 +25,13 @@ module AdvantageQuickbase
25
25
  password: password,
26
26
  apptoken: app_token
27
27
  }
28
- else #authenticate with existing ticket
28
+ elsif ticket #authenticate with existing ticket
29
29
  @ticket = ticket if ticket
30
30
 
31
+ data = {}
32
+ elsif user_token
33
+ @user_token = user_token
34
+
31
35
  data = {}
32
36
  end
33
37
 
@@ -44,11 +48,13 @@ module AdvantageQuickbase
44
48
  result = @http.post( url, request_xml, headers )
45
49
  parsed_result = parse_xml( result.body )
46
50
 
47
- ticket = get_tag_value( parsed_result, :ticket )
48
- if ticket
49
- @ticket = ticket
50
- else
51
- raise "Connection Failed\n\n#{result.body}"
51
+ if !@user_token
52
+ ticket = get_tag_value( parsed_result, :ticket )
53
+ if ticket
54
+ @ticket = ticket
55
+ else
56
+ raise "Connection Failed\n\n#{result.body}"
57
+ end
52
58
  end
53
59
  end
54
60
 
@@ -372,8 +378,13 @@ module AdvantageQuickbase
372
378
  end
373
379
 
374
380
  def ticket_and_token
375
- "<ticket>#{@ticket}</ticket>" +
376
- "<apptoken>#{@app_token}</apptoken>"
381
+ if @user_token
382
+ "<usertoken>#{@user_token}</usertoken>" +
383
+ "<apptoken>#{@app_token}</apptoken>"
384
+ else
385
+ "<ticket>#{@ticket}</ticket>" +
386
+ "<apptoken>#{@app_token}</apptoken>"
387
+ end
377
388
  end
378
389
 
379
390
  def parse_xml( xml )
@@ -414,7 +425,6 @@ module AdvantageQuickbase
414
425
  url = build_request_url( api_call, db_id )
415
426
  headers = build_request_headers( api_call, request_xml )
416
427
  result = @http.post( url, request_xml, headers )
417
- puts result
418
428
 
419
429
  xml_result = parse_xml( result.body )
420
430
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advantage_quickbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Roux
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Fast, concise implementation of select Quickbase API functions
@@ -43,17 +43,17 @@ require_paths:
43
43
  - lib
44
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
55
  rubyforge_project:
56
- rubygems_version: 2.4.6
56
+ rubygems_version: 2.2.2
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Quickbase API gem