Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support spec name in config #11 * Remove debug code * Add custom stringify_keys * Fix a bunch of rubocop issues * Fix another bunch of issues * Fix a fatal bug and bump beta2 * Doc about specs [ci skip] * Add conf migration message * Bump 1.0.0 beta3
- Loading branch information
Showing
14 changed files
with
186 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ Style/StringLiterals: | |
Enabled: false | ||
Metrics/MethodLength: | ||
Max: 30 | ||
Style/Documentation: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Caravan | ||
class ConfigMigration | ||
class << self | ||
def need_migrate?(conf) | ||
return true if conf.nil? || conf.empty? | ||
|
||
if !conf.key?("src") || | ||
!conf.key?("dst") || | ||
!conf.key?("deploy_mode") | ||
Caravan::Message.debug("Conf may need migrate.") | ||
return true | ||
end | ||
|
||
false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Caravan | ||
VERSION = "0.7.0".freeze | ||
VERSION = "1.0.0.beta3".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "test_helper" | ||
|
||
class ConfMigTest < CaravanTest | ||
context "need migrate" do | ||
should "return true of nil or empty" do | ||
assert_equal(true, Caravan::ConfigMigration.need_migrate?(nil)) | ||
assert_equal(true, Caravan::ConfigMigration.need_migrate?({})) | ||
end | ||
|
||
should "return true" do | ||
conf = {} | ||
conf["debug"]= true, | ||
assert_equal(true, Caravan::ConfigMigration.need_migrate?(conf)) | ||
end | ||
|
||
should "return false" do | ||
conf = {} | ||
conf["debug"]= true, | ||
conf["src"] = "." | ||
conf["dst"] = "dummy" | ||
conf["deploy_mode"] = "rsync" | ||
assert_equal(false, Caravan::ConfigMigration.need_migrate?(conf)) | ||
end | ||
end | ||
end |
Oops, something went wrong.