git-semver-cop 1.2.0 → 1.3.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: 5d93939abae0b642d056eddda577cb8b1bb91b6d
4
- data.tar.gz: e9946821a38aab84976d21d6568915b052532360
3
+ metadata.gz: d2b9d994d7c3dc9f0605d651dec3f345295b6cc9
4
+ data.tar.gz: cc2900d13274be1c014a4139b341fe930664d8fe
5
5
  SHA512:
6
- metadata.gz: 66ddb5aed3bdfe0b788d1ea63987ff1a20ee64a097154a724fdde494f544716c1cec93220addd3fe9b2fedf4a88162be457b597ce0135bd13f3b1d9a0a57e5a1
7
- data.tar.gz: bab402eab470a92b94cf47da8b55b87b183df81f588fd4b58adc76ea4c7ba6f080d782e5af1885e38355b00268a361ffaff0c7a98c96740fdd69244759644925
6
+ metadata.gz: dcd09cdd5b75770dd1d027d4c7ef64cc51a8be2feca5eaf5c0479501b596be0eb98fd32cae3c83dba56cb63f88bf7c78ee2c1c79291d041069ccbcc8a9fed162
7
+ data.tar.gz: 1be54368ad4d4814106d5ab62d9d9fa2e2a3645b57fb4dea58aa104d3c9279acfd95267986841450c013ac58b98ee935066de7b3b02f9ded98cd139366c92e27
@@ -10,7 +10,18 @@ module GitSemverCop
10
10
  end
11
11
 
12
12
  def self.destination
13
- File.expand_path(".git/hooks/pre-commit", Dir.pwd)
13
+ # For submodules which have a .git file that points to the module
14
+ hooks_dir = "/hooks/pre-commit"
15
+
16
+ if File.file?(".git")
17
+ File.expand_path(submodule_git + hooks_dir, Dir.pwd)
18
+ else
19
+ File.expand_path(".git" + hooks_dir, Dir.pwd)
20
+ end
21
+ end
22
+
23
+ def self.submodule_git
24
+ File.read(".git").strip[/^(gitdir: )(.+)$/, 2]
14
25
  end
15
26
 
16
27
  desc "init", "Generates a pre-commit hook to ensure you update your .semver"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-semver-cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Farah