setup_script_generator 0.2.5 → 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: e7ec2b01a3c93e3cbb3e7e3deae689f7d88dd29b2d0893cb4f1d4e26c5ed344a
4
- data.tar.gz: 8bdc8183621193b0f2eb0018f9df970392e85ce27bbdcbb1d7db754db13b630c
3
+ metadata.gz: 9fa313219d3d72070f83b76129dfa4d88b201e6711c7bf4da9ee88743a2e73f0
4
+ data.tar.gz: f71b035c63680fca762ad81752bf711b239d71f5c4211983a13368e4c5471e6e
5
5
  SHA512:
6
- metadata.gz: 3c1e243b985514a855cd0ce26ad5e8547b3736fb97bf8e8e148aded638a7ce74bf88084c5c1b6911735332c65d0bc745de41d2925a3995a151419dd7798d6c67
7
- data.tar.gz: b93238103f1eda0c4eee8ce39438eb617d63777065ed82ea16858b7e6ada05df2dd951b6372c036dba91ce5f07fc866860d5a47c622c54250d147dc97eda68c7
6
+ metadata.gz: 05f56f7fab52cb6925f0fe26ab6aa865a7b9e8eb1bffdc9bcc0f9c22730d5edbff03268f77e2401915ac0248265d4895c43f73e25cf98f34e867187de733ca5d
7
+ data.tar.gz: 36579d3cd1018b4d740d845b8ecdee0b4f2441c12fab9105f3303e15949fb891da913175f3c0fbe461c61402f34cb28ff6306b867aa6cff054e31ab64110ee87
@@ -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,7 +72,7 @@ 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) =~ '^1\.' ]]); then
75
+ if [[ $USE_BUNDLER_1 -eq 1 ]] && (! has-bundler || ! [[ $(bundle -v) =~ '^Bundler version 1\.' ]]); then
77
76
  gem install bundler -v '~> 1.0'
78
77
  elif ! has-bundler; then
79
78
  gem install bundler
@@ -1,3 +1,3 @@
1
1
  module SetupScriptGenerator
2
- VERSION = "0.2.5".freeze
2
+ VERSION = "0.3.0".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.5
4
+ version: 0.3.0
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-25 00:00:00.000000000 Z
11
+ date: 2020-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: