Sha256: 30a5dd36bcd5b23d9dcf115dfe06e6ca7e62faabbf047f7aadd7539c545db680

Contents?: true

Size: 894 Bytes

Versions: 1

Compression:

Stored size: 894 Bytes

Contents

module FlashSDK

  module FlashHelper

    def class_directory
      parts = input_in_parts
      if parts.size > 1
        parts.pop
        return File.join src, *parts
      end
      return src
    end

    def package_name
      parts = input_in_parts
      if parts.size > 1
        parts.pop
        return "#{parts.join('.')} "
      end
      return ""
    end

    def class_name
      parts = input_in_parts
      parts.pop.camel_case
    end

    def input_in_parts
      provided_input = input
      if provided_input.include?('/')
        provided_input.gsub! /^#{src}\//, ''
        provided_input = provided_input.split('/').join('.')
      end

      provided_input.gsub!(/\.as$/, '')
      provided_input.gsub!(/\.mxml$/, '')
      provided_input.gsub!(/\.xml$/, '')

      provided_input.split('.')
    end

    def fully_qualified_class_name
      input
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flashsdk-1.0.1.pre lib/flashsdk/generators/flash_helper.rb