bard 0.42.0 → 0.43.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: 8ede698ef957275736c6d373ab637f83e9a676bf3a7214a789d4314ee69f3532
4
- data.tar.gz: c0ac00d558f50fa633858358d2387f68095810e8741b13b4227a08cfd3f9c5c4
3
+ metadata.gz: 1d2474f2bb81c20829b7ca09fff60ecfce5591b079eabc5b278f84264a85af47
4
+ data.tar.gz: a2a64f425e92a13bd2fb13a8e31cf26c6515eb382612b5bb805e626be2df7447
5
5
  SHA512:
6
- metadata.gz: a237a2cc3ddc4611486f1dfe6b14a8c282daa7656330bc0748c960f668c4e5ec213ebd7cb9b7cd0671de95476a4a61b0e6763bb5588cda63dc08ab2d0809f9f0
7
- data.tar.gz: 6861a6cf67056c5762144eb4fafc809c3a7a1040a8213a5bcac5860bc4f33aec9d44dccd7567e761f96465b20e0f14e5fa4a45aadcd96217a47b92ac7c8ce008
6
+ metadata.gz: e6d10bdee8db0cd11175325e41ae74f34543f20be0b5dd6f37ef52e51c67ffad1690d7a608df746d811846044c3627efee8328ae2b6c6cea5db45122db8e58fd
7
+ data.tar.gz: 05e02cc97bc25bb51a6794effd9a29ad466fab9909193028b3d6151c51cb0e20224639a40d6732c86b0307084743a9a113aae5a6f61eff6ff954d8779edf9b2e
@@ -1,45 +1,31 @@
1
1
  module SpecifiedNode
2
- class NVMError < StandardError; end
3
-
4
- NVM_PATH = File.expand_path("~/.nvm/nvm.sh")
5
-
6
2
  extend self
7
3
 
4
+ NODE_VERSION = "v12.16.1"
5
+ NODE_PATH = "tmp/node-#{NODE_VERSION}-linux-x64/bin/node"
6
+
8
7
  def ensure!
9
- install_nvm unless nvm_installed?
10
- restart unless nvm_active?
11
8
  install_node unless node_installed?
12
- "true"
9
+ install_binstub
10
+ "bin/node --version"
13
11
  end
14
12
 
15
13
  private
16
14
 
17
- def install_nvm
18
- system("curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash")\
19
- or raise "Couldn't install nvm"
20
- end
21
-
22
- def nvm_installed?
23
- File.exist?(NVM_PATH)
24
- end
25
-
26
15
  def install_node
27
- nvm "install" or raise NVMError.new($?.exitstatus)
28
- end
29
-
30
- def node_installed?
31
- nvm "use"
16
+ system("wget -cO- https://nodejs.org/dist/#{NODE_VERSION}/node-#{NODE_VERSION}-linux-x64.tar.xz | tar xJ -C tmp/")
32
17
  end
33
18
 
34
- def restart
35
- exec %(bash -lc ". #{NVM_PATH}; #{$0}")
19
+ def install_binstub
20
+ system("cd bin && ln -fs ../#{NODE_PATH}")
36
21
  end
37
22
 
38
- def nvm_active?
39
- ENV.key?("NVM_DIR")
23
+ def node_installed?
24
+ File.exist?(NODE_PATH) && `#{NODE_PATH} --version`.chomp == NODE_VERSION
40
25
  end
41
26
 
42
- def nvm command
43
- system(". #{NVM_PATH}; nvm #{command}")
27
+ def binstub_installed?
28
+ File.exist?("bin/node")
44
29
  end
45
30
  end
31
+
@@ -1,34 +1,31 @@
1
1
  module SpecifiedYarn
2
2
  extend self
3
3
 
4
- YARN_PATH = "node_modules/yarn/bin/yarn"
4
+ YARN_VERSION = "v1.22.0"
5
+ YARN_PATH = "tmp/yarn-#{YARN_VERSION}/bin/yarn.js"
5
6
 
6
7
  def ensure!
7
8
  install_yarn unless yarn_installed?
8
- install_binstub unless binstub_installed?
9
+ install_binstub
9
10
  "bin/yarn install"
10
11
  end
11
12
 
12
13
  private
13
14
 
14
15
  def install_yarn
15
- system(". ~/.nvm/nvm.sh && npm install yarn@#{version} --no-save")
16
+ system("wget -cO- https://github.com/yarnpkg/yarn/releases/download/#{YARN_VERSION}/yarn-#{YARN_VERSION}.tar.gz | tar -xz -C tmp/")
16
17
  end
17
18
 
18
19
  def install_binstub
19
- system("cd bin && ln -s ../#{YARN_PATH}")
20
+ system("cd bin && ln -fs ../#{YARN_PATH}")
20
21
  end
21
22
 
22
23
  def yarn_installed?
23
- File.exist?(YARN_PATH) && `#{YARN_PATH} --version`.chomp == version
24
+ File.exist?(YARN_PATH) && `bin/node #{YARN_PATH} --version`.chomp == YARN_VERSION[1..-1]
24
25
  end
25
26
 
26
27
  def binstub_installed?
27
28
  File.exist?("bin/yarn")
28
29
  end
29
-
30
- def version
31
- File.read("package.json")[/"yarn": "([0-9\.]+)"/, 1]
32
- end
33
30
  end
34
31
 
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ argv0=$(echo "$0" | sed -e 's,\\,/,g')
3
+ basedir=$(dirname "$(readlink -f "$0" || echo "$argv0")")
4
+ exec "$basedir/node" "$basedir/yarn.js" "$@"
5
+
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.42.0"
2
+ VERSION = "0.43.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -143,6 +143,7 @@ files:
143
143
  - install_files/specified_node.rb
144
144
  - install_files/specified_ruby.rb
145
145
  - install_files/specified_yarn.rb
146
+ - install_files/yarn
146
147
  - lib/bard.rb
147
148
  - lib/bard/base.rb
148
149
  - lib/bard/ci.rb