-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rakefile): copyed a new rakefile from the template file
- Loading branch information
Showing
9 changed files
with
84 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {resolve} from 'path'; | ||
import {assert} from 'chai'; | ||
import sinon from 'sinon'; | ||
import any from '@travi/any'; | ||
import * as fsAsync from '../thirdparty-wrappers/fs'; | ||
import scaffoldRake from './rake'; | ||
|
||
suite('Rake', () => { | ||
let sandbox; | ||
|
||
setup(() => { | ||
sandbox = sinon.createSandbox(); | ||
|
||
sandbox.stub(fsAsync, 'copyFile'); | ||
}); | ||
|
||
teardown(() => sandbox.restore()); | ||
|
||
test('that the Rakefile is generated', async () => { | ||
const projectRoot = any.string(); | ||
|
||
const results = await scaffoldRake(projectRoot); | ||
|
||
assert.deepEqual(results.gems, ['rake']); | ||
assert.calledWith( | ||
fsAsync.copyFile, | ||
resolve(__dirname, '..', 'templates', 'Rakefile.rb'), | ||
`${projectRoot}/Rakefile` | ||
); | ||
}); | ||
}); |
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,8 @@ | ||
import {resolve} from 'path'; | ||
import {copyFile} from '../thirdparty-wrappers/fs'; | ||
|
||
export default async function (projectRoot) { | ||
await copyFile(resolve(__dirname, '..', 'templates', 'Rakefile.rb'), `${projectRoot}/Rakefile`); | ||
|
||
return {gems: ['rake']}; | ||
} |
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,11 @@ | ||
task :default => [:verify] | ||
|
||
desc 'verify' | ||
task :verify do | ||
Rake::Task['lint'].invoke | ||
end | ||
|
||
desc 'lint' | ||
task :lint do | ||
sh 'mdl --style ./markdownlint-style.rb *.md' | ||
end |
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,4 @@ | ||
import {promisify} from 'util'; | ||
import {copyFile as copyFileCallback} from 'fs'; | ||
|
||
export const copyFile = promisify(copyFileCallback); |