Sha256: 9a8499a8045f7f93aa0fd62fe520e8c78c69fab83dc2573a010b3c529046408c

Contents?: true

Size: 499 Bytes

Versions: 13

Compression:

Stored size: 499 Bytes

Contents

class String
  def grab_entry_for(type, name)
    begin      
      matches = self.match(/#{type}(.*)\{(.*)"#{name}":(.*)(#{_allowed})*\}/)[0]
    rescue
      ""
    end
  end
  def _allowed
    /[ \$\._\*\-\[\]\n\t\\\/&,\(\)"',|:=\>\<A-Za-z0-9]/
  end
  def _grab_key_value_for(type, name, key)
    grab_entry_for(type, name).scan(/#{key}[ =>]*(.*)[,?]?$/).flatten.first rescue ""
  end
  def grab_key_value_for(ty, name, key)
    _grab_key_value_for(ty,name,key).gsub(/,/, '') rescue ""
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
auser-poolparty-0.2.92 lib/poolparty/spec/core/string.rb
auser-poolparty-0.2.93 lib/poolparty/spec/core/string.rb
auser-poolparty-0.2.94 lib/poolparty/spec/core/string.rb
auser-poolparty-1.0.0 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.1 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.3 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.4 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.5 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.6 lib/poolparty/spec/core/string.rb
auser-poolparty-1.1.7 lib/poolparty/spec/core/string.rb
fairchild-poolparty-1.1.3 lib/poolparty/spec/core/string.rb
fairchild-poolparty-1.1.4 lib/poolparty/spec/core/string.rb
fairchild-poolparty-1.1.5 lib/poolparty/spec/core/string.rb