cocoapods-githooks 1.0.1 → 1.0.2
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/lib/cocoapods-githooks.rb +1 -1
- data/lib/cocoapods_plugin.rb +3 -5
- data/lib/command/githooks.rb +10 -11
- data/lib/{githooks-synctool.rb → githooks-sync.rb} +9 -8
- data/lib/githooks-sync_BACKUP_71354.rb +36 -0
- data/lib/githooks-sync_BACKUP_71547.rb +36 -0
- data/lib/githooks-sync_BASE_71354.rb +0 -0
- data/lib/githooks-sync_BASE_71547.rb +0 -0
- data/lib/githooks-sync_LOCAL_71354.rb +36 -0
- data/lib/githooks-sync_LOCAL_71547.rb +36 -0
- data/lib/githooks-sync_REMOTE_71354.rb +0 -0
- data/lib/githooks-sync_REMOTE_71547.rb +0 -0
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3907375d57ee5bfa10521f33292028b7d6ad30a673428f346fdec5b6b9e9da1
|
4
|
+
data.tar.gz: 6b93084fdcb8fdf467c73000f381f32772d21c8a992605684d82af22f265e531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcc3fc9e93d79b9b200285783ac74ca422c9fb2d0817391af14dcf1d68ecf7f95d964d1dbe90e7a9616493c9410af0bf3c022a5a3bb6f13438c2b6d812947de6
|
7
|
+
data.tar.gz: b0a7d43d8c9d772a61e32aee14a1f8c7fe87e2319c74608260f5332cf53f6f00879891fd1680b094275983da4127bda851f7128931645e5d6476cad51a7771f3
|
data/lib/cocoapods-githooks.rb
CHANGED
data/lib/cocoapods_plugin.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'command/githooks'
|
2
|
-
require_relative 'githooks-
|
2
|
+
require_relative 'githooks-sync'
|
3
3
|
|
4
4
|
module CocoapodsGitHooks
|
5
5
|
Pod::HooksManager.register('cocoapods-githooks', :post_install) do |context|
|
6
|
-
|
7
|
-
githooks.sync()
|
6
|
+
GitHooksSync.new().sync()
|
8
7
|
end
|
9
8
|
Pod::HooksManager.register('cocoapods-githooks', :post_update) do |context|
|
10
|
-
|
11
|
-
githooks.sync()
|
9
|
+
GitHooksSync.new().sync()
|
12
10
|
end
|
13
11
|
end
|
data/lib/command/githooks.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'cocoapods'
|
2
|
-
require 'githooks-
|
2
|
+
require 'githooks-sync'
|
3
3
|
|
4
4
|
include CocoapodsGitHooks
|
5
5
|
|
@@ -7,19 +7,18 @@ module Pod
|
|
7
7
|
class Command
|
8
8
|
class Githooks < Command
|
9
9
|
self.summary = <<-SUMMARY
|
10
|
-
|
11
|
-
|
10
|
+
Syncs hooks between team members
|
11
|
+
SUMMARY
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
self.description = <<-DESC
|
14
|
+
CocoaPods plugins that syncs git-hooks placed in .git-hooks directory between team members
|
15
|
+
DESC
|
16
16
|
|
17
17
|
self.arguments = []
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
19
|
+
def run
|
20
|
+
CocoapodsGitHooks::GitHooksSync.new.sync()
|
21
|
+
end
|
24
22
|
end
|
23
|
+
end
|
25
24
|
end
|
@@ -2,19 +2,19 @@ require 'cocoapods'
|
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
4
|
module CocoapodsGitHooks
|
5
|
-
class
|
5
|
+
class GitHooksSync
|
6
6
|
def sync
|
7
7
|
Pod::UI.puts "Synchronizing git hooks"
|
8
8
|
if !File.directory?(".git")
|
9
|
-
Pod::UI.puts "
|
9
|
+
Pod::UI.puts "Git repository not found"
|
10
10
|
return
|
11
11
|
end
|
12
12
|
if !File.directory?(".git-hooks")
|
13
|
-
Pod::UI.puts ".git-hooks
|
13
|
+
Pod::UI.puts ".git-hooks folder not found, nothing to sync"
|
14
14
|
return
|
15
15
|
end
|
16
16
|
if Dir['.git-hooks/*'].empty?
|
17
|
-
Pod::UI.puts ".git-hooks
|
17
|
+
Pod::UI.puts ".git-hooks folder is empty, nothing to sync"
|
18
18
|
return
|
19
19
|
end
|
20
20
|
if !File.directory?(".git/hooks")
|
@@ -24,11 +24,12 @@ module CocoapodsGitHooks
|
|
24
24
|
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
25
25
|
path = ".git/hooks/"
|
26
26
|
Dir.open(path).each do |p|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
filename = File.basename(p, File.extname(p))
|
28
|
+
if File.extname(p) == ".sh"
|
29
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
30
|
+
end
|
31
|
+
FileUtils.chmod("+x", "#{path}/#{filename}")
|
30
32
|
end
|
31
|
-
FileUtils.chmod("+x", ".git/hooks/.")
|
32
33
|
Pod::UI.puts "Git hooks synchronized"
|
33
34
|
end
|
34
35
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
class GitHooksSync
|
6
|
+
def sync
|
7
|
+
Pod::UI.puts "Synchronizing git hooks"
|
8
|
+
if !File.directory?(".git")
|
9
|
+
Pod::UI.puts "Git repository not found"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
if !File.directory?(".git-hooks")
|
13
|
+
Pod::UI.puts ".git-hooks folder not found, nothing to sync"
|
14
|
+
return
|
15
|
+
end
|
16
|
+
if Dir['.git-hooks/*'].empty?
|
17
|
+
Pod::UI.puts ".git-hooks folder is empty, nothing to sync"
|
18
|
+
return
|
19
|
+
end
|
20
|
+
if !File.directory?(".git/hooks")
|
21
|
+
FileUtils.mkdir ".git/hooks"
|
22
|
+
end
|
23
|
+
|
24
|
+
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
25
|
+
path = ".git/hooks/"
|
26
|
+
Dir.open(path).each do |p|
|
27
|
+
filename = File.basename(p, File.extname(p))
|
28
|
+
if File.extname(p) == ".sh"
|
29
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
30
|
+
end
|
31
|
+
FileUtils.chmod("+x", "#{path}/#{filename}")
|
32
|
+
end
|
33
|
+
Pod::UI.puts "Git hooks synchronized"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
class GitHooksSync
|
6
|
+
def sync
|
7
|
+
Pod::UI.puts "Synchronizing git hooks"
|
8
|
+
if !File.directory?(".git")
|
9
|
+
Pod::UI.puts "Git repository not found"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
if !File.directory?(".git-hooks")
|
13
|
+
Pod::UI.puts ".git-hooks folder not found, nothing to sync"
|
14
|
+
return
|
15
|
+
end
|
16
|
+
if Dir['.git-hooks/*'].empty?
|
17
|
+
Pod::UI.puts ".git-hooks folder is empty, nothing to sync"
|
18
|
+
return
|
19
|
+
end
|
20
|
+
if !File.directory?(".git/hooks")
|
21
|
+
FileUtils.mkdir ".git/hooks"
|
22
|
+
end
|
23
|
+
|
24
|
+
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
25
|
+
path = ".git/hooks/"
|
26
|
+
Dir.open(path).each do |p|
|
27
|
+
filename = File.basename(p, File.extname(p))
|
28
|
+
if File.extname(p) == ".sh"
|
29
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
30
|
+
end
|
31
|
+
FileUtils.chmod("+x", "#{path}/#{filename}")
|
32
|
+
end
|
33
|
+
Pod::UI.puts "Git hooks synchronized"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
class GitHooksSync
|
6
|
+
def sync
|
7
|
+
Pod::UI.puts "Synchronizing git hooks"
|
8
|
+
if !File.directory?(".git")
|
9
|
+
Pod::UI.puts "Git repository not found"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
if !File.directory?(".git-hooks")
|
13
|
+
Pod::UI.puts ".git-hooks folder not found, nothing to sync"
|
14
|
+
return
|
15
|
+
end
|
16
|
+
if Dir['.git-hooks/*'].empty?
|
17
|
+
Pod::UI.puts ".git-hooks folder is empty, nothing to sync"
|
18
|
+
return
|
19
|
+
end
|
20
|
+
if !File.directory?(".git/hooks")
|
21
|
+
FileUtils.mkdir ".git/hooks"
|
22
|
+
end
|
23
|
+
|
24
|
+
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
25
|
+
path = ".git/hooks/"
|
26
|
+
Dir.open(path).each do |p|
|
27
|
+
filename = File.basename(p, File.extname(p))
|
28
|
+
if File.extname(p) == ".sh"
|
29
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
30
|
+
end
|
31
|
+
FileUtils.chmod("+x", "#{path}/#{filename}")
|
32
|
+
end
|
33
|
+
Pod::UI.puts "Git hooks synchronized"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
class GitHooksSync
|
6
|
+
def sync
|
7
|
+
Pod::UI.puts "Synchronizing git hooks"
|
8
|
+
if !File.directory?(".git")
|
9
|
+
Pod::UI.puts "Git repository not found"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
if !File.directory?(".git-hooks")
|
13
|
+
Pod::UI.puts ".git-hooks folder not found, nothing to sync"
|
14
|
+
return
|
15
|
+
end
|
16
|
+
if Dir['.git-hooks/*'].empty?
|
17
|
+
Pod::UI.puts ".git-hooks folder is empty, nothing to sync"
|
18
|
+
return
|
19
|
+
end
|
20
|
+
if !File.directory?(".git/hooks")
|
21
|
+
FileUtils.mkdir ".git/hooks"
|
22
|
+
end
|
23
|
+
|
24
|
+
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
25
|
+
path = ".git/hooks/"
|
26
|
+
Dir.open(path).each do |p|
|
27
|
+
filename = File.basename(p, File.extname(p))
|
28
|
+
if File.extname(p) == ".sh"
|
29
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
30
|
+
end
|
31
|
+
FileUtils.chmod("+x", "#{path}/#{filename}")
|
32
|
+
end
|
33
|
+
Pod::UI.puts "Git hooks synchronized"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-githooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Korzun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -48,7 +48,15 @@ files:
|
|
48
48
|
- lib/cocoapods-githooks.rb
|
49
49
|
- lib/cocoapods_plugin.rb
|
50
50
|
- lib/command/githooks.rb
|
51
|
-
- lib/githooks-
|
51
|
+
- lib/githooks-sync.rb
|
52
|
+
- lib/githooks-sync_BACKUP_71354.rb
|
53
|
+
- lib/githooks-sync_BACKUP_71547.rb
|
54
|
+
- lib/githooks-sync_BASE_71354.rb
|
55
|
+
- lib/githooks-sync_BASE_71547.rb
|
56
|
+
- lib/githooks-sync_LOCAL_71354.rb
|
57
|
+
- lib/githooks-sync_LOCAL_71547.rb
|
58
|
+
- lib/githooks-sync_REMOTE_71354.rb
|
59
|
+
- lib/githooks-sync_REMOTE_71547.rb
|
52
60
|
homepage: https://github.com/VladKorzun/cocoapods-githooks
|
53
61
|
licenses:
|
54
62
|
- MIT
|