gollum-grit_adapter 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTk5YjhmY2NlZjdmMTBlMGUzNzkwYzVhNmQ0ZTVjN2FlYmEzZDE2Yg==
5
- data.tar.gz: !binary |-
6
- ZWRkODA3OWMzNTlkZDlkOTFlMWQ4OWE1ODQyY2U5MWZjYzIyMWNlMg==
2
+ SHA1:
3
+ metadata.gz: c2a20942c96f829cb954507a337cbaac99d8dd8b
4
+ data.tar.gz: 91387d9abcd383d7012efd67623e5e87ec1da084
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MzAwNTBiYmJjZmIxNjI1MTU0OGJkNTU0YjBlMzBlOTUxMWNiZDUzMTIwYzBh
10
- NmUyN2NhYmVhYTUzZTEwNWEyZjMzZTZjY2JmMjMzODA1MGFkMzhlM2ZiODQ2
11
- MWZhMTAzNGQ1ZDQ2ZTEwYzdkMDc4YjUyMmU1MjllNTUwNjIwNjY=
12
- data.tar.gz: !binary |-
13
- N2NmMmViZmU5ZjU0YWViNzZkZjBjNDRiZWI3ZWYyNThhMzhjOWZlOGE4Yjc4
14
- NWUyMTRkYmQwZTQ4OTcyNGE2ZmU3ZDg2OWViM2UwZDczN2M1OWI4MzMxNTUw
15
- NTFkNDRmZjRmMGJhZDY1ZjA0MGQ4NDgxZTE4ZDNjOWQ4ZWU2NWI=
6
+ metadata.gz: 32dad58dec2f20e831914edbdbbeb0d5f1ed14eb4726edab34e7b3cc831113968895f3a622308117f6740aa9a49428ccae2319cdd4ef6a883f7b1f3d8d8d6925
7
+ data.tar.gz: 1cbd9de24f1bb5d673b76077173cd71b0f40bb76082eb21002c8dd281cbaa1ceabfd22841962e6b2f4e46275e68924254b36cbb9a600616d957f06368f22ab98
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'grit'
4
4
  require 'ostruct'
5
+ require 'shellwords'
5
6
 
6
7
  module Gollum
7
8
 
@@ -166,14 +167,19 @@ module Gollum
166
167
  end
167
168
 
168
169
  def ls_files(query, options = {})
169
- options[:ref] = options[:ref] ? options[:ref] : "HEAD"
170
+ ref = options[:ref] ? options[:ref] : "HEAD"
171
+ path = options.delete(:path) || "."
172
+ options.delete(:ref)
170
173
  query = Shellwords.shellescape(query)
171
- @git.ls_files({}, "*#{query}*").split("\n")
174
+ if @git.work_tree && !@git.work_tree.empty? then
175
+ @git.ls_files({}, ref, ::File.join(path, "*#{query}*")).split("\n")
176
+ else
177
+ ls_tree({:full_tree => true, :r => true, :name_only => true}, ref, path).split("\n").select {|line| line.match(/#{Regexp.escape(query)}/i)}
178
+ end
172
179
  end
173
180
 
174
181
  def ls_tree(options={}, *args, &block)
175
182
  @git.native(:ls_tree, options, *args, &block)
176
- # {:r => true, :l => true, :z => true}, sha)
177
183
  end
178
184
 
179
185
  def apply_patch(head_sha=nil, patch=nil)
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
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.1.1
4
+ version: 0.1.2
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-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-grit
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.7'
20
- - - ! '>='
20
+ - - '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.7.1
23
23
  type: :runtime
@@ -27,7 +27,7 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '2.7'
30
- - - ! '>='
30
+ - - '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.7.1
33
33
  - !ruby/object:Gem::Dependency
@@ -51,11 +51,11 @@ executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
- - Gemfile
55
- - README.md
56
- - lib/grit_adapter.rb
57
54
  - lib/grit_adapter/git_layer_grit.rb
58
55
  - lib/grit_adapter/version.rb
56
+ - lib/grit_adapter.rb
57
+ - README.md
58
+ - Gemfile
59
59
  homepage: https://github.com/gollum/grit_adapter
60
60
  licenses:
61
61
  - MIT
@@ -66,17 +66,17 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ! '>='
69
+ - - '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.1
79
+ rubygems_version: 2.0.0
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Adapter for Gollum to use Grit at the backend.