Replace all occurrences of "burn" with "flash" (#300)

Technically, a removable drive is flashed, not burned.

Fixes: https://github.com/resin-io/etcher/issues/297
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-04-12 12:00:43 -04:00
parent 8417f94649
commit 3efea5b308
11 changed files with 76 additions and 76 deletions

View File

@ -1,7 +1,7 @@
Etcher Etcher
====== ======
> A better way to burn OS images to SD cards > A better way to flash OS images to SD cards
[![dependencies](https://david-dm.org/resin-io/etcher.svg)](https://david-dm.org/resin-io/etcher.svg) [![dependencies](https://david-dm.org/resin-io/etcher.svg)](https://david-dm.org/resin-io/etcher.svg)
[![Build Status](https://travis-ci.org/resin-io/etcher.svg?branch=master)](https://travis-ci.org/resin-io/etcher) [![Build Status](https://travis-ci.org/resin-io/etcher.svg?branch=master)](https://travis-ci.org/resin-io/etcher)

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -107,9 +107,9 @@ app.controller('AppController', function(
this.success = true; this.success = true;
// This catches the case where the user enters // This catches the case where the user enters
// the settings screen when a burn finished // the settings screen when a flash finished
// and goes back to the main screen with the back button. // and goes back to the main screen with the back button.
if (!this.writer.isBurning()) { if (!this.writer.isFlashing()) {
this.selection.clear({ this.selection.clear({
@ -198,7 +198,7 @@ app.controller('AppController', function(
}; };
this.reselectImage = function() { this.reselectImage = function() {
if (self.writer.isBurning()) { if (self.writer.isFlashing()) {
return; return;
} }
@ -212,7 +212,7 @@ app.controller('AppController', function(
}; };
this.reselectDrive = function() { this.reselectDrive = function() {
if (self.writer.isBurning()) { if (self.writer.isFlashing()) {
return; return;
} }
@ -230,30 +230,30 @@ app.controller('AppController', function(
AnalyticsService.logEvent('Restart after failure'); AnalyticsService.logEvent('Restart after failure');
}; };
this.burn = function(image, drive) { this.flash = function(image, drive) {
// Stop scanning drives when burning // Stop scanning drives when flashing
// otherwise Windows throws EPERM // otherwise Windows throws EPERM
self.scanner.stop(); self.scanner.stop();
AnalyticsService.logEvent('Burn', { AnalyticsService.logEvent('Flash', {
image: image, image: image,
device: drive.device device: drive.device
}); });
return self.writer.burn(image, drive).then(function(success) { return self.writer.flash(image, drive).then(function(success) {
// TODO: Find a better way to manage burn/check // TODO: Find a better way to manage flash/check
// success/error state than a global boolean flag. // success/error state than a global boolean flag.
self.success = success; self.success = success;
if (self.success) { if (self.success) {
NotificationService.send('Success!', 'You burn is complete'); NotificationService.send('Success!', 'Your flash is complete');
AnalyticsService.logEvent('Done'); AnalyticsService.logEvent('Done');
$state.go('success'); $state.go('success');
} else { } else {
NotificationService.send('Oops!', 'Looks like your burn has failed'); NotificationService.send('Oops!', 'Looks like your flash has failed');
AnalyticsService.logEvent('Burn error'); AnalyticsService.logEvent('Flash error');
} }
}) })
.catch(dialog.showError) .catch(dialog.showError)

View File

@ -38,10 +38,10 @@ const imageWriter = angular.module('Etcher.image-writer', [
imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel, NotifierService) { imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel, NotifierService) {
let self = this; let self = this;
let burning = false; let flashing = false;
/** /**
* @summary Reset burn state * @summary Reset flash state
* @function * @function
* @public * @public
* *
@ -56,7 +56,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
}; };
/** /**
* @summary Burn progress state * @summary Flash progress state
* @type Object * @type Object
* @public * @public
*/ */
@ -64,36 +64,36 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
this.resetState(); this.resetState();
/** /**
* @summary Check if currently burning * @summary Check if currently flashing
* @function * @function
* @private * @private
* *
* @returns {Boolean} whether is burning or not * @returns {Boolean} whether is flashing or not
* *
* @example * @example
* if (ImageWriterService.isBurning()) { * if (ImageWriterService.isFlashing()) {
* console.log('We\'re currently burning'); * console.log('We\'re currently flashing');
* } * }
*/ */
this.isBurning = function() { this.isFlashing = function() {
return burning; return flashing;
}; };
/** /**
* @summary Set the burning status * @summary Set the flashing status
* @function * @function
* @private * @private
* *
* @description * @description
* This function is extracted for testing purposes. * This function is extracted for testing purposes.
* *
* @param {Boolean} status - burning status * @param {Boolean} status - flashing status
* *
* @example * @example
* ImageWriterService.setBurning(true); * ImageWriterService.setFlashing(true);
*/ */
this.setBurning = function(status) { this.setFlashing = function(status) {
burning = Boolean(status); flashing = Boolean(status);
}; };
/** /**
@ -122,7 +122,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
}; };
/** /**
* @summary Burn an image to a drive * @summary Flash an image to a drive
* @function * @function
* @public * @public
* *
@ -135,18 +135,18 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
* @returns {Promise} * @returns {Promise}
* *
* @example * @example
* ImageWriterService.burn('foo.img', { * ImageWriterService.flash('foo.img', {
* device: '/dev/disk2' * device: '/dev/disk2'
* }).then(function() { * }).then(function() {
* console.log('Write completed!'); * console.log('Write completed!');
* }); * });
*/ */
this.burn = function(image, drive) { this.flash = function(image, drive) {
if (self.isBurning()) { if (self.isFlashing()) {
return $q.reject(new Error('There is already a burn in progress')); return $q.reject(new Error('There is already a flash in progress'));
} }
self.setBurning(true); self.setFlashing(true);
return self.performWrite(image, drive, function(state) { return self.performWrite(image, drive, function(state) {
@ -165,7 +165,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
}); });
}).finally(function() { }).finally(function() {
self.setBurning(false); self.setFlashing(false);
}); });
}; };

View File

@ -26,7 +26,7 @@ module.exports = function($state, SelectionStateModel, ImageWriterService, Analy
this.settings = SettingsModel.data; this.settings = SettingsModel.data;
/** /**
* @summary Restart the burning process * @summary Restart the flashing process
* @function * @function
* @public * @public
* *

View File

@ -20,7 +20,7 @@
* @module Etcher.Pages.Finish * @module Etcher.Pages.Finish
* *
* The finish page represents the application state where * The finish page represents the application state where
* the the burn/validation has completed. * the the flash/validation has completed.
* *
* Its purpose is to display success or failure information, * Its purpose is to display success or failure information,
* as well as the "next steps". * as well as the "next steps".

View File

@ -1,13 +1,13 @@
<div class="row around-xs"> <div class="row around-xs">
<div class="col-xs"> <div class="col-xs">
<div class="box text-center"> <div class="box text-center">
<h3><span class="tick tick--success" class="space-right-tiny"></span> Burn Complete!</h3> <h3><span class="tick tick--success" class="space-right-tiny"></span> Flash Complete!</h3>
<p class="soft space-vertical-medium" ng-show="finish.settings.unmountOnSuccess">Safely ejected and ready for use</p> <p class="soft space-vertical-medium" ng-show="finish.settings.unmountOnSuccess">Safely ejected and ready for use</p>
<div class="row center-xs space-vertical-large"> <div class="row center-xs space-vertical-large">
<div class="col-xs-4 space-medium"> <div class="col-xs-4 space-medium">
<div class="box"> <div class="box">
<p class="soft button-label">Would you like to burn the same image?</p> <p class="soft button-label">Would you like to flash the same image?</p>
<button class="btn btn-primary btn-brick" ng-click="finish.restart({ preserveImage: true })"> <button class="btn btn-primary btn-brick" ng-click="finish.restart({ preserveImage: true })">
Use <b>same</b> image Use <b>same</b> image
@ -19,7 +19,7 @@
<div class="col-xs-4 space-medium"> <div class="col-xs-4 space-medium">
<div class="box"> <div class="box">
<p class="soft button-label">Would you like to burn a new image?</p> <p class="soft button-label">Would you like to flash a new image?</p>
<button class="btn btn-primary btn-brick" ng-click="finish.restart()"> <button class="btn btn-primary btn-brick" ng-click="finish.restart()">
Use <b>new</b> image Use <b>new</b> image

View File

@ -46,20 +46,20 @@
<div class="col-xs"> <div class="col-xs">
<div class="box text-center"> <div class="box text-center">
<hero-icon path="../assets/images/burn.svg" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()" label="BURN IMAGE"></hero-icon> <hero-icon path="../assets/images/flash.svg" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()" label="FLASH IMAGE"></hero-icon>
<span class="badge space-top-medium" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()">3</span> <span class="badge space-top-medium" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()">3</span>
<div class="space-vertical-large"> <div class="space-vertical-large">
<progress-button class="btn-brick" <progress-button class="btn-brick"
percentage="app.writer.state.progress" percentage="app.writer.state.progress"
striped="{{ app.writer.state.type == 'check' }}" striped="{{ app.writer.state.type == 'check' }}"
ng-attr-active="{{ app.writer.isBurning() }}" ng-attr-active="{{ app.writer.isFlashing() }}"
ng-show="app.success" ng-show="app.success"
ng-click="app.burn(app.selection.getImage(), app.selection.getDrive())" ng-click="app.flash(app.selection.getImage(), app.selection.getDrive())"
ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()"> ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()">
<span ng-show="app.writer.state.progress == 100 && app.writer.isBurning()">Finishing...</span> <span ng-show="app.writer.state.progress == 100 && app.writer.isFlashing()">Finishing...</span>
<span ng-show="app.writer.state.progress == 0 && !app.writer.isBurning()">Burn!</span> <span ng-show="app.writer.state.progress == 0 && !app.writer.isFlashing()">Flash!</span>
<span ng-show="app.writer.state.progress == 0 && app.writer.isBurning() && !app.writer.state.speed">Starting...</span> <span ng-show="app.writer.state.progress == 0 && app.writer.isFlashing() && !app.writer.state.speed">Starting...</span>
<span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type != 'check'" <span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type != 'check'"
ng-bind="app.writer.state.progress + '% '"></span> ng-bind="app.writer.state.progress + '% '"></span>
<span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type == 'check'" <span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type == 'check'"

View File

@ -3,7 +3,7 @@
"displayName": "Etcher", "displayName": "Etcher",
"version": "1.0.0-beta.2", "version": "1.0.0-beta.2",
"main": "lib/etcher.js", "main": "lib/etcher.js",
"description": "An image burner with support for Windows, OS X and GNU/Linux.", "description": "An image flasher with support for Windows, OS X and GNU/Linux.",
"homepage": "https://github.com/resin-io/etcher", "homepage": "https://github.com/resin-io/etcher",
"repository": { "repository": {
"type": "git", "type": "git",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 120 KiB

View File

@ -52,42 +52,42 @@ describe('Browser: ImageWriter', function() {
}); });
describe('.isBurning()', function() { describe('.isFlashing()', function() {
it('should return false by default', function() { it('should return false by default', function() {
m.chai.expect(ImageWriterService.isBurning()).to.be.false; m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
}); });
it('should return true if burning', function() { it('should return true if flashing', function() {
ImageWriterService.setBurning(true); ImageWriterService.setFlashing(true);
m.chai.expect(ImageWriterService.isBurning()).to.be.true; m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
}); });
}); });
describe('.setBurning()', function() { describe('.setFlashing()', function() {
it('should be able to set burning to true', function() { it('should be able to set flashing to true', function() {
ImageWriterService.setBurning(true); ImageWriterService.setFlashing(true);
m.chai.expect(ImageWriterService.isBurning()).to.be.true; m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
}); });
it('should be able to set burning to false', function() { it('should be able to set flashing to false', function() {
ImageWriterService.setBurning(false); ImageWriterService.setFlashing(false);
m.chai.expect(ImageWriterService.isBurning()).to.be.false; m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
}); });
it('should cast to boolean by default', function() { it('should cast to boolean by default', function() {
ImageWriterService.setBurning('hello'); ImageWriterService.setFlashing('hello');
m.chai.expect(ImageWriterService.isBurning()).to.be.true; m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
ImageWriterService.setBurning(''); ImageWriterService.setFlashing('');
m.chai.expect(ImageWriterService.isBurning()).to.be.false; m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
}); });
}); });
describe('.burn()', function() { describe('.flash()', function() {
describe('given a succesful write', function() { describe('given a succesful write', function() {
@ -100,31 +100,31 @@ describe('Browser: ImageWriter', function() {
this.performWriteStub.restore(); this.performWriteStub.restore();
}); });
it('should set burning to false when done', function() { it('should set flashing to false when done', function() {
ImageWriterService.burn('foo.img', '/dev/disk2'); ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply(); $rootScope.$apply();
m.chai.expect(ImageWriterService.isBurning()).to.be.false; m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
}); });
it('should prevent writing more than once', function() { it('should prevent writing more than once', function() {
ImageWriterService.burn('foo.img', '/dev/disk2'); ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.burn('foo.img', '/dev/disk2'); ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply(); $rootScope.$apply();
m.chai.expect(this.performWriteStub).to.have.been.calledOnce; m.chai.expect(this.performWriteStub).to.have.been.calledOnce;
}); });
it('should reject the second burn attempt', function() { it('should reject the second flash attempt', function() {
ImageWriterService.burn('foo.img', '/dev/disk2'); ImageWriterService.flash('foo.img', '/dev/disk2');
let rejectError = null; let rejectError = null;
ImageWriterService.burn('foo.img', '/dev/disk2').catch(function(error) { ImageWriterService.flash('foo.img', '/dev/disk2').catch(function(error) {
rejectError = error; rejectError = error;
}); });
$rootScope.$apply(); $rootScope.$apply();
m.chai.expect(rejectError).to.be.an.instanceof(Error); m.chai.expect(rejectError).to.be.an.instanceof(Error);
m.chai.expect(rejectError.message).to.equal('There is already a burn in progress'); m.chai.expect(rejectError.message).to.equal('There is already a flash in progress');
}); });
}); });
@ -140,15 +140,15 @@ describe('Browser: ImageWriter', function() {
this.performWriteStub.restore(); this.performWriteStub.restore();
}); });
it('should set burning to false when done', function() { it('should set flashing to false when done', function() {
ImageWriterService.burn('foo.img', '/dev/disk2'); ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply(); $rootScope.$apply();
m.chai.expect(ImageWriterService.isBurning()).to.be.false; m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
}); });
it('should be rejected with the error', function() { it('should be rejected with the error', function() {
let rejection; let rejection;
ImageWriterService.burn('foo.img', '/dev/disk2').catch(function(error) { ImageWriterService.flash('foo.img', '/dev/disk2').catch(function(error) {
rejection = error; rejection = error;
}); });