Sha256: 12c8346de54b3558998dad319d370dbccd572270755a6a13f2ed57f384ad2587

Contents?: true

Size: 502 Bytes

Versions: 13

Compression:

Stored size: 502 Bytes

Contents

# encoding: UTF-8

module NameHelper

  def create_nice_file_name(file_content)
    class_name = file_content.match(/#{@app_structure.vendor}::[A-Z_]+::[a-zA-Z]+/).to_s.split('::').last
    class_name.gsub!(/[A-Z]+/) do |capital_letters|
      if capital_letters.size > 1 && class_name[-capital_letters.size..-1] != capital_letters
        "_#{capital_letters[0..-2].downcase}_#{capital_letters[-1].downcase}"
      else
        "_#{capital_letters.downcase}"
      end
    end
    class_name
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
joe_utils-0.1.6 lib/joe_utils/helpers/name_helper.rb
joe_utils-0.0.12 lib/joe_utils/name_helper.rb
joe_utils-0.0.11 lib/joe_utils/name_helper.rb
joe_utils-0.0.10 lib/joe_utils/name_helper.rb
joe_utils-0.0.9 lib/joe_utils/name_helper.rb
joe_utils-0.0.8 lib/joe_utils/name_helper.rb
joe_utils-0.0.7 lib/joe_utils/name_helper.rb
joe_utils-0.0.6 lib/joe_utils/name_helper.rb
joe_utils-0.0.5 lib/joe_utils/name_helper.rb
joe_utils-0.0.4 lib/joe_utils/name_helper.rb
joe_utils-0.0.3 lib/joe_utils/name_helper.rb
joe_utils-0.0.2 lib/joe_utils/name_helper.rb
joe_utils-0.0.0 lib/joe_utils/name_helper.rb