diff --git a/Vagrantfile b/Vagrantfile index 7b43aede..d560fc43 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,12 +26,12 @@ begin org_config_file = File.read(parsing_file) org_config_hash = JSON.parse(org_config_file) - overide_config_file_path = parsing_file.gsub(/default\.json$/, "overide.json") - if File.exist?(overide_config_file_path) - override_config_file = File.read(overide_config_file_path) - parsing_file = overide_config_file_path - overide_config_hash = JSON.parse(override_config_file) - org_config_hash = overrides(org_config_hash, overide_config_hash) + override_config_file_path = parsing_file.gsub(/default\.json$/, "override.json") + if File.exist?(override_config_file_path) + override_config_file = File.read(override_config_file_path) + parsing_file = override_config_file_path + override_config_hash = JSON.parse(override_config_file) + org_config_hash = overrides(org_config_hash, override_config_hash) end if !org_config_hash.nil? @@ -41,7 +41,7 @@ begin if data_hash['vagrant'] && data_hash['vagrant']['config_paths'] data_hash['vagrant']['config_paths'].map do |default_config_file_path| - overide_config_file_path = default_config_file_path.gsub(/default\.json$/, "overide.json") + override_config_file_path = default_config_file_path.gsub(/default\.json$/, "override.json") if File.exist?(File.dirname(__FILE__) + '/' + default_config_file_path) default_config_file = File.read(File.dirname(__FILE__) + '/' + default_config_file_path) @@ -51,11 +51,11 @@ begin puts "[teracy-dev][INFO]: #{default_config_file_path} not found, make sure this is intended." end - if File.exist?(File.dirname(__FILE__) + '/' + overide_config_file_path) - override_config_file = File.read(File.dirname(__FILE__) + '/' + overide_config_file_path) - parsing_file = overide_config_file_path - overide_config_hash = JSON.parse(override_config_file) - project_config_hash = overrides(project_config_hash, overide_config_hash) + if File.exist?(File.dirname(__FILE__) + '/' + override_config_file_path) + override_config_file = File.read(File.dirname(__FILE__) + '/' + override_config_file_path) + parsing_file = override_config_file_path + override_config_hash = JSON.parse(override_config_file) + project_config_hash = overrides(project_config_hash, override_config_hash) end if !project_config_hash.nil? overrides(data_hash, project_config_hash) diff --git a/spec/fixture/config_overide.json b/spec/fixture/config_override.json similarity index 100% rename from spec/fixture/config_overide.json rename to spec/fixture/config_override.json diff --git a/spec/utility_spec.rb b/spec/utility_spec.rb index 8b983f88..340f9e16 100644 --- a/spec/utility_spec.rb +++ b/spec/utility_spec.rb @@ -384,13 +384,13 @@ context "Giving many config file follow project base config requirement" do it "after override the config must satisfy the requirement" do teracy_default_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config.json')) - teracy_override_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config_overide.json')) + teracy_override_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config_override.json')) project_org_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/org_project.json')) project1_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/project1.json')) project2_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/project2.json')) origin_teracy_default_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config.json')) - origin_teracy_override_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config_overide.json')) + origin_teracy_override_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/config_override.json')) origin_project_org_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/org_project.json')) origin_project1_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/project1.json')) origin_project2_config = JSON.parse(File.read(File.dirname(__FILE__) + '/fixture/project2.json'))