Skip to content

Commit

Permalink
Fix which jlenv definition and references.
Browse files Browse the repository at this point in the history
  • Loading branch information
taqtiqa-mark committed Jul 4, 2019
1 parent 570807a commit 2239bb6
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 19 deletions.
8 changes: 0 additions & 8 deletions .all-contributorsrc.txt

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Installs jlenv to the system location, by default `/usr/local/jlenv`
jlenv_system_install 'foo' do
git_url # URL of the plugin repo you want to checkout
git_ref # Optional: Git reference to checkout
update_rbenv # Optional: Keeps the git repo up to date
update_jlenv # Optional: Keeps the git repo up to date
end
```

Expand Down
2 changes: 0 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Please refer to
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD
# Testing

Please refer to the [community cookbook documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD).
4 changes: 3 additions & 1 deletion libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# Library:: Chef::Jlenv::ShellHelpers
#
# Author:: Fletcher Nichol <[email protected]>
# Author:: Mark Van de Vyver <[email protected]>
#
# Copyright:: 2011-2017, Fletcher Nichol
# Copyright:: 2019, Mark Van de Vyver
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +42,7 @@ def root_path
end
end

def which_rbenv
def which_jlenv
"(#{new_resource.user || 'system'})"
end

Expand Down
2 changes: 1 addition & 1 deletion resources/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# e.g. "jlenv global" should return the version we set

action :create do
jlenv_script "globals #{which_rbenv}" do
jlenv_script "globals #{which_jlenv}" do
code "jlenv global #{new_resource.jlenv_version}"
user new_resource.user if new_resource.user
action :run
Expand Down
2 changes: 1 addition & 1 deletion resources/julia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
command << " #{new_resource.version}"
command << ' --verbose' if new_resource.verbose

jlenv_script "#{command} #{which_rbenv}" do
jlenv_script "#{command} #{which_jlenv}" do
code command
user new_resource.user if new_resource.user
environment new_resource.environment if new_resource.environment
Expand Down
2 changes: 1 addition & 1 deletion resources/rehash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
property :user, String

action :run do
jlenv_script "jlenv rehash #{which_rbenv}" do
jlenv_script "jlenv rehash #{which_jlenv}" do
code %(jlenv rehash)
user new_resource.user if new_resource.user
action :run
Expand Down
4 changes: 2 additions & 2 deletions resources/system_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
property :git_url, String, default: 'https://github.com/rbenv/rbenv.git'
property :git_ref, String, default: 'master'
property :global_prefix, String, default: '/usr/local/jlenv'
property :update_rbenv, [true, false], default: true
property :update_jlenv, [true, false], default: true

action :install do
node.run_state['root_path'] ||= {}
Expand All @@ -51,7 +51,7 @@
git new_resource.global_prefix do
repository new_resource.git_url
reference new_resource.git_ref
action :checkout if new_resource.update_rbenv == false
action :checkout if new_resource.update_jlenv == false
notifies :run, 'julia_block[Add jlenv to PATH]', :immediately
notifies :run, 'bash[Initialize system jlenv]', :immediately
end
Expand Down
4 changes: 2 additions & 2 deletions resources/user_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
property :group, String, default: lazy { user }
property :home_dir, String, default: lazy { ::File.expand_path("~#{user}") }
property :user_prefix, String, default: lazy { ::File.join(home_dir, '.jlenv') }
property :update_rbenv, [true, false], default: true
property :update_jlenv, [true, false], default: true

action :install do
package package_prerequisites
Expand All @@ -51,7 +51,7 @@
git new_resource.user_prefix do
repository new_resource.git_url
reference new_resource.git_ref
action :checkout if new_resource.update_rbenv == false
action :checkout if new_resource.update_jlenv == false
user new_resource.user
group new_resource.group
notifies :run, 'julia_block[Add jlenv to PATH]', :immediately
Expand Down

0 comments on commit 2239bb6

Please sign in to comment.