opencpu 0.9.2 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b4dd7cd2e25675a883669dcc7b2dff60c3bed910
4
- data.tar.gz: fb2c04876cdf97dc4c0656a5c24fd79718a22ffd
2
+ SHA256:
3
+ metadata.gz: fd4de2214e31540e08f33494e1c3f56898a71952d8569f8e4d348ff8c7762c71
4
+ data.tar.gz: c6fd9fd8bbd284df6e7627125ede6ae9163025bbc4e890844ebb719aec709c8c
5
5
  SHA512:
6
- metadata.gz: f3dcee9fba66c0e432feda4bb27e9b7b39f9453507dc5d26412d74fcfe576891bf09d82b8a0012b0df4d13646a529509248e72735108bcb0168c6ffdc1de9707
7
- data.tar.gz: 490fac6cde42a5a53020c0b87d5029f24a2ee0b648608aed69b67090624a1da0c0c64b530cd41d1ff15cc56b0271b5544be7e92bff86b6b167e07afdf5a32896
6
+ metadata.gz: 66eedb31b53e19cde7d5886ca4ceb9a3bf0c4d755c8072cd47869e9f38f02aa50cd61a2df15bc8739eb580a02542540a30ca4de934f8d1e625a234f6372f9008
7
+ data.tar.gz: b2dfba4531a59de7c81ea4f924e860e3d32e2e13ad6dfaea1836c662530bf31f9eab76172eaae10055c71c874f9a3b0463ee6600a9caa6039abbe75ac5be2fd5
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # OpenCPU gem
2
2
 
3
3
  [![Build Status](https://travis-ci.org/roqua/opencpu.svg?branch=master)](https://travis-ci.org/roqua/opencpu)
4
- [![Build Status](https://circleci.com/gh/roqua/opencpu.svg?style=shield&circle-token=4689df66bef26cd4aff65a4893c25400795b408a)](https://circleci.com/gh/roqua/roqua/tree/master)
4
+ [![CircleCI](https://circleci.com/gh/roqua/opencpu.svg?style=svg&circle-token=4689df66bef26cd4aff65a4893c25400795b408a)](https://circleci.com/gh/roqua/opencpu)
5
5
  [![Code Climate](https://codeclimate.com/github/roqua/opencpu.png)](https://codeclimate.com/github/roqua/opencpu)
6
6
  [![Dependency Status](https://gemnasium.com/roqua/opencpu.svg)](https://gemnasium.com/roqua/opencpu)
7
7
 
@@ -41,7 +41,7 @@ client = OpenCPU.client
41
41
 
42
42
  By default we send data using the json format. This format is efficient and safe, but only supports strings and numeric parameters (see [opencpu page](https://www.opencpu.org/api.html#api-arguments))
43
43
 
44
- If you want to send R code argument, you'll need to specify format: :urlencoded in your request. Note that you need to enclose your string parameters in quotes in that case, since they will be seen as variables otherwise:
44
+ If you want to send R code argument or files, you'll need to specify format: :urlencoded in your request. Note that you need to enclose your string parameters in quotes in that case, since they will be seen as variables otherwise:
45
45
 
46
46
  ```Ruby
47
47
  client.execute :digest, :hmac, data: { key: "'foo'", object: "'bar'" }, format: :urlencoded
data/lib/opencpu.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'httmultiparty'
1
+ require 'httparty'
2
2
  require 'yajl'
3
3
 
4
4
  begin
@@ -1,6 +1,9 @@
1
+ require 'opencpu/errors'
2
+
1
3
  module OpenCPU
2
4
  class Client
3
- include HTTMultiParty
5
+ include Errors
6
+ include HTTParty
4
7
 
5
8
  def initialize
6
9
  self.class.base_uri OpenCPU.configuration.endpoint_url
@@ -64,10 +67,21 @@ module OpenCPU
64
67
  case response.code
65
68
  when 200..201
66
69
  return yield(response)
67
- when 400
68
- fail '400: Bad Request\n' + response.body
69
70
  else
70
- fail "#{response.code}:\n #{response.body}"
71
+ fail error_class_for(response.code), "#{response.code}:\n #{response.body}"
72
+ end
73
+ end
74
+
75
+ def error_class_for(response_code)
76
+ case response_code
77
+ when 403
78
+ AccessDenied
79
+ when 400..499
80
+ BadRequest
81
+ when 500..599
82
+ InternalServerError
83
+ else
84
+ OpenCPUError
71
85
  end
72
86
  end
73
87
 
@@ -80,8 +94,8 @@ module OpenCPU
80
94
  when :json
81
95
  options[:body] = data.to_json if data
82
96
  options[:headers] = {"Content-Type" => 'application/json'}
83
- when :urlencoded
84
- options[:query] = data if data
97
+ else # :urlencoded / :multipart if a file is present.
98
+ options[:body] = data if data
85
99
  end
86
100
 
87
101
  if OpenCPU.configuration.username && OpenCPU.configuration.password
@@ -1,9 +1,9 @@
1
1
  module OpenCPU
2
2
  class UnsupportedFormatError < StandardError; end
3
3
  class ResponseNotAvailableError < StandardError; end
4
-
4
+
5
5
  class DelayedCalculation
6
- include HTTMultiParty
6
+ include HTTParty
7
7
 
8
8
  attr_accessor :location
9
9
  attr_accessor :available_resources
@@ -0,0 +1,8 @@
1
+ module OpenCPU
2
+ module Errors
3
+ class OpenCPUError < StandardError; end
4
+ class BadRequest < OpenCPUError; end
5
+ class InternalServerError < OpenCPUError; end
6
+ class AccessDenied < OpenCPUError; end
7
+ end
8
+ end
@@ -1,6 +1,6 @@
1
1
  module OpenCPU
2
2
  MAJOR = 0
3
- MINOR = 9
3
+ MINOR = 13
4
4
  TINY = 2
5
5
  VERSION = [MAJOR, MINOR, TINY].join('.')
6
6
  end
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://public.opencpu.org/ocpu/library/base/R/identity/json
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"some":"data"}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ response:
13
+ status:
14
+ code: 400
15
+ message: Bad Request
16
+ headers:
17
+ Server:
18
+ - nginx/1.10.0 (Ubuntu)
19
+ Date:
20
+ - Thu, 30 Jun 2016 10:16:58 GMT
21
+ Content-Type:
22
+ - text/plain; charset=utf-8
23
+ Transfer-Encoding:
24
+ - chunked
25
+ Connection:
26
+ - keep-alive
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Access-Control-Expose-Headers:
30
+ - Location, X-ocpu-session, Content-Type, Cache-Control
31
+ Access-Control-Allow-Headers:
32
+ - Origin, Content-Type, Accept, Accept-Encoding, Cache-Control, Authorization
33
+ Access-Control-Allow-Credentials:
34
+ - 'true'
35
+ X-Ocpu-R:
36
+ - R version 3.3.1 (2016-06-21)
37
+ X-Ocpu-Locale:
38
+ - en_US.UTF-8
39
+ X-Ocpu-Time:
40
+ - 2016-06-30 06:16:58 EDT
41
+ X-Ocpu-Version:
42
+ - 1.6.3
43
+ X-Ocpu-Server:
44
+ - rApache
45
+ Vary:
46
+ - Accept-Encoding
47
+ body:
48
+ encoding: UTF-8
49
+ string: |
50
+ unused argument (some = "data")
51
+
52
+ In call:
53
+ identity(some = "data")
54
+ http_version:
55
+ recorded_at: Thu, 30 Jun 2016 10:16:58 GMT
56
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,96 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://public.opencpu.org/ocpu/library/utils/R/read.csv/json
6
+ body:
7
+ encoding: UTF-8
8
+ string: "--------------------------uMeWJC8mkGqpOEXA\r\nContent-Disposition:
9
+ form-data; name=\"file\"; filename=\"test.csv\"\r\nContent-Type: text/csv\r\n\r\n\"head1\",
10
+ \"head2\", \"head3\"\n1, 2, 3\n4, 5, 6\n\r\n--------------------------uMeWJC8mkGqpOEXA--\r\n"
11
+ headers:
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ Content-Type:
19
+ - multipart/form-data; boundary=------------------------uMeWJC8mkGqpOEXA
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Thu, 25 Mar 2021 16:45:28 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '68'
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - __cfduid=ddcca6afafd864d5be3ebf54be87d3fd81616690728; expires=Sat, 24-Apr-21
35
+ 16:45:28 GMT; path=/; domain=.opencpu.org; HttpOnly; SameSite=Lax
36
+ Cache-Control:
37
+ - max-age=300, public
38
+ X-Ocpu-Session:
39
+ - x022b0ae9efe318
40
+ Location:
41
+ - https://public.opencpu.org/ocpu/tmp/x022b0ae9efe318/
42
+ Access-Control-Allow-Origin:
43
+ - "*"
44
+ Access-Control-Expose-Headers:
45
+ - Location, X-ocpu-session, Content-Type, Cache-Control
46
+ Access-Control-Allow-Headers:
47
+ - Origin, Content-Type, Accept, Accept-Encoding, Cache-Control, Authorization
48
+ Access-Control-Allow-Credentials:
49
+ - 'true'
50
+ X-Ocpu-R:
51
+ - R version 4.0.4 (2021-02-15)
52
+ X-Ocpu-Locale:
53
+ - en_US.UTF-8
54
+ X-Ocpu-Time:
55
+ - 2021-03-25 16:45:28 UTC
56
+ X-Ocpu-Version:
57
+ - 2.2.2
58
+ X-Ocpu-Server:
59
+ - rApache
60
+ Vary:
61
+ - Accept-Encoding
62
+ X-Ocpu-Cache:
63
+ - MISS
64
+ Cf-Cache-Status:
65
+ - DYNAMIC
66
+ Cf-Request-Id:
67
+ - '090bdfe60e0000fa74cd15a000000001'
68
+ Expect-Ct:
69
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
70
+ Report-To:
71
+ - '{"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=CSE68Tj98VN34FsQ6GxERhvu4VRaA0JzlUz%2BC4SjYpsvmgJnt0QIplPYttApcvWjIGElSwKCQchbvehe0OpnRaaXHiJeYFgodWCihTPBJYt9%2FP4%3D"}]}'
72
+ Nel:
73
+ - '{"max_age":604800,"report_to":"cf-nel"}'
74
+ Server:
75
+ - cloudflare
76
+ Cf-Ray:
77
+ - 63599c1ceefafa74-AMS
78
+ Alt-Svc:
79
+ - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: |
83
+ [
84
+ {
85
+ "head1": 1,
86
+ "head2": 2,
87
+ "head3": 3
88
+ },
89
+ {
90
+ "head1": 4,
91
+ "head2": 5,
92
+ "head3": 6
93
+ }
94
+ ]
95
+ recorded_at: Thu, 25 Mar 2021 16:45:28 GMT
96
+ recorded_with: VCR 6.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://foo:bar@staging.opencpu.roqua.nl/ocpu/user/deploy/library/digest/R/hmac/json
5
+ uri: https://staging.opencpu.roqua.nl/ocpu/user/deploy/library/digest/R/hmac/json
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"key":"foo","object":"bar"}'
@@ -9,8 +9,8 @@ describe OpenCPU::Client do
9
9
  end
10
10
  end
11
11
 
12
- it 'initializes with HTTMultiParty' do
13
- expect(described_class.ancestors).to include HTTMultiParty
12
+ it 'initializes with HTTParty' do
13
+ expect(described_class.ancestors).to include HTTParty
14
14
  end
15
15
 
16
16
  it 'defines #execute' do
@@ -21,6 +21,34 @@ describe OpenCPU::Client do
21
21
  expect(described_class.new).to respond_to :prepare
22
22
  end
23
23
 
24
+ describe '#process_query' do
25
+ let(:client) { described_class.new}
26
+ let(:url) { '/library/base/R/identity/json' }
27
+ let(:data) { { some: 'data' } }
28
+ let(:format) { :json }
29
+ let(:response_handler) { -> { nil } }
30
+
31
+ subject { client.send(:process_query, url, data, format) { |response| response_handler(response) } }
32
+
33
+ context 'test mode' do
34
+ it 'calls fake_response_for(url)' do
35
+ allow(OpenCPU).to receive(:test_mode?).and_return true
36
+ expect(client).to receive(:fake_response_for)
37
+ subject
38
+ end
39
+ end
40
+
41
+ context 'no test mode' do
42
+ context 'HTTP failure' do
43
+ it 'returns the appropiate status code' do
44
+ VCR.use_cassette :bad_request do
45
+ expect { subject }.to raise_error OpenCPU::Errors::BadRequest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
24
52
  describe 'initializes' do
25
53
 
26
54
  describe 'without configured attributes' do
@@ -115,13 +143,8 @@ describe OpenCPU::Client do
115
143
 
116
144
  context 'multipart form / file uploads' do
117
145
  it "works" do
118
- skip # vcr is broken for file uploads https://github.com/vcr/vcr/issues/441
119
146
  VCR.use_cassette :multi_part_request do |cassette|
120
- # VCR.turn_off!
121
- # WebMock.disable!
122
- response = client.execute(:utils, 'read.csv', format: nil, data: { file: File.new('spec/fixtures/test.csv') })
123
- # WebMock.enable!
124
- # VCR.turn_on!
147
+ response = client.execute(:utils, 'read.csv', format: :urlencoded, data: {file: File.new('spec/fixtures/test.csv')})
125
148
  expect(response).to eq [{"head1"=>1, "head2"=>2, "head3"=>3}, {"head1"=>4, "head2"=>5, "head3"=>6}]
126
149
  end
127
150
  end
@@ -167,7 +190,7 @@ describe OpenCPU::Client do
167
190
  VCR.use_cassette :github_animation_flip_coin_error do
168
191
  expect {
169
192
  client.execute(:foo, :bar, {user: "baz", github_remote: true})
170
- }.to raise_error RuntimeError, /400: Bad Request/
193
+ }.to raise_error OpenCPU::Errors::BadRequest, /400/
171
194
  end
172
195
  end
173
196
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,3 @@
1
- require "codeclimate-test-reporter"
2
- CodeClimate::TestReporter.start
3
-
4
1
  require 'vcr'
5
2
 
6
3
  require File.expand_path('../../lib/opencpu.rb', __FILE__)
@@ -8,5 +5,4 @@ require File.expand_path('../../lib/opencpu.rb', __FILE__)
8
5
  VCR.configure do |c|
9
6
  c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
10
7
  c.hook_into :webmock
11
- c.ignore_hosts 'codeclimate.com'
12
8
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opencpu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Malykh
8
- autorequire:
8
+ - Henk van der Veen
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
12
+ date: 2021-03-25 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: yajl-ruby
@@ -16,41 +17,38 @@ dependencies:
16
17
  requirements:
17
18
  - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: '1.2'
20
+ version: '1.3'
20
21
  - - ">="
21
22
  - !ruby/object:Gem::Version
22
- version: 1.2.0
23
+ version: 1.3.1
23
24
  type: :runtime
24
25
  prerelease: false
25
26
  version_requirements: !ruby/object:Gem::Requirement
26
27
  requirements:
27
28
  - - "~>"
28
29
  - !ruby/object:Gem::Version
29
- version: '1.2'
30
+ version: '1.3'
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
- version: 1.2.0
33
+ version: 1.3.1
33
34
  - !ruby/object:Gem::Dependency
34
- name: httmultiparty
35
+ name: httparty
35
36
  requirement: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - "~>"
38
39
  - !ruby/object:Gem::Version
39
- version: 0.3.16
40
+ version: '0.16'
40
41
  type: :runtime
41
42
  prerelease: false
42
43
  version_requirements: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - "~>"
45
46
  - !ruby/object:Gem::Version
46
- version: 0.3.16
47
+ version: '0.16'
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: bundler
49
50
  requirement: !ruby/object:Gem::Requirement
50
51
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.6'
54
52
  - - ">="
55
53
  - !ruby/object:Gem::Version
56
54
  version: 1.6.0
@@ -58,9 +56,6 @@ dependencies:
58
56
  prerelease: false
59
57
  version_requirements: !ruby/object:Gem::Requirement
60
58
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '1.6'
64
59
  - - ">="
65
60
  - !ruby/object:Gem::Version
66
61
  version: 1.6.0
@@ -68,22 +63,16 @@ dependencies:
68
63
  name: rake
69
64
  requirement: !ruby/object:Gem::Requirement
70
65
  requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '10.3'
74
66
  - - ">="
75
67
  - !ruby/object:Gem::Version
76
- version: 10.3.1
68
+ version: 12.3.3
77
69
  type: :development
78
70
  prerelease: false
79
71
  version_requirements: !ruby/object:Gem::Requirement
80
72
  requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '10.3'
84
73
  - - ">="
85
74
  - !ruby/object:Gem::Version
86
- version: 10.3.1
75
+ version: 12.3.3
87
76
  - !ruby/object:Gem::Dependency
88
77
  name: rspec
89
78
  requirement: !ruby/object:Gem::Requirement
@@ -110,69 +99,52 @@ dependencies:
110
99
  requirements:
111
100
  - - "~>"
112
101
  - !ruby/object:Gem::Version
113
- version: '1.17'
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: 1.17.4
102
+ version: '3.12'
117
103
  type: :development
118
104
  prerelease: false
119
105
  version_requirements: !ruby/object:Gem::Requirement
120
106
  requirements:
121
107
  - - "~>"
122
108
  - !ruby/object:Gem::Version
123
- version: '1.17'
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 1.17.4
109
+ version: '3.12'
127
110
  - !ruby/object:Gem::Dependency
128
111
  name: vcr
129
112
  requirement: !ruby/object:Gem::Requirement
130
113
  requirements:
131
114
  - - "~>"
132
115
  - !ruby/object:Gem::Version
133
- version: '2.9'
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 2.9.0
116
+ version: '6.0'
137
117
  type: :development
138
118
  prerelease: false
139
119
  version_requirements: !ruby/object:Gem::Requirement
140
120
  requirements:
141
121
  - - "~>"
142
122
  - !ruby/object:Gem::Version
143
- version: '2.9'
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 2.9.0
123
+ version: '6.0'
147
124
  description: This gem wraps the OpenCPU REST API.
148
125
  email:
149
- - ivan@roqua.nl
126
+ - support@roqua.nl
150
127
  executables: []
151
128
  extensions: []
152
129
  extra_rdoc_files: []
153
130
  files:
154
- - ".gitignore"
155
- - ".travis.yml"
156
- - CHANGELOG.md
157
- - Gemfile
158
- - Guardfile
159
131
  - LICENSE.txt
160
132
  - README.md
161
- - Rakefile
162
- - circle.yml
163
133
  - lib/opencpu.rb
164
134
  - lib/opencpu/client.rb
165
135
  - lib/opencpu/configuration.rb
166
136
  - lib/opencpu/delayed_calculation.rb
137
+ - lib/opencpu/errors.rb
167
138
  - lib/opencpu/version.rb
168
- - opencpu.gemspec
169
139
  - spec/fixtures/test.csv
170
140
  - spec/fixtures/vcr_cassettes/animation_flip_coin.yml
141
+ - spec/fixtures/vcr_cassettes/bad_request.yml
171
142
  - spec/fixtures/vcr_cassettes/description.yml
172
143
  - spec/fixtures/vcr_cassettes/digest_hmac.yml
173
144
  - spec/fixtures/vcr_cassettes/digest_hmac_no_parameters.yml
174
145
  - spec/fixtures/vcr_cassettes/github_animation_flip_coin.yml
175
146
  - spec/fixtures/vcr_cassettes/github_animation_flip_coin_error.yml
147
+ - spec/fixtures/vcr_cassettes/multi_part_request.yml
176
148
  - spec/fixtures/vcr_cassettes/prepare.yml
177
149
  - spec/fixtures/vcr_cassettes/response_with_na_values.yml
178
150
  - spec/fixtures/vcr_cassettes/url_encoded_request.yml
@@ -186,7 +158,7 @@ homepage: http://roqua.nl
186
158
  licenses:
187
159
  - MIT
188
160
  metadata: {}
189
- post_install_message:
161
+ post_install_message:
190
162
  rdoc_options: []
191
163
  require_paths:
192
164
  - lib
@@ -194,32 +166,33 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
166
  requirements:
195
167
  - - ">="
196
168
  - !ruby/object:Gem::Version
197
- version: 1.9.3
169
+ version: 2.5.0
198
170
  required_rubygems_version: !ruby/object:Gem::Requirement
199
171
  requirements:
200
172
  - - ">="
201
173
  - !ruby/object:Gem::Version
202
174
  version: '0'
203
175
  requirements: []
204
- rubyforge_project:
205
- rubygems_version: 2.4.6
206
- signing_key:
176
+ rubygems_version: 3.1.4
177
+ signing_key:
207
178
  specification_version: 4
208
179
  summary: Wrapper around OpenCPU REST API
209
180
  test_files:
181
+ - spec/spec_helper.rb
182
+ - spec/lib/opencpu_spec.rb
183
+ - spec/lib/opencpu/client_spec.rb
184
+ - spec/lib/opencpu/configuration_spec.rb
185
+ - spec/lib/opencpu/delayed_calculation_spec.rb
210
186
  - spec/fixtures/test.csv
211
- - spec/fixtures/vcr_cassettes/animation_flip_coin.yml
212
- - spec/fixtures/vcr_cassettes/description.yml
213
- - spec/fixtures/vcr_cassettes/digest_hmac.yml
214
- - spec/fixtures/vcr_cassettes/digest_hmac_no_parameters.yml
215
- - spec/fixtures/vcr_cassettes/github_animation_flip_coin.yml
187
+ - spec/fixtures/vcr_cassettes/url_encoded_request.yml
216
188
  - spec/fixtures/vcr_cassettes/github_animation_flip_coin_error.yml
217
- - spec/fixtures/vcr_cassettes/prepare.yml
189
+ - spec/fixtures/vcr_cassettes/digest_hmac_no_parameters.yml
190
+ - spec/fixtures/vcr_cassettes/description.yml
218
191
  - spec/fixtures/vcr_cassettes/response_with_na_values.yml
219
- - spec/fixtures/vcr_cassettes/url_encoded_request.yml
192
+ - spec/fixtures/vcr_cassettes/bad_request.yml
193
+ - spec/fixtures/vcr_cassettes/prepare.yml
194
+ - spec/fixtures/vcr_cassettes/github_animation_flip_coin.yml
195
+ - spec/fixtures/vcr_cassettes/digest_hmac.yml
196
+ - spec/fixtures/vcr_cassettes/animation_flip_coin.yml
220
197
  - spec/fixtures/vcr_cassettes/user_digest_hmac.yml
221
- - spec/lib/opencpu/client_spec.rb
222
- - spec/lib/opencpu/configuration_spec.rb
223
- - spec/lib/opencpu/delayed_calculation_spec.rb
224
- - spec/lib/opencpu_spec.rb
225
- - spec/spec_helper.rb
198
+ - spec/fixtures/vcr_cassettes/multi_part_request.yml
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- *.swp
2
- *.gem
3
- *.rbc
4
- .DS_Store
5
- .bundle
6
- .config
7
- .yardoc
8
- Gemfile.lock
9
- InstalledFiles
10
- _yardoc
11
- coverage
12
- doc/
13
- lib/bundler/man
14
- pkg
15
- rdoc
16
- spec/reports
17
- test/tmp
18
- test/version_tmp
19
- tmp
20
-
21
- .ruby-version
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3-p547
4
- - 2.0.0-p576
5
- - 2.1.3
6
- script: bundle exec rspec spec
7
- before_install:
8
- - gem install bundler
data/CHANGELOG.md DELETED
@@ -1,42 +0,0 @@
1
- # 0.9.2
2
-
3
- * Added `OpenCPU::Client#description` to retrieve a packages' description file
4
-
5
- # 0.9.1
6
-
7
- * Added `convert_na_to_nil=true/false` option to Client#execute
8
-
9
- # 0.9.0
10
-
11
- * Added support for Github R repos through OpenCPU
12
-
13
- # 0.8.2
14
-
15
- * Added uri.port
16
-
17
- # 0.8.1
18
-
19
- * Better error messages
20
-
21
- # 0.8.0
22
-
23
- * BREAKING CHANGE: verify ssl of opencpu server by default again.
24
- * Added configuration option verify_ssl so you can disable it.
25
- * Added format: :urlencoded for sending R-code and file parameters.
26
-
27
- # 0.7.8
28
-
29
- * Fixed gem by forcing json again (will add format option in 0.8)
30
-
31
- # 0.7.7 Broken! Do not use!
32
-
33
- * Added support for multipart requests [@amaunz]
34
-
35
- # 0.7.6
36
-
37
- * Made gem compatible with Ruby 1.9.3
38
-
39
- # 0.7.0
40
-
41
- * Added support for user packages [@ivdma]
42
-
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- group :development do
4
- gem 'listen', '~> 3.0.8'
5
- gem 'guard-rspec', '~> 4.2'
6
- gem 'guard-bundler', '~> 2.0'
7
- end
8
-
9
- group :test do
10
- gem "codeclimate-test-reporter", require: nil
11
- end
12
- # Specify your gem's dependencies in opencpu.gemspec
13
- gemspec
data/Guardfile DELETED
@@ -1,10 +0,0 @@
1
- guard :bundler do
2
- watch('Gemfile')
3
- watch(/^.+\.gemspec/)
4
- end
5
-
6
- guard :rspec, cmd: 'bundle exec rspec --color --format=documentation' do
7
- watch(%r{^spec/.+_spec\.rb$})
8
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
9
- watch('spec/spec_helper.rb') { "spec" }
10
- end
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require 'bundler/gem_tasks'
data/circle.yml DELETED
@@ -1,5 +0,0 @@
1
- machine:
2
- environment:
3
- CODECLIMATE_REPO_TOKEN: ecaec3d271bf32a8e203cafb71cc565d57a86dc0571b5529b491935e786001ff
4
- ruby:
5
- version: 2.1.0
data/opencpu.gemspec DELETED
@@ -1,31 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'opencpu/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "opencpu"
8
- spec.version = OpenCPU::VERSION
9
- spec.authors = ["Ivan Malykh"]
10
- spec.email = ["ivan@roqua.nl"]
11
- spec.summary = %q{Wrapper around OpenCPU REST API}
12
- spec.description = %q{This gem wraps the OpenCPU REST API.}
13
- spec.homepage = "http://roqua.nl"
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.required_ruby_version = '>= 1.9.3'
22
-
23
- spec.add_dependency 'yajl-ruby', '~> 1.2', '>= 1.2.0'
24
- spec.add_dependency 'httmultiparty', '~> 0.3.16'
25
-
26
- spec.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.0'
27
- spec.add_development_dependency 'rake', '~> 10.3', '>= 10.3.1'
28
- spec.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1'
29
- spec.add_development_dependency 'webmock', '~> 1.17', '>= 1.17.4'
30
- spec.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.0'
31
- end