wildland_dev_tools 0.8.3 → 1.0.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
  SHA1:
3
- metadata.gz: c1809c260f3f126ca49ffbacea30c94bd5be4652
4
- data.tar.gz: 7c33efa95ec3781d44ed722c6e5fbd264a61f178
3
+ metadata.gz: 40bc73b0ec0d6ce0ebde969eafad7585c8ad0fb7
4
+ data.tar.gz: 890e4525c95b5e2f5a8e599bf92ac199dfa2b653
5
5
  SHA512:
6
- metadata.gz: ca03caa15b54bc4f272038693e9be88435e90b4f2298b0ea07609b6fa68945307a19133acc8d2d98105df6508236359c9acc0ba7b907d86ce329e72f0b826c48
7
- data.tar.gz: fb57e31e8b924e3ea3c65cfacc33b1bd590ac140bee2a72b738daec6dd877ac2bca87cb46de8bfce8c3eafa70d9b114d8acb549cbc59f3e2ac10efb49772066a
6
+ metadata.gz: 14c8616886be729c61623c7eea137073ccfaa73a6de66f517ee2841e66575619ef5dd3945d212badebacc9be527bf9135082028c98067508c498c717d1b66bb5
7
+ data.tar.gz: ab0472a04e966b4e30dc46343a36675a6abc1bcbd5c7bd1f041a0c0e91d43a30e25f70fd9f1f968f014ee9d980442b475fa7ca9ed3cba3ed408c30a00913feda
data/README.md CHANGED
@@ -6,13 +6,13 @@ These are most useful for projects created by [trailhead](https://github.com/wil
6
6
 
7
7
  Add the following to your `Gemfile`:
8
8
 
9
- `gem 'wildland_dev_tools', '~>0.8.1', github: 'wildland/wildland_dev_tools'`
9
+ `gem 'wildland_dev_tools', '~>1.0.0'
10
10
 
11
11
  Typically for wildland projects you will want to put this inside the dev/test block:
12
12
  ```
13
13
  group :development, :test do
14
14
  ...
15
- gem 'wildland_dev_tools', '~>0.8.1', github: 'wildland/wildland_dev_tools'`
15
+ gem 'wildland_dev_tools', '~>1.0.0'
16
16
  ...
17
17
  end
18
18
  ```
data/lib/tasks/setup.rake CHANGED
@@ -9,27 +9,25 @@ namespace :wildland do
9
9
  task :update_ruby do
10
10
  needed_ruby_version = File.read('.ruby-version')
11
11
  if WildlandDevTools::Updater.ruby_version_up_to_date?(needed_ruby_version)
12
- puts 'up to date.'
12
+ puts 'Ruby up to date.'
13
13
  else
14
- puts 'out of date. Updating.'
14
+ puts 'Ruby out of date. Updating.'
15
15
  WildlandDevTools::Updater.update_ruby(needed_ruby_version)
16
16
  end
17
17
  end
18
18
 
19
19
  task :update_node do
20
- puts 'Node updater needs written'
21
- end
22
-
23
- task :update_ember_dependencies do
24
- if WildlandDevTools::Updater.ember_cli_rails_installed?
25
- puts 'ember-cli-rails installed'
26
- system('npm install')
20
+ needed_node_version = File.read('.nvmrc')
21
+ if WildlandDevTools::Updater.node_version_up_to_date?(needed_node_version)
22
+ puts 'Node up to date.'
27
23
  else
28
- puts 'install ember dependencies'
29
- WildlandDevTools::Updater.old_ember_setup
24
+ puts 'Node out of date. Updating.'
25
+ WildlandDevTools::Updater.update_node(needed_node_version)
30
26
  end
31
27
  end
32
28
 
29
+ task update_ember_dependencies: 'ember:install'
30
+
33
31
  desc 'Clears local cache.'
34
32
  task :cache_clear do
35
33
  WildlandDevTools::Updater.clear_ember_cache
@@ -14,14 +14,29 @@ module WildlandDevTools
14
14
  system('rake demo:seed')
15
15
  end
16
16
 
17
- def ruby_version_up_to_date?(needed_ruby_version)
18
- ruby_version = `ruby -v`
19
- ruby_version.include?(needed_ruby_version.strip)
17
+ def node_version_up_to_date?(needed_version)
18
+ current_version = `node -v`
19
+ current_version.include?(needed_version.strip)
20
+ end
21
+
22
+ def update_node(version)
23
+ # Try to use the version or install and use
24
+ system("nvm use #{version}")
25
+ unless node_version_up_to_date?(version)
26
+ system("nvm install #{version}")
27
+ system("nvm use #{version}")
28
+ end
29
+ end
30
+
31
+ def ruby_version_up_to_date?(needed_version)
32
+ current_version = `ruby -v`
33
+ current_version.include?(needed_version.strip)
20
34
  end
21
35
 
22
36
  def update_ruby(version)
23
37
  case
24
38
  when system('which rvm > /dev/null 2>&1')
39
+ warn "[DEPRECATION] `rvm` is deprecated. Please use `rbenv` to manage ruby versions instead."
25
40
  update_ruby_with_rvm(version)
26
41
  when system('which rbenv > /dev/null 2>&1')
27
42
  update_ruby_with_rbenv(version)
@@ -40,18 +55,9 @@ module WildlandDevTools
40
55
  end
41
56
 
42
57
  def update_ruby_with_rbenv(version)
58
+ system('brew upgrade rbenv ruby-build')
43
59
  system("rbenv install #{version}")
44
- end
45
-
46
- def ember_cli_rails_installed?
47
- File.exist?('bin/heroku_install') && File.exist?('package.json')
48
- end
49
-
50
- def old_ember_setup
51
- Dir.chdir('app-ember') do
52
- system('npm install')
53
- system('bower install')
54
- end
60
+ system("rbenv rehash")
55
61
  end
56
62
 
57
63
  def clear_ember_cache
@@ -1,3 +1,3 @@
1
1
  module WildlandDevTools
2
- VERSION = '0.8.3'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wildland_dev_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Weakley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-01 00:00:00.000000000 Z
11
+ date: 2017-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.5.1
148
+ rubygems_version: 2.5.2
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Wildland Dev Tools