<NME> refinerycms-resources.rb
<BEF> require 'refinery/resources'
      private
        def defaults
          { 
            'max_client_body_size' => 50.megabytes
          }
        end
        
        def load_config
          config = {}
          begin
            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery_resource_config.yml'))[Rails.env]['refinery']['resources']
          rescue; end
          config
        end
        
        def configure!
          config = load_config
          config.merge!(defaults)
          ::Refinery::Resource.max_client_body_size = config['max_client_body_size']
        end
    end
  end

<MSG> move refinery_resource_config into config/refinery/resources.yml
remove additional namespacing on config values in resources.yml since we're now namespaced on directory and filename
update generator and engine to use the new location and namespacing of this config file
fix generator so migrations will copy once again

<DFF> @@ -44,22 +44,20 @@ module Refinery
       private
         def defaults
           { 
-            'max_client_body_size' => 50.megabytes
+            'max_client_body_size' => 52428800
           }
         end
         
-        def load_config
+        def resources_config
           config = {}
           begin
-            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery_resource_config.yml'))[Rails.env]['refinery']['resources']
+            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery', 'resources.yml'))[Rails.env]
           rescue; end
-          config
+          defaults.merge(config)
         end
         
         def configure!
-          config = load_config
-          config.merge!(defaults)
-          ::Refinery::Resource.max_client_body_size = config['max_client_body_size']
+          ::Refinery::Resource.max_client_body_size = resources_config['max_client_body_size']
         end
     end
   end

{'commit': 'diff --git a/resources/lib/generators/resources_generator.rb b/resources/lib/generators/resources_generator.rb\nindex 6b0b9f894..f964eba62 100644\n--- a/resources/lib/generators/resources_generator.rb\n+++ b/resources/lib/generators/resources_generator.rb\n@@ -3,11 +3,11 @@ require \'refinery/generators\'\n module ::Refinery\n   class ResourcesGenerator < ::Refinery::Generators::EngineInstaller\n \n-    source_root File.expand_path(\'../templates\', __FILE__)\n+    source_root File.expand_path(\'../../../\', __FILE__)\n     engine_name "resources"\n     \n     def generate_resource_config_files\n-      template "config/refinery_resource_config.yml", destination_path.join("config", "refinery_resource_config.yml")\n+      template "lib/generators/templates/config/refinery/resources.yml", destination_path.join("config", "refinery","resources.yml")\n     end\n \n   end\ndiff --git a/resources/lib/generators/templates/config/refinery/resources.yml b/resources/lib/generators/templates/config/refinery/resources.yml\nnew file mode 100644\nindex 000000000..c3bc9ee4d\n--- /dev/null\n+++ b/resources/lib/generators/templates/config/refinery/resources.yml\n@@ -0,0 +1,8 @@\n+development:\n+  max_client_body_size: 52428800\n+\n+test:\n+  max_client_body_size: 52428800\n+\n+production:\n+  max_client_body_size: 52428800\n\\ No newline at end of file\ndiff --git a/resources/lib/generators/templates/config/refinery_resource_config.yml b/resources/lib/generators/templates/config/refinery_resource_config.yml\ndeleted file mode 100644\nindex f014f2e20..000000000\n--- a/resources/lib/generators/templates/config/refinery_resource_config.yml\n+++ /dev/null\n@@ -1,14 +0,0 @@\n-development:\n-  refinery:\n-    resources:\n-      max_client_body_size: 52428800\n-\n-test:\n-  refinery:\n-    resources:\n-      max_client_body_size: 52428800\n-\n-production:\n-  refinery:\n-    resources:\n-      max_client_body_size: 52428800\n\\ No newline at end of file\ndiff --git a/resources/lib/refinerycms-resources.rb b/resources/lib/refinerycms-resources.rb\nindex 2acfe7e69..08dec152c 100644\n--- a/resources/lib/refinerycms-resources.rb\n+++ b/resources/lib/refinerycms-resources.rb\n@@ -44,22 +44,20 @@ module Refinery\n       private\n         def defaults\n           { \n-            \'max_client_body_size\' => 50.megabytes\n+            \'max_client_body_size\' => 52428800\n           }\n         end\n         \n-        def load_config\n+        def resources_config\n           config = {}\n           begin\n-            config = YAML.load_file(File.join(Rails.root, \'config\', \'refinery_resource_config.yml\'))[Rails.env][\'refinery\'][\'resources\']\n+            config = YAML.load_file(File.join(Rails.root, \'config\', \'refinery\', \'resources.yml\'))[Rails.env]\n           rescue; end\n-          config\n+          defaults.merge(config)\n         end\n         \n         def configure!\n-          config = load_config\n-          config.merge!(defaults)\n-          ::Refinery::Resource.max_client_body_size = config[\'max_client_body_size\']\n+          ::Refinery::Resource.max_client_body_size = resources_config[\'max_client_body_size\']\n         end\n     end\n   end\ndiff --git a/resources/spec/lib/generators/resources_generator_spec.rb b/resources/spec/lib/generators/resources_generator_spec.rb\nindex 030324186..b6fc06e5a 100644\n--- a/resources/spec/lib/generators/resources_generator_spec.rb\n+++ b/resources/spec/lib/generators/resources_generator_spec.rb\n@@ -13,9 +13,14 @@ module Refinery\n     \n     specify do\n       destination_root.should have_structure {\n+        directory "db" do\n+          directory "migrate"\n+        end\n         directory "config" do\n-          file "refinery_resource_config.yml" do\n-            contains "max_client_body_size:"\n+          directory "refinery" do\n+            file "resources.yml" do\n+              contains "max_client_body_size:"\n+            end\n           end\n         end\n       }\n', 'commit_subject': "move refinery_resource_config into config/refinery/resources.yml remove additional namespacing on config values in resources.yml since we're now namespaced on directory and filename update generator and engine to use the new location and namespacing of this config file fix generator so migrations will copy once again", 'repo_name': 'refinery/refinerycms', 'committer': {'name': 'Jamie Winsor', 'email': 'b4dde37aa2aac745c0e6c43447507eaeace3e59f@enmasse.com', 'time_sec': '1315262666', 'tz_offset': '-420', 'date': {'seconds': '1315262666'}}, 'commit_tree': '8f5f306c3848e333c88b35f3de403223346a78b0', 'commit_message': "move refinery_resource_config into config/refinery/resources.yml\nremove additional namespacing on config values in resources.yml since we're now namespaced on directory and filename\nupdate generator and engine to use the new location and namespacing of this config file\nfix generator so migrations will copy once again\n", 'language_name': 'Ruby', 'license': 'mit', 'hunks': "@@ -44,22 +44,20 @@ module Refinery\n       private\n         def defaults\n           { \n-            'max_client_body_size' => 50.megabytes\n+            'max_client_body_size' => 52428800\n           }\n         end\n         \n-        def load_config\n+        def resources_config\n           config = {}\n           begin\n-            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery_resource_config.yml'))[Rails.env]['refinery']['resources']\n+            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery', 'resources.yml'))[Rails.env]\n           rescue; end\n-          config\n+          defaults.merge(config)\n         end\n         \n         def configure!\n-          config = load_config\n-          config.merge!(defaults)\n-          ::Refinery::Resource.max_client_body_size = config['max_client_body_size']\n+          ::Refinery::Resource.max_client_body_size = resources_config['max_client_body_size']\n         end\n     end\n   end\n", 'addition_count': 5, 'deletion_count': 7, 'src_file': 'a/resources/lib/refinerycms-resources.rb', 'tgt_file': 'b/resources/lib/refinerycms-resources.rb', 'file_extension': '.rb', 'before_file': "require 'refinery/resources'\n      private\n        def defaults\n          { \n            'max_client_body_size' => 50.megabytes\n          }\n        end\n        \n        def load_config\n          config = {}\n          begin\n            config = YAML.load_file(File.join(Rails.root, 'config', 'refinery_resource_config.yml'))[Rails.env]['refinery']['resources']\n          rescue; end\n          config\n        end\n        \n        def configure!\n          config = load_config\n          config.merge!(defaults)\n          ::Refinery::Resource.max_client_body_size = config['max_client_body_size']\n        end\n    end\n  end\n", 'message': "move refinery_resource_config into config/refinery/resources.yml\nremove additional namespacing on config values in resources.yml since we're now namespaced on directory and filename\nupdate generator and engine to use the new location and namespacing of this config file\nfix generator so migrations will copy once again\n", 'author_name': 'Jamie Winsor', 'lang': 'rb'}