gem_paths 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab575f0abbcb7374009cff4885ece82452980429f918a9295d6ae0f4788532ef
4
- data.tar.gz: a8fa38a8bb06e89517f98f9f0614be555a7d0edcaa1a15bae60244cbdac1fe55
3
+ metadata.gz: c522fb82a3a57e7993a08933a7f2180ae6a2775a00466988e985916c325e4064
4
+ data.tar.gz: 431be503f4a09b0936f00bfa8f2b2c4bfa0ec1a5cf13dbedcc90d23391e92401
5
5
  SHA512:
6
- metadata.gz: 90679cc1226dbb20828748c06dd60d213550322a12b576f38f04d218f7caef772723f56cade9300be929af467edd6c254eeef9891f345d9d29b3b8478ebf5520
7
- data.tar.gz: 195b1933fac5e118dcc56dca7324801148be81f0cb7ebb4c42d22aed737db161a956b594c6d6b6093db83b33995aa2d2cbe5be9d17741e476b6c0234d618d54e
6
+ metadata.gz: d07a8877d5e69ed1906aabe8271d42f02d90c7523bc3f140d61bbba016ad813637431b1e55cfe1d634e063eb846ecdf3a9f15b6cc97dd7cdcf12a8c01e7f833a
7
+ data.tar.gz: c2fab0f2ba02b8274808d1e569f15cb5d5a5ac5187d1c975eadbf5a7749e4940e2540c370378c19fb099b141ae92d8b4d4743d62cb529adf9ff556fae8872731
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gem_paths (0.2.0)
4
+ gem_paths (0.3.0)
5
5
  bundler (~> 2.0)
6
6
  thor (~> 0.20)
7
7
 
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'gem_paths/cli'
4
+
5
+ GemPaths::CLI.start
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ #Legacy command name. It will be removed in version 1.0.0.
4
+ #Use 'gem_paths' command instead
3
5
  require 'gem_paths/cli'
4
6
 
5
7
  GemPaths::CLI.start
@@ -0,0 +1,15 @@
1
+ require 'gem_paths/list'
2
+ require 'fileutils'
3
+
4
+ module Bundler
5
+ class Command
6
+ Plugin::API.command('gem_paths', self)
7
+
8
+ def exec(command_name, args)
9
+ gem_paths_make_file = (Bundler::SharedHelpers.root + '.bundle' + 'gem_paths.make')
10
+ puts "Updating #{gem_paths_make_file} ..."
11
+ FileUtils.mkdir_p gem_paths_make_file.dirname unless File.directory?(gem_paths_make_file.dirname)
12
+ File.write(gem_paths_make_file, GemPaths::List.to_make.join("\n") + "\n")
13
+ end
14
+ end
15
+ end
@@ -11,7 +11,7 @@ module GemPaths
11
11
 
12
12
 
13
13
  def self.to_make
14
- gem_name_path_map.map { |pair| "gem-path-#{pair[0]} := #{pair[1]}" }
14
+ gem_name_path_map.map { |pair| "export gem-path-#{pair[0]} := #{pair[1]}" }
15
15
  end
16
16
 
17
17
  def self.to_yaml
@@ -23,7 +23,7 @@ module GemPaths
23
23
 
24
24
  def self.to_json
25
25
  require 'json'
26
- JSON.pretty_generate(gem_name_path_map)
26
+ JSON.pretty_generate(Hash[*gem_name_path_map.flatten])
27
27
  end
28
28
 
29
29
  end
@@ -0,0 +1,23 @@
1
+ require 'gem_paths/list'
2
+ require 'fileutils'
3
+
4
+ module GemPaths
5
+ module Plugin
6
+
7
+ class << self
8
+ # Registers the plugin and adds all needed hooks
9
+ # Will call troubleshoot via the `after-install` hook if the install does not succeed
10
+ def register
11
+ return if defined?(@registered) && @registered
12
+ @registered = true
13
+ Bundler::Plugin.add_hook('after-install-all') do |spec_install|
14
+ gem_paths_make_file = (Bundler::SharedHelpers.root + '.bundle' + 'gem_paths.make')
15
+ puts "Updating #{gem_paths_make_file} ..."
16
+ FileUtils.mkdir_p gem_paths_make_file.dirname unless File.directory?(gem_paths_make_file.dirname)
17
+ File.write(gem_paths_make_file, GemPaths::List.to_make.join("\n") + "\n")
18
+ end
19
+ end
20
+ end
21
+
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module GemPaths
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -0,0 +1,3 @@
1
+ require 'bundler/command'
2
+ require 'gem_paths/plugin'
3
+ GemPaths::Plugin.register
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_paths
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Torben Jacobsen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-14 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,6 +99,7 @@ description: This gem is used to get the paths for all gems known to Bundler in
99
99
  email:
100
100
  - torben@ic-factory.com
101
101
  executables:
102
+ - gem_paths
102
103
  - gempaths
103
104
  extensions: []
104
105
  extra_rdoc_files: []
@@ -113,17 +114,21 @@ files:
113
114
  - Rakefile
114
115
  - bin/console
115
116
  - bin/setup
117
+ - exe/gem_paths
116
118
  - exe/gempaths
117
119
  - gem_paths.gemspec
120
+ - lib/bundler/command.rb
118
121
  - lib/gem_paths.rb
119
122
  - lib/gem_paths/cli.rb
120
123
  - lib/gem_paths/list.rb
124
+ - lib/gem_paths/plugin.rb
121
125
  - lib/gem_paths/version.rb
126
+ - plugins.rb
122
127
  homepage: https://github.com/ic-factory/gem_paths
123
128
  licenses:
124
129
  - LGPL-3.0
125
130
  metadata: {}
126
- post_install_message:
131
+ post_install_message:
127
132
  rdoc_options: []
128
133
  require_paths:
129
134
  - lib
@@ -138,9 +143,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
143
  - !ruby/object:Gem::Version
139
144
  version: '0'
140
145
  requirements: []
141
- rubyforge_project:
146
+ rubyforge_project:
142
147
  rubygems_version: 2.7.7
143
- signing_key:
148
+ signing_key:
144
149
  specification_version: 4
145
150
  summary: Gem to be used in plugin for Bundler, which can list gem paths in various
146
151
  output formats, eg. GNU Make.