Class: Source::FilesFromBundlerDirectoryProvider
- Inherits:
-
FilesFromDirectoryProvider
- Object
- FilesProvider
- FilesFromDirectoryProvider
- Source::FilesFromBundlerDirectoryProvider
- Defined in:
- lib/gpm/source/files_providers/files_from_bundler_directory_provider.rb
Instance Attribute Summary
Attributes inherited from FilesFromDirectoryProvider
Instance Method Summary collapse
- #file_contents ⇒ Object
- #files_to_provide ⇒ Object
-
#initialize(gemfile, gemspec, vendored_gems_installer = nil) ⇒ FilesFromBundlerDirectoryProvider
constructor
A new instance of FilesFromBundlerDirectoryProvider.
Methods inherited from FilesFromDirectoryProvider
create_from_directory, create_from_glob
Methods inherited from FilesProvider
Constructor Details
#initialize(gemfile, gemspec, vendored_gems_installer = nil) ⇒ FilesFromBundlerDirectoryProvider
Returns a new instance of FilesFromBundlerDirectoryProvider.
8 9 10 11 12 13 14 |
# File 'lib/gpm/source/files_providers/files_from_bundler_directory_provider.rb', line 8 def initialize(gemfile,gemspec,vendored_gems_installer = nil) raise "Must give me a Gemfile, not #{gemfile.inspect}" unless File.basename(gemfile)=="Gemfile" @vendored_gems_installer = vendored_gems_installer || Source::VendoredGemsInstaller.new(gemfile) @installed = false super(File.dirname(gemfile), [File.basename(gemfile),File.basename(gemspec),'Gemfile.lock','.bundle/config']) end |
Instance Method Details
#file_contents ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/gpm/source/files_providers/files_from_bundler_directory_provider.rb', line 23 def file_contents unless @installed @vendored_gems_installer.install! @installed = true end super end |
#files_to_provide ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/gpm/source/files_providers/files_from_bundler_directory_provider.rb', line 15 def files_to_provide bundled_files = nil Dir.chdir(directory) do bundled_files = Dir["vendor/bundle/**/*"] end super + bundled_files end |