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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0034f945269abf5a562e9ac393621ef5ab6dfed0
4
- data.tar.gz: 772a237027e861ea5a76c3e87a891fe9cc45b825
3
+ metadata.gz: bf0545d7e2a35d02175c24c5ad16941d6fa61237
4
+ data.tar.gz: ff40e8a9c02faa7fc77d48c83b99b2fbc3e1ec2c
5
5
  SHA512:
6
- metadata.gz: 68a111fe637ba4a2e0307f04d5fec574bf3fca41ad9eee91cba1f1fe07cdaa36cc18ed953a29702a0dff4c4435cdb45b8b4a0ff06a1a39702aa8136bb9b04c27
7
- data.tar.gz: fb56e7e538076c94866cd6d10b427919ed91ec50fba6f4d3692b30bbcd1e56eee004f4caba8eb64c832d8e490f67faaae3b9d3498fb951fbdb2613d662ff1327
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
@@ -4,5 +4,6 @@ sudo: false
4
4
  rvm:
5
5
  - 1.8.7
6
6
  - 1.9.3
7
- - 2.0.0
8
- - 2.1.5
7
+ - 2.0
8
+ - 2.1
9
+ - 2.2
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- v1.4.0 (trunk)
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.0)
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.0.0)
14
- backports (3.6.4)
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.7.0)
18
+ minitest (5.8.0)
19
19
  mocha (1.1.0)
20
20
  metaclass (~> 0.0.1)
21
- oj (2.12.9)
22
- parser (2.2.2.5)
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://badge.fury.io/rb/starscope.svg)](http://badge.fury.io/rb/starscope)
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
- Anyone who has done much programming in C (or C++) on a Unix-based OS has come
9
- across the fantastic [Cscope](http://cscope.sourceforge.net/) tool. Sadly, it
10
- only works for C (and sort of works for C++).
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
- Starscope is a similar tool for [Ruby](https://www.ruby-lang.org/) and
13
- [Golang](https://golang.org/), with a design intended to make it easy to add
14
- [support for other languages](doc/LANGUAGE_SUPPORT.md) within the same framework
15
- (thus the name Starscope, i.e. \*scope).
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
@@ -134,7 +134,7 @@ END
134
134
  buf << "\t@\n"
135
135
 
136
136
  header = "cscope 15 #{Dir.pwd} -c "
137
- offset = "%010d\n" % (header.length + 11 + buf.bytes.count)
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
- if index && index + key.length < offset
212
- buf << cscope_plaintext(line, prev, index) << "\n"
213
- buf << "#{key}\n"
214
- prev = index + key.length
215
- end
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"
@@ -26,19 +26,19 @@ module Starscope::Lang
26
26
  end
27
27
  end
28
28
 
29
- unless multiline
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
- match = /#{ERB_START}(.*)$/.match(line)
37
- if match
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
@@ -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
@@ -9,6 +9,7 @@ module Starscope
9
9
  @regexp = Regexp.new(@query, Regexp::IGNORECASE)
10
10
  rescue RegexpError
11
11
  # not a regex, oh well
12
+ return
12
13
  end
13
14
  end
14
15
 
@@ -10,11 +10,10 @@ class Starscope::Output
10
10
  end
11
11
 
12
12
  def new_pbar(title, num_items)
13
- if @level != :quiet
14
- @pbar = ProgressBar.create(:title => title, :total => num_items,
15
- :format => PBAR_FORMAT, :length => 80,
16
- :out => @out)
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
@@ -1,3 +1,3 @@
1
1
  module Starscope
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
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 = 'A code indexer and analyzer'
7
- gem.description = 'A tool like the venerable cscope, but for ruby, golang and other languages'
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.0
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-06-19 00:00:00.000000000 Z
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: A tool like the venerable cscope, but for ruby, golang and other languages
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.3
216
+ rubygems_version: 2.2.2
214
217
  signing_key:
215
218
  specification_version: 4
216
- summary: A code indexer and analyzer
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