reivt 1.1.0 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b3c9e087c0ad53503be266bc6f8c01b73293ca9
4
- data.tar.gz: c8a6cbfd57419d6e9728c3bc7a35570f505ab6da
3
+ metadata.gz: 1b5ce822e873bc5b0301231c3c6eb161a6e16b9b
4
+ data.tar.gz: 9d153f849c288ef9f2717461fe3091974e2d27ed
5
5
  SHA512:
6
- metadata.gz: d7db558fdf4a467e2957639f55fa6d3c86fd6a360cc1b1603987e41afda4451460b2b183cc67e718f4cde1d19a00437e2f4bcf72c2f398f61e5276e1b63114ca
7
- data.tar.gz: '096a8b6684da942184392245d58107c12daf07568041dc2ebc76e8dba048253f0ff820eb1142151de61037849e99cb1fcb9cc483c97447da746038d3c67aa192'
6
+ metadata.gz: 9158ad213c232d9ec353997baf2a52528e417c3512e520f3e1747c29893a348cdfccd16655163a09a13fc914341705856e7a2bddb56849669fd863db1ba3e5f9
7
+ data.tar.gz: 7f868c6c8d1dd80272bfcc25fb2631399f7d372f131ea1bd3c65099287a01667548faa08e4aa39648be326661b2be5b8808d98ce8cb98b0992c32ae4ffa68bc1
data/bin/console CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'bundler/setup'
4
4
  require 'paint'
5
- require 'revit'
5
+ require 'reivt'
6
6
 
7
7
  require 'irb'
8
8
 
data/exe/revit CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'revit'
3
+ require 'reivt'
4
4
 
5
5
  Revit::CLI.start(ARGV)
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
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 Revit::GraphQLValidationException, 'Missing rev id'
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 Revit
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 Revit::GraphQLValidationException, 'Missing id to delete'
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 Revit
5
+ module Reivt
6
6
  # An extension of the RevAPI module
7
7
  #
8
8
  # @author [brwnrclse]
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
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 Revit::GraphQLValidationException, 'Missing id to delete'
27
+ raise Reivt::GraphQLValidationException, 'Missing id to delete'
28
28
  end
29
29
 
30
30
  result = CLIENT.query(RevAPI::DeleteRevMutation, variables: { id: id })
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
5
+ module Reivt
6
6
  # An extension of the RevAPI module
7
7
  #
8
8
  # @author [brwnrclse]
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
5
+ module Reivt
6
6
  # An extension of the RevAPI module
7
7
  #
8
8
  # @author [brwnrclse]
@@ -1,21 +1,21 @@
1
1
  require 'graphql/client'
2
2
  require 'graphql/client/http'
3
3
 
4
- # An extension of our main module Revit
4
+ # An extension of our main module Reivt
5
5
  #
6
6
  # @author [brwnrclse]
7
7
  #
8
- module Revit
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/revit/schema/schema.json".freeze
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 = Revit::REVIT_STORE.transaction do |store|
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 = Revit::REVIT_STORE.transaction do |store|
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 Revit::GraphQLDataException, errors[:data].join(', ')
48
+ raise Reivt::GraphQLDataException, errors[:data].join(', ')
49
49
  end
50
50
 
51
51
  if data.errors.any?
52
- raise Revit::GraphQLDataException, data.errors[:data].join(', ')
52
+ raise Reivt::GraphQLDataException, data.errors[:data].join(', ')
53
53
  end
54
54
 
55
55
  data
@@ -10,7 +10,7 @@ require 'uri'
10
10
  #
11
11
  # @author [brwnrclse]
12
12
  #
13
- module Revit
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 = Revit::REVIT_STORE.transaction do
23
- Revit::REVIT_STORE.fetch(:auth0_id, nil)
22
+ AUTH0_ID = Reivt::REIVT_STORE.transaction do
23
+ Reivt::REIVT_STORE.fetch(:auth0_id, nil)
24
24
  end
25
- AUTH_STORE_ACCESS_TOKEN = Revit::REVIT_STORE.transaction do
26
- Revit::REVIT_STORE.fetch(:access_token, nil)
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)
@@ -8,7 +8,7 @@ require 'tty-spinner'
8
8
  #
9
9
  # @author [brwnrclse]
10
10
  #
11
- module Revit
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
- Revit::BaemptyException, Revit::GraphQLDataException,
99
- Revit::GraphQLValidationException => e
98
+ Reivt::BaemptyException, Reivt::GraphQLDataException,
99
+ Reivt::GraphQLValidationException => e
100
100
 
101
- Revit::DEVLOGGER.error(e.message)
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
- Revit::REVIT_STORE.transaction do |store|
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
- Revit::GraphQLDataException,
150
- Revit::GraphQLValidationException => e
149
+ Reivt::GraphQLDataException,
150
+ Reivt::GraphQLValidationException => e
151
151
 
152
- Revit::DEVLOGGER.error(e.message)
152
+ Reivt::DEVLOGGER.error(e.message)
153
153
  spinner.error(Paint[e.message, :red])
154
154
  end
155
155
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
5
+ module Reivt
6
6
  # Blueprint for Document objects
7
7
  #
8
8
  # @author [brwnrclse]
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # @author [brwnrclse]
4
4
  #
5
- module Revit
5
+ module Reivt
6
6
  # Custom errors for dealing with repos in revit
7
7
  #
8
8
  # @author [bwrnrclse]
@@ -6,8 +6,8 @@ require 'tempfile'
6
6
  #
7
7
  # @author [brwnrclse]
8
8
  #
9
- module Revit
10
- # A collection of utility functions for use with revit
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<Revit::Document>] List of documents from directory
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<Revit::Document>] List of documents from repo commit
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 Revit::BaemptyException, "Bad repo: #{path}"
62
+ raise Reivt::BaemptyException, "Bad repo: #{path}"
63
63
  end
64
64
 
65
65
  commit = repo.head.target
@@ -0,0 +1,3 @@
1
+ module Reivt
2
+ VERSION = '1.2.0'.freeze
3
+ end
@@ -14,19 +14,19 @@ require 'pstore'
14
14
  #
15
15
  # @author [brwnrclse]
16
16
  #
17
- module Revit
18
- FileUtils.mkdir_p("#{Dir.home}/.revit")
17
+ module Reivt
18
+ FileUtils.mkdir_p("#{Dir.home}/.reivt")
19
19
 
20
- REVIT_STORE = PStore.new("#{Dir.home}/.revit/revit.pstore")
21
- DEVLOGGER = Logger.new("#{Dir.home}/.revit/revit-dev.log")
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 'revit/api'
27
- require 'revit/auth'
28
- require 'revit/cli'
29
- require 'revit/document'
30
- require 'revit/exception'
31
- require 'revit/util'
32
- require 'revit/version'
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 'revit/version'
6
+ require 'reivt/version'
7
7
 
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = 'reivt'
10
- spec.version = Revit::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.1.0
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/revit.rb
241
- - lib/revit/api.rb
242
- - lib/revit/api/mutations/document_create.mutation.rb
243
- - lib/revit/api/mutations/document_delete.mutation.rb
244
- - lib/revit/api/mutations/rev_create.mutation.rb
245
- - lib/revit/api/mutations/rev_delete.mutation.rb
246
- - lib/revit/api/mutations/user_create.mutation.rb
247
- - lib/revit/api/mutations/user_signin.mutation.rb
248
- - lib/revit/auth.rb
249
- - lib/revit/cli.rb
250
- - lib/revit/document.rb
251
- - lib/revit/exception.rb
252
- - lib/revit/schema/schema.json
253
- - lib/revit/util.rb
254
- - lib/revit/version.rb
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
@@ -1,3 +0,0 @@
1
- module Revit
2
- VERSION = '1.1.0'.freeze
3
- end
File without changes