frett 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- == SYNOPSIS:
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 FIXME full name
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
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Frett
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
7
7
 
8
8
  require 'rubygems'
@@ -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
@@ -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
- ["", file.light_yellow, "#{doc[:line]}: #{content.light_blue}"]
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - johannes-kostas goetzinger