From 31bdc6da2706eec95c54ca46cb8e544661296bf6 Mon Sep 17 00:00:00 2001 From: Federico Bana Date: Mon, 25 Mar 2013 16:58:19 -0300 Subject: Properly hyphenate css class names for widgets. --- bin/dashing | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/dashing b/bin/dashing index 4fb4b50..8c7e348 100755 --- a/bin/dashing +++ b/bin/dashing @@ -28,6 +28,11 @@ module Dashing class << self attr_accessor :auth_token + + def hyphenate(str) + return str.downcase if str =~ /^[A-Z-]+$/ + str.gsub('_', '-').gsub(/\B[A-Z]/, '-\&').squeeze('-').downcase + end end attr_accessor :name @@ -106,4 +111,4 @@ module Dashing end end -Dashing::CLI.start \ No newline at end of file +Dashing::CLI.start -- cgit v1.2.3