logs_tf 0.0.4 → 0.0.5

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
- SHA1:
3
- metadata.gz: 64856de6045b4b089bb9083f008d9600d68cb613
4
- data.tar.gz: c922a73635877e18d1ce2927d409ffba54fc0415
2
+ SHA256:
3
+ metadata.gz: 30923ae1e7445c66b59097c54b9639f48f5b21a066e229fa674fb8ee12256ef7
4
+ data.tar.gz: 3ad1b46201a4a14f7c684d4ee133f5b46f11d3db24c58ce76e8c90b52fe77dea
5
5
  SHA512:
6
- metadata.gz: 396b0606c040f3662b6385bc9a3a97ae272925b3ac4cc971444929470432de4e7a7bae4dacea0dd29cecb62fcdd3a90935ea37ea7fbb9406cdb1dc62889ab525
7
- data.tar.gz: 0961323bb17348d90e8cedac5bd2d421adac2134ff73471eab1bac145d57a9ef3c0eabf55a4ebf0da6b385243f21f705da38d5e7eafe018913b9a4a88ebaf137
6
+ metadata.gz: c52eb061d1e5beb06541866e1582eae8c6b56510d2c53f7b3edf494a49028dde6a12724148a91057f3c943cc032af51ecd839223dbd87e992535ba14d5ba3f17
7
+ data.tar.gz: 4d885017a0e6328f2f923bc96fa820ef2a12d8ab33c6e1177b6d8963b7c700952ff5660c6726f36afecafb8864a8d8b35c59fcaa4b8620b5d6c098fb84901a27
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
3
+ - 2.3.8
4
+ - 2.4.5
5
+ - 2.5.3
4
6
  - rbx-19mode
5
- - jruby-19mode
6
7
  script: ./script/ci
data/Gemfile.lock CHANGED
@@ -1,57 +1,75 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- logs_tf (0.0.3)
5
- faraday (~> 0.8.0)
6
- multipart-post (~> 1.2.0)
4
+ logs_tf (0.0.5)
5
+ faraday (~> 1.0)
6
+ multipart-post (>= 1.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- coderay (1.1.0)
12
- coveralls (0.7.0)
13
- multi_json (~> 1.3)
14
- rest-client
15
- simplecov (>= 0.7)
16
- term-ansicolor
17
- thor
18
- diff-lcs (1.2.5)
19
- docile (1.1.0)
20
- faraday (0.8.8)
21
- multipart-post (~> 1.2.0)
22
- lockfile (2.1.0)
23
- method_source (0.8.2)
24
- mime-types (2.0)
25
- multi_json (1.8.2)
26
- multipart-post (1.2.0)
27
- pry (0.9.12.3)
28
- coderay (~> 1.0)
29
- method_source (~> 0.8)
30
- slop (~> 3.4)
31
- pry-nav (0.2.3)
32
- pry (~> 0.9.10)
33
- rest-client (1.6.7)
34
- mime-types (>= 1.16)
35
- rspec (2.14.1)
36
- rspec-core (~> 2.14.0)
37
- rspec-expectations (~> 2.14.0)
38
- rspec-mocks (~> 2.14.0)
39
- rspec-core (2.14.7)
40
- rspec-expectations (2.14.4)
41
- diff-lcs (>= 1.1.3, < 2.0)
42
- rspec-mocks (2.14.4)
43
- simplecov (0.8.1)
44
- docile (~> 1.1.0)
45
- lockfile (>= 2.1.0)
46
- multi_json
47
- simplecov-html (~> 0.8.0)
48
- simplecov-html (0.8.0)
49
- slop (3.4.6)
50
- term-ansicolor (1.2.2)
51
- tins (~> 0.8)
52
- thor (0.18.1)
53
- tins (0.13.1)
54
- vcr (2.7.0)
11
+ coderay (1.1.3)
12
+ coveralls (0.8.23)
13
+ json (>= 1.8, < 3)
14
+ simplecov (~> 0.16.1)
15
+ term-ansicolor (~> 1.3)
16
+ thor (>= 0.19.4, < 2.0)
17
+ tins (~> 1.6)
18
+ diff-lcs (1.4.4)
19
+ docile (1.4.0)
20
+ faraday (1.8.0)
21
+ faraday-em_http (~> 1.0)
22
+ faraday-em_synchrony (~> 1.0)
23
+ faraday-excon (~> 1.1)
24
+ faraday-httpclient (~> 1.0.1)
25
+ faraday-net_http (~> 1.0)
26
+ faraday-net_http_persistent (~> 1.1)
27
+ faraday-patron (~> 1.0)
28
+ faraday-rack (~> 1.0)
29
+ multipart-post (>= 1.2, < 3)
30
+ ruby2_keywords (>= 0.0.4)
31
+ faraday-em_http (1.0.0)
32
+ faraday-em_synchrony (1.0.0)
33
+ faraday-excon (1.1.0)
34
+ faraday-httpclient (1.0.1)
35
+ faraday-net_http (1.0.1)
36
+ faraday-net_http_persistent (1.2.0)
37
+ faraday-patron (1.0.0)
38
+ faraday-rack (1.0.0)
39
+ json (2.6.1)
40
+ method_source (1.0.0)
41
+ multipart-post (2.1.1)
42
+ pry (0.14.1)
43
+ coderay (~> 1.1)
44
+ method_source (~> 1.0)
45
+ pry-nav (1.0.0)
46
+ pry (>= 0.9.10, < 0.15)
47
+ rspec (3.10.0)
48
+ rspec-core (~> 3.10.0)
49
+ rspec-expectations (~> 3.10.0)
50
+ rspec-mocks (~> 3.10.0)
51
+ rspec-core (3.10.1)
52
+ rspec-support (~> 3.10.0)
53
+ rspec-expectations (3.10.1)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.10.0)
56
+ rspec-mocks (3.10.2)
57
+ diff-lcs (>= 1.2.0, < 2.0)
58
+ rspec-support (~> 3.10.0)
59
+ rspec-support (3.10.3)
60
+ ruby2_keywords (0.0.5)
61
+ simplecov (0.16.1)
62
+ docile (~> 1.1)
63
+ json (>= 1.8, < 3)
64
+ simplecov-html (~> 0.10.0)
65
+ simplecov-html (0.10.2)
66
+ sync (0.5.0)
67
+ term-ansicolor (1.7.1)
68
+ tins (~> 1.0)
69
+ thor (1.1.0)
70
+ tins (1.29.1)
71
+ sync
72
+ vcr (6.0.0)
55
73
 
56
74
  PLATFORMS
57
75
  ruby
@@ -62,3 +80,6 @@ DEPENDENCIES
62
80
  pry-nav
63
81
  rspec
64
82
  vcr
83
+
84
+ BUNDLED WITH
85
+ 2.2.32
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Logs.tf interface [![Build Status](https://secure.travis-ci.org/Arie/logs_tf.png)](http://travis-ci.org/Arie/logs_tf) [![Dependencies](https://gemnasium.com/Arie/logs_tf.png)](https://gemnasium.com/Arie/logs_tf.png) [![Code Climate](https://codeclimate.com/github/Arie/logs_tf.png)](https://codeclimate.com/github/Arie/logs_tf) [![Coverage Status](https://coveralls.io/repos/Arie/logs_tf/badge.png?branch=master)](https://coveralls.io/r/Arie/logs_tf)
1
+ # Logs.tf interface [![Build Status](https://secure.travis-ci.org/Arie/logs_tf.png)](http://travis-ci.org/Arie/logs_tf) [![Dependencies](https://gemnasium.com/Arie/logs_tf.png)](https://gemnasium.com/Arie/logs_tf.png) [![Code Climate](https://codeclimate.com/github/Arie/logs_tf.png)](https://codeclimate.com/github/Arie/logs_tf) [![Coverage Status](https://coveralls.io/repos/github/Arie/logs_tf/badge.svg?branch=master)](https://coveralls.io/r/Arie/logs_tf)
2
2
 
3
3
  A gem for the logs.tf API
4
4
 
@@ -60,8 +60,6 @@ module LogsTF
60
60
  response_body["error"]
61
61
  end
62
62
 
63
- private
64
-
65
63
  def response_body
66
64
  @response_body ||= JSON.parse(response.body)
67
65
  end
@@ -74,6 +72,8 @@ module LogsTF
74
72
  response.status == 200
75
73
  end
76
74
 
75
+ private
76
+
77
77
  def post_options
78
78
  { :key => api_key,
79
79
  :title => title,
@@ -1,3 +1,3 @@
1
1
  module LogsTF
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/logs_tf.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ["lib"]
15
15
  gem.homepage = 'http://github.com/Arie/logs_tf'
16
16
 
17
- gem.add_dependency "faraday", "~> 0.8"
17
+ gem.add_dependency "faraday", "~> 1.0"
18
18
  gem.add_dependency "multipart-post", ">= 1.2.0"
19
19
 
20
20
  gem.add_development_dependency "vcr"
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'pry-nav'
2
3
 
3
4
  module LogsTF
4
5
 
@@ -10,110 +11,110 @@ module LogsTF
10
11
  let(:upload) { Upload.new(log, logs_tf_url ) }
11
12
 
12
13
 
13
- vcr_options = { :cassette_name => "upload", :record => :new_episodes, :match_requests_on => [:method, :uri, :body] }
14
+ vcr_options = { :cassette_name => "upload", :record => :none, :match_requests_on => [:method, :uri] }
14
15
  context "uploading logfiles", :vcr => vcr_options do
15
16
 
16
17
  describe "#send" do
17
18
 
18
19
  it "knows the status of the request" do
19
20
  upload.send
20
- upload.should be_request_success
21
+ expect(upload).to be_request_success
21
22
  end
22
23
 
23
24
  it "knows if tf.logs was able to parse the log" do
24
25
  upload.send
25
- upload.should be_upload_success
26
+ expect(upload).to be_upload_success
26
27
  end
27
28
 
28
29
  it "knows the log's location after sending" do
29
30
  upload.send
30
- upload.url.should == "#{logs_tf_url}/91"
31
+ expect(upload.url).to eql "#{logs_tf_url}/91"
31
32
  end
32
33
 
33
34
  it "raises the appropriate error when upload was unsuccessful" do
34
- upload.stub(:connection => double(:connection).as_null_object)
35
- upload.stub(:request_success? => true)
36
- upload.stub(:upload_success? => false)
37
- upload.should_receive(:raise_logs_tf_error)
35
+ expect(upload).to receive(:connection).and_return(double(:connection).as_null_object)
36
+ expect(upload).to receive(:request_success?).and_return(true)
37
+ expect(upload).to receive(:upload_success?).and_return(false)
38
+ expect(upload).to receive(:raise_logs_tf_error)
38
39
  upload.send
39
40
  end
40
41
 
41
42
  it "raises an error when the response status is not 200" do
42
- upload.stub(:connection => double(:connection).as_null_object)
43
- upload.stub(:request_success? => false)
43
+ expect(upload).to receive(:connection).and_return(double(:connection).as_null_object)
44
+ expect(upload).to receive(:request_success?).and_return(false)
44
45
  expect{upload.send}.to raise_error Upload::RequestError
45
46
  end
46
47
 
47
48
  end
48
49
 
49
50
  describe '#error' do
50
- before { upload.stub(:response => double(:body => '{ "error": "foobar" }')) }
51
+ before { expect(upload).to receive(:response).and_return(double(body: '{ "error": "foobar" }')) }
51
52
 
52
53
  it "parses the JSON respone from logs.tf for the error message" do
53
- upload.error.should == 'foobar'
54
+ expect(upload.error).to eql 'foobar'
54
55
  end
55
56
 
56
57
  end
57
58
 
58
59
  describe '#raise_logs_tf_error' do
59
60
 
60
- before { upload.stub(:response => double(:body => '{ "error": "foobar" }')) }
61
+ before { expect(upload).to receive(:response).and_return(double(body: '{ "error": "foobar" }')) }
61
62
 
62
63
  it "raises InvalidLogError" do
63
- upload.stub(:error => "Invalid log file")
64
+ expect(upload).to receive(:error).and_return("Invalid log file")
64
65
  expect{upload.raise_logs_tf_error}.to raise_error Upload::InvalidLogError
65
66
  end
66
67
 
67
68
  it "raises MissingLogError" do
68
- upload.stub(:error => "No file")
69
+ expect(upload).to receive(:error).and_return("No file")
69
70
  expect{upload.raise_logs_tf_error}.to raise_error Upload::MissingLogError
70
71
  end
71
72
 
72
73
  it "raises NotAuthenticatedError" do
73
- upload.stub(:error => "Not authenticated")
74
+ expect(upload).to receive(:error).and_return("Not authenticated")
74
75
  expect{upload.raise_logs_tf_error}.to raise_error Upload::NotAuthenticatedError
75
76
  end
76
77
 
77
78
  it "raises InvalidAPIKeyError" do
78
- upload.stub(:error => "Invalid API key")
79
+ expect(upload).to receive(:error).and_return("Invalid API key")
79
80
  expect{upload.raise_logs_tf_error}.to raise_error Upload::InvalidAPIKeyError
80
81
  end
81
82
 
82
83
  it "raises NoValidRoundsError" do
83
- upload.stub(:error => "Log has no valid rounds (at least one needed)")
84
+ expect(upload).to receive(:error).and_return("Log has no valid rounds (at least one needed)")
84
85
  expect{upload.raise_logs_tf_error}.to raise_error Upload::NoValidRoundsError
85
86
  end
86
87
 
87
88
  it "raises NotEnoughPlayersError" do
88
- upload.stub(:error => "Not enough players (2 needed)")
89
+ expect(upload).to receive(:error).and_return("Not enough players (2 needed)")
89
90
  expect{upload.raise_logs_tf_error}.to raise_error Upload::NotEnoughPlayersError
90
91
  end
91
92
 
92
93
  it "raises LogIsEmptyError" do
93
- upload.stub(:error => "Log is empty")
94
+ expect(upload).to receive(:error).and_return("Log is empty")
94
95
  expect{upload.raise_logs_tf_error}.to raise_error Upload::LogIsEmptyError
95
96
  end
96
97
 
97
98
  it "raises ParsingFailedError" do
98
- upload.stub(:error => "Parsing failed in line 123")
99
+ expect(upload).to receive(:error).and_return("Parsing failed in line 123")
99
100
  expect{upload.raise_logs_tf_error}.to raise_error Upload::ParsingFailedError
100
101
 
101
- upload.stub(:error => "Parsing failed in line 456")
102
+ expect(upload).to receive(:error).and_return("Parsing failed in line 456")
102
103
  expect{upload.raise_logs_tf_error}.to raise_error Upload::ParsingFailedError
103
104
  end
104
105
 
105
106
  it "raises MissingAPIKeyOrLoginError" do
106
- upload.stub(:error => "Missing API key or login")
107
+ expect(upload).to receive(:error).and_return("Missing API key or login")
107
108
  expect{upload.raise_logs_tf_error}.to raise_error Upload::MissingAPIKeyOrLoginError
108
109
  end
109
110
 
110
111
  it "raises GuruMeditationError" do
111
- upload.stub(:error => "Guru Meditation")
112
+ expect(upload).to receive(:error).and_return("Guru Meditation")
112
113
  expect{upload.raise_logs_tf_error}.to raise_error Upload::GuruMeditationError
113
114
  end
114
115
 
115
116
  it "raises UnknownLogsTFError" do
116
- upload.stub(:error => "Foobar")
117
+ expect(upload).to receive(:error).and_return("Foobar")
117
118
  expect{upload.raise_logs_tf_error}.to raise_error Upload::UnknownLogsTfError
118
119
  end
119
120
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logs_tf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arie
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.8'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multipart-post
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -138,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.4.8
141
+ rubygems_version: 3.2.32
143
142
  signing_key:
144
143
  specification_version: 4
145
144
  summary: Logs.tf