eth-gas-reporter
Advanced tools
Comparing version 0.1.5 to 0.1.7
## Changelog: eth-gas-reporter | ||
0.1.5 / 2018-05-15 | ||
================== | ||
* Support multi-contract files by parsing files w/ solidity-parser-antlr | ||
0.1.4 / 2018-05-14 | ||
@@ -3,0 +7,0 @@ ================== |
@@ -26,2 +26,4 @@ /** | ||
let outputFile; | ||
let rst; | ||
let rstTitle; | ||
@@ -158,2 +160,4 @@ /** | ||
const leftPad = (rst) ? ' ' : ''; | ||
// Format table | ||
@@ -163,5 +167,6 @@ const table = new Table({ | ||
chars: { | ||
'mid': '·', 'top-mid': '|', 'left-mid': '·', 'mid-mid': '|', 'right-mid': '·', | ||
'top-left': '·', 'top-right': '·', 'bottom-left': '·', 'bottom-right': '·', | ||
'middle': '·', 'top': '-', 'bottom': '-', 'bottom-mid': '|' | ||
'mid': '·', 'top-mid': '|', 'left-mid': `${leftPad}·`, 'mid-mid': '|', 'right-mid': '·', | ||
'left': `${leftPad}|`, 'top-left': `${leftPad}·`, 'top-right': '·', | ||
'bottom-left': `${leftPad}·`, 'bottom-right': '·', 'middle': '·', 'top': '-', | ||
'bottom': '-', 'bottom-mid': '|' | ||
} | ||
@@ -223,12 +228,16 @@ }) | ||
let rstOutput = ''; | ||
if (rst) { | ||
rstOutput += `${rstTitle}\n`; | ||
rstOutput += `${'='.repeat(rstTitle.length)}\n\n`; | ||
rstOutput += `.. code-block:: shell\n\n`; | ||
} | ||
let tableOutput = rstOutput + table.toString(); | ||
// export to preferred output | ||
if (outputFile) { | ||
fs.writeFile(outputFile, table.toString(), (err) => { | ||
if (err) { | ||
console.log('Writing to %s failed', outputFile); | ||
console.log(table.toString()); | ||
} | ||
}); | ||
fs.writeFileSync(outputFile, tableOutput) | ||
} else { | ||
console.log(table.toString()) | ||
console.log(tableOutput) | ||
} | ||
@@ -268,2 +277,4 @@ } | ||
outputFile = config.outputFile || null | ||
rst = config.rst || false | ||
rstTitle = config.rstTitle || ''; | ||
colors.enabled = !config.noColors || false | ||
@@ -270,0 +281,0 @@ |
@@ -16,5 +16,7 @@ module.exports = { | ||
onlyCalledMethods: true, | ||
noColors: true | ||
noColors: true, | ||
rst: true, | ||
rstTitle: 'Gas Usage' | ||
} | ||
} | ||
} |
{ | ||
"name": "eth-gas-reporter", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Mocha reporter which shows gas used per unit test.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
{ | ||
"name": "eth-gas-reporter", | ||
"version": "0.1.5", | ||
"version": "0.1.7", | ||
"description": "Mocha reporter which shows gas used per unit test.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,4 @@ # eth-gas-reporter | ||
| onlyCalledMethods | *Boolean* | false | Omit methods that are never called from report. | | ||
| rst | *Boolean* | false | Output with a reStructured text code-block directive. Useful if you want to include report in RTD | | ||
| rstTitle | *String* | '' | Title for reStructured text header (See Travis for example output) | | ||
@@ -54,0 +56,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41455
763
77