citrix 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{CONTRIBUITING.md → CONTRIBUTING.md} +0 -0
- data/README.md +17 -1
- data/lib/citrix/training/namespace/trainings.rb +12 -0
- data/lib/citrix/version.rb +1 -1
- data/spec/citrix/training/namespace/trainings_spec.rb +24 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 202698e1982c4eef3b771e757d37ce8f4e759b3e
|
4
|
+
data.tar.gz: a9feb13e4be7315947e8842af036a2f992ab8fbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d682457accf3034894bc1927a46ea7262af587f796c78bf1b8d7999e406332984b22429b609941603e1dfc108b59a03a3a10d3c82a822b7ee2df48cf88c4035
|
7
|
+
data.tar.gz: 8baf578f08483877dec153cdd70f0da6293bfc671e5d05266d25e77f6d4988ed41b6ef36fefed9fd99bcd64a8cc67fc5ecdea060a209f729aee570ccba6ff7e6
|
File without changes
|
data/README.md
CHANGED
@@ -10,7 +10,9 @@ API wrappers for Citrix services like GoToTraining. It includes partial API mapp
|
|
10
10
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
|
-
|
13
|
+
```ruby
|
14
|
+
gem 'citrix'
|
15
|
+
```
|
14
16
|
|
15
17
|
And then execute:
|
16
18
|
|
@@ -72,6 +74,20 @@ else
|
|
72
74
|
end
|
73
75
|
```
|
74
76
|
|
77
|
+
#### Get training
|
78
|
+
|
79
|
+
Retrieve information on a given scheduled training for a given organizer.
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
response, training = client.trainings.find(training_key)
|
83
|
+
|
84
|
+
if training
|
85
|
+
# Do something with training
|
86
|
+
else
|
87
|
+
p response.json
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
75
91
|
#### Remove a training
|
76
92
|
|
77
93
|
Deletes a scheduled or completed training.
|
@@ -69,6 +69,18 @@ module Citrix
|
|
69
69
|
[response, trainings]
|
70
70
|
end
|
71
71
|
|
72
|
+
# Find a scheduled or completed training by its key.
|
73
|
+
def find(key)
|
74
|
+
url = url_for('organizers', credentials.organizer_key, 'trainings', key)
|
75
|
+
response = http_client.get(url)
|
76
|
+
|
77
|
+
if response.ok?
|
78
|
+
training = Resource::Training.new Resource::Training.deserialize(response.json)
|
79
|
+
end
|
80
|
+
|
81
|
+
[response, training]
|
82
|
+
end
|
83
|
+
|
72
84
|
# Deletes a scheduled or completed training.
|
73
85
|
#
|
74
86
|
# For scheduled trainings, it deletes all scheduled sessions of the
|
data/lib/citrix/version.rb
CHANGED
@@ -60,6 +60,30 @@ describe Citrix::Training::Namespace::Trainings do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
describe '#find' do
|
64
|
+
let(:client) { build_client }
|
65
|
+
|
66
|
+
it 'performs request' do
|
67
|
+
stub_request(:get, /.+/)
|
68
|
+
.to_return(status: 200, body: fixtures.join('training.json').read, headers: {'Content-Type' => 'application/json'})
|
69
|
+
client.trainings.find('1234')
|
70
|
+
|
71
|
+
url = url_for('organizers', client.credentials.organizer_key, 'trainings', '1234')
|
72
|
+
|
73
|
+
expect(last_request.method).to eq(:get)
|
74
|
+
expect(last_request.uri.normalize.to_s).to eq(url)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'returns training' do
|
78
|
+
stub_request(:get, /.+/)
|
79
|
+
.to_return(status: 200, body: fixtures.join('training.json').read, headers: {'Content-Type' => 'application/json'})
|
80
|
+
|
81
|
+
response, training = client.trainings.find('1234')
|
82
|
+
|
83
|
+
expect(training).to be_a(Citrix::Training::Resource::Training)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
63
87
|
describe '#remove' do
|
64
88
|
let(:client) { build_client }
|
65
89
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: citrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aitch
|
@@ -119,7 +119,7 @@ files:
|
|
119
119
|
- ".rspec"
|
120
120
|
- ".travis.yml"
|
121
121
|
- CHANGELOG.md
|
122
|
-
-
|
122
|
+
- CONTRIBUTING.md
|
123
123
|
- Gemfile
|
124
124
|
- LICENSE.md
|
125
125
|
- README.md
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.4.5
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: API wrappers for Citrix services like GoToTraining.
|