yap-shell-parser 0.2.0 → 0.2.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: 38fe37a326babe384c9ee17b218628b096392e1c
4
- data.tar.gz: 2c2eaaf1cc9522a4b6b3db7e8011f258f1c49b4a
3
+ metadata.gz: c7f17d75ea90aa83388bee1083d1247d20261da3
4
+ data.tar.gz: 0cf0a96f80e36feb9fbd1ac91251cba524820bfe
5
5
  SHA512:
6
- metadata.gz: 41aee65259f186af876c993a484329da3efbda47275227df23c6e8e17c2299e342f0c9c96b210b01017accc94d617389853fe1f4bda3d8c0d187d44903991d49
7
- data.tar.gz: d6742e6486e4178d5e90910c06ac5e7c852bcda64a5cd08b5c8f95107c0b3e49635d60cd58c6c40a04fc02ea20bdc63d75b9cb689ee5c1cbfb8ddb1010ac4562
6
+ metadata.gz: 4b16e7e2c7e1e88280a1ca976729fb36639135a42f586bb044181c957190df62097ef199961841b66e13bd4f45194e15b6c5d2fb8529633b68d15a6c57295f00
7
+ data.tar.gz: 696fc416a943bb644176dec23a67a1aa4723c70ae370b69e452f54d041c3215880244c0c6723e32cad41a8a77754c8af514ee7c528492b15c9b76cff7c2a68af
@@ -100,10 +100,6 @@ end
100
100
  ---- inner
101
101
  include Yap::Shell::Parser::Nodes
102
102
 
103
- def each_command_substitution_for(input, &blk)
104
- Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
105
- end
106
-
107
103
  #=end
108
104
  def parse(str)
109
105
  @yydebug = true
@@ -3,7 +3,7 @@ require 'yap/shell/parser'
3
3
  module Yap
4
4
  module Shell
5
5
  module Parser
6
- VERSION = "0.2.0"
6
+ VERSION = "0.2.1"
7
7
  end
8
8
  end
9
9
  end
@@ -10,6 +10,10 @@ module Yap
10
10
  rescue Racc::ParseError => ex
11
11
  raise ParseError, "Message: #{ex.message}\nInput: #{input}"
12
12
  end
13
+
14
+ def self.each_command_substitution_for(input, &blk)
15
+ Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.9
3
+ # This file is automatically generated by Racc 1.4.12
4
4
  # from Racc grammer file "".
5
5
  #
6
6
 
@@ -24,10 +24,6 @@ module Yap
24
24
  module_eval(<<'...end grammar.y/module_eval...', 'grammar.y', 101)
25
25
  include Yap::Shell::Parser::Nodes
26
26
 
27
- def each_command_substitution_for(input, &blk)
28
- Yap::Shell::Parser::Lexer.new.each_command_substitution_for(input, &blk)
29
- end
30
-
31
27
  #=end
32
28
  def parse(str)
33
29
  @yydebug = true
@@ -23,6 +23,16 @@ describe Yap::Shell::Parser do
23
23
  end
24
24
  end
25
25
 
26
+ describe '.each_command_substitution_for' do
27
+ let(:str){ "echo `echo hi`" }
28
+
29
+ it "yields the command substitution string" do
30
+ expect { |b|
31
+ parser.each_command_substitution_for(str, &b)
32
+ }.to yield_with_args OpenStruct.new(str:"echo hi", position:5..14)
33
+ end
34
+ end
35
+
26
36
  it_parses "ls"
27
37
  it_parses "echo foo"
28
38
  it_parses "echo foo ; echo bar baz yep"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yap-shell-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Dennis
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.4.6
116
+ rubygems_version: 2.4.3
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: The parser for the yap shell