| Filename | /home/ocbnet/domain/ocbnet.ch/vhost/webmerge/htdocs/webmerge/scripts/modules/RTP/Webmerge/Process/CSS/SCSS.pm |
| Statements | Executed 9 statements in 1.49ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 85µs | 181µs | RTP::Webmerge::Process::CSS::SCSS::BEGIN@8 |
| 1 | 1 | 1 | 65µs | 587µs | RTP::Webmerge::Process::CSS::SCSS::BEGIN@69 |
| 1 | 1 | 1 | 54µs | 84µs | RTP::Webmerge::Process::CSS::SCSS::BEGIN@9 |
| 1 | 1 | 1 | 23µs | 23µs | RTP::Webmerge::Process::CSS::SCSS::BEGIN@14 |
| 0 | 0 | 0 | 0s | 0s | RTP::Webmerge::Process::CSS::SCSS::scss |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | ################################################################################################### | ||||
| 2 | # Copyright 2013 by Marcel Greter | ||||
| 3 | # This file is part of Webmerge (GPL3) | ||||
| 4 | ################################################################################################### | ||||
| 5 | package RTP::Webmerge::Process::CSS::SCSS; | ||||
| 6 | ################################################################################################### | ||||
| 7 | |||||
| 8 | 2 | 155µs | 2 | 276µs | # spent 181µs (85+96) within RTP::Webmerge::Process::CSS::SCSS::BEGIN@8 which was called:
# once (85µs+96µs) by RTP::Webmerge::Process::CSS::BEGIN@20 at line 8 # spent 181µs making 1 call to RTP::Webmerge::Process::CSS::SCSS::BEGIN@8
# spent 96µs making 1 call to strict::import |
| 9 | 2 | 190µs | 2 | 114µs | # spent 84µs (54+30) within RTP::Webmerge::Process::CSS::SCSS::BEGIN@9 which was called:
# once (54µs+30µs) by RTP::Webmerge::Process::CSS::BEGIN@20 at line 9 # spent 84µs making 1 call to RTP::Webmerge::Process::CSS::SCSS::BEGIN@9
# spent 30µs making 1 call to warnings::import |
| 10 | |||||
| 11 | ################################################################################################### | ||||
| 12 | |||||
| 13 | # define our version string | ||||
| 14 | 1 | 894µs | 1 | 23µs | # spent 23µs within RTP::Webmerge::Process::CSS::SCSS::BEGIN@14 which was called:
# once (23µs+0s) by RTP::Webmerge::Process::CSS::BEGIN@20 at line 14 # spent 23µs making 1 call to RTP::Webmerge::Process::CSS::SCSS::BEGIN@14 |
| 15 | |||||
| 16 | ################################################################################################### | ||||
| 17 | |||||
| 18 | # process spritesets with additional modules | ||||
| 19 | # try to keep them as standalone as possible | ||||
| 20 | sub scss | ||||
| 21 | { | ||||
| 22 | |||||
| 23 | # load the cscc compiler | ||||
| 24 | require CSS::Sass; | ||||
| 25 | |||||
| 26 | # get input variables | ||||
| 27 | my ($data, $config, $output) = @_; | ||||
| 28 | |||||
| 29 | # init scss compiler object | ||||
| 30 | my $scss = CSS::Sass->new( | ||||
| 31 | |||||
| 32 | # TODO: add current path from config step | ||||
| 33 | # include_paths => ['some/include/path'], | ||||
| 34 | |||||
| 35 | # always output in nice formated way | ||||
| 36 | # will compress later by our own compilers | ||||
| 37 | output_style => CSS::Sass::SASS_STYLE_NESTED(), | ||||
| 38 | |||||
| 39 | # output debug comments | ||||
| 40 | source_comments => $config->{'debug'}, | ||||
| 41 | |||||
| 42 | # dont die on errors | ||||
| 43 | # handle them myself | ||||
| 44 | dont_die => 1 | ||||
| 45 | |||||
| 46 | ); | ||||
| 47 | # init scss object | ||||
| 48 | |||||
| 49 | # compile the passed scss data | ||||
| 50 | ${$data} = $scss->compile(${$data}); | ||||
| 51 | |||||
| 52 | # check if compile was ok | ||||
| 53 | unless (defined ${$data}) | ||||
| 54 | { | ||||
| 55 | # output an error message (it may not tell much) | ||||
| 56 | die "Fatal error when compiling scss:\n", | ||||
| 57 | " in ", $output->{'path'}, "\n", $scss->last_error; | ||||
| 58 | } | ||||
| 59 | |||||
| 60 | # return success | ||||
| 61 | return 1; | ||||
| 62 | |||||
| 63 | } | ||||
| 64 | # EO sub scss | ||||
| 65 | |||||
| 66 | ################################################################################################### | ||||
| 67 | |||||
| 68 | # import registered processors | ||||
| 69 | 2 | 229µs | 2 | 1.11ms | # spent 587µs (65+522) within RTP::Webmerge::Process::CSS::SCSS::BEGIN@69 which was called:
# once (65µs+522µs) by RTP::Webmerge::Process::CSS::BEGIN@20 at line 69 # spent 587µs making 1 call to RTP::Webmerge::Process::CSS::SCSS::BEGIN@69
# spent 522µs making 1 call to Exporter::import |
| 70 | |||||
| 71 | # register the processor function | ||||
| 72 | 1 | 7µs | $processors{'scss'} = \& scss; | ||
| 73 | |||||
| 74 | ################################################################################################### | ||||
| 75 | ################################################################################################### | ||||
| 76 | 1 | 14µs | 1; |