moduleBundlerclassManifestFileNotFound<StandardError;endclassDsldefself.evaluate(environment,file)builder=new(environment)builder.instance_eval(File.read(file.to_s),file.to_s,1)enddefinitialize(environment)@environment=environment@directory_sources=[]@git_sources={}@only,@except,@directory,@git=nil,nil,nil,nilenddefbundle_path(path)path=Pathname.new(path)@environment.gem_path=(path.relative??@environment.root.join(path):path).expand_pathenddefbin_path(path)path=Pathname.new(path)@environment.bindir=(path.relative??@environment.root.join(path):path).expand_pathenddefdisable_rubygems@environment.rubygems=falseenddefdisable_system_gems@environment.system_gems=falseenddefsource(source)source=GemSource.new(:uri=>source)unless@environment.sources.include?(source)@environment.add_source(source)endenddefonly(*env)old,@only=@only,_combine_only(env)yield@only=oldenddefexcept(*env)old,@except=@except,_combine_except(env)yield@except=oldenddefdirectory(path,options={})raiseDirectorySourceError,"cannot nest calls to directory or git"if@directory||@git@directory=DirectorySource.new(options.merge(:location=>path))@directory_sources<<@directory@environment.add_priority_source(@directory)yieldifblock_given?@directory=nilenddefgit(uri,options={})raiseDirectorySourceError,"cannot nest calls to directory or git"if@directory||@git@git=GitSource.new(options.merge(:uri=>uri))@git_sources[uri]=@git@environment.add_priority_source(@git)yieldifblock_given?@git=nilenddefclear_sources@environment.clear_sourcesenddefgem(name,*args)options=args.last.is_a?(Hash)?args.pop:{}version=args.lastifpath=options.delete(:vendored_at)options[:path]=pathwarn"The :vendored_at option is deprecated. Use :path instead.\nFrom #{caller[0]}"endoptions[:only]=_combine_only(options[:only]||options["only"])options[:except]=_combine_except(options[:except]||options["except"])dep=Dependency.new(name,options.merge(:version=>version))ifoptions.key?(:bundle)&&!options[:bundle]# We're using system gems for this oneelsif@git||options[:git]_handle_git_option(name,version,options)elsif@directory||options[:path]_handle_vendored_option(name,version,options)end@environment.dependencies<<dependprivatedef_handle_vendored_option(name,version,options)dir,path=_find_directory_source(options[:path])ifdirdir.required_specs<<namedir.add_spec(path,name,version)ifversionelsedirectoryoptions[:path]do_handle_vendored_option(name,version,{})endendenddef_find_directory_source(path)if@directoryreturn@directory,Pathname.new(path||'')endpath=@environment.filename.dirname.join(path)@directory_sources.eachdo|s|ifs.location.expand_path.to_s<path.expand_path.to_sreturns,path.relative_path_from(s.location)endendnilenddef_handle_git_option(name,version,options)git=options[:git].to_sref=options[:commit]||options[:tag]branch=options[:branch]ifsource=@git||@git_sources[git]ifref&&source.ref!=refraiseGitSourceError,"'#{git}' already specified with ref: #{source.ref}"elsifbranch&&source.branch!=branchraiseGitSourceError,"'#{git}' already specified with branch: #{source.branch}"endsource.required_specs<<namesource.add_spec(Pathname.new(options[:path]||'.'),name,version)ifversionelsegit(git,:ref=>ref,:branch=>branch)do_handle_git_option(name,version,options)endendenddef_combine_only(only)return@onlyunlessonlyonly=Array(only).compact.uniq.map{|o|o.to_s}only&=@onlyif@onlyonlyenddef_combine_except(except)return@exceptunlessexceptexcept=Array(except).compact.uniq.map{|o|o.to_s}except|=@exceptif@exceptexceptendendend