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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a672745a78f09d23b3777f8f11ca3725f673afe6
4
- data.tar.gz: 7ec09bdfae0344c549d6c145d10dfc6593bf6bfc
3
+ metadata.gz: 16cc0b7d5c3226ca3680b475dfcd923348352d9f
4
+ data.tar.gz: f3c98060b7b84c54fc13fab3469387f691dfb76f
5
5
  SHA512:
6
- metadata.gz: 7026d21cc7c2c1be4755db9f6b4c5ab93cbed8073c31b417d39dc9d8ffdf8bb2c028cb5d999cff4185795a86c19fedc7d0a45ecadd9bbb1d14effbce1265ada1
7
- data.tar.gz: 2fe2786def57bbbae6e24d4baeee414dc971a7c6b07e0b7f1b0ed56e5db03f723da28b9023bc245ff810e4ce5c7f812144e466c2476cfc1c6a0807b32bb27450
6
+ metadata.gz: 6b56db7031396663009a1d062b7444ada17e3d103f2bb972e6bd94b6211eb22a4a44d3891ae1e9a01dc8317800d64438c3f45d4fa25fc8dd17e8e8e1f9ce36bc
7
+ data.tar.gz: 7080292f2aaa289b20733edf0a40594ad213864cdda3b7c014143aae6405c51aa142993b52058313f8ddfa0703401db21c47eec0b7d30cfcc36de94648c344b4
@@ -3,7 +3,7 @@ sudo: false
3
3
 
4
4
  rvm:
5
5
  - 2.0
6
- - 2.1
7
- - 2.2
8
6
  - 2.3
9
7
  - 2.4
8
+ - 2.5
9
+ - 2.6.1
@@ -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
@@ -63,5 +63,3 @@ Other Uses
63
63
 
64
64
  - Starscope is a supported backend for
65
65
  [CodeQuery](https://github.com/ruben2020/codequery).
66
- - Starscope has been [packaged for Arch
67
- Linux](https://aur.archlinux.org/packages/ruby-starscope/).
@@ -56,7 +56,7 @@ module Starscope
56
56
 
57
57
  @meta[:langs].merge!(LANGS)
58
58
 
59
- File.open(filename, 'w') do |file|
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, 'r') do |file|
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)
@@ -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, 'w') do |file|
22
+ File.open(path, 'wb') do |file|
23
23
  export_to(format, file, path_prefix)
24
24
  end
25
25
  @output.normal('Export complete.')
@@ -90,7 +90,16 @@ module Starscope
90
90
 
91
91
  when :const
92
92
  name = scoped_name(node, scope)
93
- yield :reads, name, line_no: loc.line, col: loc.name.column
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
@@ -1,3 +1,3 @@
1
1
  module Starscope
2
- VERSION = '1.5.6'.freeze
2
+ VERSION = '1.5.7'.freeze
3
3
  end
@@ -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.3'
23
- gem.add_dependency 'parser', '~> 2.4'
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', '~> 1.7'
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'
@@ -162,3 +162,5 @@ class Starscope::DB
162
162
  end
163
163
  end
164
164
  end
165
+
166
+ puts __ENCODING__
@@ -1,6 +1,6 @@
1
1
  require 'minitest/autorun'
2
2
  require 'minitest/pride'
3
- require 'mocha/mini_test'
3
+ require 'mocha/minitest'
4
4
  require_relative '../lib/starscope'
5
5
 
6
6
  FIXTURES = 'test/fixtures'.freeze
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.6
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: 2018-01-16 00:00:00.000000000 Z
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.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.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.4'
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.4'
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