revelry_generate 0.4.7 → 0.4.8

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
  SHA1:
3
- metadata.gz: 65fbc30b9789fba87473536017239ffb6d11994c
4
- data.tar.gz: 2512dad81fe94db8eaa721903690b4439df24ff3
3
+ metadata.gz: 10fa01183488f274afc53ee90030af9dacb35d05
4
+ data.tar.gz: e1bf3d50330a72831c51a606b9a6f7f42af9acdd
5
5
  SHA512:
6
- metadata.gz: 83043a38b8aa3f0987f516324bf5bed5f03d462773e9eb6061565b668d08e121423fa5b03dea41d824e64670b2554aa98186d49ec8e30baa98467b88bde735b5
7
- data.tar.gz: a1e47654b3d8a211385699f0c1777a09da71691983de55460a8c8e1b4296685458136db6721726e49bfe6d747a6262347e17983ba19b183dc0adea98a2213df8
6
+ metadata.gz: b8bad466f0f5bc8f9dc006d485529f724e44608ecb934c7d775df50c4d87afa987e495bbcc2f53dc21c61c1d9323e31909aea959e2c4ddc0f5607a3bd8124cc1
7
+ data.tar.gz: 928b70de135ca71a179bf80f3dcc8c910a9d196ed605e8c951ac6e4f69892639388f6a50b8a764e07441b248bb31a5a0828b558c50585c66e184e6d758b9286d
@@ -47,6 +47,7 @@ module RevelryGenerate
47
47
  hook_path = File.join(gem_root, 'skeletons', ENV['SKELETON'] || 'slush', '__generators__', 'post_skeleton.rb')
48
48
 
49
49
  return unless File.exist? hook_path
50
+
50
51
  puts "rake rails:template LOCATION=#{hook_path}"
51
52
  if Rails::VERSION::MAJOR < 4
52
53
  rake("rails:template LOCATION=#{hook_path}")
@@ -1,10 +1,43 @@
1
- # Set the latest installed node version in nodenv as the version
2
- node_version = `nodenv versions`.split.last
1
+ puts ""
2
+ puts "#######################################"
3
+ puts "# Starting post skeleton #"
4
+ puts "#######################################"
5
+ puts ""
6
+
7
+ def which(cmd)
8
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
9
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
10
+ exts.each { |ext|
11
+ exe = File.join(path, "#{cmd}#{ext}")
12
+ return exe if File.executable?(exe) && !File.directory?(exe)
13
+ }
14
+ end
15
+ return nil
16
+ end
17
+
18
+ node_version =
19
+ if which('asdf').present?
20
+ `asdf list nodejs`.split.last
21
+ elsif which('nodenv').present?
22
+ `nodenv versions`.split.last
23
+ end
24
+
25
+ if node_version.present?
26
+ # If we have a working node version manager, try to set the version to the
27
+ # latest node we have installed
28
+ node_set_version_command =
29
+ if which('asdf').present?
30
+ 'asdf local nodejs'
31
+ elsif which('nodenv').present?
32
+ 'nodenv local'
33
+ end
34
+
35
+ system("#{node_set_version_command} #{node_version}") || fail('Failed to set node version!')
36
+ end
3
37
 
4
38
  # Bootstrap a render server node app
5
39
  x = system(
6
40
  <<-SH
7
- nodenv local #{node_version} &&
8
41
  npm install -g slush revelrylabs/slush-revelry &&
9
42
  npm install &&
10
43
  slush &&
@@ -159,7 +192,6 @@ inject_into_file 'render-server/package.json', after: '"scripts": {' do
159
192
  end
160
193
 
161
194
  generate 'rspec:install'
162
- system("SKELETON=#{ENV['SKELETON']||'slush'} rails g revelry_generate:skeleton")
163
195
  git :init
164
196
 
165
197
  if yes? 'Setup github and heroku?'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revelry_generate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Prehn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: