et 0.5.2 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -5
- data/et.gemspec +1 -0
- data/lib/et/api.rb +10 -2
- data/lib/et/formatter.rb +1 -0
- data/lib/et/version.rb +1 -1
- data/spec/lib/api_spec.rb +14 -3
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b9eb9ec2a15351bbd78345f80ecf9bb05875cd
|
4
|
+
data.tar.gz: 680ae5fe564094a0cc5b5f31835c7e0623d99ac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caaf8769682a2810cd1e8f500e97be611eb48fa0f0c8e848c3dcf5af3a3327e61528203290ae67a5dc393568ce7803e5c1e52a9fbb1ca7fc95f388f87018257a
|
7
|
+
data.tar.gz: 250fc3b6d3cf7b439353dd1dba062c7671d7df0cac3f449db37ae67a3cb3aba634765130b1372d1cba5a6e537f5647afd06978f77d7f8e79415181600ec9c2df
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
et (0.5.
|
4
|
+
et (0.5.3)
|
5
5
|
gli (= 2.11.0)
|
6
6
|
multipart-post (~> 2.0)
|
7
7
|
rspec (~> 3.0)
|
@@ -10,27 +10,35 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
+
coderay (1.1.0)
|
13
14
|
diff-lcs (1.2.5)
|
14
15
|
gli (2.11.0)
|
16
|
+
method_source (0.8.2)
|
15
17
|
multipart-post (2.0.0)
|
18
|
+
pry (0.10.1)
|
19
|
+
coderay (~> 1.1.0)
|
20
|
+
method_source (~> 0.8.1)
|
21
|
+
slop (~> 3.4)
|
16
22
|
rake (10.3.2)
|
17
23
|
rspec (3.2.0)
|
18
24
|
rspec-core (~> 3.2.0)
|
19
25
|
rspec-expectations (~> 3.2.0)
|
20
26
|
rspec-mocks (~> 3.2.0)
|
21
|
-
rspec-core (3.2.
|
27
|
+
rspec-core (3.2.3)
|
22
28
|
rspec-support (~> 3.2.0)
|
23
|
-
rspec-expectations (3.2.
|
29
|
+
rspec-expectations (3.2.1)
|
24
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
25
31
|
rspec-support (~> 3.2.0)
|
26
|
-
rspec-mocks (3.2.
|
32
|
+
rspec-mocks (3.2.1)
|
27
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
28
34
|
rspec-support (~> 3.2.0)
|
29
|
-
rspec-support (3.2.
|
35
|
+
rspec-support (3.2.2)
|
36
|
+
slop (3.6.0)
|
30
37
|
|
31
38
|
PLATFORMS
|
32
39
|
ruby
|
33
40
|
|
34
41
|
DEPENDENCIES
|
35
42
|
et!
|
43
|
+
pry (~> 0)
|
36
44
|
rake (~> 10)
|
data/et.gemspec
CHANGED
@@ -20,6 +20,7 @@ DESC
|
|
20
20
|
s.executables << "et"
|
21
21
|
s.license = "MIT"
|
22
22
|
s.add_development_dependency("rake", "~> 10")
|
23
|
+
s.add_development_dependency("pry", '~> 0')
|
23
24
|
s.add_runtime_dependency("rspec", "~> 3.0")
|
24
25
|
s.add_runtime_dependency("rspec-mocks", "~> 3.0")
|
25
26
|
s.add_runtime_dependency("multipart-post", "~> 2.0")
|
data/lib/et/api.rb
CHANGED
@@ -14,8 +14,16 @@ module ET
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def list_lessons
|
17
|
-
|
18
|
-
|
17
|
+
request = Net::HTTP::Get.new(lessons_url)
|
18
|
+
request["Authorization"] = auth_header
|
19
|
+
|
20
|
+
response = nil
|
21
|
+
Net::HTTP.start(lessons_url.host, lessons_url.port,
|
22
|
+
use_ssl: lessons_url.scheme == "https") do |http|
|
23
|
+
|
24
|
+
response = http.request(request)
|
25
|
+
end
|
26
|
+
JSON.parse(response.body, symbolize_names: true)[:lessons]
|
19
27
|
end
|
20
28
|
|
21
29
|
def get_lesson(slug)
|
data/lib/et/formatter.rb
CHANGED
data/lib/et/version.rb
CHANGED
data/spec/lib/api_spec.rb
CHANGED
@@ -7,9 +7,20 @@ describe ET::API do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "queries for a list of lessons" do
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
request = {}
|
11
|
+
response = double
|
12
|
+
http = double
|
13
|
+
lessons_uri = URI("http://localhost:3000/lessons.json?submittable=1")
|
14
|
+
expect(Net::HTTP::Get).to receive(:new).
|
15
|
+
with(lessons_uri).
|
16
|
+
and_return(request)
|
17
|
+
expect(Net::HTTP).to receive(:start).with(
|
18
|
+
lessons_uri.host,
|
19
|
+
lessons_uri.port,
|
20
|
+
use_ssl: lessons_uri.scheme == "https").
|
21
|
+
and_yield(http)
|
22
|
+
expect(http).to receive(:request).and_return(response)
|
23
|
+
expect(response).to receive(:body).and_return(lessons_response)
|
13
24
|
|
14
25
|
results = api.list_lessons
|
15
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: et
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Sheehan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
168
|
version: '0'
|
155
169
|
requirements: []
|
156
170
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
171
|
+
rubygems_version: 2.2.2
|
158
172
|
signing_key:
|
159
173
|
specification_version: 4
|
160
174
|
summary: Command-line interface for the event horizon.
|