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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8a66ea83e90c063ae3e92a5c3d82624376ddc2b
4
- data.tar.gz: 74eed50746565d7c6c0df0f5ab429b088508080f
3
+ metadata.gz: e27cd6e792aa6ec42e19a32097d97080beb7db74
4
+ data.tar.gz: 2ae8f97a7c29043e093e7a16695f20f537a77c0f
5
5
  SHA512:
6
- metadata.gz: 6975398a9a676d9703e8d776d27b12a9d2391380e12d2dac5fea27ae9cdd2165795a913c243238e30bfbdd15218291355a181b10b8e067cb7c8869381624eb3b
7
- data.tar.gz: 902f2e58656d463a442300ee6fc6f74d4f0615b6207143aea8214006eac595edac4c8b47da63fda33d47fe0e3a5b548930ce6abbf39d73fed271b4c99d63a045
6
+ metadata.gz: c0664436bcf559918c42b819eff3c2335b0db634790fa5aa72d38d48e61e3e80f459b38132067e82f2642e2b4fee6327d3759e6b0ae116f3405ce79acd418f92
7
+ data.tar.gz: 8aff8c7ce3cae6ad42d7398110cf04b89f05087ab06b5a07165ea86bc1adb23a5c9ddb5063ff2ffde92a2155bd574360daa118e7738cd2d79d81b6fe95bb6204
@@ -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.4'
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"]
@@ -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: [path(field)])
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
- return nil unless fileob = current.tree.path(filename)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Amemiya