HELLO v3!!!

This commit is contained in:
Ryan Dewhurst
2018-09-26 21:12:01 +02:00
parent 28b9c15256
commit d268a86795
1871 changed files with 988118 additions and 0 deletions

16
lib/wpscan/helper.rb Normal file
View File

@@ -0,0 +1,16 @@
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