capistrano-asdf 0.0.2 → 0.0.3

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: 9f440e29b8fac1a4f924f55f81ae455ac84af13f9d71fbb7cd8102da67f6a9ed
4
- data.tar.gz: 3212c41e926141e4cd3759c209e0d4d2d69ebb81a38e134c208bf4a949fce7db
3
+ metadata.gz: 46324af703fd974f1dde1ddc31666fb73623ee8143f7d71b4f3dc30ee539c28d
4
+ data.tar.gz: d0b865987d6bdb2bc23480e89b7eae791ec2e99a9c54090555b01bc80c750a2e
5
5
  SHA512:
6
- metadata.gz: 50b48074621efdfa299cf3f3087d04b3b99f9aa9fc491d9713bcccc4487b7b6592f21cec9dbf72f6b3563752fa42e9683e52e23c4d62c3adc6cf36918cd1a766
7
- data.tar.gz: e6f440d8d77b796d1c4722d72d4c1cfba2db4ef14d7f5d2a244db733f4b60760d9532c9c29312953aac6c491811f4ffe8ead2eb4095b90eb69ffb135494adf70
6
+ metadata.gz: 607b4fbd945f5a33854220fbbffb69b1798cdd6b86edb61833e648fa5d66f14ef2d249b3d1004e664b950d08bef08c1d4d62a9dedba975702c1ce663ebceaa27
7
+ data.tar.gz: 3b33b6ae87a5de31f2e90e0281aa3add9d18c55b10edc5ee0e7b2e8ffa67f9738fcd65f33e577f8b45db379428bd4a1bc85614a60df2e110dcde54f8527a5538
@@ -1,3 +1,12 @@
1
- ## 0.0.1
1
+ ## 0.0.3
2
2
 
3
- Initial release
3
+ Add some configuration options:
4
+
5
+ set :asdf_custom_path, '~/.my_asdf_installation_path' # only needed if not '~/.asdf'
6
+ set :asdf_tools, %w{ ruby } # defaults to %{ ruby nodejs }
7
+ set :asdf_map_ruby_bins, %w{ bundle gem } # defaults to %w{ rake gem bundle ruby rails }
8
+ set :asdf_map_nodejs_bins, %w{ node npm } # defaults to %w{ node npm yarn }
9
+
10
+ ## 0.0.2
11
+
12
+ Basic working tasks
data/README.md CHANGED
@@ -29,10 +29,49 @@ And you should be good to go!
29
29
 
30
30
  ## Configuration
31
31
 
32
- There is no configuration yet.
33
32
  Everything *should work* for a basic ASDF setup *out of the box*.
34
33
  However we strongly encourage you to use the `.tool-versions` for proper tool version selection.
35
34
 
35
+ If you need some special settings, set those in the stage file for your server:
36
+
37
+ # deploy.rb or stage file (staging.rb, production.rb or else)
38
+ set :asdf_custom_path, '~/.my_asdf_installation_path' # only needed if not '~/.asdf'
39
+ set :asdf_tools, %w{ ruby } # defaults to %{ ruby nodejs }
40
+ set :asdf_map_ruby_bins, %w{ bundle gem } # defaults to %w{ rake gem bundle ruby rails }
41
+ set :asdf_map_nodejs_bins, %w{ node npm } # defaults to %w{ node npm yarn }
42
+
43
+ ### Custom ASDF path: `:asdf_custom_path`
44
+
45
+ If you have a custom ASDF setup with a different path then expected, you have
46
+ to define a custom ASDF path to tell capistrano where it is.
47
+
48
+ ### Custom ASDF tools selection: `:asdf_tools`
49
+
50
+ If you don't want to use all the tools available (`ruby` and `nodejs`), you have
51
+ to define which one you want to use.
52
+
53
+ For example; if you just want to use ASDF for ruby, you may set `:asdf_tools`:
54
+
55
+ set :asdf_tools, %w{ ruby }
56
+
57
+ ### Custom ASDF ruby binaries selection: `:asdf_map_ruby_bins`
58
+
59
+ If you want to add or remove which ruby related binaries will be mapped to ASDF ruby installation, you have
60
+ to define which one you want to be mapped.
61
+
62
+ For example; if you just want to map `bundle` and `gem` ruby binaries, you may set `:asdf_map_ruby_bins`:
63
+
64
+ set :asdf_map_ruby_bins, %w{ bundle gem }
65
+
66
+ ### Custom ASDF nodejs binaries selection: `:asdf_map_nodejs_bins`
67
+
68
+ If you want to add or remove which nodejs related binaries will be mapped to ASDF nodejs installation, you have
69
+ to define which one you want to be mapped.
70
+
71
+ For example; if you just want to map `node` and `npm` nodejs binaries, you may set `:asdf_map_nodejs_bins`:
72
+
73
+ set :asdf_map_nodejs_bins, %w{ node npm }
74
+
36
75
  ## Restrictions
37
76
 
38
77
  Capistrano can't use ASDF to install rubies, nodes or other tools yet.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "capistrano-asdf"
7
- gem.version = '0.0.2'
7
+ gem.version = '0.0.3'
8
8
  gem.licenses = ['MIT']
9
9
  gem.authors = ["Jean-Baptiste Poix"]
10
10
  gem.email = ["jbpoix@inosophia.com"]
@@ -1,4 +1,9 @@
1
1
  ASDF_USER_PATH = "~/.asdf"
2
+ ASDF_DEFAULT_TOOLS = %w{ruby nodejs}
3
+ # Ruby related bins
4
+ ASDF_DEFAULT_RUBY_BINS = %w{rake gem bundle ruby rails}
5
+ # Nodejs related bin
6
+ ASDF_DEFAULT_NODEJS_BINS = %w{node npm yarn}
2
7
 
3
8
  namespace :asdf do
4
9
  desc "Prints the ASDF tools versions on the target host"
@@ -9,17 +14,18 @@ namespace :asdf do
9
14
  end
10
15
 
11
16
  task :map_ruby_bins do
12
- fetch(:asdf_map_ruby_bins).each do |mapped_command|
13
- SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source #{fetch(:asdf_path)}/asdf.sh;")
17
+ if fetch(:asdf_tools).include?('ruby')
18
+ fetch(:asdf_map_ruby_bins).each do |mapped_command|
19
+ SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source #{fetch(:asdf_path)}/asdf.sh;")
20
+ end
14
21
  end
15
22
  end
16
23
 
17
24
  task :map_nodejs_bins do
18
- fetch(:asdf_map_nodejs_bins).each do |mapped_command|
19
- SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source #{fetch(:asdf_path)}/asdf.sh;")
20
- end
21
- fetch(:asdf_map_nodejs_npm_bins).each do |mapped_command|
22
- SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source #{fetch(:asdf_path)}/asdf.sh;")
25
+ if fetch(:asdf_tools).include?('nodejs')
26
+ fetch(:asdf_map_nodejs_bins).each do |mapped_command|
27
+ SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source #{fetch(:asdf_path)}/asdf.sh;")
28
+ end
23
29
  end
24
30
  end
25
31
 
@@ -37,8 +43,9 @@ namespace :load do
37
43
  asdf_path ||= ASDF_USER_PATH
38
44
  }
39
45
 
40
- set :asdf_map_ruby_bins, %w{rake gem bundle ruby rails}
41
- set :asdf_map_nodejs_bins, %w{node npm}
42
- set :asdf_map_nodejs_npm_bins, %w{yarn}
46
+ set :asdf_tools, fetch(:asdf_tools, ASDF_DEFAULT_TOOLS)
47
+
48
+ set :asdf_map_ruby_bins, fetch(:asdf_map_ruby_bins, ASDF_DEFAULT_RUBY_BINS)
49
+ set :asdf_map_nodejs_bins, fetch(:asdf_map_nodejs_bins, ASDF_DEFAULT_NODEJS_BINS)
43
50
  end
44
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-asdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Poix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-04 00:00:00.000000000 Z
11
+ date: 2018-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano