api
travis-ci
208 of 249 relevant lines covered (83.53%)
1334.43 hits per line
1 |
module Wasabi |
|
2 |
module CoreExt |
|
3 |
module String |
|
4 |
|
|
5 |
def self.snakecase(str) |
× |
6 |
str = str.dup |
6,440✔ |
7 |
str.gsub!(/::/, '/') |
6,440✔ |
8 |
str.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') |
6,440✔ |
9 |
str.gsub!(/([a-z\d])([A-Z])/, '\1_\2') |
6,440✔ |
10 |
str.tr!(".", "_") |
6,440✔ |
11 |
str.tr!("-", "_") |
6,440✔ |
12 |
str.downcase! |
6,440✔ |
13 |
str |
6,440✔ |
14 |
end
|
|
15 |
|
|
16 |
end
|
|
17 |
end
|
|
18 |
end
|