grancher 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/grancher.gemspec +2 -2
- data/lib/grancher.rb +18 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/grancher.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{grancher}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Magnus Holm"]
|
9
|
-
s.date = %q{2010-04-
|
9
|
+
s.date = %q{2010-04-08}
|
10
10
|
s.description = %q{Easily copy folders and files to other Git branches}
|
11
11
|
s.email = %q{judofyr@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "lib/grancher/task.rb", "lib/grancher.rb"]
|
data/lib/grancher.rb
CHANGED
@@ -65,6 +65,17 @@ require 'gash'
|
|
65
65
|
# end
|
66
66
|
#
|
67
67
|
#
|
68
|
+
|
69
|
+
class Gash
|
70
|
+
def commit(msg, opts={})
|
71
|
+
puts opts.inspect
|
72
|
+
return unless changed? || opts[:force]
|
73
|
+
commit = commit_tree(to_tree!, msg)
|
74
|
+
@sha1 = git_tree_sha1
|
75
|
+
commit
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
68
79
|
class Grancher
|
69
80
|
attr_accessor :branch, :refspec, :push_to, :repo, :message
|
70
81
|
attr_reader :gash, :files, :directories
|
@@ -132,7 +143,13 @@ class Grancher
|
|
132
143
|
|
133
144
|
# Commits the changes.
|
134
145
|
def commit(message = nil)
|
135
|
-
|
146
|
+
old_keys = gash.keys
|
147
|
+
build
|
148
|
+
if gash.keys.sort == old_keys.sort
|
149
|
+
gash.commit(message || message())
|
150
|
+
else
|
151
|
+
gash.commit(message || message(), :force => true)
|
152
|
+
end
|
136
153
|
end
|
137
154
|
|
138
155
|
private
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Magnus Holm
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-08 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|