-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for rsync-ing a codebase from within the testing suite #332
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b10fcd6
Stubbing out rsyncing
srtfisher 685ae2c
WIP
srtfisher db68be5
Merge remote-tracking branch 'origin/main' into rsync-theme
srtfisher 907d430
Adding support for rsyncing a plugin/theme
srtfisher 5594223
Require in testing package
srtfisher f7f5824
Dropping 7.4 support
srtfisher d2121b9
Remove ds store
srtfisher 791d4d9
Merge remote-tracking branch 'origin/main' into rsync-theme
srtfisher 9405162
Merge branch 'rsync-theme' of github.com:alleyinteractive/mantle-fram…
srtfisher 2fc890e
Info message formatting fix
srtfisher 42a7fc0
Wrap up rsyncing and proxy to new command
srtfisher b1cd522
Fixing use
srtfisher 0705e8b
Remove older code that was previously required
srtfisher bd1b2e7
Adding some debug messaging
srtfisher f6f57b3
Clarify default and doc
srtfisher d017e6c
Testing Github actions
srtfisher cbf5466
Include a colon with the prefix for asci
srtfisher 977af0a
Code review feedback
srtfisher 7af4adb
Merging in main
srtfisher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,96 @@ | ||
<?php | ||
/** | ||
* Output_Messages trait file | ||
* | ||
* @package Mantle | ||
*/ | ||
|
||
namespace Mantle\Testing\Concerns; | ||
|
||
use function Termwind\render; | ||
|
||
/** | ||
* Messages for testing managed with Termwind. | ||
*/ | ||
trait Output_Messages { | ||
/** | ||
* Render a message to the console. | ||
* | ||
* @param string $prefix Prefix for the message. | ||
* @param string $prefix_color Color for the prefix. | ||
* @param string $message Message to render. | ||
* @param string $message_color Color for the message. | ||
* @param string $parent_classes Parent classes for the message. | ||
* @return void | ||
*/ | ||
protected static function message( | ||
string $prefix, | ||
string $prefix_color, | ||
string $message, | ||
string $message_color = 'white', | ||
string $parent_classes = '', | ||
) { | ||
render( | ||
sprintf( | ||
'<div class="%s"> | ||
<div class="px-1 bg-%s text-%s">%s:</div> | ||
<span class="ml-1">%s</span> | ||
</div>', | ||
$parent_classes, | ||
$prefix_color, | ||
$message_color, | ||
$prefix, | ||
$message, | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* Output a info message to the console. | ||
* | ||
* @param string $message Message to output. | ||
* @param string $prefix Prefix to output. | ||
* @return void | ||
*/ | ||
public static function info( string $message, $prefix = 'Install' ): void { | ||
static::message( $prefix, 'yellow-600', $message ); | ||
} | ||
|
||
/** | ||
* Output a success message to the console. | ||
* | ||
* @param string $message Message to output. | ||
* @param string $prefix Prefix to output. | ||
* @return void | ||
*/ | ||
public static function success( string $message, $prefix = 'Install' ): void { | ||
static::message( $prefix, 'lime-600', $message ); | ||
} | ||
|
||
/** | ||
* Output a error message to the console. | ||
* | ||
* @param string $message Message to output. | ||
* @param string $prefix Prefix to output. | ||
* @return void | ||
*/ | ||
public static function error( string $message, $prefix = 'Install' ): void { | ||
static::message( $prefix, 'red-800', $message, 'red-100', 'pt-1' ); | ||
} | ||
|
||
/** | ||
* Display a formatted code block. | ||
* | ||
* @link https://github.com/nunomaduro/termwind#code | ||
* | ||
* @param string|string[] $code Code to display. | ||
* @return void | ||
*/ | ||
public static function code( $code ): void { | ||
if ( is_array( $code ) ) { | ||
$code = implode( PHP_EOL, $code ); | ||
} | ||
|
||
render( "<div class=\"my-1\"><code>{$code}</code></div>" ); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need additional defaults?