frett 0.0.2 → 0.0.3
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.
- data/README.rdoc +6 -2
- data/lib/frett.rb +1 -1
- data/lib/frett/cli.rb +5 -0
- data/lib/frett/search.rb +6 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -11,7 +11,7 @@ it's built on top of the 'ferret' and 'listen' gems.
|
|
11
11
|
|
12
12
|
* files changes are not tracked until the initial index has been build
|
13
13
|
|
14
|
-
==
|
14
|
+
== USAGE:
|
15
15
|
|
16
16
|
go to any folder you want to index for searching. then hit
|
17
17
|
* 'frett_service start' or
|
@@ -21,6 +21,10 @@ go to any folder you want to index for searching. then hit
|
|
21
21
|
start your search using 'frett'. see
|
22
22
|
* 'frett -h' for usage instructions
|
23
23
|
|
24
|
+
== CONFIGURATION:
|
25
|
+
|
26
|
+
put a .frett.yml file in the project root folder. see the .frett.sample.yml for options.
|
27
|
+
|
24
28
|
== REQUIREMENTS:
|
25
29
|
|
26
30
|
frett uses the 'listen' gem. should work out of the box on any platform. (except windows?)
|
@@ -33,7 +37,7 @@ frett uses the 'listen' gem. should work out of the box on any platform. (except
|
|
33
37
|
|
34
38
|
(The MIT License)
|
35
39
|
|
36
|
-
Copyright (c) 2012
|
40
|
+
Copyright (c) 2012 johannes-kostas goetzinger
|
37
41
|
|
38
42
|
Permission is hereby granted, free of charge, to any person obtaining
|
39
43
|
a copy of this software and associated documentation files (the
|
data/lib/frett.rb
CHANGED
data/lib/frett/cli.rb
CHANGED
@@ -35,6 +35,11 @@ module Frett
|
|
35
35
|
options[:use_or] = false
|
36
36
|
end
|
37
37
|
|
38
|
+
options[:vim] = nil
|
39
|
+
opts.on( '-v', '--vim', 'produces output that can be populated into the vim quickfix buffer' ) do
|
40
|
+
options[:vim] = true
|
41
|
+
end
|
42
|
+
|
38
43
|
opts.on( '-h', '--help', 'Display this screen' ) do
|
39
44
|
puts opts
|
40
45
|
exit
|
data/lib/frett/search.rb
CHANGED
@@ -21,8 +21,13 @@ class Frett::Search
|
|
21
21
|
|
22
22
|
def result(doc)
|
23
23
|
file = doc[:file].gsub!(File.join(Frett::Config.working_dir,"/"), '')
|
24
|
+
line = doc[:line]
|
24
25
|
content = ( doc[:content].length > 200 ) ? ( doc[:content][0..77] + "..." ) : doc[:content]
|
25
|
-
|
26
|
+
if @options[:vim]
|
27
|
+
"#{file}:#{line}:#{content}"
|
28
|
+
else
|
29
|
+
["", file.light_yellow, "#{line}: #{content.light_blue}"]
|
30
|
+
end
|
26
31
|
end
|
27
32
|
|
28
33
|
def adapter
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frett
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- johannes-kostas goetzinger
|