Sha256: 9639d733e8dac3831a366e9ebe89052951d8f9c5897262d0d2c95224ec98477e

Contents?: true

Size: 750 Bytes

Versions: 11

Compression:

Stored size: 750 Bytes

Contents

module ArchitectureJS
  module Helpers
    
    def get_file_name(module_path)
      module_path = module_path.split(/[\\\/]/).last
      split = module_path.split(/[\.\-\s]/)
      module_filename = String.new
      split.each do |piece|
        module_filename << piece unless piece.match(/^module$|^js$/i)
      end
      module_filename
    end
    
    def array_to_yml(array)
      yml = array.empty? ? '[]' : %Q{['#{array.join("', '")}']}
    end

    def symbolize_keys(hash)
      symbolized_hash = Hash.new
      hash.each do |key, value|
        symbolized_hash[key.to_sym] = value
      end
      symbolized_hash
    end

    module_function :get_file_name,
                    :array_to_yml,
                    :symbolize_keys
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
architecture-js-0.1.10 lib/architecture-js/helpers.rb
architecture-js-0.1.9 lib/architecture-js/helpers.rb
architecture-js-0.1.8 lib/architecture-js/helpers.rb
architecture-js-0.1.7 lib/architecture-js/helpers.rb
architecture-js-0.1.6 lib/architecture-js/helpers.rb
architecture-js-0.1.5 lib/architecture-js/helpers.rb
architecture-js-0.1.4 lib/architecture-js/helpers.rb
architecture-js-0.1.3 lib/architecture-js/helpers.rb
architecture-js-0.1.2 lib/architecture-js/helpers.rb
architecture-js-0.1.1 lib/architecture-js/helpers.rb
architecture-js-0.1.0 lib/architecture-js/helpers.rb