raconteur 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: 40f5be16cfc9920d63f8332214c5009695734ee0
4
- data.tar.gz: 417b590a83a4236cd4915054043528198e4d8240
3
+ metadata.gz: dae7db6a3938bee8091bbcabbda6ae5b26a2b54a
4
+ data.tar.gz: ab673e373254607228acb6081c1e35122832353a
5
5
  SHA512:
6
- metadata.gz: 95cb7b120d24b40f9be3d7473d193c01f8f439fe072cc2990fed3623a18418a257ff432ab69a3551da714b4266aec36a72b5028de5788f7076d6fc5a0e645d7b
7
- data.tar.gz: 140f9e5e85d8ccf725bb9d671f768a2b2a20b9e4a5a2c79594f660b1f9ef787b270f5c135daa79b5da7082dc975f2d8eff0669b11ab3f8459a87e0c0f0a5c857
6
+ metadata.gz: f01c359a91e2ae8f1730faa05454119685c036b17579737118cfa27ee93ba2ff2fb8dcdde1b5ee0df7c7d06dccb48e8b1e79461158a99d5a5267c5af7a1d0f08
7
+ data.tar.gz: e763e2b21b5f5d1522cca03e9e8c7da014bbc10201d0eee65df7f2b7dd8d000b1ae77214791ee7f4db5ee216930e4e2cebfa962a54143c44c4299ad1195f7d52
@@ -73,6 +73,12 @@ class Raconteur::Parse
73
73
  # input: (string) 'id=353 + report-title="E-Commerce Checkout Usability Report"'
74
74
  # output: (hash) { id: '353', report_title: 'E-Commerce Checkout Usability Report' }
75
75
  def self.parse_settings(str)
76
+ # prepare a fresh hash for the parsed settings
77
+ parsed_settings = {}
78
+ # return empty hash if settings string is 'nil'
79
+ if str == nil
80
+ return parsed_settings
81
+ end
76
82
  # regex escape 'quote' character
77
83
  quote = Regexp.quote(@@raconteur.settings.setting_quotes)
78
84
  # Parsing logic:
@@ -83,8 +89,6 @@ class Raconteur::Parse
83
89
  # b) a string wrapped by the 'quote' character at both ends
84
90
  # (instances of the 'quote' character within the string can be escaped by a backward-slash '\')
85
91
  regex = /([^\s#{quote}]+)\=(#{quote}.*?[^\\]#{quote}|[^\s]+)/mi
86
- # prepare a fresh hash for the parsed settings
87
- parsed_settings = {}
88
92
  # loop over all key-value setting pairs in the string
89
93
  str.scan(regex).each do |setting_str|
90
94
  # grap keys and turn them into underscored symbols
@@ -95,9 +95,9 @@ class Raconteur::Processor
95
95
 
96
96
  # regex for matching tag and its settings
97
97
  def regex
98
- /^\s*#{Regexp.quote(@processor.tag)}:?(?<settings>.*?)?\s*$/im
98
+ /^\s*#{Regexp.quote(@processor.tag)}(:(?<settings>.*?))?\s*$/im
99
99
  end
100
-
100
+
101
101
  # execute the processor
102
102
  def execute(content="", settings={})
103
103
  output = content
@@ -1,3 +1,3 @@
1
1
  class Raconteur
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raconteur
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
  - Jamie Appleseed
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-27 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler