parser 2.0.0.pre5 → 2.0.0.pre6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccfc8117e7126a0d2a68485bd7205c6fb3d8f53f
4
- data.tar.gz: e67e194ab1aeb4cc4d9689e53c1c6fc85086182b
3
+ metadata.gz: 57e819d2cd65b374e49ccdc64313da51dab99dec
4
+ data.tar.gz: 33288353f3f0585227149c307f5ca3d8a7247012
5
5
  SHA512:
6
- metadata.gz: 484011952706244097f33d7ce465578b49550d77afc34d726898b949a2040d52338e42eabed815526e65fc2bc38af474a932850efc5a3d5692ed6e58b50b2cbc
7
- data.tar.gz: bec7774f6f7d49f2fd232c97d0849691fb783a2f7726b7f5b2358fc8dfb4989334903be3bbdc1513f5a20806cb4e2cb607e926fe76db68e2b654392e28f8fa1b
6
+ metadata.gz: df8f0b48532727b9d74a81f91d0293fc9412942280ab02065d36f8578c4086e496ab7aa05de95b9e894be640135502af0c72e1a9aa85cb782153956e531dfafb
7
+ data.tar.gz: 16b3d4f6db7babe591faa0ae73bfd78602f681a67f1f19bfe654ab7e711905c41c764431498909035f231f3ad24c70cae121787aead0e318d5fea80592e1f7c4
@@ -86,12 +86,12 @@ module Parser
86
86
 
87
87
  def advance_through_directives
88
88
  # Skip shebang.
89
- if current_comment.text =~ /^#!/
89
+ if current_comment && current_comment.text =~ /^#!/
90
90
  advance_comment
91
91
  end
92
92
 
93
93
  # Skip encoding line.
94
- if current_comment.text =~ Buffer::ENCODING_RE
94
+ if current_comment && current_comment.text =~ Buffer::ENCODING_RE
95
95
  advance_comment
96
96
  end
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module Parser
2
- VERSION = '2.0.0.pre5'
2
+ VERSION = '2.0.0.pre6'
3
3
  end
@@ -65,4 +65,22 @@ end
65
65
  associations[ast].map(&:text)
66
66
  end
67
67
 
68
+ def test_associate_shebang_only
69
+ ast, associations = associate(<<-END)
70
+ #!ruby
71
+ class Foo
72
+ end
73
+ END
74
+
75
+ assert_equal 0, associations.size
76
+ end
77
+
78
+ def test_associate_no_comments
79
+ ast, associations = associate(<<-END)
80
+ class Foo
81
+ end
82
+ END
83
+
84
+ assert_equal 0, associations.size
85
+ end
68
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre5
4
+ version: 2.0.0.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zotov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-31 00:00:00.000000000 Z
11
+ date: 2013-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast