mnc 0.1.2 → 0.1.3
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 +4 -4
- data/.rubocop.yml +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +3 -1
- data/lib/mnc/parslet.rb +47 -0
- data/lib/mnc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fd4d19c21cb543ea5c1bef3c207d2ea6be312e0d97abcbdc7d83bc50d0a8121
|
4
|
+
data.tar.gz: 9abb02f41998330d15d72590b9fc2b27812cb9389f66b57a89cd75c7452c4c87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e89dfb50b9a33854e1cdf9ea52917bbe0dd766f482cbef43528ad35e6c18981dc618a37977b2c9770318687826b9ddb0fa457ace0950f993c3c6b86e1d934e12
|
7
|
+
data.tar.gz: d47db045b0970a8db444096c928b6a8965eb8ed1d5307f0c96f516d378fb313a0b07059192639cd975daf5bf0e1e2a6b306e554cb5dc637aec18fe49ccfca6c3
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mnc (0.1.
|
4
|
+
mnc (0.1.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -11,6 +11,7 @@ GEM
|
|
11
11
|
parallel (1.20.1)
|
12
12
|
parser (3.0.1.1)
|
13
13
|
ast (~> 2.4.1)
|
14
|
+
parslet (2.0.0)
|
14
15
|
rainbow (3.0.0)
|
15
16
|
rake (13.0.3)
|
16
17
|
regexp_parser (2.1.1)
|
@@ -39,6 +40,7 @@ PLATFORMS
|
|
39
40
|
DEPENDENCIES
|
40
41
|
minitest (~> 5.0)
|
41
42
|
mnc!
|
43
|
+
parslet (~> 2.0)
|
42
44
|
rake (~> 13.0)
|
43
45
|
rubocop (~> 1.7)
|
44
46
|
rubocop-minitest
|
data/lib/mnc/parslet.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'parslet'
|
4
|
+
|
5
|
+
module MNC
|
6
|
+
class Parslet < Parslet::Parser
|
7
|
+
rule(:crontab) { lines.as(:crontab) }
|
8
|
+
rule(:lines) { (line >> eol).repeat }
|
9
|
+
rule(:line) { cron | env | comment | blank }
|
10
|
+
|
11
|
+
rule(:space) { match[" \t"].repeat(1) }
|
12
|
+
rule(:eol) { line_end.repeat(1) }
|
13
|
+
rule(:line_end) { crlf >> space.maybe }
|
14
|
+
rule(:crlf) { match["\r\n"].repeat(1) }
|
15
|
+
rule(:eof) { any.absent? }
|
16
|
+
|
17
|
+
rule(:blank) { space.repeat }
|
18
|
+
|
19
|
+
rule(:comment) { space >> hash >> match["^\n"].repeat }
|
20
|
+
rule(:hash) { str('#') }
|
21
|
+
|
22
|
+
rule(:env) { variable >> space >> equal >> space >> value }
|
23
|
+
rule(:variable) { match('\w').repeat(1) }
|
24
|
+
rule(:equal) { str('=') }
|
25
|
+
rule(:value) { match["^\n"].repeat(1) }
|
26
|
+
|
27
|
+
rule(:cron) { (special | traditional).as(:cron) >> space >> command }
|
28
|
+
rule(:special) { (str('@') >> match['a-z'].repeat(1)).as(:special) }
|
29
|
+
rule(:traditional) { minute >> space >> hour >> space >> dom >> space >> month >> space >> dow }
|
30
|
+
|
31
|
+
rule(:minute) { entry.as(:minute) }
|
32
|
+
rule(:hour) { entry.as(:hour) }
|
33
|
+
rule(:dom) { entry.as(:dom) }
|
34
|
+
rule(:month) { entry.as(:month) }
|
35
|
+
rule(:dow) { entry.as(:dow) }
|
36
|
+
|
37
|
+
rule(:entry) { step | wildcard | list }
|
38
|
+
rule(:step) { str('*/') >> integer }
|
39
|
+
rule(:wildcard) { str('*') }
|
40
|
+
rule(:list) { (range | integer) >> (str(',') >> (range | integer)).repeat }
|
41
|
+
rule(:range) { integer >> str('-') >> integer }
|
42
|
+
rule(:integer) { match['0-9'].repeat(1) }
|
43
|
+
rule(:command) { match["^\n"].repeat(1) }
|
44
|
+
|
45
|
+
root(:crontab)
|
46
|
+
end
|
47
|
+
end
|
data/lib/mnc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank J. Cameron
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- bin/console
|
30
30
|
- bin/setup
|
31
31
|
- lib/mnc.rb
|
32
|
+
- lib/mnc/parslet.rb
|
32
33
|
- lib/mnc/version.rb
|
33
34
|
- mnc.gemspec
|
34
35
|
homepage: https://gitlab.com/fjc/mnc
|