bundler-symlink 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cdbf5e2c44802fe68bce259655af91acb6dc6e10
4
+ data.tar.gz: 1e5fa5aeef106cc9817ddc09e9d8333239fdb3f5
5
+ SHA512:
6
+ metadata.gz: e992fe616b66b2226722dd790923d1853b35424fee9dc1bf317a6e32e65f404e5272a3ad9e0d0ce922afd818377b1577ed47c0894bdfcb8496a12f1468583115
7
+ data.tar.gz: 75a51b94a78ebaca36c2ab74758fa054c64da0899f0ebb37bd96c190226649798f3bf4f177c33c4902f84e0ae422ce87bea762a231044ba949b72e04aa062966
@@ -0,0 +1,29 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "bundler/symlink/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bundler-symlink"
8
+ spec.version = Bundler::Symlink::VERSION
9
+ spec.authors = ["Pete Kinnecom"]
10
+ spec.email = ["git@k7u7.com"]
11
+ spec.licenses = ["WTFPL"]
12
+
13
+ spec.summary = "Post-install hook for bundler to symlink to all gems from a local directory"
14
+ spec.homepage = "https://github.com/petekinnecom/bundler-symlink"
15
+
16
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
+
18
+ spec.files = [
19
+ "bundler-symlink.gemspec",
20
+ "plugins.rb",
21
+ "lib/bundler/symlink.rb",
22
+ "lib/bundler/symlink/version.rb"
23
+ ]
24
+ spec.bindir = "exe"
25
+ spec.executables = []
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_dependency "bundler", ">= 1.17.0"
29
+ end
@@ -0,0 +1,5 @@
1
+ module Bundler
2
+ module Symlink
3
+ VERSION = "0.2.0"
4
+ end
5
+ end
@@ -0,0 +1,52 @@
1
+ require "bundler/symlink/version"
2
+
3
+ require "tmpdir"
4
+ require "fileutils"
5
+
6
+ module Bundler
7
+ module Symlink
8
+ def self.call
9
+ root_path = File.dirname(Bundler.default_gemfile)
10
+ target_dir = File.join(
11
+ root_path,
12
+ '.bundle',
13
+ 'gems'
14
+ )
15
+
16
+ Dir.mktmpdir do |tmpdir|
17
+ link_dir = File.join(tmpdir, 'gems')
18
+ FileUtils.mkdir(link_dir)
19
+
20
+ Bundler
21
+ .load
22
+ .specs
23
+ .map(&:full_gem_path)
24
+ .reject {|path| path.start_with?(root_path)}
25
+ .each do |gem_path|
26
+ target = File.join(
27
+ link_dir,
28
+ File.basename(gem_path)
29
+ )
30
+
31
+ FileUtils.ln_s(
32
+ gem_path,
33
+ target
34
+ )
35
+ end
36
+
37
+ FileUtils.mkdir_p(File.dirname(target_dir))
38
+ Bundler.ui.info("Symlinking bundled gems into #{target_dir}")
39
+ FileUtils.rm_r(target_dir)
40
+ FileUtils.mv(link_dir, target_dir, force: true)
41
+ end
42
+ end
43
+
44
+ class Command
45
+ Plugin::API.command('symlink', self)
46
+
47
+ def exec(name, args)
48
+ Symlink.call
49
+ end
50
+ end
51
+ end
52
+ end
data/plugins.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler"
2
+ require "bundler/symlink"
3
+
4
+ Bundler::Plugin.add_hook('after-install-all') do |_dependencies|
5
+ Bundler::Symlink.call
6
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundler-symlink
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Pete Kinnecom
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.17.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.17.0
27
+ description:
28
+ email:
29
+ - git@k7u7.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - bundler-symlink.gemspec
35
+ - lib/bundler/symlink.rb
36
+ - lib/bundler/symlink/version.rb
37
+ - plugins.rb
38
+ homepage: https://github.com/petekinnecom/bundler-symlink
39
+ licenses:
40
+ - WTFPL
41
+ metadata:
42
+ allowed_push_host: https://rubygems.org
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.5.2
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: Post-install hook for bundler to symlink to all gems from a local directory
63
+ test_files: []