arcanus 0.9.0 → 0.10.0

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
2
  SHA1:
3
- metadata.gz: 8575f8a22c444666c7442acbdd8c57e7f6b69097
4
- data.tar.gz: 275c2b13e0cd12e4ab752e16995b733eac412823
3
+ metadata.gz: 888bf2081e42c456d9276d560543cce366fff384
4
+ data.tar.gz: e2ec43b0bf7fde05b039026e6c38122608a625ab
5
5
  SHA512:
6
- metadata.gz: fcf188423860de011f8baf0b51c0fd497c1a60a1121035000df44daade3300b673dbe7e33819dc9235e360ff683b3396a17bb47d67016244e6d82204b7c53082
7
- data.tar.gz: 586375c09267f2b2c2339ef83f90f6f2f1593c6ef06d13cedc03f279d73f91766594ffe6464143f96a53c3b42c534278c964850e3ac3074c10875471e9cf1b03
6
+ metadata.gz: 9f87f25ab4192c8223b65655e2daaa922ab7292c86690b948c08686bffc7c86cd52503762ef7af48264d3f15b621a3afc62776809c16d4fdbfd2b2a1bdf57a82
7
+ data.tar.gz: 74140896c221a1049e7ecd5437ec5b114100971cb26bf3a42f0ad742b368c7e03088a57f3f129b5fa3fb308207948382a7c6e0db65110dd4a1f553d078478322
@@ -27,8 +27,9 @@ module Arcanus::Errors
27
27
  # Raised when invalid/non-existent command was used.
28
28
  class CommandInvalidError < UsageError; end
29
29
 
30
- # Raised when run in a directory not part of a valid git repository.
31
- class InvalidGitRepoError < UsageError; end
30
+ # Raised when run in a directory not part of a repository with Arcanus
31
+ # installed.
32
+ class InvalidArcanusRepoError < UsageError; end
32
33
 
33
34
  # Raised when a key path corresponding to a non-existent key is specified.
34
35
  class InvalidKeyPathError < UsageError; end
@@ -12,44 +12,22 @@ module Arcanus
12
12
  # current working directory resides within.
13
13
  #
14
14
  # @return [String]
15
- # @raise [Arcanus::Errors::InvalidGitRepoError] if the current directory
15
+ # @raise [Arcanus::Errors::InvalidArcanusRepoError] if the current directory
16
16
  # doesn't reside within a git repository
17
17
  def root
18
18
  @root ||=
19
19
  begin
20
- git_dir = Pathname.new(File.expand_path('.'))
20
+ arc_dir = Pathname.new(File.expand_path('.'))
21
21
  .enum_for(:ascend)
22
22
  .find do |path|
23
- (path + '.git').exist?
23
+ (path + '.arcanus').exist?
24
24
  end
25
25
 
26
- unless git_dir
27
- raise Errors::InvalidGitRepoError, 'no .git directory found'
26
+ unless arc_dir
27
+ raise Errors::InvalidArcanusRepoError, 'no .arcanus directory found'
28
28
  end
29
29
 
30
- git_dir.to_s
31
- end
32
- end
33
-
34
- # Returns an absolute path to the .git directory for a repo.
35
- #
36
- # @return [String]
37
- def git_dir
38
- @git_dir ||=
39
- begin
40
- git_dir = File.expand_path('.git', root)
41
-
42
- # .git could also be a file that contains the location of the git directory
43
- unless File.directory?(git_dir)
44
- git_dir = File.read(git_dir)[/^gitdir: (.*)$/, 1]
45
-
46
- # Resolve relative paths
47
- unless git_dir.start_with?('/')
48
- git_dir = File.expand_path(git_dir, repo_dir)
49
- end
50
- end
51
-
52
- git_dir
30
+ arc_dir.to_s
53
31
  end
54
32
  end
55
33
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Arcanus
5
- VERSION = '0.9.0'.freeze
5
+ VERSION = '0.10.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcanus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva