Commit 3ab4d3a8a5b1d2f2dd7f1835464a1a71635f72d1

Authored by Eric Fernandez
1 parent 8028dbc69a
Exists in master and in 1 other branch develop

tareas para concatenar archivos spec

... ... @@ -9,10 +9,13 @@ const jshint = require('gulp-jshint');
9 9 const replace = require('gulp-replace');
10 10 const connect = require('gulp-connect');
11 11 const clean = require('gulp-clean');
  12 +const header = require('gulp-header');
  13 +const footer = require('gulp-footer');
12 14  
13 15 var paths = {
14 16 srcJS: 'src/js/*.js',
15 17 srcViews: 'src/views/*.html',
  18 + specs: 'spec/*.js',
16 19 tmp: 'tmp',
17 20 dist: 'dist/'
18 21 };
... ... @@ -40,8 +43,8 @@ gulp.task('uglify', ['templates'], function() {
40 43 'tmp/views.js'
41 44 ]),
42 45 concat('foca-abm-vehiculo.js'),
43   - replace("['ngRoute', 'focaModal', 'ui.bootstrap', 'focaBotoneraLateral']", '[]'),
44 46 replace("src/views/", ''),
  47 + replace("'ngRoute'", ''),
45 48 gulp.dest(paths.tmp),
46 49 rename('foca-abm-vehiculo.min.js'),
47 50 uglify(),
... ... @@ -50,6 +53,16 @@ gulp.task('uglify', ['templates'], function() {
50 53 );
51 54 });
52 55  
  56 +gulp.task('uglify-spec', function() {
  57 + return pump([
  58 + gulp.src(paths.specs),
  59 + concat('foca-abm-vehiculo.spec.js'),
  60 + header("describe('Módulo foca-abm-vehiculo', function() { \n"),
  61 + footer("});"),
  62 + gulp.dest(paths.dist)
  63 + ]);
  64 +})
  65 +
53 66 gulp.task('clean', function() {
54 67 return gulp.src(['tmp', 'dist'], {read: false})
55 68 .pipe(clean());
... ... @@ -58,7 +71,7 @@ gulp.task('clean', function() {
58 71 gulp.task('pre-commit', function() {
59 72 return pump(
60 73 [
61   - gulp.src(paths.srcJS),
  74 + gulp.src([paths.srcJS, paths.specs]),
62 75 jshint('.jshintrc'),
63 76 jshint.reporter('default'),
64 77 jshint.reporter('fail')
1   -angular.module('focaAbmVehiculo', ['ngRoute', 'focaModal', 'ui.bootstrap', 'focaBotoneraLateral']);
  1 +angular.module('focaAbmVehiculo', ['ngRoute']);
src/js/controller.js
... ... @@ -145,9 +145,9 @@ angular.module('focaAbmVehiculo')
145 145 $scope.cisternas = res;
146 146 $scope.$apply();
147 147 });
148   - }
  148 + }
149 149 });
150   -
  150 +
151 151 $scope.next = function(key) {
152 152 if (key === 13) $scope.focused++;
153 153 };
... ... @@ -158,7 +158,7 @@ angular.module('focaAbmVehiculo')
158 158 if(key) {
159 159 $location.path('/vehiculo/' + $routeParams.idVehiculo +
160 160 '/cisterna/' + key);
161   - }else {
  161 + } else {
162 162 $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/0/');
163 163 }
164 164 };