<commit_before>#
# Cookbook Name:: system_info
# Recipe:: default
#
# Copyright 2014, Travis CI GmbH
#
# MIT License
#

git '/usr/local/system_info' do
  repository 'https://github.com/travis-ci/system_info.git'
  revision 'master'
  action :sync
end

execute "set owner on /usr/local/system_info" do
  command "chown -R #{node.travis_build_environment.user}:#{node.travis_build_environment.group} /usr/local/system_info"
end

directory '/usr/share/travis' do
  owner node.travis_build_environment.user
  group node.travis_build_environment.group
  recursive true
end

execute 'execute-system_info' do
  user node.travis_build_environment.user
  command <<-EOF
    bash -l -c 'cd /usr/local/system_info
    env FORMATS=human,json HUMAN_OUTPUT=/usr/share/travis/system_info JSON_OUTPUT=/usr/share/travis/system_info.json \
      bundle exec ./bin/system_info #{node['system_info']['cookbooks_sha'] || 'fffffff'}'
  EOF
  action :nothing
end

execute 'Install system_info gems' do
  user node.travis_build_environment.user
  cwd  '/usr/local/system_info'
  command <<-EOF
    bundle install --deployment
  EOF
  notifies :run, 'execute[execute-system_info]'
end<commit_msg>Use login bash in execute resource to install gems<commit_after>#
# Cookbook Name:: system_info
# Recipe:: default
#
# Copyright 2014, Travis CI GmbH
#
# MIT License
#

git '/usr/local/system_info' do
  repository 'https://github.com/travis-ci/system_info.git'
  revision 'master'
  action :sync
end

execute "set owner on /usr/local/system_info" do
  command "chown -R #{node.travis_build_environment.user}:#{node.travis_build_environment.group} /usr/local/system_info"
end

directory '/usr/share/travis' do
  owner node.travis_build_environment.user
  group node.travis_build_environment.group
  recursive true
end

execute 'execute-system_info' do
  user node.travis_build_environment.user
  command <<-EOF
    bash -l -c 'cd /usr/local/system_info
    env FORMATS=human,json HUMAN_OUTPUT=/usr/share/travis/system_info JSON_OUTPUT=/usr/share/travis/system_info.json \
      bundle exec ./bin/system_info #{node['system_info']['cookbooks_sha'] || 'fffffff'}'
  EOF
  action :nothing
end

execute 'Install system_info gems' do
  user node.travis_build_environment.user
  command <<-EOF
    bash -l -c 'cd /usr/local/system_info
    bundle install --deployment'
  EOF
  notifies :run, 'execute[execute-system_info]'
end
{'fraction_non_alphanumeric': 0.11297071129707113, 'fraction_numerical': 0.0033472803347280333, 'mean_word_length': 4.446469248291572, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4545851', 'n_tokens_mistral': 836, 'n_tokens_neox': 824, 'n_words': 188}