Sha256: 10a585115e6bda153c222f071c1bbf2a06022c238b564d008964bd2e504a4681
Contents?: true
Size: 504 Bytes
Versions: 13
Compression:
Stored size: 504 Bytes
Contents
def read_json_file(file) JSON.parse(File.read(file)) rescue StandardError => e raise "JSON parsing error in #{file} #{e}" end # @return [ Symbol ] # @note As a class can not start with a digit or underscore, a D_ is # put as a prefix in such case. Ugly but well :x # Not only used to classify slugs though, but Dynamic Finder names as well def classify_slug(slug) classified = slug.to_s.tr('-', '_').camelize.to_s classified = "D_#{classified}" if classified[0] =~ /\d/ classified.to_sym end
Version data entries
13 entries across 13 versions & 1 rubygems