Generate require paths from gemspecs if they exist or assume the default
 lib directory.

 @return [Array<String>]
13244
def generate_require_paths
      return configured_require_paths unless gemspec?
      result = []
      gemspecs.each do |file|
        base = File.dirname(file)
        # @todo Evaluating gemspec files violates the goal of not running
        #   workspace code, but this is how Gem::Specification.load does it
        #   anyway.
        begin
          spec = eval(File.read(file), binding, file)
          next unless Gem::Specification === spec
          result.concat(spec.require_paths.map { |path| File.join(base, path) })
        rescue Exception => e
          # Don't die if we have an error during eval-ing a gem spec.
          # Concat the default lib directory instead.
          Solargraph.logger.warn "Error reading #{file}: [#{e.class}] #{e.message}"
          result.push File.join(base, 'lib')
        end
      end
      result.concat config.require_paths
      result.push File.join(directory, 'lib') if result.empty?
      result
    end
395715
def resolve_requires
      relative_require_dir = @config_dir || Dir.pwd
      Array(@hash['require']).each do |r|
        if r.start_with?('.')
          require File.join(relative_require_dir, r)
        else
          require r
        end
      end
    end
1320010
def create
      Dir.mktmpdir do |tmp_dir|
        project_dir = Pathname.new(@config[:app_dir])
        package_dir = Pathname.new(tmp_dir)
        build_dir = Pathname.new(@config[:build_dir])
        copy_source(project_dir, package_dir)
        copy_executables(project_dir, package_dir)
        create_gem_shims(package_dir)
        install_dependencies(package_dir, fetcher)
        Dir.chdir(tmp_dir) do
          create_archive(build_dir)
        end
        File.join(build_dir, @config[:archive_name])
      end
    end
1129387
def available_gems
      return [] unless gemfile_path
      dsl = Bundler::Dsl.evaluate(gemfile_path, nil, true)
      return dsl.dependencies.map(&:name)
    end
183923
def require(self, *namespecs):
        """"""
        blacklist = set([n[1:] for n in namespecs if n.startswith('!')])
        not_blacklist = [n for n in namespecs if not n.startswith('!')]
        return Bundle(*[bundle for name, version, bundle
            in self._require_recursive(*not_blacklist) if name not in blacklist])
196526
def build_paths
      case @paths
      when String
        @paths = Path::Single.new(path: @paths)
      when Array
        tmp_paths = []
        @paths.each do |path|
          if path.is_a? Hash
            tmp_paths << Path::Single.new(path)
          elsif path.is_a? String
            tmp_paths << Path::Single.new(path: path)
          else
            raise 'Unknown path structure'
          end
        end
        @paths = Path::Sequence.new(tmp_paths)
      when Hash
        @paths = Path::Single.new(@paths)
      when Path::Single, Path::Sequence, Path::Weighted
      else
        raise 'Unknown path structure'
      end
    end
44121
def require_resources
      if RUBY_PLATFORM =~ /java/
        resource_paths(:remove_jruby => true).each {|res| require res}
        true
      else
        false
      end
    end
692462
function getBundlesPaths(configuration){
	// If a bundlesPath is not provided, the paths are not needed because they are
	// already set up in steal.js
	if(!configuration.loader.bundlesPath) {
		return "";
	}
	var bundlesPath = configuration.bundlesPathURL;

	// Get the dist directory and set the paths output
	var paths = util.format('\tSystem.paths["bundles/*.css"] ="%s/*css";\n' +
													'\tSystem.paths["bundles/*"] = "%s/*.js";\n',
													bundlesPath, bundlesPath);
	return "if(!System.bundlesPath) {\n" + paths + "}\n";
}
83428
def load_defaults_files(files)
      # collect the class => path => value entries from each defaults file
      hash = LazyHash.new { Hash.new }
      files.enumerate { |file| load_defaults_file(file, hash) }
      hash
    end
426641
def build
      trace "gem build #{gemspec}"
      spec = load_gemspec
      package = ::Gem::Package.build(spec)
      mkdir_p(pkgdir) unless File.directory?(pkgdir)
      mv(package, pkgdir)
    end
665413
def gemspec
      @gemspec ||= begin
        raise Error.new("Unable to automatically determine gem name from specs in #{base}. Please set the gem name via #{self.class.name}.install_tasks(gem_name: 'name')") unless gem_name
        g = Bundler.load_gemspec(File.join(base, gem_name+'.gemspec'))
        # This is returning the path it would be in if installed normally,
        # override so we get the local path. Also for reasons that are entirely
        # beyond me, #tap makes Gem::Specification flip out so do it old-school.
        g.full_gem_path = base
        g
      end
    end
833660
def get_requires(path=REQUIRE_PATH):
    
    for line in read(path).splitlines():
        line = line.strip()
        if line and not line.startswith('#'):
            yield line
362203
def create_empty_directories
      %w{config/initializers lib spec}.each do |dir|
        empty_directory File.join(@app_path, dir)
      end

      empty_directory File.join(@app_path, 'db/migrate') unless @database.empty?

      create_file File.join(@app_path, "lib", ".gitkeep")
    end
317781
def manifest_task
      # Load all the gem's files using "git ls-files"
      repository_files = `#{git} ls-files`.split("\n")
      test_files       = Dir[test_pattern] + Dir[spec_pattern]

      update_gemspec(:files, repository_files)
      update_gemspec(:test_files, repository_files & test_files)
    end
85789
private String[] requiredLibraries() {
        List<String> libraries = new ArrayList<String>(Arrays.asList(
            "org.dbunit",
            "org.apache.commons",
            "org.apache.log4j",
            "org.slf4j",
            "org.yaml",
            "org.codehaus.jackson"
        ));

        if (!dbunitConfigurationInstance.get().isExcludePoi()) {
            libraries.add("org.apache.poi");
        }

        return libraries.toArray(new String[libraries.size()]);
    }
1205661
def gem_dependencies(gem_name)
      Utils.cache.cache(gem_name) do
        gems = Utils.gems_collection(false)
        gem_collection = gems.find_by_name(gem_name)

        return '' if gem_collection.nil?

        gem_collection = Parallel.map(gem_collection, in_threads: 4) do |gem|
          [gem, spec_for(gem.name, gem.number, gem.platform)]
        end
        gem_collection.reject! do |_, spec|
          spec.nil?
        end

        Parallel.map(gem_collection, in_threads: 4) do |gem, spec|
          dependencies = spec.dependencies.select do |d|
            d.type == :runtime
          end

          dependencies = Parallel.map(dependencies, in_threads: 4) do |d|
            [d.name.is_a?(Array) ? d.name.first : d.name, d.requirement.to_s]
          end

          {
            name: gem.name,
            number: gem.number,
            platform: gem.platform,
            dependencies: dependencies
          }
        end
      end
    end
546393
def load_rewriters
      Dir.glob(File.join(default_snippets_path, 'lib/**/*.rb')).each { |file| require file }

      @options[:custom_snippet_paths].each do |snippet_path|
        if snippet_path =~ /^http/
          uri = URI.parse snippet_path
          eval(uri.read)
        else
          require snippet_path
        end
      end
    rescue
      FileUtils.rm_rf default_snippets_path
      retry
    end