Sha256: 9c1f95e3d2594af6d77f85301c7467a253ac0aa0954104a850aa396ff6047ed5

Contents?: true

Size: 594 Bytes

Versions: 8

Compression:

Stored size: 594 Bytes

Contents

module Buzztools
	module Shell
		module_function

		# from whenever crontab
		#/bin/bash -l -c 'cd /var/www/homeopen.com/releases/20140714092436 && bin/rails runner -e production '\''scripts/update_contacts.rb'\'' >> log/cron.log 2>&1'

		def run(aCommand)
			`/bin/bash -l -c 'cd "#{Rails.root.to_s}" && #{aCommand} 2>&1'`   			# bin/rails runner -e production '\''scripts/update_contacts.rb'\'' >> log/cron.log 2>&1'`
		end

		def runner(aScript,*args)
			pars = (args || []).join(' ')
			cmd = "rails runner -e #{Rails.env} #{aScript}"
			cmd += ' ' + pars if pars
			run(cmd)
		end
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
buzztools-0.1.2 lib/buzztools/shell.rb
buzztools-0.1.1 lib/buzztools/shell.rb
buzztools-0.1.0 lib/buzztools/shell.rb
buzztools-0.0.11 lib/buzztools/shell.rb
buzztools-0.0.10 lib/buzztools/shell.rb
buzztools-0.0.9 lib/buzztools/shell.rb
buzztools-0.0.8 lib/buzztools/shell.rb
buzztools-0.0.7 lib/buzztools/shell.rb