Sha256: 68c0feb18fc6a00341173fc6fb788d94948801a82c3c21be87d7a0df16973275

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

module Dev
class Defaults
  attr_accessor :project

  def get_default_value(key)
    begin
      return get_default_value_src_glob if key=="src_glob"
	  return get_default_value_toolset if key=="toolset"
	  return get_default_value_name if key=="name"
	  return get_default_value_directory if key=="directory"
	  return get_default_value_type if key=="type"
	rescue
	  return nil
	end
  end

  def get_default_value_src_glob
	value="**/{*.{rb,feature,spec,cs,c,cpp,h,hpp,csproj,vcproj,snk,vcxproj,sln,filters,xaml,xml,resx,settings,txt,png,bmp,ico},Jamfile,.semver,Gemfile,README,LICENSE}"
	return value
  end

  def get_default_value_toolset
    return Dev::BoostBuild.defaultToolset
  end

  def get_default_value_name
    dirs=Rake.original_dir().split('/')
	return dirs[dirs.length-2] if(dirs.length > 3)
    return nil
  end

  def get_default_value_directory
    return Rake.original_dir()
  end

  def get_default_value_type
    Dir.glob("**/*.{cpp,hpp}").each { |f| return "c++" }
	Dir.glob("**/*.{c,h}").each { |f| return "c" }
	Dir.glob("**/*.{cs}").each { |f| return "C#" }
	Dir.glob("**/*.{gemspec}").each { |f| return "gem" }
	return "ruby"
  end

end # class Defaults
end # module Dev

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dev-1.0.124 lib/dev/Defaults.rb