starscope 1.5.6 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +8 -0
- data/README.md +0 -2
- data/lib/starscope/db.rb +7 -5
- data/lib/starscope/exportable.rb +1 -1
- data/lib/starscope/langs/ruby.rb +10 -1
- data/lib/starscope/version.rb +1 -1
- data/starscope.gemspec +3 -3
- data/test/fixtures/sample_ruby.rb +2 -0
- data/test/test_helper.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16cc0b7d5c3226ca3680b475dfcd923348352d9f
|
4
|
+
data.tar.gz: f3c98060b7b84c54fc13fab3469387f691dfb76f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b56db7031396663009a1d062b7444ada17e3d103f2bb972e6bd94b6211eb22a4a44d3891ae1e9a01dc8317800d64438c3f45d4fa25fc8dd17e8e8e1f9ce36bc
|
7
|
+
data.tar.gz: 7080292f2aaa289b20733edf0a40594ad213864cdda3b7c014143aae6405c51aa142993b52058313f8ddfa0703401db21c47eec0b7d30cfcc36de94648c344b4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
v1.5.7 (2019-04-04)
|
5
|
+
--------------------
|
6
|
+
|
7
|
+
* Use binary mode for file writes to fix compatibility on MS Windows (#171).
|
8
|
+
* Make sure the database is still valid when a parse exception happens (#173).
|
9
|
+
* Fix handling of `__ENCODING__` literals in ruby parser (#174).
|
10
|
+
* Update some dependencies.
|
11
|
+
|
4
12
|
v1.5.6 (2018-01-16)
|
5
13
|
--------------------
|
6
14
|
|
data/README.md
CHANGED
data/lib/starscope/db.rb
CHANGED
@@ -56,7 +56,7 @@ module Starscope
|
|
56
56
|
|
57
57
|
@meta[:langs].merge!(LANGS)
|
58
58
|
|
59
|
-
File.open(filename, '
|
59
|
+
File.open(filename, 'wb') do |file|
|
60
60
|
Zlib::GzipWriter.wrap(file) do |stream|
|
61
61
|
stream.puts DB_FORMAT
|
62
62
|
stream.puts Oj.dump @meta
|
@@ -148,7 +148,7 @@ module Starscope
|
|
148
148
|
private
|
149
149
|
|
150
150
|
def open_db(filename)
|
151
|
-
File.open(filename, '
|
151
|
+
File.open(filename, 'rb') do |file|
|
152
152
|
begin
|
153
153
|
Zlib::GzipReader.wrap(file) do |stream|
|
154
154
|
parse_db(stream)
|
@@ -272,15 +272,17 @@ module Starscope
|
|
272
272
|
@meta[:files][file][:sublangs] << lang
|
273
273
|
end
|
274
274
|
|
275
|
+
rescue => e
|
276
|
+
@output.normal("#{extractor} raised \"#{e}\" while extracting #{file}")
|
277
|
+
ensure
|
278
|
+
# metadata must be created for any record that was inserted into a tbl
|
279
|
+
# even if there was later a rescued exception
|
275
280
|
@meta[:files][file][:lang] = extractor.name.split('::').last.to_sym
|
276
281
|
@meta[:files][file][:lines] = lines
|
277
282
|
|
278
283
|
if extractor_metadata.is_a? Hash
|
279
284
|
@meta[:files][file] = extractor_metadata.merge!(@meta[:files][file])
|
280
285
|
end
|
281
|
-
|
282
|
-
rescue => e
|
283
|
-
@output.normal("#{extractor} raised \"#{e}\" while extracting #{file}")
|
284
286
|
end
|
285
287
|
|
286
288
|
def file_changed(name)
|
data/lib/starscope/exportable.rb
CHANGED
@@ -19,7 +19,7 @@ module Starscope
|
|
19
19
|
|
20
20
|
@output.normal("Exporting to '#{path}' in format '#{format}'...")
|
21
21
|
path_prefix = Pathname.getwd.relative_path_from(Pathname.new(path).dirname.expand_path)
|
22
|
-
File.open(path, '
|
22
|
+
File.open(path, 'wb') do |file|
|
23
23
|
export_to(format, file, path_prefix)
|
24
24
|
end
|
25
25
|
@output.normal('Export complete.')
|
data/lib/starscope/langs/ruby.rb
CHANGED
@@ -90,7 +90,16 @@ module Starscope
|
|
90
90
|
|
91
91
|
when :const
|
92
92
|
name = scoped_name(node, scope)
|
93
|
-
|
93
|
+
# handle `__ENCODING__` and other weird quasi-constants
|
94
|
+
column = case loc
|
95
|
+
when Parser::Source::Map::Constant
|
96
|
+
loc.name.column
|
97
|
+
when Parser::Source::Map
|
98
|
+
loc.column
|
99
|
+
when nil
|
100
|
+
return
|
101
|
+
end
|
102
|
+
yield :reads, name, line_no: loc.line, col: column
|
94
103
|
|
95
104
|
when :lvar, :ivar, :cvar, :gvar
|
96
105
|
yield :reads, scope + [node.children[0]], line_no: loc.line, col: loc.name.column
|
data/lib/starscope/version.rb
CHANGED
data/starscope.gemspec
CHANGED
@@ -19,14 +19,14 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ['lib']
|
20
20
|
gem.required_ruby_version = '>= 2.0'
|
21
21
|
|
22
|
-
gem.add_dependency 'oj', '~> 3.
|
23
|
-
gem.add_dependency 'parser', '~> 2.
|
22
|
+
gem.add_dependency 'oj', '~> 3.7'
|
23
|
+
gem.add_dependency 'parser', '~> 2.6'
|
24
24
|
gem.add_dependency 'ruby-progressbar', '~> 1.9'
|
25
25
|
gem.add_dependency 'rkelly-remix', '~> 0.0.7'
|
26
26
|
gem.add_dependency 'babel-transpiler', '~> 0.7'
|
27
27
|
gem.add_dependency 'sourcemap', '~> 0.1'
|
28
28
|
|
29
|
-
gem.add_development_dependency 'bundler', '
|
29
|
+
gem.add_development_dependency 'bundler', '>= 1.7'
|
30
30
|
gem.add_development_dependency 'rake', '~> 11.2'
|
31
31
|
gem.add_development_dependency 'pry', '~> 0.11'
|
32
32
|
gem.add_development_dependency 'minitest', '~> 5.10'
|
data/test/test_helper.rb
CHANGED
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.5.
|
4
|
+
version: 1.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Huus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.7'
|
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
|
-
version: '3.
|
26
|
+
version: '3.7'
|
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
|
-
version: '2.
|
33
|
+
version: '2.6'
|
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
|
-
version: '2.
|
40
|
+
version: '2.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ruby-progressbar
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.7'
|
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: '1.7'
|
111
111
|
- !ruby/object:Gem::Dependency
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
259
|
rubyforge_project:
|
260
|
-
rubygems_version: 2.5.2
|
260
|
+
rubygems_version: 2.5.2.3
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Smart code search and indexing
|