starscope 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +19 -3
- data/.travis.yml +3 -2
- data/CHANGELOG.md +9 -1
- data/Gemfile.lock +6 -6
- data/README.md +24 -10
- data/bin/starscope +3 -1
- data/lib/starscope/exportable.rb +6 -6
- data/lib/starscope/langs/erb.rb +11 -11
- data/lib/starscope/langs/go.rb +1 -1
- data/lib/starscope/matcher.rb +1 -0
- data/lib/starscope/output.rb +4 -5
- data/lib/starscope/version.rb +1 -1
- data/starscope.gemspec +6 -2
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf0545d7e2a35d02175c24c5ad16941d6fa61237
|
4
|
+
data.tar.gz: ff40e8a9c02faa7fc77d48c83b99b2fbc3e1ec2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77b085891ca912792487ef07a6aeaaabc7ec5a94193879b62877f1729c2f205265d30c2eee3f12ba2272b69181f68025e55ed84767b12b506fc448aea83c9c8
|
7
|
+
data.tar.gz: bf3c86d110ec7c87e2d0393b3e06f8e87b4bf62ba860a4183c857d8ad082a3a047acccdf5d9453000a8762f7b404d59cbdbe766837c66ab5e41c527827396142
|
data/.rubocop.yml
CHANGED
@@ -4,12 +4,12 @@ Lint/UnusedBlockArgument:
|
|
4
4
|
Lint/UnusedMethodArgument:
|
5
5
|
Enabled: false
|
6
6
|
|
7
|
-
Style/HashSyntax:
|
8
|
-
EnforcedStyle: hash_rockets
|
9
|
-
|
10
7
|
Metrics/AbcSize:
|
11
8
|
Enabled: false
|
12
9
|
|
10
|
+
Metrics/BlockNesting:
|
11
|
+
Enabled: false
|
12
|
+
|
13
13
|
Metrics/ClassLength:
|
14
14
|
Enabled: false
|
15
15
|
|
@@ -22,8 +22,24 @@ Metrics/LineLength:
|
|
22
22
|
Metrics/MethodLength:
|
23
23
|
Enabled: false
|
24
24
|
|
25
|
+
Metrics/ModuleLength:
|
26
|
+
Enabled: false
|
27
|
+
|
25
28
|
Metrics/PerceivedComplexity:
|
26
29
|
Enabled: false
|
27
30
|
|
31
|
+
Style/ClassAndModuleChildren:
|
32
|
+
Enabled: false
|
33
|
+
|
28
34
|
Style/Documentation:
|
29
35
|
Enabled: false
|
36
|
+
|
37
|
+
Style/HashSyntax:
|
38
|
+
EnforcedStyle: hash_rockets
|
39
|
+
|
40
|
+
Style/Next:
|
41
|
+
Exclude:
|
42
|
+
- 'test/fixtures/sample_ruby.rb'
|
43
|
+
|
44
|
+
Style/SpecialGlobalVars:
|
45
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
v1.4.
|
4
|
+
v1.4.1 (trunk)
|
5
|
+
--------------------
|
6
|
+
|
7
|
+
Misc:
|
8
|
+
* Minor code style cleanups and documentation improvements.
|
9
|
+
* Bumped a few dependencies.
|
10
|
+
* Official support for ruby 2.2 although it already worked.
|
11
|
+
|
12
|
+
v1.4.0 (2015-06-19)
|
5
13
|
--------------------
|
6
14
|
|
7
15
|
New Features:
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
starscope (1.4.
|
4
|
+
starscope (1.4.1)
|
5
5
|
backports (~> 3.6)
|
6
6
|
oj (~> 2.9)
|
7
7
|
parser (~> 2.2.2)
|
@@ -10,16 +10,16 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
ast (2.
|
14
|
-
backports (3.6.
|
13
|
+
ast (2.1.0)
|
14
|
+
backports (3.6.6)
|
15
15
|
coderay (1.1.0)
|
16
16
|
metaclass (0.0.4)
|
17
17
|
method_source (0.8.2)
|
18
|
-
minitest (5.
|
18
|
+
minitest (5.8.0)
|
19
19
|
mocha (1.1.0)
|
20
20
|
metaclass (~> 0.0.1)
|
21
|
-
oj (2.12.
|
22
|
-
parser (2.2.2.
|
21
|
+
oj (2.12.13)
|
22
|
+
parser (2.2.2.6)
|
23
23
|
ast (>= 1.1, < 3.0)
|
24
24
|
pry (0.10.1)
|
25
25
|
coderay (~> 1.1.0)
|
data/README.md
CHANGED
@@ -1,18 +1,32 @@
|
|
1
1
|
Starscope
|
2
2
|
=========
|
3
3
|
|
4
|
-
[![Gem Version](https://
|
4
|
+
[![Gem Version](https://img.shields.io/gem/v/starscope.svg)](https://rubygems.org/gems/starscope)
|
5
5
|
[![Build Status](https://travis-ci.org/eapache/starscope.svg?branch=master)](https://travis-ci.org/eapache/starscope)
|
6
6
|
[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html)
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
Starscope is a code indexer, search and navigation tool for
|
9
|
+
[Ruby](https://www.ruby-lang.org/) and [Golang](https://golang.org/), with a
|
10
|
+
design intended to make it easy to add
|
11
|
+
[support for other languages](doc/LANGUAGE_SUPPORT.md).
|
11
12
|
|
12
|
-
|
13
|
-
[
|
14
|
-
|
15
|
-
|
13
|
+
Inspired by the extremely popular [Ctags](https://en.wikipedia.org/wiki/Ctags)
|
14
|
+
and [Cscope](http://cscope.sourceforge.net/) utilities, Starscope can answer a
|
15
|
+
lot of questions about your code. It can tell you:
|
16
|
+
- where methods are defined
|
17
|
+
- where methods are called
|
18
|
+
- where variables are assigned
|
19
|
+
- where symbols are used
|
20
|
+
- where files and libraries are imported or required
|
21
|
+
|
22
|
+
While Ctags already supports Ruby and Go, it can only tell you where things are
|
23
|
+
defined. Cscope can answer a lot more of your questions, but it is limited to
|
24
|
+
just the C language family. Starscope was written to combine the power of
|
25
|
+
Cscope with the flexibility of Ctags, bringing full code indexing to as many
|
26
|
+
developers as possible.
|
27
|
+
|
28
|
+
Quick Start
|
29
|
+
-----------
|
16
30
|
|
17
31
|
Install it as a gem:
|
18
32
|
```
|
@@ -40,9 +54,9 @@ More Documentation
|
|
40
54
|
------------------
|
41
55
|
|
42
56
|
* [User Guide](doc/USER_GUIDE.md)
|
43
|
-
* [Database Format](doc/DB_FORMAT.md)
|
44
|
-
* [Language Support](doc/LANGUAGE_SUPPORT.md)
|
45
57
|
* [Version History](CHANGELOG.md)
|
58
|
+
* [Language Support](doc/LANGUAGE_SUPPORT.md)
|
59
|
+
* [Database Format](doc/DB_FORMAT.md)
|
46
60
|
|
47
61
|
Other Uses
|
48
62
|
----------
|
data/bin/starscope
CHANGED
@@ -251,7 +251,7 @@ end
|
|
251
251
|
if options[:linemode]
|
252
252
|
puts "Run your query as 'TABLE QUERY' or run '!help' for more information."
|
253
253
|
begin
|
254
|
-
while input = Readline.readline('> ', true)
|
254
|
+
while (input = Readline.readline('> ', true))
|
255
255
|
next if input.empty?
|
256
256
|
cmd, param = input.split(' ', 2)
|
257
257
|
if cmd[0] == '!'
|
@@ -284,5 +284,7 @@ if options[:linemode]
|
|
284
284
|
end
|
285
285
|
end
|
286
286
|
rescue Interrupt
|
287
|
+
# just exit
|
288
|
+
return
|
287
289
|
end
|
288
290
|
end
|
data/lib/starscope/exportable.rb
CHANGED
@@ -134,7 +134,7 @@ END
|
|
134
134
|
buf << "\t@\n"
|
135
135
|
|
136
136
|
header = "cscope 15 #{Dir.pwd} -c "
|
137
|
-
offset = "%010d\n"
|
137
|
+
offset = format("%010d\n", header.length + 11 + buf.bytes.count)
|
138
138
|
|
139
139
|
file.print(header)
|
140
140
|
file.print(offset)
|
@@ -208,11 +208,11 @@ END
|
|
208
208
|
index = line.index(key, index + 1)
|
209
209
|
end
|
210
210
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
211
|
+
next unless index && index + key.length < offset
|
212
|
+
|
213
|
+
buf << cscope_plaintext(line, prev, index) << "\n"
|
214
|
+
buf << "#{key}\n"
|
215
|
+
prev = index + key.length
|
216
216
|
end
|
217
217
|
|
218
218
|
buf << cscope_plaintext(line, prev, offset) << "\n"
|
data/lib/starscope/langs/erb.rb
CHANGED
@@ -26,19 +26,19 @@ module Starscope::Lang
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
line.scan(/#{ERB_START}(.*?)#{ERB_END}/) do |match|
|
31
|
-
yield FRAGMENT, :Ruby, :frag => match[0], :line_no => line_no
|
32
|
-
end
|
33
|
-
|
34
|
-
line.gsub!(/<%.*?%>/, '')
|
29
|
+
next if multiline
|
35
30
|
|
36
|
-
|
37
|
-
|
38
|
-
yield FRAGMENT, :Ruby, :frag => match[1], :line_no => line_no
|
39
|
-
multiline = true
|
40
|
-
end
|
31
|
+
line.scan(/#{ERB_START}(.*?)#{ERB_END}/) do |match|
|
32
|
+
yield FRAGMENT, :Ruby, :frag => match[0], :line_no => line_no
|
41
33
|
end
|
34
|
+
|
35
|
+
line.gsub!(/<%.*?%>/, '')
|
36
|
+
|
37
|
+
match = /#{ERB_START}(.*)$/.match(line)
|
38
|
+
next unless match
|
39
|
+
|
40
|
+
yield FRAGMENT, :Ruby, :frag => match[1], :line_no => line_no
|
41
|
+
multiline = true
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/starscope/langs/go.rb
CHANGED
@@ -41,7 +41,7 @@ module Starscope::Lang
|
|
41
41
|
if stack[-1] != :import && !line.start_with?('import')
|
42
42
|
# strip string literals like "foo" unless they're part of an import
|
43
43
|
pos = 0
|
44
|
-
while match = STRING_LITERAL.match(line[pos..-1])
|
44
|
+
while (match = STRING_LITERAL.match(line[pos..-1]))
|
45
45
|
eos = find_end_of_string(line, match.begin(0))
|
46
46
|
line = line[0..match.begin(0)] + line[eos..-1]
|
47
47
|
pos += match.begin(0) + 2
|
data/lib/starscope/matcher.rb
CHANGED
data/lib/starscope/output.rb
CHANGED
@@ -10,11 +10,10 @@ class Starscope::Output
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_pbar(title, num_items)
|
13
|
-
if @level
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
13
|
+
return if @level == :quiet
|
14
|
+
@pbar = ProgressBar.create(:title => title, :total => num_items,
|
15
|
+
:format => PBAR_FORMAT, :length => 80,
|
16
|
+
:out => @out)
|
18
17
|
end
|
19
18
|
|
20
19
|
def inc_pbar
|
data/lib/starscope/version.rb
CHANGED
data/starscope.gemspec
CHANGED
@@ -3,8 +3,12 @@ require File.expand_path('../lib/starscope/version.rb', __FILE__)
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'starscope'
|
5
5
|
gem.version = Starscope::VERSION
|
6
|
-
gem.summary = '
|
7
|
-
gem.description =
|
6
|
+
gem.summary = 'Smart code search and indexing'
|
7
|
+
gem.description = <<-EOF
|
8
|
+
Starscope is a code indexer, search and navigation tool for Ruby and Go.
|
9
|
+
Inspired by the extremely popular Ctags and Cscope utilities, Starscope can
|
10
|
+
answer a lot of questions about a lot of code.
|
11
|
+
EOF
|
8
12
|
gem.authors = ['Evan Huus']
|
9
13
|
gem.homepage = 'https://github.com/eapache/starscope'
|
10
14
|
gem.email = 'eapache@gmail.com'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starscope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Huus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -136,7 +136,10 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
description:
|
139
|
+
description: |2
|
140
|
+
Starscope is a code indexer, search and navigation tool for Ruby and Go.
|
141
|
+
Inspired by the extremely popular Ctags and Cscope utilities, Starscope can
|
142
|
+
answer a lot of questions about a lot of code.
|
140
143
|
email: eapache@gmail.com
|
141
144
|
executables:
|
142
145
|
- starscope
|
@@ -210,10 +213,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
213
|
version: '0'
|
211
214
|
requirements: []
|
212
215
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.2.
|
216
|
+
rubygems_version: 2.2.2
|
214
217
|
signing_key:
|
215
218
|
specification_version: 4
|
216
|
-
summary:
|
219
|
+
summary: Smart code search and indexing
|
217
220
|
test_files:
|
218
221
|
- test/fixtures/db_added_files.json
|
219
222
|
- test/fixtures/db_missing_language.json
|