starscope 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- v0.1.7 (trunk)
4
+ v0.1.8 (trunk)
5
+ -------------------
6
+
7
+ Bug Fixes:
8
+ * Correctly handle empty files in ruby parser (#12)
9
+
10
+ v0.1.7 (2014-01-14)
5
11
  -------------------
6
12
 
7
13
  Improvements:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- starscope (0.1.7)
4
+ starscope (0.1.8)
5
5
  oj (~> 2.5)
6
6
  parser (~> 2.1)
7
7
  ruby-progressbar (~> 1.4)
@@ -19,11 +19,11 @@ GEM
19
19
  debugger-linecache (1.2.0)
20
20
  debugger-ruby_core_source (1.3.1)
21
21
  method_source (0.8.2)
22
- oj (2.5.3)
22
+ oj (2.5.5)
23
23
  parser (2.1.4)
24
24
  ast (~> 1.1)
25
25
  slop (~> 3.4, >= 3.4.5)
26
- pry (0.9.12.4)
26
+ pry (0.9.12.6)
27
27
  coderay (~> 1.0)
28
28
  method_source (~> 0.8)
29
29
  slop (~> 3.4)
@@ -31,14 +31,14 @@ GEM
31
31
  debugger (~> 1.3)
32
32
  pry (~> 0.9.10)
33
33
  rake (10.1.1)
34
- ruby-progressbar (1.4.0)
34
+ ruby-progressbar (1.4.1)
35
35
  slop (3.4.7)
36
36
 
37
37
  PLATFORMS
38
38
  ruby
39
39
 
40
40
  DEPENDENCIES
41
- bundler (~> 1.3)
41
+ bundler (~> 1.5)
42
42
  pry
43
43
  pry-debugger
44
44
  rake
@@ -7,6 +7,8 @@ module StarScope::Lang
7
7
  return File.open(name) {|f| f.readline} =~ /^#!.*ruby/
8
8
  rescue ArgumentError # may occur if file is binary (invalid UTF)
9
9
  false
10
+ rescue EOFError # occurs when file is empty
11
+ false
10
12
  end
11
13
 
12
14
  def self.extract(file, &block)
@@ -1,3 +1,3 @@
1
1
  module StarScope
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/starscope.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency 'oj', '~> 2.5'
19
19
  gem.add_dependency 'parser', '~> 2.1'
20
20
  gem.add_dependency 'ruby-progressbar', '~> 1.4'
21
- gem.add_development_dependency 'bundler', '~> 1.3'
21
+ gem.add_development_dependency 'bundler', '~> 1.5'
22
22
  gem.add_development_dependency 'rake'
23
23
  gem.add_development_dependency 'pry'
24
24
  gem.add_development_dependency 'pry-debugger'
data/test/files/empty ADDED
File without changes
@@ -13,7 +13,8 @@ class TestGolang < MiniTest::Unit::TestCase
13
13
 
14
14
  def test_recognition
15
15
  assert StarScope::Lang::Go.match_file(GOLANG_SAMPLE)
16
- refute StarScope::Lang::Go.match_file('something_else')
16
+ refute StarScope::Lang::Go.match_file(RUBY_SAMPLE)
17
+ refute StarScope::Lang::Go.match_file(EMPTY_FILE)
17
18
  end
18
19
 
19
20
  def test_defs
@@ -14,7 +14,8 @@ class TestRuby < MiniTest::Unit::TestCase
14
14
  def test_recognition
15
15
  assert StarScope::Lang::Ruby.match_file(RUBY_SAMPLE)
16
16
  assert StarScope::Lang::Ruby.match_file('bin/starscope')
17
- refute StarScope::Lang::Ruby.match_file('test/files/sample_golang.go')
17
+ refute StarScope::Lang::Ruby.match_file(GOLANG_SAMPLE)
18
+ refute StarScope::Lang::Ruby.match_file(EMPTY_FILE)
18
19
  end
19
20
 
20
21
  def test_function_defs
data/test/test_helper.rb CHANGED
@@ -4,3 +4,4 @@ require File.expand_path('../../lib/starscope.rb', __FILE__)
4
4
 
5
5
  GOLANG_SAMPLE = 'test/files/sample_golang.go'
6
6
  RUBY_SAMPLE = 'test/files/sample_ruby.rb'
7
+ EMPTY_FILE = 'test/files/empty'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-14 00:00:00.000000000 Z
12
+ date: 2014-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oj
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '1.3'
69
+ version: '1.5'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '1.3'
77
+ version: '1.5'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rake
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +147,7 @@ files:
147
147
  - lib/starscope/version.rb
148
148
  - starscope.gemspec
149
149
  - test/files/db_old.json.gz
150
+ - test/files/empty
150
151
  - test/files/sample_golang.go
151
152
  - test/files/sample_ruby.rb
152
153
  - test/lib/test_db.rb
@@ -173,6 +174,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
174
  - - ! '>='
174
175
  - !ruby/object:Gem::Version
175
176
  version: '0'
177
+ segments:
178
+ - 0
179
+ hash: -3125433471722623864
176
180
  requirements: []
177
181
  rubyforge_project:
178
182
  rubygems_version: 1.8.23
@@ -181,6 +185,7 @@ specification_version: 3
181
185
  summary: A code indexer and analyzer
182
186
  test_files:
183
187
  - test/files/db_old.json.gz
188
+ - test/files/empty
184
189
  - test/files/sample_golang.go
185
190
  - test/files/sample_ruby.rb
186
191
  - test/lib/test_db.rb