setup_script_generator 0.2.6 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf213e5c70d16dcdb1e39d45bbcc412d506c9bc9fe1c17df9873b1a647294412
4
- data.tar.gz: d5893fdb48d55b91da2a5104da6f251257e7cc130e7cf34d5450e8b165564eda
3
+ metadata.gz: 4379891f48bbc0eb854a07195331ea38069bf8757808cf07882aff97c419a29c
4
+ data.tar.gz: 355658991af90bc45354433fe5c0b4afb32b15cbc0db6916ec54515d8d94f4e6
5
5
  SHA512:
6
- metadata.gz: 858393d01c48d5977538984fab3bc1b3f5082992a7c73c45d3d32d7bf5a9813c9139ae06364e61deae27bead4ce6cade875e367041f660e6cfb89333ecef65c6
7
- data.tar.gz: 55aaa0d7db1e05ab253d5c82d7091e020951350a35715b42bf9419510d76ee981479411094505538318c69ebc080d810befa7a53a18b02bd02e428a66a7fc2eb
6
+ metadata.gz: 396e36d2da122281011f4a12ad962f97d01f5bcff85598ca00f74a89c01f81a839d1eeb4a5491f5d5827078767ec7a0bbdab84e4ba8b264088aed8b338405c20
7
+ data.tar.gz: c0da9ecdb57e0292bf4c6cbd08f13820eabba6acf1e8774b04ec75322d346ae0adcf753bc72c585f5756ea4678bd09462faaa6a045604e9a8ca70f87ea0afcd9
@@ -5,11 +5,13 @@ provision-node() {
5
5
  REQUIRED_NODE_VERSION=$(cat .node-version)
6
6
  elif [[ -f .nvmrc ]]; then
7
7
  REQUIRED_NODE_VERSION=$(cat .nvmrc)
8
- else
9
- error "You don't seem to have a Node version set in your project."
8
+ fi
9
+
10
+ if [[ -z $REQUIRED_NODE_VERSION ]]; then
11
+ error "Could not determine required Node version for this project."
10
12
  print-wrapped "\
11
- You'll need to create either a .tool-versions file or .nvmrc file in your
12
- project before you can run this script."
13
+ Your project needs to include either a valid .tool-versions file with a 'nodejs'
14
+ line or a valid .node-version or .nvimrc file."
13
15
  exit 1
14
16
  fi
15
17
 
@@ -2,20 +2,25 @@ provision-ruby() {
2
2
  USE_BUNDLER_1=0
3
3
 
4
4
  if [[ -f .tool-versions ]]; then
5
- REQUIRED_RUBY_VERSION=$(cat .tool-versions | grep '^ruby ' | sed -Ee 's/^ruby (.+)$/\1/')
5
+ REQUIRED_RUBY_VERSION=$(cat .tool-versions | grep '^ruby ' | head -n 1 | sed -Ee 's/^ruby (.+)$/\1/')
6
6
  elif [[ -f .ruby-version ]]; then
7
- REQUIRED_RUBY_VERSION=$(cat .ruby-version)
8
- else
9
- error "You don't seem to have a Ruby version set in your project."
7
+ REQUIRED_RUBY_VERSION=$(cat .ruby-version | head -n 1 | sed -Ee 's/^ruby-([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)$/\1/')
8
+ fi
9
+
10
+ if [[ -z $REQUIRED_RUBY_VERSION ]]; then
11
+ error "Could not determine required Ruby version for this project."
10
12
  print-wrapped "\
11
- You'll need to create either a .tool-versions file or .ruby-version file in your
12
- project before you can run this script."
13
+ Your project needs to include either a valid .tool-versions file with a 'ruby'
14
+ line or a valid .ruby-version file."
13
15
  exit 1
14
16
  fi
15
17
 
16
18
  ensure-ruby-development-libraries-installed
17
19
  ensure-ruby-installed
18
- ensure-project-ruby-dependencies-installed
20
+
21
+ if [[ -f Gemfile ]]; then
22
+ ensure-project-ruby-dependencies-installed
23
+ fi
19
24
  }
20
25
 
21
26
  ensure-ruby-development-libraries-installed() {
@@ -48,12 +53,6 @@ ensure-ruby-installed() {
48
53
  error "Please use chruby to install Ruby $REQUIRED_RUBY_VERSION!"
49
54
  fi
50
55
  fi
51
- elif has-executable rvm; then
52
- if ! (rvm list | grep $required_ruby_version'\>' &>/dev/null); then
53
- banner "Installing Ruby $required_ruby_version with rvm"
54
- rvm install $required_ruby_version
55
- rvm use $required_ruby_version
56
- fi
57
56
  else
58
57
  error "You don't seem to have a Ruby manager installed."
59
58
  print-wrapped "\
@@ -73,8 +72,8 @@ has-bundler() {
73
72
  ensure-project-ruby-dependencies-installed() {
74
73
  banner 'Installing Ruby dependencies'
75
74
 
76
- if [[ $USE_BUNDLER_1 -eq 1 ]] && (! has-bundler || ! [[ $(bundle -v) =~ ^Bundler version 1\. ]]); then
77
- gem install bundler -v '~> 1.0'
75
+ if [[ $USE_BUNDLER_1 -eq 1 ]] && (! has-bundler || ! [[ $(bundle -v) =~ '^Bundler version 1\.' ]]); then
76
+ gem install bundler:'~> 1.0'
78
77
  elif ! has-bundler; then
79
78
  gem install bundler
80
79
  fi
@@ -1,3 +1,3 @@
1
1
  module SetupScriptGenerator
2
- VERSION = "0.2.6".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setup_script_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-26 00:00:00.000000000 Z
11
+ date: 2020-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: