red_cap 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93ba101bfd82c80f76b3ea87d88426a3e93aa82c
4
- data.tar.gz: d7a25e016f5cb1eec633eae2a98c186da63bad95
3
+ metadata.gz: 23e77e89b7534b408882b97f3a0f2ef6481bd48d
4
+ data.tar.gz: 100d5e1c4e9c069e6c8b8ffe4d51de9caad67015
5
5
  SHA512:
6
- metadata.gz: c000536384e11f231e39e6ecdad4c658e7c94d7969b17547921629ade46c5ec9ccf00c7ade80eab2aa521e9794cbf362aefab1c418e28d0693ecfde815a8dbde
7
- data.tar.gz: cb9bce3352cb01bd0342a9b2479fb432783187400f4426456104b6929a0ba536473108eef6f36db6a4ca8fdf9e86d0cb65360ff4f9b383ab1c31b92a058ca848
6
+ metadata.gz: 3cea82c792788f6e28ddc5e67931fd2c8d3157bb54fef4adb8b4b0de2d9bce70eb07fe6e94c8fa8e360ebe4724f9950043ef00cf3c0ae3090191f00c7c58d20d
7
+ data.tar.gz: cfe34f23aeb1e38667633f13b831556c423adc5b7b7b5512fd4f788d9fd20ba048b1d035c96b792c1c51d6072627312fa2f18f7df85697e357b0704c8607eedc
@@ -40,11 +40,15 @@ module REDCap
40
40
 
41
41
  def base_request options
42
42
  connection = Faraday.new(url: @url)
43
- connection.options.open_timeout = 300
44
- connection.options.timeout = 300
45
- connection.post(nil, options.reverse_merge({
43
+ response = connection.post(nil, options.reverse_merge({
46
44
  token: @token,
47
45
  }))
46
+ if error_message = response.body[/<error>(.+?)<\/error>/, 1]
47
+ raise Error.new(error_message)
48
+ end
49
+ response
48
50
  end
51
+
52
+ class Error < StandardError; end
49
53
  end
50
54
  end
@@ -1,3 +1,3 @@
1
1
  module REDCap
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
data/red_cap.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "faraday"
25
25
  spec.add_dependency "activesupport"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.16"
28
- spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "bundler"
28
+ spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "rspec"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red_cap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-26 00:00:00.000000000 Z
11
+ date: 2019-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -42,44 +42,44 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '0'
83
83
  description: Library for connecting to REDCap and parsing forms and data
84
84
  email:
85
85
  - micah@botandrose.com
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.4.6
127
+ rubygems_version: 2.6.14
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Library for connecting to REDCap and parsing forms and data