Browse Source

COOK-318 use ::File instead of File in recipes

jtimberman 13 years ago
parent
commit
14ac2c969e
6 changed files with 11 additions and 11 deletions
  1. 2 2
      metadata.json
  2. 1 1
      metadata.rb
  3. 2 2
      recipes/rails.rb
  4. 2 2
      recipes/rails_nginx_ree_passenger.rb
  5. 2 2
      recipes/tomcat.rb
  6. 2 2
      recipes/unicorn.rb

+ 2 - 2
metadata.json

@@ -41,7 +41,7 @@
   "platforms": {
   },
   "name": "application",
-  "version": "0.8.0",
+  "version": "0.8.1",
   "conflicting": {
   },
   "license": "Apache 2.0",
@@ -55,4 +55,4 @@
     "application::java_webapp": "Deploys a Java web application WAR specified in a data bag with the remote_file resource",
     "application::tomcat": "Sets up the deployed Java application with Tomcat as the servlet container"
   }
-}
+}

+ 1 - 1
metadata.rb

@@ -3,7 +3,7 @@ maintainer_email "cookbooks@opscode.com"
 license          "Apache 2.0"
 description      "Deploys and configures a variety of applications defined from databag 'apps'"
 long_description  IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          "0.8.0"
+version          "0.8.1"
 recipe           "application", "Loads application databags and selects recipes to use"
 recipe           "application::java_webapp", "Deploys a Java web application WAR specified in a data bag with the remote_file resource"
 recipe           "application::passenger-nginx", "Installs Ruby Enterprise with Passenger under Nginx"

+ 2 - 2
recipes/rails.rb

@@ -87,11 +87,11 @@ end
 if app.has_key?("deploy_key")
   ruby_block "write_key" do
     block do
-      f = File.open("#{app['deploy_to']}/id_deploy", "w")
+      f = ::File.open("#{app['deploy_to']}/id_deploy", "w")
       f.print(app["deploy_key"])
       f.close
     end
-    not_if do File.exists?("#{app['deploy_to']}/id_deploy"); end
+    not_if do ::File.exists?("#{app['deploy_to']}/id_deploy"); end
   end
 
   file "#{app['deploy_to']}/id_deploy" do

+ 2 - 2
recipes/rails_nginx_ree_passenger.rb

@@ -89,11 +89,11 @@ search(:apps) do |app|
     if app.has_key?("deploy_key")
       ruby_block "write_key" do
         block do
-          f = File.open("#{app['deploy_to']}/id_deploy", "w")
+          f = ::File.open("#{app['deploy_to']}/id_deploy", "w")
           f.print(app["deploy_key"])
           f.close
         end
-        not_if do File.exists?("#{app['deploy_to']}/id_deploy"); end
+        not_if do ::File.exists?("#{app['deploy_to']}/id_deploy"); end
       end
 
       file "#{app['deploy_to']}/id_deploy" do

+ 2 - 2
recipes/tomcat.rb

@@ -33,7 +33,7 @@ link "#{node['tomcat']['context_dir']}/ROOT.xml" do
   notifies :restart, resources(:service => "tomcat")
 end
 
-if File.symlink?(File.join(node['tomcat']['context_dir'], "ROOT.xml"))
+if ::File.symlink?(::File.join(node['tomcat']['context_dir'], "ROOT.xml"))
   d = resources(:remote_file => app['id'])
   d.notifies :restart, resources(:service => "tomcat")
-end
+end

+ 2 - 2
recipes/unicorn.rb

@@ -31,7 +31,7 @@ node.set[:unicorn][:options] = { :tcp_nodelay => true, :backlog => 100 }
 
 unicorn_config "/etc/unicorn/#{app['id']}.rb" do
   listen({ node[:unicorn][:port] => node[:unicorn][:options] })
-  working_directory File.join(app['deploy_to'], 'current')
+  working_directory ::File.join(app['deploy_to'], 'current')
   worker_timeout node[:unicorn][:worker_timeout] 
   preload_app node[:unicorn][:preload_app] 
   worker_processes node[:unicorn][:worker_processes]
@@ -45,7 +45,7 @@ runit_service app['id'] do
   run_restart false
 end
 
-if File.exists?(File.join(app['deploy_to'], "current"))
+if ::File.exists?(::File.join(app['deploy_to'], "current"))
   d = resources(:deploy => app['id'])
   d.restart_command do
     execute "/etc/init.d/#{app['id']} hup"