recall 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/lib/recall/results.rb +1 -1
- data/lib/recall/version.rb +1 -1
- data/recall.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0cd72c43e2ad76cc2fa2d26fb4b631683cd39c9
|
4
|
+
data.tar.gz: 972070255c4cba8f924f0ec3632a5162bd3e9f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1f6f07248093691e2872fffa6aeb3a822186213adec12b10e92aa8c891e378d37735863736ecdddf17c6b9ff9c86c881689dc46f9cc5029fcd68490769cdb2e
|
7
|
+
data.tar.gz: 8c029e0471569e6740f3e3a234cc0e804d3af80ad1eaf4c0ecc28a06c564a85ef89b456f4ec4986bbdcaad295402b6ca27b51a38263eb41571b053ad51981091
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Recall
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/recall.png)](http://badge.fury.io/rb/recall)
|
4
|
+
|
4
5
|
#### A command line interface that searches for previous examples of Ruby code based on user's query and present results in default Ruby editor.
|
5
6
|
|
6
7
|
> [E]ach time the natural laziness which deters us from every difficult enterprise, every work of importance, has urged me to leave the thing alone, to drink my tea and to think merely of the worries of today and of my hopes for tomorrow, which let themselves be pondered over without effort or distress of mind.
|
@@ -11,8 +12,17 @@
|
|
11
12
|
|
12
13
|
Ever want to find a piece of code you've written but aren't sure which project or file you wrote it in?
|
13
14
|
|
14
|
-
Recall is a simple Ruby
|
15
|
+
Recall is a simple Ruby Gem, run via the command line, to search your the Ruby files in your code folder.
|
16
|
+
|
17
|
+
Huge thanks to [Kevin Curtin](https://twitter.com/kcurtin) for getting the gem working!
|
15
18
|
|
19
|
+
## What it Does
|
20
|
+
|
21
|
+
The first time users run `Recall`, they'll be prompted to enter the absolute path of their desired search directory (most likely the user's main "code" directory).
|
22
|
+
|
23
|
+
Once the user sets his or her prefered search directory, Recall accepts a search query and will recursively search through all of the .rb files in that directory for mentions of the query. An example of a typcial query would be a semi-exotic Ruby method like `.each_with_object`.
|
24
|
+
|
25
|
+
When it's completed its search, Recall opens a new .rb file in the user's default text editor, presenting all of the search results it found. When the user is finished with the results, he or she can simply close it. The results file is overwritten with each subsequent search.
|
16
26
|
|
17
27
|
## Installation
|
18
28
|
|
@@ -20,12 +30,16 @@ From your command line, enter:
|
|
20
30
|
|
21
31
|
`gem install recall`
|
22
32
|
|
33
|
+
Awesome!
|
34
|
+
|
23
35
|
## Use
|
24
36
|
|
25
|
-
|
37
|
+
To use recall, simply type `recall` into your command line from any directory. The first time you call the gem it will ask for the absolute path of a directory for it to search. Then it will ask for a search query. It will search all of the .rb files in that directory, recursively, and present the results in a new .rb file.
|
26
38
|
|
27
39
|
Your search directory will persist until you change it. To change the search directory, enter `change_dir` into the prompt.
|
28
40
|
|
41
|
+
## Notes
|
29
42
|
|
43
|
+
Currently, Recall only searches files with the .rb extension.
|
30
44
|
|
31
45
|
|
data/lib/recall/results.rb
CHANGED
@@ -38,7 +38,7 @@ class Recall::Results
|
|
38
38
|
|
39
39
|
def get_grep_results
|
40
40
|
format_query # # /Users/samschlinkert/Documents/code/flatiron
|
41
|
-
return `grep -r -n -i --include=*.rb "#{@query}" #{@search_path} | sort -r`
|
41
|
+
return `grep -r -n -i --include=*.rb --include=*.erb "#{@query}" #{@search_path} | sort -r`
|
42
42
|
end
|
43
43
|
|
44
44
|
Result = Struct.new(:file_path, :line_number, :code_snippet, :full_code)
|
data/lib/recall/version.rb
CHANGED
data/recall.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["sschlinkert@gmail.com"]
|
11
11
|
spec.summary = "Simple Local Code Search"
|
12
12
|
spec.description = "Search a local directory for a specific query"
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/sts10/recall"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Schlinkert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,7 +76,7 @@ files:
|
|
76
76
|
- recall.gemspec
|
77
77
|
- spec/lib/results_spec.rb
|
78
78
|
- spec/spec_helper.rb
|
79
|
-
homepage:
|
79
|
+
homepage: https://github.com/sts10/recall
|
80
80
|
licenses:
|
81
81
|
- MIT
|
82
82
|
metadata: {}
|