starscope 1.3.0 → 1.3.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: 9dc4d4ed48ed8e03902cab715035cec7226085dd
4
- data.tar.gz: d65334b73069abcfdb1e411dc898e672e556d52c
3
+ metadata.gz: 65718aa5d56aa5e07b3f4316ca5efe49f5b744ac
4
+ data.tar.gz: 323f5f0878dac6386bc5681584f9744f03f51b1c
5
5
  SHA512:
6
- metadata.gz: 084546bf7ecfff1a1bf673d8a302d7fdbd7c0f302dd45830e9a5c8aaae4ec7d28e044a3744ef3eefbf3e1a76ec40d66d9fe2e1a7f601fed94bcf2023649d19df
7
- data.tar.gz: de3833eb0f5ee2033760008fac08a0c1726c2fd148f28a81dc5501924e925fce6d06d8ff657e9ba1e6ebc6c29264456918ff60744b652954787539f36b2a561d
6
+ metadata.gz: 69b497639a09ceb44a3d34dd7743290f5c96b93a8e5eca40364df4d01b3b733336a71a7d008163efeb2841d0c00b2f1f027e24d8f5ab0ee1b521a56ce7a7d43f
7
+ data.tar.gz: 04967c93a1031595852ca2c6d4bb95f5b7e2ade6f5ca6de35e466461364c0a7653bf8a5e0949ec89e873be8859a4486f4f99a718f54c88fa42a668d89ca6b4a9
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- v1.3.0 (trunk)
4
+ v1.3.1 (trunk)
5
+ --------------------
6
+
7
+ Bug Fixes:
8
+ * Fix parsing of certain queries containing `:`.
9
+ * Fix alignment of summaries on large DBs.
10
+
11
+ v1.3.0 (2015-01-04)
5
12
  --------------------
6
13
 
7
14
  New Features:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- starscope (1.3.0)
4
+ starscope (1.3.1)
5
5
  backports (~> 3.6)
6
6
  oj (~> 2.9)
7
7
  parser (~> 2.1)
data/bin/starscope CHANGED
@@ -102,7 +102,7 @@ def print_summary(db)
102
102
  tables = db.tables
103
103
  puts "No tables" if tables.empty?
104
104
  tables.sort {|a,b| a.to_s <=> b.to_s}.each do |table|
105
- printf("%-8s %5d records\n", table, db.records(table).length)
105
+ printf("%-9s %6d records\n", table, db.records(table).length)
106
106
  end
107
107
  end
108
108
 
@@ -129,7 +129,7 @@ def run_query(db, query, separator)
129
129
  end
130
130
  match = match.join(separator)
131
131
 
132
- if !match
132
+ if match.empty?
133
133
  $stderr.puts "Invalid input - no query found."
134
134
  return false
135
135
  end
@@ -35,14 +35,6 @@ module Starscope::Exportable
35
35
 
36
36
  private
37
37
 
38
- # cscope has this funky issue where it refuses to recognize function calls that
39
- # happen outside of a function definition - this isn't an issue in C, where all
40
- # calls must occur in a function, but in ruby et al. it is perfectly legal to
41
- # write normal code outside the "scope" of a function definition - we insert a
42
- # fake shim "global" function everywhere we can to work around this
43
- CSCOPE_GLOBAL_HACK_START = " \n\t$-\n"
44
- CSCOPE_GLOBAL_HACK_STOP = " \n\t}\n"
45
-
46
38
  def export_ctags(file)
47
39
  file.puts <<END
48
40
  !_TAG_FILE_FORMAT 2 /extended format/
@@ -58,6 +50,44 @@ END
58
50
  end
59
51
  end
60
52
 
53
+ def ctag_line(rec, file)
54
+ ret = "#{rec[:name][-1]}\t#{rec[:file]}\t/^#{line_for_record(rec)}$/"
55
+
56
+ ext = ctag_ext_tags(rec, file)
57
+ if not ext.empty?
58
+ ret << ";\""
59
+ ext.sort.each do |k, v|
60
+ ret << "\t#{k}:#{v}"
61
+ end
62
+ end
63
+
64
+ ret
65
+ end
66
+
67
+ def ctag_ext_tags(rec, file)
68
+ tag = {}
69
+
70
+ # these extensions are documented at http://ctags.sourceforge.net/FORMAT
71
+ case rec[:type]
72
+ when :func
73
+ tag["kind"] = "f"
74
+ when :module, :class
75
+ tag["kind"] = "c"
76
+ end
77
+
78
+ tag["language"] = file[:lang]
79
+
80
+ tag
81
+ end
82
+
83
+ # cscope has this funky issue where it refuses to recognize function calls that
84
+ # happen outside of a function definition - this isn't an issue in C, where all
85
+ # calls must occur in a function, but in ruby et al. it is perfectly legal to
86
+ # write normal code outside the "scope" of a function definition - we insert a
87
+ # fake shim "global" function everywhere we can to work around this
88
+ CSCOPE_GLOBAL_HACK_START = " \n\t$-\n"
89
+ CSCOPE_GLOBAL_HACK_STOP = " \n\t}\n"
90
+
61
91
  # ftp://ftp.eeng.dcu.ie/pub/ee454/cygwin/usr/share/doc/mlcscope-14.1.8/html/cscope.html
62
92
  def export_cscope(file)
63
93
  buf = ""
@@ -132,7 +162,7 @@ END
132
162
  db[record[:file]][record[:line_no]] << record
133
163
  end
134
164
  end
135
- return db
165
+ db
136
166
  end
137
167
 
138
168
  def tokenize_line(line, records)
@@ -160,10 +190,9 @@ END
160
190
 
161
191
  record[:key] = key
162
192
  toks[index] = record
163
-
164
193
  end
165
194
 
166
- return toks.sort
195
+ toks.sort
167
196
  end
168
197
 
169
198
  def cscope_output(line, prev, offset, record)
@@ -249,37 +278,6 @@ END
249
278
  return ""
250
279
  end
251
280
 
252
- return "\t" + ret
281
+ "\t" + ret
253
282
  end
254
-
255
- def ctag_line(rec, file)
256
- ret = "#{rec[:name][-1]}\t#{rec[:file]}\t/^#{line_for_record(rec)}$/"
257
-
258
- ext = ctag_ext_tags(rec, file)
259
- if not ext.empty?
260
- ret << ";\""
261
- ext.sort.each do |k, v|
262
- ret << "\t#{k}:#{v}"
263
- end
264
- end
265
-
266
- ret
267
- end
268
-
269
- def ctag_ext_tags(rec, file)
270
- tag = {}
271
-
272
- # these extensions are documented at http://ctags.sourceforge.net/FORMAT
273
- case rec[:type]
274
- when :func
275
- tag["kind"] = "f"
276
- when :module, :class
277
- tag["kind"] = "c"
278
- end
279
-
280
- tag["language"] = file[:lang]
281
-
282
- tag
283
- end
284
-
285
283
  end
@@ -1,3 +1,3 @@
1
1
  module Starscope
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.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-01-04 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-progressbar
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: backports
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mocha
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: A tool like the venerable cscope, but for ruby, golang and other languages
@@ -143,8 +143,8 @@ executables:
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".gitignore"
147
- - ".travis.yml"
146
+ - .gitignore
147
+ - .travis.yml
148
148
  - CHANGELOG.md
149
149
  - Gemfile
150
150
  - Gemfile.lock
@@ -193,17 +193,17 @@ require_paths:
193
193
  - lib
194
194
  required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - ">="
196
+ - - '>='
197
197
  - !ruby/object:Gem::Version
198
198
  version: 1.8.7
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ">="
201
+ - - '>='
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.2.2
206
+ rubygems_version: 2.0.14
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: A code indexer and analyzer