parse_a_changelog 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/parse_a_changelog.rb +25 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 71b9f84f44a8df5f2d6e8c4d172feabfebc454ac
4
+ data.tar.gz: 0df8403b602567bcf3a03ae4626e4bd9af97e838
5
+ SHA512:
6
+ metadata.gz: 07cf177e73d4a9a1e70422d3dcde1ffa117743584453a44fefb29c865f4ea64da04aff507dd2cb385ab52284a2767c2269747ddc8c5f2b64f2480894c7aae986
7
+ data.tar.gz: c0406de889427151fe87107649edccdbbc9c14ba30207195dffc419563c47ea8ed4aa9f0040dacc83910e4bcf3bba59add8045f6e6a811e4f6f65199ebcf4058
@@ -0,0 +1,25 @@
1
+ require 'treetop'
2
+
3
+ Treetop.load('lib/grammar')
4
+
5
+ module ParseAChangelog
6
+ class ParseError < StandardError; end
7
+
8
+ class << self
9
+ def parse(file_path)
10
+ file = File.read(file_path)
11
+ parser = KeepAChangelogParser.new
12
+ result = parser.parse(file)
13
+
14
+ if !result
15
+ raise ParseError.new(failure_message(parser))
16
+ end
17
+
18
+ result
19
+ end
20
+
21
+ def failure_message(parser)
22
+ parser.failure_reason.split(' after ')[0]
23
+ end
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: parse_a_changelog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - John Tuttle
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A validator for the keep-a-changelog format
14
+ email: jtuttle.develops@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/parse_a_changelog.rb
20
+ homepage: http://github.com/cyberark/parse-a-changelog
21
+ licenses:
22
+ - Apache-2.0
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.12
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: A validator for the keep-a-changelog format
44
+ test_files: []