Sha256: d78ab8a51f138c8b20177761751848eb1b48baa32298da823403d7deb3216b76

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 Bytes

Contents

module SimpleGuiCreator
  def self.snake_case string
    string = string.to_s.dup
    string.gsub!(/::/, '/')
    string.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
    string.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
    string.tr!("-", "_")
    string.downcase!
	string
  end
end

# some autoloads, in case they save any load time...
for clazz in [:DriveInfo, :MouseControl, :PlayAudio, :PlayMp3Audio, :RubyClip]
  new_path = File.dirname(__FILE__) + '/simple_gui_creator/' + SimpleGuiCreator.snake_case(clazz) + '.rb'
  autoload clazz, new_path
end

require File.dirname(__FILE__) + '/simple_gui_creator/simple_gui_creator.rb'

module SimpleGuiCreator
  autoload :ParseTemplate, File.dirname(__FILE__) + '/simple_gui_creator/parse_template.rb'
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simple_gui_creator-0.2.0 lib/simple_gui_creator.rb
simple_gui_creator-0.1.4 lib/simple_gui_creator.rb
simple_gui_creator-0.1.3 lib/simple_gui_creator.rb
simple_gui_creator-0.1.2 lib/simple_gui_creator.rb