Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb57c0ab

Browse files
committed
rename back to concat-tests
1 parent1355b82 commitb57c0ab

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

‎lib/reducers/run-tests/parse-loaders.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
varpath=require('path');
33
varfs=require('fs');
44
varsupportedFileTypes=['js','jsx','ts','py'];
5-
varjs=/^\/\/\s?load\(['"`](.+)['"`]\)$/;
5+
varjs=/^\/\/\s?load\(['"`](.+)['"`]\)$/m;
66
varloaderMatch={
77
js:js,
88
ts:js,
99
jsx:js,
10-
py:/\#\s?load\(['"`](.+)['"`]\)$/
10+
py:/^#\s?load\(['"`](.+)['"`]\)$/m
1111
};
1212
functionparseLoaders(data,fileType){
1313
if(supportedFileTypes.indexOf(fileType)<0){
1414
console.log("File type \""+fileType+"\" not supported.");
1515
return'';
1616
}
1717
varimports='';
18-
vari=0;
18+
vari=-1;
1919
varlines=data.split('\n');
2020
while(i<lines.length-1){
2121
i+=1;

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"atom-coderoad",
33
"main":"./lib/atom/main",
4-
"version":"0.5.7",
4+
"version":"0.6.0",
55
"description":"Interactive tutorial plugin for Atom",
66
"author":"Shawn McKay <shawn.j.mckay@gmail.com>",
77
"keywords": [

‎src/reducers/run-tests/parse-loaders.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as path from 'path';
22
import*asfsfrom'fs';
33

44
constsupportedFileTypes=['js','jsx','ts','py'];
5-
constjs=/^\/\/\s?load\(['"`](.+)['"`]\)$/;
5+
constjs=/^\/\/\s?load\(['"`](.+)['"`]\)$/m;
66
constloaderMatch={
77
js,// // load('file'),
88
ts:js,
99
jsx:js,
10-
py:/\#\s?load\(['"`](.+)['"`]\)$/// # load('file')
10+
py:/^#\s?load\(['"`](.+)['"`]\)$/m// # load('file')
1111
};
1212

1313
exportdefaultfunctionparseLoaders(data:string,fileType:string){
@@ -19,7 +19,7 @@ export default function parseLoaders(data: string, fileType: string) {
1919

2020
letimports='';
2121
// loop over lines and add editor files
22-
leti=0;
22+
leti=-1;
2323
letlines=data.split('\n');
2424

2525
while(i<lines.length-1){

‎src/reducers/task-tests/loader.tsrenamed to‎src/reducers/task-tests/concat-tests.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function readAppend(targetFile: string, file: string): boolean {
2020
}
2121
}
2222

23-
functionconcatTests(targetFile:string,files:any):string{
23+
exportdefaultfunctionconcatTests(targetFile:string,files:any):string{
2424
// delete previous file
2525
unlink(targetFile).then(()=>{
2626
// load tests in order
@@ -33,7 +33,3 @@ function concatTests(targetFile: string, files: any): string {
3333
});
3434
return;
3535
}
36-
37-
exportdefaultfunctionload(targetFile:string,files:any){
38-
concatTests(targetFile,files);
39-
}

‎src/reducers/task-tests/task-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
'use strict';
21
import*aspathfrom'path';
2+
import*asfsfrom'fs';
33
import*asTypefrom'../../actions/actionTypes';
4-
importloadfrom'./loader';
4+
importconcatTestsfrom'./concat-tests';
55

66
exportdefaultfunctiontaskTestsReducer(taskTests='',action:CR.Action):string{
77
switch(action.type){
88
caseType.SET_PAGE:
99
lettarget=path.join(window.coderoad.tutorialDir||window.coderoad.dir,`_tmpTests${window.coderoad.suffix}`);
10-
load(target,action.payload.taskTests);
10+
concatTests(target,action.payload.taskTests);
1111
returntarget;
1212
default:
1313
returntaskTests;

‎tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"src/reducers/run-tests/run.ts",
8585
"src/reducers/run-tests/test-result.ts",
8686
"src/reducers/task-position/task-position.ts",
87-
"src/reducers/task-tests/loader.ts",
87+
"src/reducers/task-tests/concat-tests.ts",
8888
"src/reducers/task-tests/task-tests.ts",
8989
"src/reducers/tasks/tasks.ts",
9090
"src/reducers/tutorials/tutorials.ts",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp