module Dev class Defaults < Hash def initialize(args) args = defaults.merge(args) end def defaults { :src_glob => "**/{*.{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}", :toolset => Dev::BoostBuild.defaultToolset, :name => get_default_value_name, :directory => Rake.original_dir(), :type => get_default_value_type } end #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