blufin-lib 2.2.1 → 2.2.2

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: 99d34bff64db5b0ddbb13452a1ba53d8ecc91410
4
- data.tar.gz: 196081755c6f4688d4013d6f7119f6d245f28eb3
3
+ metadata.gz: 6277cc9d0ce36387db4539da117d9545cea679d4
4
+ data.tar.gz: fff64f90538da43d91d9a589fc1b7776285725d5
5
5
  SHA512:
6
- metadata.gz: c883881f8813f392f2e35750dfcd7eed506a0a22278cc35986d02197de3b42cd1377814b2cbfcd68bb1a48bc1838fc5e605758ab411cc6f8caebe5425311524b
7
- data.tar.gz: 1350235cf7853ac1f40ef6370d28ef28acd1fa49dbb2cdca66702dbe2b46a46f741dcf1d02cb449e153a4934529f6c1c78d0e4ab6f40006edb1d1efeb60f69a8
6
+ metadata.gz: a4f9d10c168f9739768878858a8f9474d0d6a7b9ad3c6979b0bea66cfdfdd337b8beb6575a1ad78615aed4a750765555ba9e1d0d58153fe6e6d3b30b9b952e54
7
+ data.tar.gz: 91aec2f1270fee3f8a0a1517cf073b5ca84c3b096bce01ee4bdb050ac7aad434df573225d8df9a30dc009c79a2e0e98dd93af8ea254c0f580aee9278ee207215
@@ -109,7 +109,7 @@ module Blufin
109
109
  ls = line.gsub(/^\s*\*+\s*@param\s+/, '').split(' ')
110
110
  type = extract_type(ls[0])
111
111
  param_name = ls[1]
112
- param_name = param_name.strip.gsub(/^\[/, '').gsub(/]$/, '')
112
+ param_name = param_name.strip.gsub(/^\[/, '').gsub(/]$/, '')
113
113
  hyphen = ls[2]
114
114
  description = ls.drop(3).join(' ')
115
115
  raise RuntimeError, "Duplicate parameter: #{param_name}" if @docs[:params].is_a?(Hash) && @docs[:params].has_key?(param_name)
@@ -148,7 +148,7 @@ module Blufin
148
148
  raise RuntimeError, "Expected exactly one equal (=) sign, got: #{ps.length - 1}" unless ps.length == 2
149
149
  param_extracted = ps[0].strip
150
150
  raise RuntimeError, "Duplicate parameter: #{param_extracted}" if @params.has_key?(param_extracted)
151
- @params[param_extracted] = { :default => ps[1].strip }
151
+ @params[param_extracted] = {:default => ps[1].strip}
152
152
  elsif param =~ /\w+/
153
153
  raise RuntimeError, "Duplicate parameter: #{param}" if @params.has_key?(param)
154
154
  @params[param] = {}
@@ -156,7 +156,7 @@ module Blufin
156
156
  raise RuntimeError, "Unrecognized parameter: #{param}"
157
157
  end
158
158
  end
159
- @docs = { :params => {} } unless @docs.is_a?(Hash)
159
+ @docs = {:params => {}} unless @docs.is_a?(Hash)
160
160
  @docs[:params] = {} unless @docs[:params].is_a?(Hash)
161
161
  @data[@file_short][:methods][method_name] = {
162
162
  :line => @line,
@@ -173,9 +173,12 @@ module Blufin
173
173
  def self.extract_type(string, allow_void = false)
174
174
  types = DATA_TYPES
175
175
  types << 'void' if allow_void
176
- type = string.gsub(/^\{/, '').gsub(/\}$/, '')
177
- raise RuntimeError, "Unrecognized data type: #{type}" unless types.include?(type.downcase)
178
- raise RuntimeError, "Data types must be lowercase, found: #{type}" if type.downcase != 'array' && type != type.downcase
176
+ type = string.gsub(/^\{/, '').gsub(/\}$/, '')
177
+ types_compare = type =~ /\|/ ? type.split('|') : [type]
178
+ types_compare.each do |type_inner|
179
+ raise RuntimeError, "Unrecognized data type: #{type_inner}" unless types.include?(type_inner.downcase)
180
+ raise RuntimeError, "Data types must be lowercase, found: #{type_inner}" if type_inner.downcase != 'array' && type_inner != type_inner.downcase
181
+ end
179
182
  type
180
183
  end
181
184
 
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- BLUFIN_LIB_VERSION = '2.2.1'
1
+ BLUFIN_LIB_VERSION = '2.2.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blufin-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Rannetsperger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-07 00:00:00.000000000 Z
11
+ date: 2020-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline