gollum-grit_adapter 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum-grit_adapter might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d871bb42c88eabb6c791ce8da27246976c99468
4
- data.tar.gz: 8e3c385dc460a6fbbbd57039c7dd1be9b81d1e09
3
+ metadata.gz: fec3b95003833b68d26ed5e70595be3e4f165eb3
4
+ data.tar.gz: 8b626ca0f6e8bd9a9c1b837514646e6378f27895
5
5
  SHA512:
6
- metadata.gz: 0b94c9ed9edaf6df005e2102b272d710f0d93f638602c5644b21023473848cfeeccbd0c534f47c69ca29a9ae7e4e28f75615836a925aa435cf53d4e784a09107
7
- data.tar.gz: 76778c49ff74bdb69b75e325b01fe9ed4dd4e33f4abc1e153dd9cb9b1c26bc0fd1b707fd121c741619f47c909e86b0d1dcc1b9c51b142ba3763fe67d571ec369
6
+ metadata.gz: 735d80249532575b9ebc38452121f6eb6ff1ff23432edcc48a3d4b5a109a5a56aa0b87eb3ed82652997e2ce431c9e360d64fef6821d8c29ee740640ef08689bf
7
+ data.tar.gz: a554c3322767dc792f4c1907c98cffae892ba2cea9a5fec2d8f50396b1ff583289235f003a0dfd15f0cb036d8f1fd02c0c76608d45716883e7a710a4cdde5508
data/Gemfile CHANGED
@@ -6,6 +6,5 @@ gem 'rake', '~> 10.0.3'
6
6
  gem 'adapter_specs', :git => 'https://github.com/gollum/adapter_specs.git'
7
7
 
8
8
  group :test do
9
- gem "rspec", "2.13.0"
10
9
  gem "simplecov"
11
10
  end
@@ -1,6 +1,7 @@
1
1
  # ~*~ encoding: utf-8 ~*~
2
2
 
3
3
  require 'grit'
4
+ require 'ostruct'
4
5
 
5
6
  module Gollum
6
7
 
@@ -88,6 +89,13 @@ module Gollum
88
89
  def to_s
89
90
  @commit.id
90
91
  end
92
+
93
+ def stats
94
+ @stats ||= begin
95
+ grit_stats = @commit.stats
96
+ OpenStruct.new(:additions => grit_stats.additions, :deletions => grit_stats.deletions, :files => grit_stats.files, :id => id, :total => grit_stats.total)
97
+ end
98
+ end
91
99
 
92
100
  def author
93
101
  author = @commit.author
@@ -128,8 +136,8 @@ module Gollum
128
136
 
129
137
  def grep(query, options={})
130
138
  ref = options[:ref] ? options[:ref] : "HEAD"
131
- args = [{}, '-i', '-c', query, ref, '--']
132
- args << '--' << options[:path] if options[:path]
139
+ args = [{}, '-I', '-i', '-c', query, ref, '--']
140
+ args << options[:path] if options[:path]
133
141
  result = @git.grep(*args).split("\n")
134
142
  result.map do |line|
135
143
  branch_and_name, _, count = line.rpartition(":")
@@ -165,8 +173,8 @@ module Gollum
165
173
  # {:r => true, :l => true, :z => true}, sha)
166
174
  end
167
175
 
168
- def apply_patch(options={}, head_sha=nil, patch=nil)
169
- @git.apply_patch(options, head_sha, patch)
176
+ def apply_patch(head_sha=nil, patch=nil)
177
+ @git.apply_patch({}, head_sha, patch)
170
178
  end
171
179
 
172
180
  # @repo.git.cat_file({:p => true}, sha)
@@ -186,6 +194,8 @@ module Gollum
186
194
  end
187
195
  end
188
196
 
197
+ private
198
+
189
199
  def log(path = nil, ref = nil, options = nil, *args)
190
200
  @git.native(:log, options, "--", path)
191
201
  end
@@ -309,7 +319,7 @@ module Gollum
309
319
  end
310
320
 
311
321
  def log(commit = 'master', path = nil, options = {})
312
- @repo.log(commit, path, options)
322
+ @repo.log(commit, path, options).map {|grit_commit| Gollum::Git::Commit.new(grit_commit)}
313
323
  end
314
324
 
315
325
  def lstree(sha, options = {})
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.0.2'
4
+ VERSION = '0.1.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-grit_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-grit