cocoapods-githooks 1.0.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 +7 -0
- data/lib/cocoapods-githooks.rb +3 -0
- data/lib/cocoapods_plugin.rb +13 -0
- data/lib/command/githooks.rb +25 -0
- data/lib/githooks-synctool.rb +31 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 00d290ee9274f9d94db696792a2b736bb0c31d1948bb7275a4c379f0e8b312ea
|
4
|
+
data.tar.gz: c94852249fb94606b262cac250e2199c30a3f6f13406bb75faa7916c10e58f2a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cad1059aa58609deab6f503ef067c58e9c7b665f923379e312430f4d6a9528bd35f1b60c1f689cae1e8bbef21e582fdcd8ba7b733567b9a6ee2ec1c55686c83e
|
7
|
+
data.tar.gz: 43c222a508551bd33f3c85abb84a8eaa9aa856a17bdccdc3e86f9f940f8118ffdc042cef29212de7d861cf82a3024b7a9684f3d14317437828e74169ecb1295a
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'command/githooks'
|
2
|
+
require_relative 'githooks-synctool'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
Pod::HooksManager.register('cocoapods-githooks', :post_install) do |context|
|
6
|
+
githooks = GitHooksSynctool.new()
|
7
|
+
githooks.sync()
|
8
|
+
end
|
9
|
+
Pod::HooksManager.register('cocoapods-githooks', :post_update) do |context|
|
10
|
+
githooks = GitHooksSynctool.new()
|
11
|
+
githooks.sync()
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'githooks-synctool'
|
3
|
+
|
4
|
+
include CocoapodsGitHooks
|
5
|
+
|
6
|
+
module Pod
|
7
|
+
class Command
|
8
|
+
class Githooks < Command
|
9
|
+
self.summary = <<-SUMMARY
|
10
|
+
Syncs hooks between team members
|
11
|
+
SUMMARY
|
12
|
+
|
13
|
+
self.description = <<-DESC
|
14
|
+
CocoaPods plugins that syncs git-hooks placed in .git-hooks directory between team members
|
15
|
+
DESC
|
16
|
+
|
17
|
+
self.arguments = []
|
18
|
+
|
19
|
+
def run
|
20
|
+
githooks = CocoapodsGitHooks::GitHooksSynctool.new()
|
21
|
+
githooks.sync()
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module CocoapodsGitHooks
|
5
|
+
class GitHooksSynctool
|
6
|
+
def sync
|
7
|
+
Pod::UI.puts "Synchronizing git hooks"
|
8
|
+
if !File.directory?(".git-hooks")
|
9
|
+
Pod::UI.puts ".git-hooks directory not found, nothing to sync"
|
10
|
+
return
|
11
|
+
end
|
12
|
+
if Dir['.git-hooks/*'].empty?
|
13
|
+
Pod::UI.puts ".git-hooks directory is empty, nothing to sync"
|
14
|
+
return
|
15
|
+
end
|
16
|
+
if !File.directory?(".git/hooks")
|
17
|
+
FileUtils.mkdir ".git/hooks"
|
18
|
+
end
|
19
|
+
|
20
|
+
FileUtils.cp_r(".git-hooks/.", ".git/hooks/")
|
21
|
+
path = ".git/hooks/"
|
22
|
+
Dir.open(path).each do |p|
|
23
|
+
next if File.extname(p) != ".sh"
|
24
|
+
filename = File.basename(p, File.extname(p))
|
25
|
+
FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
|
26
|
+
end
|
27
|
+
FileUtils.chmod("+x", ".git/hooks/.")
|
28
|
+
Pod::UI.puts "Git hooks synchronized"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-githooks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vlad Korzun
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12.3'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- vladyslavkorzun@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/cocoapods-githooks.rb
|
49
|
+
- lib/cocoapods_plugin.rb
|
50
|
+
- lib/command/githooks.rb
|
51
|
+
- lib/githooks-synctool.rb
|
52
|
+
homepage: https://github.com/VladKorzun/cocoapods-githooks
|
53
|
+
licenses:
|
54
|
+
- MIT
|
55
|
+
metadata: {}
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '2.0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
requirements: []
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 2.7.6
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: A CocoaPods plugin that syncs git hooks between team members
|
76
|
+
test_files: []
|