git_checker 0.0.2 → 0.0.3

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.
data/README.markdown CHANGED
@@ -20,30 +20,42 @@ Create a file with the extension .gck.rb
20
20
 
21
21
  Add some checks in that file, like:
22
22
 
23
+ ```ruby
23
24
  #checkthis.gck.rb
24
25
  local = Repository.new
25
- commits_not_in local.branches['master'], local
26
+ print_commits_not_in local.branches['master'], local
27
+ ```
26
28
 
27
29
  Then run the command:
28
30
  `gck`
29
31
 
32
+ Available Checks:
33
+ -----------------
34
+ * branches_not_in repo, from, ignore=[]
35
+ * print_branches_not_in repo, from, ignore=[]
36
+ * branches_not_merged_in branch, from, ignore=[]
37
+ * print_branches_not_merged_in branch, from, ignore=[]
38
+ * print_commits_not_in branch, from, ignore=[]
39
+
30
40
  More:
31
41
  -----
32
42
 
33
43
  You can also ask for run task that you not always want, like this:
34
44
 
45
+ ```ruby
35
46
  #checkthis.gck.rb
36
47
  local= Repository.new
37
48
  remote= Repository.new 'origin'
38
49
  ignore= %w(backup test) #for ignore this branches in the list
39
50
 
40
- commits_not_in local.branches['master'], local, ignore
51
+ print_commits_not_in local.branches['master'], local, ignore
41
52
 
42
53
  check_group "Check for branches not in Remote?" do
43
54
 
44
- branches_not_in remote, local, ignore
55
+ print_branches_not_in remote, local, ignore
45
56
 
46
57
  end #>>> Check for branches not in Remote? [y/n]
58
+ ```
47
59
 
48
60
  You can skip this questions an run all with the command `agck`
49
61
 
data/git_checker.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ["lizzydw@gmail.com"]
10
10
  s.homepage = "https://github.com/leizzer/git_checker"
11
11
  s.summary = %q{Keep an eye on your git repository}
12
- s.description = %q{Using git_checker you can make scrips for perform checks over your git repositories easily }
12
+ s.description = %q{Using git_checker you can make scripts for perform checks over your git repositories easily}
13
13
 
14
14
  s.rubyforge_project = "git_checker"
15
15
 
@@ -1,3 +1,3 @@
1
1
  module GitChecker
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/git_checker.rb CHANGED
@@ -6,24 +6,41 @@ require_relative 'branch'
6
6
  module GitChecker
7
7
 
8
8
  include MessagePrinter
9
-
9
+
10
+ # Returns the branches from 'from' (Repository) that are not pushed to 'repo' (Repository)
10
11
  def branches_not_in repo, from, ignore=[]
12
+ repo.missing_branches(from.list_of_branches) - ignore
13
+ end
14
+
15
+ # Prints the result from branches_not_in method
16
+ def print_branches_not_in repo, from, ignore=[]
11
17
  print_message "Branches in #{from.name.capitalize} not in #{repo.name.capitalize}"
12
- puts repo.missing_branches(from.list_of_branches) - ignore
18
+ puts branches_not_in(repo, from, ignore)
13
19
  end
14
20
 
21
+ ################################################################
22
+
23
+ # Returns the branches from 'from' (Repository) that are not merged in 'branch' (Branch)
15
24
  def branches_not_merged_in branch, from, ignore=[]
16
- print_message "Branches not in #{branch.name.capitalize}"
17
25
  branches = []
18
26
  from.branches.values.each do |b|
19
27
  unless ignore.include? b.name
20
28
  branches << b.name if branch.merges_with(b.name).empty?
21
29
  end
22
30
  end
23
- puts branches
31
+ branches
24
32
  end
25
33
 
26
- def commits_not_in branch, from, ignore=[]
34
+ # Prints the result from branches_not_merged_in method
35
+ def print_branches_not_merged_in branch, from, ignore=[]
36
+ print_message "Branches not in #{branch.name.capitalize}"
37
+ puts branches_not_merged_in(branch, from, ignore)
38
+ end
39
+
40
+ ################################################################
41
+
42
+ # Returns the commits from all the branches in 'from' (Repository) that are not in 'branch' (Branch)
43
+ def print_commits_not_in branch, from, ignore=[]
27
44
  print_message "Commits not in #{branch.name.capitalize}"
28
45
  from.branches.each_value do |b|
29
46
  unless ignore.include? b.name
@@ -36,6 +53,8 @@ module GitChecker
36
53
  end
37
54
  end
38
55
 
56
+ ################################################################
57
+
39
58
  #You ask, you answer and you have
40
59
  def check_group question, &block
41
60
  print "\n>>> #{question} [y/n] "
metadata CHANGED
@@ -1,34 +1,26 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: git_checker
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - leizzer
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-08-03 00:00:00 -04:00
18
- default_executable:
12
+ date: 2011-09-13 00:00:00.000000000Z
19
13
  dependencies: []
20
-
21
- description: "Using git_checker you can make scrips for perform checks over your git repositories easily\t"
22
- email:
14
+ description: Using git_checker you can make scripts for perform checks over your git
15
+ repositories easily
16
+ email:
23
17
  - lizzydw@gmail.com
24
- executables:
18
+ executables:
25
19
  - agck
26
20
  - gck
27
21
  extensions: []
28
-
29
22
  extra_rdoc_files: []
30
-
31
- files:
23
+ files:
32
24
  - .gitignore
33
25
  - Gemfile
34
26
  - README.markdown
@@ -41,37 +33,28 @@ files:
41
33
  - lib/git_checker/version.rb
42
34
  - lib/message_printer.rb
43
35
  - lib/repository.rb
44
- has_rdoc: true
45
36
  homepage: https://github.com/leizzer/git_checker
46
37
  licenses: []
47
-
48
38
  post_install_message:
49
39
  rdoc_options: []
50
-
51
- require_paths:
40
+ require_paths:
52
41
  - lib
53
- required_ruby_version: !ruby/object:Gem::Requirement
42
+ required_ruby_version: !ruby/object:Gem::Requirement
54
43
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
49
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- segments:
67
- - 0
68
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
69
54
  requirements: []
70
-
71
55
  rubyforge_project: git_checker
72
- rubygems_version: 1.3.7
56
+ rubygems_version: 1.8.5
73
57
  signing_key:
74
58
  specification_version: 3
75
59
  summary: Keep an eye on your git repository
76
60
  test_files: []
77
-