reivt 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +1 -1
- data/exe/revit +1 -1
- data/lib/{revit → reivt}/api/mutations/document_create.mutation.rb +2 -2
- data/lib/{revit → reivt}/api/mutations/document_delete.mutation.rb +2 -2
- data/lib/{revit → reivt}/api/mutations/rev_create.mutation.rb +1 -1
- data/lib/{revit → reivt}/api/mutations/rev_delete.mutation.rb +2 -2
- data/lib/{revit → reivt}/api/mutations/user_create.mutation.rb +1 -1
- data/lib/{revit → reivt}/api/mutations/user_signin.mutation.rb +1 -1
- data/lib/{revit → reivt}/api.rb +7 -7
- data/lib/{revit → reivt}/auth.rb +5 -5
- data/lib/{revit → reivt}/cli.rb +8 -8
- data/lib/{revit → reivt}/document.rb +1 -1
- data/lib/{revit → reivt}/exception.rb +1 -1
- data/lib/{revit → reivt}/util.rb +5 -5
- data/lib/reivt/version.rb +3 -0
- data/lib/{revit.rb → reivt.rb} +11 -11
- data/revit.gemspec +2 -2
- metadata +16 -16
- data/lib/revit/version.rb +0 -3
- /data/lib/{revit → reivt}/schema/schema.json +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5ce822e873bc5b0301231c3c6eb161a6e16b9b
|
4
|
+
data.tar.gz: 9d153f849c288ef9f2717461fe3091974e2d27ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9158ad213c232d9ec353997baf2a52528e417c3512e520f3e1747c29893a348cdfccd16655163a09a13fc914341705856e7a2bddb56849669fd863db1ba3e5f9
|
7
|
+
data.tar.gz: 7f868c6c8d1dd80272bfcc25fb2631399f7d372f131ea1bd3c65099287a01667548faa08e4aa39648be326661b2be5b8808d98ce8cb98b0992c32ae4ffa68bc1
|
data/bin/console
CHANGED
data/exe/revit
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# @author [brwnrclse]
|
4
4
|
#
|
5
|
-
module
|
5
|
+
module Reivt
|
6
6
|
# An extension of the RevAPI module
|
7
7
|
#
|
8
8
|
# @author [brwnrclse]
|
@@ -34,7 +34,7 @@ module Revit
|
|
34
34
|
end
|
35
35
|
|
36
36
|
if rev_id.length < 25
|
37
|
-
raise
|
37
|
+
raise Reivt::GraphQLValidationException, 'Missing rev id'
|
38
38
|
end
|
39
39
|
|
40
40
|
result = CLIENT.query(CreateDocumentMutation, variables: {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# @author [brwnrclse]
|
4
4
|
#
|
5
|
-
module
|
5
|
+
module Reivt
|
6
6
|
# An extension of the RevAPI module
|
7
7
|
#
|
8
8
|
# @author [brwnrclse]
|
@@ -24,7 +24,7 @@ module Revit
|
|
24
24
|
#
|
25
25
|
def self.delete_doc(id)
|
26
26
|
if id.length < 25
|
27
|
-
raise raise
|
27
|
+
raise raise Reivt::GraphQLValidationException, 'Missing id to delete'
|
28
28
|
end
|
29
29
|
|
30
30
|
result = CLIENT.query(DeleteDocumentMutation, variables: { id: id })
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# @author [brwnrclse]
|
4
4
|
#
|
5
|
-
module
|
5
|
+
module Reivt
|
6
6
|
# An extension of the RevAPI module
|
7
7
|
#
|
8
8
|
# @author [brwnrclse]
|
@@ -24,7 +24,7 @@ module Revit
|
|
24
24
|
#
|
25
25
|
def self.delete_rev(id)
|
26
26
|
if id.length < 25
|
27
|
-
raise
|
27
|
+
raise Reivt::GraphQLValidationException, 'Missing id to delete'
|
28
28
|
end
|
29
29
|
|
30
30
|
result = CLIENT.query(RevAPI::DeleteRevMutation, variables: { id: id })
|
data/lib/{revit → reivt}/api.rb
RENAMED
@@ -1,21 +1,21 @@
|
|
1
1
|
require 'graphql/client'
|
2
2
|
require 'graphql/client/http'
|
3
3
|
|
4
|
-
# An extension of our main module
|
4
|
+
# An extension of our main module Reivt
|
5
5
|
#
|
6
6
|
# @author [brwnrclse]
|
7
7
|
#
|
8
|
-
module
|
8
|
+
module Reivt
|
9
9
|
# Intrface for rev API, connects local changes with our remote.
|
10
10
|
#
|
11
11
|
# @author [brwnrclse]
|
12
12
|
#
|
13
13
|
module RevAPI
|
14
|
-
SCHEMA_PATH = "#{Dir.pwd}/lib/
|
14
|
+
SCHEMA_PATH = "#{Dir.pwd}/lib/reivt/schema/schema.json".freeze
|
15
15
|
ENDPOINT_URL = 'https://api.graph.cool/simple/v1/revwver'.freeze
|
16
16
|
ENDPOINT = GraphQL::Client::HTTP.new(ENDPOINT_URL) do
|
17
17
|
def headers(_context)
|
18
|
-
auth_token =
|
18
|
+
auth_token = Reivt::REIVT_STORE.transaction do |store|
|
19
19
|
store.fetch(:auth0_id, nil)
|
20
20
|
end
|
21
21
|
|
@@ -23,7 +23,7 @@ module Revit
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
ID_TOKEN =
|
26
|
+
ID_TOKEN = Reivt::REIVT_STORE.transaction do |store|
|
27
27
|
store.fetch(:user_id, nil)
|
28
28
|
end
|
29
29
|
|
@@ -45,11 +45,11 @@ module Revit
|
|
45
45
|
data = api_response.data
|
46
46
|
|
47
47
|
if errors.key?(:data)
|
48
|
-
raise
|
48
|
+
raise Reivt::GraphQLDataException, errors[:data].join(', ')
|
49
49
|
end
|
50
50
|
|
51
51
|
if data.errors.any?
|
52
|
-
raise
|
52
|
+
raise Reivt::GraphQLDataException, data.errors[:data].join(', ')
|
53
53
|
end
|
54
54
|
|
55
55
|
data
|
data/lib/{revit → reivt}/auth.rb
RENAMED
@@ -10,7 +10,7 @@ require 'uri'
|
|
10
10
|
#
|
11
11
|
# @author [brwnrclse]
|
12
12
|
#
|
13
|
-
module
|
13
|
+
module Reivt
|
14
14
|
# Convience module for handling our authentication actions and talking to
|
15
15
|
# Auth0
|
16
16
|
#
|
@@ -19,11 +19,11 @@ module Revit
|
|
19
19
|
module Auth
|
20
20
|
AUTH_CALLBACK_URL = 'https://rev.vaemoi.co/login_success'.freeze
|
21
21
|
AUTH_CLIENT_ID = 'Q1fRDQ9u3oN33ok0ciIi9Vww5kV8U8MA'.freeze
|
22
|
-
AUTH0_ID =
|
23
|
-
|
22
|
+
AUTH0_ID = Reivt::REIVT_STORE.transaction do
|
23
|
+
Reivt::REIVT_STORE.fetch(:auth0_id, nil)
|
24
24
|
end
|
25
|
-
AUTH_STORE_ACCESS_TOKEN =
|
26
|
-
|
25
|
+
AUTH_STORE_ACCESS_TOKEN = Reivt::REIVT_STORE.transaction do
|
26
|
+
Reivt::REIVT_STORE.fetch(:access_token, nil)
|
27
27
|
end
|
28
28
|
AUTH_URL = 'https://vaemoi.auth0.com'.freeze
|
29
29
|
VERIFIER = Sysrandom.urlsafe_base64(32)
|
data/lib/{revit → reivt}/cli.rb
RENAMED
@@ -8,7 +8,7 @@ require 'tty-spinner'
|
|
8
8
|
#
|
9
9
|
# @author [brwnrclse]
|
10
10
|
#
|
11
|
-
module
|
11
|
+
module Reivt
|
12
12
|
#
|
13
13
|
# Rev's cli
|
14
14
|
#
|
@@ -95,10 +95,10 @@ module Revit
|
|
95
95
|
puts "\nLogin at #{Paint['wver.vaemoi.co/', :green]} to start your rev!\n"
|
96
96
|
rescue Errno::ECONNRESET, Errno::EINVAL, EOFError, Net::HTTPBadResponse,
|
97
97
|
Net::HTTPHeaderSyntaxError, Net::OpenTimeout, Net::ProtocolError,
|
98
|
-
|
99
|
-
|
98
|
+
Reivt::BaemptyException, Reivt::GraphQLDataException,
|
99
|
+
Reivt::GraphQLValidationException => e
|
100
100
|
|
101
|
-
|
101
|
+
Reivt::DEVLOGGER.error(e.message)
|
102
102
|
spinner.error(e.message)
|
103
103
|
|
104
104
|
doc_ids.each do |id|
|
@@ -136,7 +136,7 @@ module Revit
|
|
136
136
|
spinner.success(Paint['User created', :green])
|
137
137
|
end
|
138
138
|
|
139
|
-
|
139
|
+
Reivt::REIVT_STORE.transaction do |store|
|
140
140
|
store[:access_token] = auth_token[:access_token].strip
|
141
141
|
store[:expires] = auth_token[:expires]
|
142
142
|
store[:auth0_id] = auth_token[:auth0_id].strip
|
@@ -146,10 +146,10 @@ module Revit
|
|
146
146
|
rescue Errno::ECONNRESET, Errno::EINVAL, EOFError,
|
147
147
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
148
148
|
Net::OpenTimeout, Net::ProtocolError,
|
149
|
-
|
150
|
-
|
149
|
+
Reivt::GraphQLDataException,
|
150
|
+
Reivt::GraphQLValidationException => e
|
151
151
|
|
152
|
-
|
152
|
+
Reivt::DEVLOGGER.error(e.message)
|
153
153
|
spinner.error(Paint[e.message, :red])
|
154
154
|
end
|
155
155
|
end
|
data/lib/{revit → reivt}/util.rb
RENAMED
@@ -6,8 +6,8 @@ require 'tempfile'
|
|
6
6
|
#
|
7
7
|
# @author [brwnrclse]
|
8
8
|
#
|
9
|
-
module
|
10
|
-
# A collection of utility functions for use with
|
9
|
+
module Reivt
|
10
|
+
# A collection of utility functions for use with reivt
|
11
11
|
#
|
12
12
|
# @author [brwnrclse]
|
13
13
|
#
|
@@ -33,7 +33,7 @@ module Revit
|
|
33
33
|
#
|
34
34
|
# @param path [String] Location on the filesystem to access for files
|
35
35
|
#
|
36
|
-
# @return [Array<
|
36
|
+
# @return [Array<Reivt::Document>] List of documents from directory
|
37
37
|
#
|
38
38
|
def self.docs_from_dir(path)
|
39
39
|
docs = []
|
@@ -52,14 +52,14 @@ module Revit
|
|
52
52
|
#
|
53
53
|
# @param path [String] Location on the filesystem to access for files
|
54
54
|
#
|
55
|
-
# @return [Array<
|
55
|
+
# @return [Array<Reivt::Document>] List of documents from repo commit
|
56
56
|
#
|
57
57
|
def self.docs_from_repo(path)
|
58
58
|
docs = []
|
59
59
|
repo = Rugged::Repository.discover(path)
|
60
60
|
|
61
61
|
if repo.bare? || repo.empty?
|
62
|
-
raise
|
62
|
+
raise Reivt::BaemptyException, "Bad repo: #{path}"
|
63
63
|
end
|
64
64
|
|
65
65
|
commit = repo.head.target
|
data/lib/{revit.rb → reivt.rb}
RENAMED
@@ -14,19 +14,19 @@ require 'pstore'
|
|
14
14
|
#
|
15
15
|
# @author [brwnrclse]
|
16
16
|
#
|
17
|
-
module
|
18
|
-
FileUtils.mkdir_p("#{Dir.home}/.
|
17
|
+
module Reivt
|
18
|
+
FileUtils.mkdir_p("#{Dir.home}/.reivt")
|
19
19
|
|
20
|
-
|
21
|
-
DEVLOGGER = Logger.new("#{Dir.home}/.
|
20
|
+
REIVT_STORE = PStore.new("#{Dir.home}/.reivt/reivt.pstore")
|
21
|
+
DEVLOGGER = Logger.new("#{Dir.home}/.reivt/reivt-dev.log")
|
22
22
|
|
23
23
|
DEVLOGGER.datetime_format = '%Y-%m-%d %H:%M:%S '
|
24
24
|
end
|
25
25
|
|
26
|
-
require '
|
27
|
-
require '
|
28
|
-
require '
|
29
|
-
require '
|
30
|
-
require '
|
31
|
-
require '
|
32
|
-
require '
|
26
|
+
require 'reivt/api'
|
27
|
+
require 'reivt/auth'
|
28
|
+
require 'reivt/cli'
|
29
|
+
require 'reivt/document'
|
30
|
+
require 'reivt/exception'
|
31
|
+
require 'reivt/util'
|
32
|
+
require 'reivt/version'
|
data/revit.gemspec
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
|
4
4
|
lib = File.expand_path('../lib', __FILE__)
|
5
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
-
require '
|
6
|
+
require 'reivt/version'
|
7
7
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = 'reivt'
|
10
|
-
spec.version =
|
10
|
+
spec.version = Reivt::VERSION
|
11
11
|
spec.authors = ['vaemoi', 'Barry Harris, Tarik Massac']
|
12
12
|
spec.email = ['dev@vaemoi.co', 'brwnrclse@vaemoi.co', 'tai@vaemoi.co']
|
13
13
|
spec.summary = 'Creating and uploading code reviews to use with rev'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reivt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaemoi
|
@@ -237,21 +237,21 @@ files:
|
|
237
237
|
- guides/GraphQLDataIssue.md
|
238
238
|
- guides/GraphQLValidationError.md
|
239
239
|
- guides/LoggingIn.md
|
240
|
-
- lib/
|
241
|
-
- lib/
|
242
|
-
- lib/
|
243
|
-
- lib/
|
244
|
-
- lib/
|
245
|
-
- lib/
|
246
|
-
- lib/
|
247
|
-
- lib/
|
248
|
-
- lib/
|
249
|
-
- lib/
|
250
|
-
- lib/
|
251
|
-
- lib/
|
252
|
-
- lib/
|
253
|
-
- lib/
|
254
|
-
- lib/
|
240
|
+
- lib/reivt.rb
|
241
|
+
- lib/reivt/api.rb
|
242
|
+
- lib/reivt/api/mutations/document_create.mutation.rb
|
243
|
+
- lib/reivt/api/mutations/document_delete.mutation.rb
|
244
|
+
- lib/reivt/api/mutations/rev_create.mutation.rb
|
245
|
+
- lib/reivt/api/mutations/rev_delete.mutation.rb
|
246
|
+
- lib/reivt/api/mutations/user_create.mutation.rb
|
247
|
+
- lib/reivt/api/mutations/user_signin.mutation.rb
|
248
|
+
- lib/reivt/auth.rb
|
249
|
+
- lib/reivt/cli.rb
|
250
|
+
- lib/reivt/document.rb
|
251
|
+
- lib/reivt/exception.rb
|
252
|
+
- lib/reivt/schema/schema.json
|
253
|
+
- lib/reivt/util.rb
|
254
|
+
- lib/reivt/version.rb
|
255
255
|
- revit.gemspec
|
256
256
|
- revit.sublime-project
|
257
257
|
homepage: https://rev.vaemoi.co
|
data/lib/revit/version.rb
DELETED
File without changes
|