reqres_rspec 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -16
- data/lib/reqres_rspec/uploaders.rb +1 -2
- data/lib/reqres_rspec/version.rb +1 -1
- data/lib/reqres_rspec.rb +0 -1
- data/reqres_rspec.gemspec +0 -1
- metadata +3 -18
- data/lib/reqres_rspec/uploaders/google_drive.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b38750f5220de33c0368d31712309ac4931ef316
|
4
|
+
data.tar.gz: 8aa7c34a80eae9ff885a3c1fde8e81d697654b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36b28294db8d302964a3df248cb70ad9ad76bd609652c080cc28228ea51b8ecdbb746e9f430117f9cdc2f4f7d81ba4a064251101ed514d0f724c8bacdc142b1f
|
7
|
+
data.tar.gz: 76fed227164b295fc9a572de43cdb7ffa05aa4ea6f19d7ef09f87868064dc6ebc13615789887b7b8b4363678af9665f9089133a8efc0087a92884bd262a21f77
|
data/README.md
CHANGED
@@ -54,22 +54,6 @@ Then run
|
|
54
54
|
|
55
55
|
`REQRES_RSPEC=1 REQRES_UPLOAD=AmazonS3 bundle exec rspec --order=defined`
|
56
56
|
|
57
|
-
|
58
|
-
## Upload to Google Drive
|
59
|
-
|
60
|
-
Follow "Create a client ID and client secret" in [this page](https://developers.google.com/drive/web/auth/web-server) to get OAuth credentials.
|
61
|
-
|
62
|
-
Set environment variables
|
63
|
-
|
64
|
-
```
|
65
|
-
GOOGLE_CLIENT_ID
|
66
|
-
GOOGLE_CLIENT_SECRET
|
67
|
-
```
|
68
|
-
|
69
|
-
`REQRES_RSPEC=1 REQRES_UPLOAD=GoogleDrive bundle exec rspec --order=defined`
|
70
|
-
|
71
|
-
Follow instructions in console.
|
72
|
-
|
73
57
|
### Sample controller action
|
74
58
|
|
75
59
|
```ruby
|
data/lib/reqres_rspec/version.rb
CHANGED
data/lib/reqres_rspec.rb
CHANGED
@@ -9,7 +9,6 @@ require 'reqres_rspec/formatters/json'
|
|
9
9
|
require 'reqres_rspec/formatters/pdf'
|
10
10
|
require 'reqres_rspec/uploaders'
|
11
11
|
require 'reqres_rspec/uploaders/amazon_s3'
|
12
|
-
require 'reqres_rspec/uploaders/google_drive'
|
13
12
|
|
14
13
|
if defined?(RSpec) && ENV['REQRES_RSPEC'] == '1'
|
15
14
|
collector = ReqresRspec::Collector.new
|
data/reqres_rspec.gemspec
CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency 'coderay'
|
22
22
|
spec.add_dependency 'mime-types'
|
23
23
|
spec.add_dependency 'aws-sdk-core', '~> 2.0'
|
24
|
-
spec.add_dependency 'google_drive'
|
25
24
|
|
26
25
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
27
26
|
spec.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reqres_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rilian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderay
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: google_drive
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: bundler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +110,6 @@ files:
|
|
124
110
|
- lib/reqres_rspec/templates/spec.erb
|
125
111
|
- lib/reqres_rspec/uploaders.rb
|
126
112
|
- lib/reqres_rspec/uploaders/amazon_s3.rb
|
127
|
-
- lib/reqres_rspec/uploaders/google_drive.rb
|
128
113
|
- lib/reqres_rspec/utils.rb
|
129
114
|
- lib/reqres_rspec/version.rb
|
130
115
|
- reqres_rspec.gemspec
|
@@ -148,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
133
|
version: '0'
|
149
134
|
requirements: []
|
150
135
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.5.1
|
152
137
|
signing_key:
|
153
138
|
specification_version: 4
|
154
139
|
summary: Generates API documentation in PDF, HTML, JSON, YAML format for integration
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'google/api_client'
|
2
|
-
require 'google_drive'
|
3
|
-
|
4
|
-
module ReqresRspec
|
5
|
-
module Uploader
|
6
|
-
# You can find more detailed information here https://github.com/gimite/google-drive-ruby
|
7
|
-
class GoogleDrive
|
8
|
-
def initialize
|
9
|
-
@path = ReqresRspec.configuration.output_path
|
10
|
-
@logger = ReqresRspec.logger
|
11
|
-
|
12
|
-
client = Google::APIClient.new
|
13
|
-
auth = client.authorization
|
14
|
-
auth.client_id = ENV['GOOGLE_CLIENT_ID']
|
15
|
-
auth.client_secret = ENV['GOOGLE_CLIENT_SECRET']
|
16
|
-
auth.scope = [
|
17
|
-
'https://www.googleapis.com/auth/drive',
|
18
|
-
'https://spreadsheets.google.com/feeds/'
|
19
|
-
]
|
20
|
-
auth.redirect_uri = 'urn:ietf:wg:oauth:2.0:oob'
|
21
|
-
puts("\n\n1. Open this page:\n%s\n\n" % auth.authorization_uri)
|
22
|
-
puts('2. Enter the authorization code shown in the page: ')
|
23
|
-
auth.code = $stdin.gets.chomp
|
24
|
-
auth.fetch_access_token!
|
25
|
-
access_token = auth.access_token
|
26
|
-
@session = GoogleDrive::GoogleDrive.login_with_oauth(access_token)
|
27
|
-
end
|
28
|
-
|
29
|
-
attr_reader :logger, :path
|
30
|
-
|
31
|
-
def self.upload
|
32
|
-
uploader = self.new
|
33
|
-
uploader.process
|
34
|
-
end
|
35
|
-
|
36
|
-
def process
|
37
|
-
Dir["#{path}/**/*"].each { |file|
|
38
|
-
next if File.directory?(file)
|
39
|
-
local_path = file.gsub("#{@path}/", '')
|
40
|
-
|
41
|
-
start = Time.now
|
42
|
-
@session.upload_from_file(file, local_path, convert: false)
|
43
|
-
done = Time.now
|
44
|
-
|
45
|
-
puts "\n[#{local_path}] Uploaded in #{done.to_i - start.to_i}s"
|
46
|
-
}
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|