<commit_before>include_recipe "apt"
include_recipe "vim"

# Mount any configured SAMBA shared directory
# http://jsosic.wordpress.com/2012/08/13/accessing-host-filesystem-from-virtualbox-guest/
if node[:smbfs][:install] === true
  node[:smbfs][:mounts].keys.each do |mount_point|
    directory mount_point do
      recursive true
      action :create
    end
  end
  include_recipe "smbfs::attribute_driven"
end

# If there is no workspace, set the first SAMBA shared directory as workspace
if !node[:smbfs][:mounts].empty? && File.directory?(node[:smbfs][:mounts].keys[0])
  link node[:core][:workspace_path] do
    to node[:smbfs][:mounts].keys[0]
    only_if { !File.exist?(node[:core][:workspace_path]) }
  end
end

# If there is no workspace, set the vagrant shared directory as workspace
if File.directory?(node[:vagrant][:workspace_path])
  link node[:core][:workspace_path] do
    to node[:vagrant][:workspace_path]
    only_if { !File.exist?(node[:core][:workspace_path]) }
  end
end

# If there is no workspace, create one
directory node[:core][:workspace_path] do
  recursive true
  action :create
  only_if { !File.exist?(node[:core][:workspace_path]) }
end<commit_msg>Update init recipe with chef's `ruby_block`s<commit_after>include_recipe "apt"
include_recipe "vim"

# Mount any configured SAMBA shared directory
# http://jsosic.wordpress.com/2012/08/13/accessing-host-filesystem-from-virtualbox-guest/
if node[:smbfs][:install] === true
  node[:smbfs][:mounts].keys.each do |mount_point|
    directory mount_point do
      recursive true
      action :create
    end
  end
  include_recipe "smbfs::attribute_driven"
end

# If there is no workspace, set the FIRST SAMBA shared directory as workspace
samba_is_mounted = false
ruby_block "check_samba_workspace_created" do
  block do
    if not node[:smbfs][:mounts].empty? and File.directory? node[:smbfs][:mounts].keys[0]
        samba_is_mounted = true
    end
  end
  action :create
end

link node[:core][:workspace_path] do
  to node[:smbfs][:mounts].keys[0]
  only_if { samba_is_mounted and not File.exist? node[:core][:workspace_path] }
end

# If there is no workspace, set the vagrant shared directory as workspace
vagrant_workspace_exist = false
ruby_block "check_vagrant_workspace_created" do
  block do
    if File.directory? node[:vagrant][:workspace_path]
      vagrant_workspace_exist = true
    end
  end
  action :create
end

link node[:core][:workspace_path] do
  to node[:vagrant][:workspace_path]
  only_if { vagrant_workspace_exist and not File.exist? node[:core][:workspace_path] }
end

# If there is no workspace, create one
directory node[:core][:workspace_path] do
  recursive true
  action :create
  only_if { not File.exist? node[:core][:workspace_path] }
end
{'fraction_non_alphanumeric': 0.1160844250363901, 'fraction_numerical': 0.00727802037845706, 'mean_word_length': 5.0153172866520785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6368108', 'n_tokens_mistral': 958, 'n_tokens_neox': 936, 'n_words': 232}