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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d66ffc5ad32dab33a9332720bec1a060c713d332ad7f83939eb15afa537d587
4
- data.tar.gz: 4deeec2ae5b2751bf489418669df2ac1e485bf02e797d09f6bbefb771024cf27
3
+ metadata.gz: a3907375d57ee5bfa10521f33292028b7d6ad30a673428f346fdec5b6b9e9da1
4
+ data.tar.gz: 6b93084fdcb8fdf467c73000f381f32772d21c8a992605684d82af22f265e531
5
5
  SHA512:
6
- metadata.gz: 1f379dec163dddcc9c9a1eff30f26c04c940c5c78bfbe79df8b47ff38e7213b2661735cb1e7ef52ea661a9ef2875aa672debc77e98f77eec1cb5bfa251967909
7
- data.tar.gz: 3a32457c6c5eedbfdecbcf30276fb83393a7cdaf02f292a89af27383b91ab660cfa263f9419dada2e49c1120449807b23f4c1181d0ee9f0a3857eb41c09300ee
6
+ metadata.gz: dcc3fc9e93d79b9b200285783ac74ca422c9fb2d0817391af14dcf1d68ecf7f95d964d1dbe90e7a9616493c9410af0bf3c022a5a3bb6f13438c2b6d812947de6
7
+ data.tar.gz: b0a7d43d8c9d772a61e32aee14a1f8c7fe87e2319c74608260f5332cf53f6f00879891fd1680b094275983da4127bda851f7128931645e5d6476cad51a7771f3
@@ -1,3 +1,3 @@
1
1
  module CocoapodsGitHooks
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -1,13 +1,11 @@
1
1
  require 'command/githooks'
2
- require_relative 'githooks-synctool'
2
+ require_relative 'githooks-sync'
3
3
 
4
4
  module CocoapodsGitHooks
5
5
  Pod::HooksManager.register('cocoapods-githooks', :post_install) do |context|
6
- githooks = GitHooksSynctool.new()
7
- githooks.sync()
6
+ GitHooksSync.new().sync()
8
7
  end
9
8
  Pod::HooksManager.register('cocoapods-githooks', :post_update) do |context|
10
- githooks = GitHooksSynctool.new()
11
- githooks.sync()
9
+ GitHooksSync.new().sync()
12
10
  end
13
11
  end
@@ -1,5 +1,5 @@
1
1
  require 'cocoapods'
2
- require 'githooks-synctool'
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
- Syncs hooks between team members
11
- SUMMARY
10
+ Syncs hooks between team members
11
+ SUMMARY
12
12
 
13
- self.description = <<-DESC
14
- CocoaPods plugins that syncs git-hooks placed in .git-hooks directory between team members
15
- DESC
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
- def run
20
- githooks = CocoapodsGitHooks::GitHooksSynctool.new()
21
- githooks.sync()
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 GitHooksSynctool
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 "It is not a git repository, aborting"
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 directory not found, nothing to sync"
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 directory is empty, nothing to sync"
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
- next if File.extname(p) != ".sh"
28
- filename = File.basename(p, File.extname(p))
29
- FileUtils.mv("#{path}/#{p}", "#{path}/#{filename}")
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.1
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-23 00:00:00.000000000 Z
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-synctool.rb
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