openapply 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +70 -0
- data/.travis.yml +10 -1
- data/Gemfile.lock +7 -15
- data/README.md +12 -16
- data/lib/openapply/convert_to_array.rb +2 -4
- data/lib/openapply/version.rb +1 -1
- data/openapply.gemspec +3 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1db17dca4047fa3c54362d33e4a1ce0691c1d9e3b8625755917e3b690d262bc6
|
4
|
+
data.tar.gz: 7ed84e202dc03228432c3f14fb91cf8f51211ad2a8c99e869a7d4341a9b84e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6656549f87187da3bcfe96b2c7cab0f49a77b624189f19b288778c6330b1c2d05d7e2aa8d141282682ab9910552b41c1307589d8a29d3d049f2f27e4522bd8c8
|
7
|
+
data.tar.gz: 29563f4ed5d34edb691e368724e8d17db74cb022e24b93077d2cf479fa8ce04d349b3f7c31ae81c2f086bcc9df5db8b00061e08f5cc30189f13136c57e64cc87
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
dependencies:
|
6
|
+
pre:
|
7
|
+
- gem install bundler -v 1.16.0
|
8
|
+
# - rvm install rubygems 2.4.8 --force
|
9
|
+
|
10
|
+
version: 2
|
11
|
+
jobs:
|
12
|
+
build:
|
13
|
+
test:
|
14
|
+
override:
|
15
|
+
- bundle exec rspec -r rspec_junit_formatter --format RspecJunitFormatter -o $CIRCLE_TEST_REPORTS/rspec/junit.xml
|
16
|
+
|
17
|
+
docker:
|
18
|
+
# specify the version you desire here
|
19
|
+
- image: circleci/ruby:2.4.1-node-browsers
|
20
|
+
|
21
|
+
# Specify service dependencies here if necessary
|
22
|
+
# CircleCI maintains a library of pre-built images
|
23
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
24
|
+
# - image: circleci/postgres:9.4
|
25
|
+
|
26
|
+
working_directory: ~/repo
|
27
|
+
|
28
|
+
steps:
|
29
|
+
- checkout
|
30
|
+
|
31
|
+
# Download and cache dependencies
|
32
|
+
- restore_cache:
|
33
|
+
keys:
|
34
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
35
|
+
# fallback to using the latest cache if no exact match is found
|
36
|
+
- v1-dependencies-
|
37
|
+
|
38
|
+
- run:
|
39
|
+
name: install dependencies
|
40
|
+
command: |
|
41
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
42
|
+
|
43
|
+
- save_cache:
|
44
|
+
paths:
|
45
|
+
- ./vendor/bundle
|
46
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
47
|
+
|
48
|
+
# # Database setup
|
49
|
+
# - run: bundle exec rake db:create
|
50
|
+
# - run: bundle exec rake db:schema:load
|
51
|
+
|
52
|
+
# run tests!
|
53
|
+
- run:
|
54
|
+
name: run tests
|
55
|
+
command: |
|
56
|
+
mkdir /tmp/test-results
|
57
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
58
|
+
|
59
|
+
bundle exec rspec --format progress \
|
60
|
+
--format RspecJunitFormatter \
|
61
|
+
--out /tmp/test-results/rspec.xml \
|
62
|
+
--format progress \
|
63
|
+
"${TEST_FILES}"
|
64
|
+
|
65
|
+
# collect reports
|
66
|
+
- store_test_results:
|
67
|
+
path: /tmp/test-results
|
68
|
+
- store_artifacts:
|
69
|
+
path: /tmp/test-results
|
70
|
+
destination: test-results
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapply (0.2.
|
4
|
+
openapply (0.2.10)
|
5
5
|
httparty (~> 0.15)
|
6
6
|
json (~> 2.1)
|
7
7
|
net-scp (~> 1.2)
|
@@ -22,26 +22,20 @@ GEM
|
|
22
22
|
multi_xml (>= 0.5.2)
|
23
23
|
json (2.1.0)
|
24
24
|
method_source (0.9.0)
|
25
|
-
mini_portile2 (2.3.0)
|
26
25
|
multi_xml (0.6.0)
|
27
26
|
net-scp (1.2.1)
|
28
27
|
net-ssh (>= 2.6.5)
|
29
28
|
net-ssh (4.2.0)
|
30
|
-
nokogiri (1.8.1)
|
31
|
-
mini_portile2 (~> 2.3.0)
|
32
29
|
pry (0.11.3)
|
33
30
|
coderay (~> 1.1.0)
|
34
31
|
method_source (~> 0.9.0)
|
35
32
|
public_suffix (3.0.1)
|
36
|
-
rake (
|
37
|
-
roo (2.7.1)
|
38
|
-
nokogiri (~> 1)
|
39
|
-
rubyzip (~> 1.1, < 2.0.0)
|
33
|
+
rake (12.3.0)
|
40
34
|
rspec (3.7.0)
|
41
35
|
rspec-core (~> 3.7.0)
|
42
36
|
rspec-expectations (~> 3.7.0)
|
43
37
|
rspec-mocks (~> 3.7.0)
|
44
|
-
rspec-core (3.7.
|
38
|
+
rspec-core (3.7.1)
|
45
39
|
rspec-support (~> 3.7.0)
|
46
40
|
rspec-expectations (3.7.0)
|
47
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -50,14 +44,13 @@ GEM
|
|
50
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
45
|
rspec-support (~> 3.7.0)
|
52
46
|
rspec-support (3.7.0)
|
53
|
-
rubyzip (1.2.1)
|
54
47
|
safe_yaml (1.0.4)
|
55
48
|
simplecov (0.15.1)
|
56
49
|
docile (~> 1.1.0)
|
57
50
|
json (>= 1.8, < 3)
|
58
51
|
simplecov-html (~> 0.10.0)
|
59
52
|
simplecov-html (0.10.2)
|
60
|
-
webmock (3.
|
53
|
+
webmock (3.2.1)
|
61
54
|
addressable (>= 2.3.6)
|
62
55
|
crack (>= 0.3.2)
|
63
56
|
hashdiff
|
@@ -69,11 +62,10 @@ DEPENDENCIES
|
|
69
62
|
bundler (~> 1.15)
|
70
63
|
openapply!
|
71
64
|
pry (~> 0.11)
|
72
|
-
rake (~>
|
73
|
-
roo (~> 2.7)
|
65
|
+
rake (~> 12.3)
|
74
66
|
rspec (~> 3.7)
|
75
67
|
simplecov (~> 0.15)
|
76
|
-
webmock (~> 3.
|
68
|
+
webmock (~> 3.2)
|
77
69
|
|
78
70
|
BUNDLED WITH
|
79
|
-
1.16.
|
71
|
+
1.16.1
|
data/README.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/btihen/openapply.svg?branch=master)](https://travis-ci.org/btihen/openapply) | [![Dependency Status](https://beta.gemnasium.com/badges/github.com/btihen/openapply.svg)](https://beta.gemnasium.com/projects/github.com/btihen/openapply) | [![Known Vulnerabilities](https://snyk.io/test/github/btihen/openapply/badge.svg?targetFile=Gemfile.lock)](https://snyk.io/test/github/btihen/openapply?targetFile=Gemfile.lock)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
1
6
|
# Openapply
|
2
7
|
|
3
8
|
This gem allows ruby access to the OpenApply API v1 - and supports the GET features described at: https://dev.faria.co/oa
|
@@ -138,11 +143,12 @@ Associates the above settings with HTTParty
|
|
138
143
|
@oa.payments_by_id(95)
|
139
144
|
#
|
140
145
|
# individual student records combined & possible pre-processing
|
141
|
-
# ATTRIBUTES: id, [:keys_to_un-nest], [:keys_to_exclude]
|
142
146
|
@oa.student_details_by_id(95)
|
147
|
+
|
148
|
+
# ATTRIBUTES: id, [:keys_to_un-nest], [:keys_to_exclude]
|
143
149
|
@oa.student_details_by_id(95, [:custom_fields], [:parent_guardian])
|
150
|
+
|
144
151
|
# skip payment info -- (payments: [])
|
145
|
-
@oa.student_details_by_id(95, [], [], false)
|
146
152
|
@oa.student_details_by_id(95, [:custom_fields], [:parent_guardian], false)
|
147
153
|
#
|
148
154
|
# student summaries of a given status (recursively if more than on page)
|
@@ -150,21 +156,12 @@ Associates the above settings with HTTParty
|
|
150
156
|
#
|
151
157
|
# student details of a given status (recursively if more than on page)
|
152
158
|
@oa.students_details_by_status('applied')
|
153
|
-
@oa.students_details_by_status('applied', [:custom_fields])
|
154
|
-
@oa.students_details_by_status('applied', [], [:parent_guardian])
|
155
159
|
@oa.students_details_by_status('applied', [:custom_fields], [:parent_guardian])
|
156
160
|
# skip payment info (payments: [])
|
157
|
-
@oa.students_details_by_status('applied', [], [], false)
|
158
161
|
@oa.students_details_by_status('applied', [:custom_fields], [:parent_guardian], false)
|
159
162
|
#
|
160
163
|
# student details with multiple status (recursively if more than on page)
|
161
164
|
@oa.students_details_by_statuses(['applied','enrolled'], [:custom_fields])
|
162
|
-
@oa.students_details_by_statuses(['applied','enrolled'], nil, [:parent_guardian])
|
163
|
-
@oa.students_details_by_statuses(['applied','enrolled'], [:custom_fields], [:parent_guardian])
|
164
|
-
# speed up and skip payment info - returns [] in payment area
|
165
|
-
@oa.students_details_by_statuses(['applied','enrolled'], [], [], false)
|
166
|
-
# speed up and skip payment info - returns [] in payment area
|
167
|
-
@oa.students_details_by_statuses(['applied','enrolled'], [:custom_fields], [:parent_guardian], false)
|
168
165
|
#
|
169
166
|
# create an array
|
170
167
|
@oa.students_as_array_by_status('applied', [:custom_fields], [:parent_guardian], [:id, :name], {count: 1, keys: [:id, :name, :address]}, {count: 2, order: :newest, keys: [:date, :amount]} )
|
@@ -172,7 +169,6 @@ Associates the above settings with HTTParty
|
|
172
169
|
@oa.students_as_array_by_statuses(['applied','enrolled'], [:custom_fields], [:parent_guardian], [:id, :name], {count: 1, keys: [:id, :name, :address]}, {count: 2, order: :newest, keys: [:date, :amount]} )
|
173
170
|
#
|
174
171
|
# Create a csv string
|
175
|
-
@oa.students_as_csv_by_status('applied',[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
176
172
|
# multiple status into
|
177
173
|
csv_string=@oa.students_as_csv_by_statuses(['applied','enrolled'],[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
178
174
|
#
|
@@ -183,12 +179,12 @@ csv_string=@oa.students_as_csv_by_statuses(['applied','enrolled'],[:custom_field
|
|
183
179
|
@oa.send_data_to_remote_server( csv_string, 'hostname.domain.name', 'myusername', '/home/myusername/xfer/myexport.csv', '0750', {verify_host_key: false} )
|
184
180
|
|
185
181
|
# Create XLSX file
|
186
|
-
@oa.students_as_xlsx_by_status('applied',[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
187
|
-
# # multiple status into
|
188
|
-
xlsx_obj=@oa.students_as_xlsx_by_statuses(['applied','enrolled'],[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
182
|
+
# @oa.students_as_xlsx_by_status('applied',[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
183
|
+
# # # multiple status into
|
184
|
+
# xlsx_obj=@oa.students_as_xlsx_by_statuses(['applied','enrolled'],[:custom_fields], [:parent_guardian], [:id, :name], {type: :guardians, count: 1, keys: [:id, :name, :address]}, {type: :payments, count: 2, order: :newest, keys: [:date, :amount]} )
|
189
185
|
# #
|
190
186
|
# # send XLSX to a remote server as a file - using ssh-keys
|
191
|
-
@oa.send_data_to_remote_server(xlsx_obj, 'hostname.domain.name', 'myusername', '/home/myusername/xfer/myexport.xlsx', '0750')
|
187
|
+
# @oa.send_data_to_remote_server(xlsx_obj, 'hostname.domain.name', 'myusername', '/home/myusername/xfer/myexport.xlsx', '0750')
|
192
188
|
```
|
193
189
|
|
194
190
|
#### INDIVIDUAL STUDENT QUERIES
|
data/lib/openapply/version.rb
CHANGED
data/openapply.gemspec
CHANGED
@@ -59,9 +59,10 @@ Gem::Specification.new do |spec|
|
|
59
59
|
# spec.add_runtime_dependency "rubyzip", "~> 1.2"
|
60
60
|
|
61
61
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
62
|
-
spec.add_development_dependency "webmock" , "~> 3.
|
62
|
+
spec.add_development_dependency "webmock" , "~> 3.2"
|
63
63
|
spec.add_development_dependency "bundler", "~> 1.15"
|
64
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
64
|
+
# spec.add_development_dependency "rake", "~> 10.0"
|
65
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
65
66
|
spec.add_development_dependency "rspec", "~> 3.7"
|
66
67
|
spec.add_development_dependency "pry", "~> 0.11"
|
67
68
|
# spec.add_development_dependency "roo", "~> 2.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Tihen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
89
|
+
version: '3.2'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
96
|
+
version: '3.2'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '12.3'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '12.3'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +157,7 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- ".circleci/config.yml"
|
160
161
|
- ".gitignore"
|
161
162
|
- ".rspec"
|
162
163
|
- ".travis.yml"
|
@@ -203,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
204
|
version: '0'
|
204
205
|
requirements: []
|
205
206
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.7.
|
207
|
+
rubygems_version: 2.7.4
|
207
208
|
signing_key:
|
208
209
|
specification_version: 4
|
209
210
|
summary: Access OpenApply's API with Ruby
|