Skip to content

Commit 72da8cc

Browse files
committed
more specs fixed
1 parent 545286f commit 72da8cc

File tree

10 files changed

+90
-83
lines changed

10 files changed

+90
-83
lines changed

Gruntfile.coffee

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ module.exports = (grunt) ->
5050
options.open = _.extend options.open, allExamplesOpen
5151
grunt.initConfig options
5252

53+
grunt.registerTask 'build', ['verbosity', 'clean:dist', 'jshint', 'mkdir', 'coffee',
54+
'concat:libs', 'replace', 'webpack', 'concat:dist', 'concat:streetview'
55+
'copy']
5356
# Default task: build a release in dist/
54-
grunt.registerTask "default", [
55-
'bower', 'curl',
56-
'verbosity', 'clean:dist', 'jshint', 'mkdir', 'coffee',
57-
'concat:libs', 'replace', 'webpack', 'concat:dist', 'concat:streetview'
58-
'copy', 'uglify:dist', 'uglify:streetview', 'karma']
57+
grunt.registerTask "default", ['bower', 'curl', 'build', 'uglify:dist', 'uglify:streetview', 'karma']
5958

6059
# run default "grunt" prior to generate _SpecRunner.html
6160
grunt.registerTask "spec", [
@@ -135,4 +134,7 @@ module.exports = (grunt) ->
135134

136135
grunt.registerTask 'karmaSpecific', 'karma runner', ->
137136
karmaRunner(grunt, files: argv.files) @async()
137+
138+
grunt.registerTask 'karmaB', ['build', 'karmaSpecific']
139+
grunt.registerTask 'karmaSpecB', ['build', 'karma']
138140
#to see all tasks available don't forget "grunt --help" !!!

dist/angular-google-maps-street-view.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.3.0 2016-01-23
1+
/*! angular-google-maps 2.3.0 2016-01-24
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -193,7 +193,10 @@ return UUID;
193193
]);
194194

195195
}).call(this);
196-
;(function() {
196+
;
197+
/*global _:true, angular:true, google:true */
198+
199+
(function() {
197200
angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapGmapUtil', [
198201
'uiGmapLogger', '$compile', function(Logger, $compile) {
199202
var _isFalse, _isTruthy, getCoords, getLatitude, getLongitude, validateCoords;

dist/angular-google-maps-street-view.min.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/angular-google-maps.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-google-maps 2.3.0 2016-01-23
1+
/*! angular-google-maps 2.3.0 2016-01-24
22
* AngularJS directives for Google Maps
33
* git: https://github.com/angular-ui/angular-google-maps.git
44
*/
@@ -1053,7 +1053,10 @@ Nicholas McCready - https://twitter.com/nmccready
10531053
]);
10541054

10551055
}).call(this);
1056-
;(function() {
1056+
;
1057+
/*global _:true, angular:true, google:true */
1058+
1059+
(function() {
10571060
angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapGmapUtil', [
10581061
'uiGmapLogger', '$compile', function(Logger, $compile) {
10591062
var _isFalse, _isTruthy, getCoords, getLatitude, getLongitude, validateCoords;
@@ -1440,8 +1443,11 @@ Nicholas McCready - https://twitter.com/nmccready
14401443
return (function(superClass) {
14411444
extend(_Class, superClass);
14421445

1443-
function _Class(scope1) {
1446+
function _Class(scope1, _interface) {
14441447
this.scope = scope1;
1448+
this["interface"] = _interface != null ? _interface : {
1449+
scopeKeys: []
1450+
};
14451451
this.modelsLength = bind(this.modelsLength, this);
14461452
this.updateChild = bind(this.updateChild, this);
14471453
this.destroy = bind(this.destroy, this);
@@ -1451,8 +1457,6 @@ Nicholas McCready - https://twitter.com/nmccready
14511457
this.setIdKey = bind(this.setIdKey, this);
14521458
this.modelKeyComparison = bind(this.modelKeyComparison, this);
14531459
_Class.__super__.constructor.call(this);
1454-
this["interface"] = {};
1455-
this["interface"].scopeKeys = [];
14561460
this.defaultIdKey = 'id';
14571461
this.idKey = void 0;
14581462
}
@@ -1472,16 +1476,21 @@ Nicholas McCready - https://twitter.com/nmccready
14721476
};
14731477

14741478
_Class.prototype.modelKeyComparison = function(model1, model2) {
1475-
var hasCoords, isEqual, ref, scope, without;
1476-
hasCoords = (ref = this["interface"].scopeKeys) != null ? ref.hasOwnProperty('coords') : void 0;
1479+
var coord1, coord2, hasCoords, isEqual, scope, without;
1480+
hasCoords = this["interface"].scopeKeys.indexOf('coords') >= 0;
14771481
if (hasCoords && (this.scope.coords != null) || !hasCoords) {
14781482
scope = this.scope;
14791483
}
14801484
if (scope == null) {
14811485
throw 'No scope set!';
14821486
}
14831487
if (hasCoords) {
1484-
isEqual = GmapUtil.equalCoords(this.scopeOrModelVal('coords', scope, model1), this.scopeOrModelVal('coords', scope, model2));
1488+
console.log('hasCoords');
1489+
coord1 = this.scopeOrModelVal('coords', scope, model1);
1490+
coord2 = this.scopeOrModelVal('coords', scope, model2);
1491+
console.log("coord1:" + JSON.stringify(coord1));
1492+
console.log("coord2:" + JSON.stringify(coord2));
1493+
isEqual = GmapUtil.equalCoords(coord1, coord2);
14851494
if (!isEqual) {
14861495
return isEqual;
14871496
}

dist/angular-google-maps.min.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

grunt/options.coffee

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
log = require('util').log
22
_ = require 'lodash'
33
_pkg = require '../package.json'
4+
{pipeline, fullPipeline} = require './pipeline'
45

56
_pkg.nextVersion = do ->
67
# note this will fail on new minor or major releases.. oh well manually fix it
@@ -9,35 +10,6 @@ _pkg.nextVersion = do ->
910
next = Number(last) + 1
1011
_pkg.version.replace(last, String(next))
1112

12-
pipeline = [
13-
"src/coffee/module"
14-
"src/coffee/providers/*"
15-
"src/coffee/extensions/*"
16-
"src/coffee/directives/api/utils/*"
17-
"src/coffee/directives/api/managers/*"
18-
19-
"src/coffee/controllers/polyline-display"
20-
"src/coffee/utils/*"
21-
22-
"src/coffee/directives/api/options/**/*"
23-
"src/coffee/directives/api/models/child/*"
24-
"src/coffee/directives/api/models/parent/*"
25-
"src/coffee/directives/api/*"
26-
"src/coffee/directives/map"
27-
"src/coffee/directives/marker"
28-
"src/coffee/directives/markers"
29-
"src/coffee/directives/label"
30-
"src/coffee/directives/polygon"
31-
"src/coffee/directives/circle"
32-
"src/coffee/directives/polyline*"
33-
"src/coffee/directives/rectangle"
34-
"src/coffee/directives/window"
35-
"src/coffee/directives/windows"
36-
"src/coffee/directives/layer"
37-
"src/coffee/directives/control"
38-
"src/coffee/directives/*"
39-
]
40-
4113
# configs for concat main distribution & dev mapping
4214
concatDist =
4315
options:
@@ -52,17 +24,7 @@ concatDist =
5224
"""
5325
separator: ";"
5426
footer: "}( window,angular));"
55-
src: pipeline.map( (f) -> "tmp/#{f}.js").concat [
56-
"tmp/wrapped_uuid.js"
57-
"tmp/wrapped_gmaps_sdk_util_v3.js"
58-
"tmp/webpack.dataStructures.js"
59-
"tmp/wrapped_marker_spiderfier.js"
60-
"src/js/**/*.js" #this all will only work if the dependency orders do not matter
61-
"src/js/**/**/*.js"
62-
"src/js/**/**/**/*.js"
63-
"!src/js/wrapped/webpack/*.js"
64-
"!src/js/wrapped/*.js"
65-
]
27+
src: fullPipeline
6628
dest: "dist/<%= pkg.name %>.js"
6729

6830
concatDistMapped = _.cloneDeep concatDist

grunt/pipeline.coffee

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
pipeline = [
2+
"src/coffee/module"
3+
"src/coffee/providers/*"
4+
"src/coffee/extensions/*"
5+
"src/coffee/directives/api/utils/*"
6+
"src/coffee/directives/api/managers/*"
7+
8+
"src/coffee/controllers/polyline-display"
9+
"src/coffee/utils/*"
10+
11+
"src/coffee/directives/api/options/**/*"
12+
"src/coffee/directives/api/models/child/*"
13+
"src/coffee/directives/api/models/parent/*"
14+
"src/coffee/directives/api/*"
15+
"src/coffee/directives/map"
16+
"src/coffee/directives/marker"
17+
"src/coffee/directives/markers"
18+
"src/coffee/directives/label"
19+
"src/coffee/directives/polygon"
20+
"src/coffee/directives/circle"
21+
"src/coffee/directives/polyline*"
22+
"src/coffee/directives/rectangle"
23+
"src/coffee/directives/window"
24+
"src/coffee/directives/windows"
25+
"src/coffee/directives/layer"
26+
"src/coffee/directives/control"
27+
"src/coffee/directives/*"
28+
]
29+
30+
module.exports =
31+
pipeline: pipeline
32+
fullPipeline: pipeline.map( (f) -> "tmp/#{f}.js").concat [
33+
"tmp/wrapped_uuid.js"
34+
"tmp/wrapped_gmaps_sdk_util_v3.js"
35+
"tmp/webpack.dataStructures.js"
36+
"tmp/wrapped_marker_spiderfier.js"
37+
"src/js/**/*.js" #this all will only work if the dependency orders do not matter
38+
"src/js/**/**/*.js"
39+
"src/js/**/**/**/*.js"
40+
"!src/js/wrapped/webpack/*.js"
41+
"!src/js/wrapped/*.js"
42+
]

spec/coffee/directives/api/utils/model-key.spec.coffee

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ describe 'ModelKey Tests', ->
2828

2929
it 'model1 to model1 is same', ->
3030
@scope.coords = 'coords'
31-
expect(@subject.modelKeyComparison(@model1, @model1, @scope))
31+
expect(@subject.modelKeyComparison(@model1, @model1))
3232
.toEqual(true)
3333

3434
it 'model1 to model2 is diff', ->
35-
expect(@subject.modelKeyComparison(@model1, @model2, @scope))
35+
@scope.coords = 'coords'
36+
expect(@subject.modelKeyComparison(@model1, @model2))
3637
.toEqual(false)
3738

3839
it 'model2 to model3 is same by values', ->
3940
@scope.coords = 'coords'
40-
expect(@subject.modelKeyComparison(@model2, @model3, @scope))
41+
expect(@subject.modelKeyComparison(@model2, @model3))
4142
.toEqual(true)
4243

4344
it 'should properly set id key', ->

src/coffee/directives/api/utils/gmap-util.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
###global _:true, angular:true, google:true ###
12
angular.module('uiGmapgoogle-maps.directives.api.utils')
23
.service 'uiGmapGmapUtil', ['uiGmapLogger', '$compile', (Logger, $compile) ->
34
#BEGIN Private Methods
@@ -150,7 +151,7 @@ angular.module('uiGmapgoogle-maps.directives.api.utils')
150151
if polygon[0].length > this.max
151152
this.max = polygon[0].length
152153
this.index = index
153-
, trackMaxVertices);
154+
, trackMaxVertices)
154155

155156
#TODO: Properly support MultiPolygons
156157
polygon = path.coordinates[trackMaxVertices.index]
@@ -199,7 +200,7 @@ angular.module('uiGmapgoogle-maps.directives.api.utils')
199200
if polygon[0].length > this.max
200201
this.max = polygon[0].length
201202
this.index = index
202-
, trackMaxVertices);
203+
, trackMaxVertices)
203204

204205
#TODO: Properly support MultiPolygons
205206
array = path.coordinates[trackMaxVertices.index][0]

0 commit comments

Comments
 (0)