avocado-docs 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9e17577dcc185b2fafb1cd6541a87786faa7c952
4
- data.tar.gz: c5951ac8cdc378125d3864dff8937a749dfab2b7
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzYzZWYwOWEzYzFkOGMzYzBlMjJiNzZlYjFiODc5ODg5YjI1NTY5Zg==
5
+ data.tar.gz: !binary |-
6
+ Njg3Zjg4ZjVjNGQ2MDY5ZWU0NzZlNzUzNDVhYTJjODUxNGEwYjNjZg==
5
7
  SHA512:
6
- metadata.gz: 91692ba66fdbdec0bbc5b4a2ba674c309a81ee9aa5ee42fd97faaa2d5f8272e0f89daf2a726bb3477621710c9ed90ae47f909ddee05051c441070084906a5ad8
7
- data.tar.gz: f2d670c5a0bc653b0c1b47eb598233f2e2800144d30e05d402a634ae3b424347c6af16103cabbbdab670cdc62e7b5ff118e23a7dfcacf181cf5aca9d479bfe7f
8
+ metadata.gz: !binary |-
9
+ NTA2YjQyYTc2MTcyOWZiZmE5MjUxZjhmNDU0YmQ5MDg5OGFhMjIwZDE2ZDJl
10
+ NTIwYzk3YTJjNzQ5YjUyMjcwMmJhOTgzOTY5ZjhkODY3ZTEzYTVkZmRjNjli
11
+ ODA0N2IwNmZmMThkOTU4ZjhjMTE5M2YzOTA1ZTI5ZjE0MzJjNjU=
12
+ data.tar.gz: !binary |-
13
+ NTAyNDIyY2RiNTA2OGZhOGEzNjM0NGQ0M2VmNGQ4MTY3NGU0ZTU0M2I0MGNi
14
+ MjI1YjkxMGNhYTE5MzEwYWZmYWE1MTU3NmU0NzZiNmNhYWY2MTc3MTFkMTEx
15
+ MGE2Zjk3NDdhNDQxZThjZWUyMTZkYzZlYTNiZTUyMTE3M2ZiNjI=
@@ -4,6 +4,7 @@ require 'avocado/uploader'
4
4
  require 'avocado/controller'
5
5
  require 'avocado/request_store'
6
6
  require 'avocado/packages/package'
7
+ require 'avocado/packages/minitest_package'
7
8
  require 'avocado/packages/rspec_package'
8
9
  require 'avocado/middleware'
9
10
  require 'avocado/middleware/defaults'
@@ -17,4 +18,4 @@ module Avocado
17
18
  Avocado::RequestStore.instance.reset!
18
19
  Avocado::Uploader.instance.payload = []
19
20
  end
20
- end
21
+ end
@@ -0,0 +1,36 @@
1
+ module MinitestAvocadoPlugin
2
+ def before_setup
3
+ super
4
+ ActionController::Base.send :include, Avocado::Controller
5
+ ActionController::API.send :include, Avocado::Controller if defined?(ActionController::API)
6
+ end
7
+
8
+ def before_teardown
9
+ super
10
+ request = Avocado::RequestStore.instance.request
11
+ response = Avocado::RequestStore.instance.response
12
+
13
+ if request && response
14
+ package = Avocado::Packages::MinitestPackage.new(name, request, response)
15
+ Avocado::Middleware.invoke(package) do
16
+ Avocado::Uploader.instance.payload << Avocado::RequestStore.instance.json
17
+ end
18
+ end
19
+
20
+ Avocado::RequestStore.instance.reset!
21
+ end
22
+ end
23
+
24
+ class MiniTest::Test
25
+ include MinitestAvocadoPlugin
26
+ end
27
+
28
+ if MiniTest::Unit.respond_to? :after_run
29
+ MiniTest::Unit.after_run do
30
+ Avocado::Uploader.instance.upload!
31
+ end
32
+ else
33
+ MiniTest.after_run do
34
+ Avocado::Uploader.instance.upload!
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ module Avocado
2
+ module Packages
3
+ class MinitestPackage < Package
4
+
5
+ def description
6
+ example
7
+ end
8
+
9
+ def document?
10
+ true
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -10,7 +10,7 @@ module Avocado
10
10
 
11
11
  def upload!
12
12
  return unless should_upload?
13
- WebMock.allow_net_connect!
13
+ WebMock.allow_net_connect! if defined? WebMock
14
14
  write_payload_to_json_file do |file|
15
15
  request = Net::HTTP::Post::Multipart.new uri.path, 'file' => UploadIO.new(file, 'text/json', 'avocado.json')
16
16
  net_request = Net::HTTP.new(uri.host, uri.port)
@@ -18,7 +18,7 @@ module Avocado
18
18
  net_request.start { |http| http.request(request) }
19
19
  end
20
20
  ensure
21
- WebMock.disable_net_connect!
21
+ WebMock.disable_net_connect! if defined? WebMock
22
22
  end
23
23
 
24
24
  private
@@ -1,3 +1,3 @@
1
1
  module Avocado
2
- VERSION = "3.0.3"
2
+ VERSION = '3.0.4'
3
3
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avocado-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-06 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.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
26
  version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multipart-post
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.14'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: combustion
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.15'
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
96
  version: '1.15'
97
97
  description: Avocado listens for JSON responses in the test environment and generates
@@ -140,6 +140,8 @@ files:
140
140
  - lib/avocado/middleware/request_serialization.rb
141
141
  - lib/avocado/middleware/resource_serialization.rb
142
142
  - lib/avocado/middleware/response_serialization.rb
143
+ - lib/avocado/minitest.rb
144
+ - lib/avocado/packages/minitest_package.rb
143
145
  - lib/avocado/packages/package.rb
144
146
  - lib/avocado/packages/rspec_package.rb
145
147
  - lib/avocado/request_store.rb
@@ -155,17 +157,17 @@ require_paths:
155
157
  - lib
156
158
  required_ruby_version: !ruby/object:Gem::Requirement
157
159
  requirements:
158
- - - ">="
160
+ - - ! '>='
159
161
  - !ruby/object:Gem::Version
160
162
  version: '0'
161
163
  required_rubygems_version: !ruby/object:Gem::Requirement
162
164
  requirements:
163
- - - ">="
165
+ - - ! '>='
164
166
  - !ruby/object:Gem::Version
165
167
  version: '0'
166
168
  requirements: []
167
169
  rubyforge_project:
168
- rubygems_version: 2.2.2
170
+ rubygems_version: 2.4.5
169
171
  signing_key:
170
172
  specification_version: 4
171
173
  summary: Automatic API documentation from RSpec tests