script_executor 1.7.4 → 1.7.5

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: 73c1c08d24e34a3c848c5514f9468ac6da34a109
4
- data.tar.gz: 21361a7deed4aa7961730300d9e8a774c52223d4
3
+ metadata.gz: 14d76bcbd7dec002c5f8a212e401e85fc179d48d
4
+ data.tar.gz: fdd367cd483f92c06fca53ceed9071971ade9eb6
5
5
  SHA512:
6
- metadata.gz: 3a49c7dcae66dcb6ac84fe3f37d7317c55a25a8807e4bb46f788a010e4dd3936a926316bceb2a1f013debac9711e48cc0b086678924bfb98e28244c8c178fc7a
7
- data.tar.gz: 38543fcc57931bfdfe4a52c988fd581e59ba4ecd5bfc9baefd050f57562500fc3972bb4d6c955322104827e9d0c008e6e793a9b26752847bceba6e7ea0a1d777
6
+ metadata.gz: 7cd378c64712dcfda80578495da636439cf31845c98350f0c574daa9ffb15ce4d772875996634c7cf284fd60a1eea1259f34973ddfda1de2adbe6023f5ad4f67
7
+ data.tar.gz: 15301ca977bf1cc446da11ebc71caa22ae5eb7ca1b601add1f28459e2366a18af72cd149b614f6d539b15193b02e716d8e5148167ca453f5a40d64707f4e2fdd
data/CHANGES CHANGED
@@ -109,3 +109,7 @@
109
109
  == Version 1.7.1 - 1.7.4
110
110
 
111
111
  * Bug fixes.
112
+
113
+ == Version 1.7.5
114
+
115
+ * Add one more format for name section.
@@ -3,25 +3,29 @@ require 'parslet'
3
3
  class ScriptsParser < Parslet::Parser
4
4
  root :language
5
5
 
6
- rule(:language) { (shebang.as(:shebang).maybe >> empty_lines >> comment.repeat(0).as(:ignored) >> empty_lines >> scripts).as(:language) }
6
+ rule(:language) { (shebang.maybe >> ignored >> scripts).as(:language) }
7
7
 
8
- rule(:shebang) { str('#') >> str('!') >> match['\w\d_/\s'].repeat(1) }
8
+ rule(:shebang) { str('#') >> str('!') >> match['\w\d_/\s'].repeat(1).as(:shebang) }
9
+ rule(:ignored) { empty_lines >> (name.absent? >> comment).repeat(0).as(:ignored) >> empty_lines }
9
10
 
10
- rule(:comment) { (str(';') | str('#')) >> spaces >> (newline.absent? >> any).repeat(0).as(:comment) >> eol }
11
+ rule(:comment) { comment_char >> spaces >> (newline.absent? >> any).repeat(0).as(:comment) >> eol }
12
+ rule(:comment_char) { str(';') | str('#') }
11
13
 
12
- rule(:scripts) { script.repeat(0).as(:scripts) }
14
+ rule(:scripts) { script.repeat(0).as(:scripts) }
15
+ rule(:script) { (name >> empty_lines >> (name.absent? >> (comment | code_line)).repeat(0)).as(:script) }
13
16
 
14
- rule(:name) { spaces >> str('[') >> spaces >> name_chars.as(:name) >> str(']') >> eol }
15
- rule(:name_chars) { match['\w\d_'].repeat(1) }
17
+ rule(:name) { name_v1 |name_v2 }
18
+ rule(:name_v1) { spaces >> str('[') >> spaces >> name_chars.as(:name) >> str(']') >> spaces >> eol }
19
+ rule(:name_v2) { spaces >> comment_char >> spaces >> str('[') >> spaces >> name_chars.as(:name) >> str(']') >> spaces >> eol }
20
+ rule(:name_chars) { match['\w\d_'].repeat(1) }
16
21
 
17
- rule(:script) { (name >> empty_lines >> (name.absent? >> (comment | code_line)).repeat(0)).as(:script) }
18
- rule(:code_line) { (newline.absent? >> code_chars).repeat(1).as(:code_line) >> eol }
19
- rule(:code_chars) { any }
22
+ rule(:code_line) { (newline.absent? >> code_chars).repeat(1).as(:code_line) >> eol }
23
+ rule(:code_chars) { any }
20
24
 
21
- rule(:empty_lines) { empty_line.repeat(0) }
22
- rule(:empty_line) { spaces >> newline }
23
- rule(:newline) { str("\n") >> match("\r").maybe }
24
- rule(:spaces) { match["\s\t "].repeat(0) }
25
- rule(:eol) { (newline.repeat(0) | eof) }
26
- rule(:eof) { any.absent? }
25
+ rule(:empty_lines) { empty_line.repeat(0) }
26
+ rule(:empty_line) { spaces >> newline }
27
+ rule(:newline) { str("\n") >> match("\r").maybe }
28
+ rule(:spaces) { match["\s\t "].repeat(0) }
29
+ rule(:eol) { (newline.repeat(0) | eof) }
30
+ rule(:eof) { any.absent? }
27
31
  end
@@ -1,3 +1,3 @@
1
1
  class ScriptExecutor
2
- VERSION = "1.7.4"
2
+ VERSION = "1.7.5"
3
3
  end
@@ -55,17 +55,21 @@ describe ScriptsParser do
55
55
 
56
56
  ap transform parsed_content
57
57
  end
58
-
58
+ #
59
59
  # it "test" do
60
60
  # content = <<-DATA
61
61
  # #!/usr/bin/env bash
62
62
  #
63
+ # #######################################
64
+ #
63
65
  # # Some description
64
- # [name]
66
+ # # [name]
65
67
  #
66
68
  # # some comment
67
- # aaa
68
- # bbb
69
+ #
70
+ # aaa
71
+ # bbb
72
+ #
69
73
  # DATA
70
74
  #
71
75
  # parsed_content = subject.parse(content)
@@ -1,28 +1,32 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- [test1]
3
+
4
+ # [test1]
4
5
  # Some description
5
6
 
6
7
  echo "<%= name %>"
7
8
 
8
- [test2]
9
+
10
+ #######################################
11
+ # [test2]
9
12
 
10
13
  echo "test2"
11
14
 
15
+
12
16
  #######################################
13
- [echo]
17
+ # [echo]
14
18
 
15
19
  echo "Hello world!"
16
20
 
17
21
 
18
22
  #######################################
19
- [ubuntu_update]
23
+ # [ubuntu_update]
20
24
 
21
25
  sudo apt-get update
22
26
 
23
27
 
24
28
  #######################################
25
- [prepare_linux]
29
+ # [prepare_linux]
26
30
  # Updates linux core packages
27
31
 
28
32
  sudo apt-get update
@@ -51,7 +55,7 @@ sudo apt-get install -y libffi-dev
51
55
 
52
56
 
53
57
  #######################################
54
- [rvm]
58
+ # [rvm]
55
59
  # Installs rvm
56
60
 
57
61
  curl -L https://get.rvm.io | bash
@@ -60,7 +64,7 @@ curl -L https://get.rvm.io | bash
60
64
 
61
65
 
62
66
  #######################################
63
- [ruby]
67
+ # [ruby]
64
68
  # Installs ruby
65
69
 
66
70
  source /usr/local/rvm/scripts/rvm
@@ -69,14 +73,14 @@ rvm install ruby-2.2.3
69
73
 
70
74
 
71
75
  #######################################
72
- [node]
76
+ # [node]
73
77
  # Installs node
74
78
 
75
79
  sudo apt-get install -y node
76
80
 
77
81
 
78
82
  #######################################
79
- [rbenv ]
83
+ # [rbenv ]
80
84
  # Installs node
81
85
 
82
86
  sudo apt-get install -y rbenv
@@ -84,8 +88,9 @@ git clone git://github.com/jf/rbenv-gemset.git $HOME/.rbenv/plugins/rbenv-gemset
84
88
 
85
89
 
86
90
  #######################################
87
- [prepare]
91
+ # [prepare]
88
92
  # to support nokogiri
93
+
89
94
  sudo apt-get install -y libgmp-dev
90
95
 
91
96
  # to support capybara-webkit
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: script_executor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline