File tree Expand file tree Collapse file tree 5 files changed +33
-19
lines changed Expand file tree Collapse file tree 5 files changed +33
-19
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ function initLogLevel() {
5454}
5555
5656function initDir ( ) {
57+ file . init ( ) ;
5758 file . mkdir ( file . homeDir ( ) )
5859}
5960
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ var mkdirp = require('mkdirp');
77
88const file = { }
99
10+ file . init = function ( ) {
11+ _ . templateSettings = {
12+ evaluate : / \{ \{ ( .+ ?) \} \} / g,
13+ interpolate : / \$ \{ ( .+ ?) \} / g
14+ } ;
15+ } ;
16+
1017file . isWindows = function ( ) {
1118 return process . platform === 'win32' ;
1219} ;
Original file line number Diff line number Diff line change 1- <%= code %>
1+ $ { code}
Original file line number Diff line number Diff line change 1- <%= comment.start %>
2- <%= comment.line %> @lc app=<%= app %> id=<%= fid %> lang=<%= lang %>
3- <%= comment.line %>
4- <%= comment.line %> [<%= fid %>] <%= name %>
5- <%= comment.line %>
6- <%= comment.line %> <%= link %>
7- <%= comment.line %>
8- <%= comment.line %> <%= category %>
9- <%= comment.line %> <%= level %> (<%= percent %> %)
10- <%= comment.line %> Total Accepted: <%= totalAC %>
11- <%= comment.line %> Total Submissions: <%= totalSubmit %>
12- <%= comment.line %> Testcase Example: <%= testcase %>
13- <%= comment.line %>
14- <% desc.forEach(function(x) { %><% = comment.line %> <% = x %>
15- <% } ) %><%= comment.end %>
16- <%= code %>
1+ $ { comment.start}
2+ $ { comment.line} @lc app=$ { app} id=$ { fid} lang=$ { lang}
3+ $ { comment.line}
4+ $ { comment.line} [$ { fid} ] $ { name}
5+ $ { comment.line}
6+ $ { comment.line} $ { link}
7+ $ { comment.line}
8+ $ { comment.line} $ { category}
9+ $ { comment.line} $ { level} ($ { percent} %)
10+ $ { comment.line} Total Accepted: $ { totalAC}
11+ $ { comment.line} Total Submissions: $ { totalSubmit}
12+ $ { comment.line} Testcase Example: $ { testcase}
13+ $ { comment.line}
14+ { { desc.forEach(function(x) { } }$ { comment.line} $ { x }
15+ { { } ) }}$ { comment.end}
16+ $ { code}
Original file line number Diff line number Diff line change @@ -142,6 +142,14 @@ describe('core', function() {
142142 } ) ; // #starProblem
143143
144144 describe ( '#exportProblem' , function ( ) {
145+ let file ;
146+
147+ beforeEach ( function ( ) {
148+ file = rewire ( '../lib/file' ) ;
149+ file . init ( ) ;
150+ core . __set__ ( 'file' , file ) ;
151+ } ) ;
152+
145153 it ( 'should codeonly ok' , function ( ) {
146154 const expected = [
147155 '/**' ,
@@ -171,9 +179,7 @@ describe('core', function() {
171179 } ) ;
172180
173181 it ( 'should codeonly ok in windows' , function ( ) {
174- const file = rewire ( '../lib/file' ) ;
175182 file . isWindows = ( ) => true ;
176- core . __set__ ( 'file' , file ) ;
177183
178184 const expected = [
179185 '/**' ,
You can’t perform that action at this time.
0 commit comments