guard-mthaml 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/mthaml/compiler/MtHaml.php +14 -13
- data/lib/guard/mthaml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf60a53b3e1903615ea808484bf4214fb84d7093
|
4
|
+
data.tar.gz: 53295e37956b12972113146042cc21769626f75b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec8b9f29917fae1764bd4ee78ea699123106df7b6a323b5399255b0f0fd40dc32a5e99fc5f59a456362a99d3c29e63e30f57e8b19454c9875cae4ff482cbf2d8
|
7
|
+
data.tar.gz: 3cc38f1b4d69941b53f75c83d5b333672115ebcdee6e571502b3311b2f53a6862c98ee835beda9d6a5c580b7c5354f24411194fc094fc78f214fabbf60547cbb
|
@@ -136,6 +136,18 @@ class MtHamlCompiler {
|
|
136
136
|
self::set_environment();
|
137
137
|
}
|
138
138
|
|
139
|
+
/**
|
140
|
+
* Colorize output messages to terminal
|
141
|
+
*
|
142
|
+
* @param {String} $message
|
143
|
+
* @param {String} $color
|
144
|
+
*
|
145
|
+
* @since 0.2.0
|
146
|
+
*/
|
147
|
+
public static function colorize($message, $color) {
|
148
|
+
return "\e[0$color" . "m" . "$message\e[0m";
|
149
|
+
}
|
150
|
+
|
139
151
|
/**
|
140
152
|
* Runs compiler and writes contents to output file
|
141
153
|
*
|
@@ -237,18 +249,6 @@ class MtHamlCompiler {
|
|
237
249
|
throw new \Exception( self::colorize( "It looks like `" . basename( $this->input_file ) . "` compiled without any output.", ";33" ) );
|
238
250
|
}
|
239
251
|
}
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Colorize output messages to terminal
|
243
|
-
*
|
244
|
-
* @param {String} $message
|
245
|
-
* @param {String} $color
|
246
|
-
*
|
247
|
-
* @since 0.2.0
|
248
|
-
*/
|
249
|
-
private function colorize($message, $color) {
|
250
|
-
return "\e[0$color" . "m" . "$message\e[0m";
|
251
|
-
}
|
252
252
|
}
|
253
253
|
|
254
254
|
/**
|
@@ -271,5 +271,6 @@ try {
|
|
271
271
|
));
|
272
272
|
$compiler->run();
|
273
273
|
} catch ( \Exception $err ) {
|
274
|
-
|
274
|
+
fwrite( STDERR, "Guard::MtHaml: " . MtHamlCompiler::colorize( $err->getMessage() . "\n", ";31" ) );
|
275
|
+
exit(1);
|
275
276
|
}
|
data/lib/guard/mthaml/version.rb
CHANGED