title: How to call Chef resource inside ruby_block in Chef?
body: <p>I'm trying to call the Chef resource inside ruby_block. Anyone can tell me what's wrong with this code?</p>
  
  <pre><code>file '/tmp/arockia/storage.txt' do
  end
  
  lines = `cat /tmp/arockia/storage.txt | wc -l`
  ruby_block 'Check for content' do
      block do
              lines = `cat /tmp/arockia/storage.txt | wc -l`
              if Integer(lines) == 0
                      r = Chef::Resource::Execute.new('Get-Disk-Storage',run_context)
                      r.command 'df -kh &gt;&gt; /tmp/arockia/storage.txt'
                      r.run_action :run
              end
      end
  end
  </code></pre>