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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6265a35fbd53ec50dbd1f0c661a3f55863eaeb8
4
- data.tar.gz: 71a553c9f295034abb2878b146d1c715c87a61d5
3
+ metadata.gz: 51b9eb9ec2a15351bbd78345f80ecf9bb05875cd
4
+ data.tar.gz: 680ae5fe564094a0cc5b5f31835c7e0623d99ac1
5
5
  SHA512:
6
- metadata.gz: 2a0dd2902e3c5ef89eadd8e4b07544f32756579e714b0acadf9b34d1b3d60951258ed3ce81a73c85c336119c7721c7f81154cc776a998e74618126f486c600a9
7
- data.tar.gz: 81cd40a31acbfb853fc8d676bcae5ee8e923d43f79fdb084a89a8e44cc39752f4c70f66a422331b211e272daa6cc8132765b6d6a3ccd47741a6eccc5039d96d8
6
+ metadata.gz: caaf8769682a2810cd1e8f500e97be611eb48fa0f0c8e848c3dcf5af3a3327e61528203290ae67a5dc393568ce7803e5c1e52a9fbb1ca7fc95f388f87018257a
7
+ data.tar.gz: 250fc3b6d3cf7b439353dd1dba062c7671d7df0cac3f449db37ae67a3cb3aba634765130b1372d1cba5a6e537f5647afd06978f77d7f8e79415181600ec9c2df
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et (0.5.2)
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.0)
27
+ rspec-core (3.2.3)
22
28
  rspec-support (~> 3.2.0)
23
- rspec-expectations (3.2.0)
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.0)
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.1)
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")
@@ -14,8 +14,16 @@ module ET
14
14
  end
15
15
 
16
16
  def list_lessons
17
- response = Net::HTTP.get(lessons_url)
18
- JSON.parse(response, symbolize_names: true)[:lessons]
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)
@@ -1,6 +1,7 @@
1
1
  module ET
2
2
  class Formatter
3
3
  def self.print_table(data, *headers)
4
+ return puts "No challenges assigned" if data.empty?
4
5
  column_widths = headers.map do |header|
5
6
  data.map { |row| row[header].length }.max
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module ET
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.4"
3
3
  end
@@ -7,9 +7,20 @@ describe ET::API do
7
7
  end
8
8
 
9
9
  it "queries for a list of lessons" do
10
- expect(Net::HTTP).to receive(:get).
11
- with(URI("http://localhost:3000/lessons.json?submittable=1")).
12
- and_return(lessons_response)
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.2
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-04-09 00:00:00.000000000 Z
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.4.5
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.