acts_as_git 0.2.4 → 0.2.5
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/acts_as_git.gemspec +1 -1
- data/lib/acts_as_git.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e27cd6e792aa6ec42e19a32097d97080beb7db74
|
|
4
|
+
data.tar.gz: 2ae8f97a7c29043e093e7a16695f20f537a77c0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0664436bcf559918c42b819eff3c2335b0db634790fa5aa72d38d48e61e3e80f459b38132067e82f2642e2b4fee6327d3759e6b0ae116f3405ce79acd418f92
|
|
7
|
+
data.tar.gz: 8aff8c7ce3cae6ad42d7398110cf04b89f05087ab06b5a07165ea86bc1adb23a5c9ddb5063ff2ffde92a2155bd574360daa118e7738cd2d79d81b6fe95bb6204
|
data/acts_as_git.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.homepage = "https://github.com/rail44/acts_as_git"
|
|
9
9
|
s.summary = "Make your field act as a git repo"
|
|
10
10
|
s.description = "Make your field act as a git repo. Save the content to a file, and load the content from a file."
|
|
11
|
-
s.version = '0.2.
|
|
11
|
+
s.version = '0.2.5'
|
|
12
12
|
s.date = Time.now.strftime("%Y-%m-%d")
|
|
13
13
|
|
|
14
14
|
s.extra_rdoc_files = Dir["*.rdoc"]
|
data/lib/acts_as_git.rb
CHANGED
|
@@ -92,10 +92,10 @@ module ActsAsGit
|
|
|
92
92
|
walker.push(@@repo.head.target)
|
|
93
93
|
commits = []
|
|
94
94
|
walker.map do |commit|
|
|
95
|
-
if commit.diff(paths: [
|
|
95
|
+
if commit.diff(paths: [filename]).size > 0
|
|
96
96
|
commit
|
|
97
97
|
end
|
|
98
|
-
end
|
|
98
|
+
end.compact
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
define_method :checkout do |commit|
|
|
@@ -160,7 +160,11 @@ module ActsAsGit
|
|
|
160
160
|
return nil unless repodir
|
|
161
161
|
return nil unless filename
|
|
162
162
|
return nil if @@repo.empty?
|
|
163
|
-
|
|
163
|
+
begin
|
|
164
|
+
fileob = current.tree.path(filename)
|
|
165
|
+
rescue Rugged::TreeError
|
|
166
|
+
return nil
|
|
167
|
+
end
|
|
164
168
|
oid = fileob[:oid]
|
|
165
169
|
file = StringIO.new(@@repo.lookup(oid).content)
|
|
166
170
|
file.seek(offset) if offset
|