ende 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48c8c0d0d16dbab8612cf83787761d537d678761
4
- data.tar.gz: e1bcad642478c0f6d5904df518ebcf59d99f8e20
3
+ metadata.gz: 48ea395bfca3bbe1ea124665465c52b6e5897cc5
4
+ data.tar.gz: c6c097475ccfa0b037ca7801f092932d7cae1601
5
5
  SHA512:
6
- metadata.gz: ec2040e2851d5c62f381d2445f66af9e50ba5ca0ad1a59bc8a3f04795fc23606645b09e1f0f905121659f636577d60d70409c92fe771583473c2b9598081ddc5
7
- data.tar.gz: 6f0d4b3102c0909fc8df7ac91dc4b62b047f4ec5ab53cd278956b58afa1d759b11d8d236fb4d7a700d501c7b2542af28c3137f3caa4da5113b912c7b8f2a3065
6
+ metadata.gz: f63a2d8340006c7124cf410f88a3c0b89358852f2f2bb4efb4799229e8be907bf3d0e358d4122bb3321ecef5000874a52358076fa14c6513012392d98ab32725
7
+ data.tar.gz: 93be43830a8fc8ddacd5a13a7e471ba346a330a63ad7570949281ca07eb1ab0364c4d8707016f86fa283bdd69f95ef86aeff27bb88b7045368088cd6b5384c41
@@ -23,7 +23,7 @@ define 'aura/extensions/devise', () ->
23
23
  else
24
24
 
25
25
  # TODO create an indemma model
26
- # TODO deprecate this usage and always use app default model
26
+ # TODO deprecate this usage and always use app default model or the ende default model
27
27
  # TODO after that create a configuration for using a custom model
28
28
  user_session = core.models.record.call
29
29
  resource:
@@ -31,6 +31,15 @@ define 'aura/extensions/devise', () ->
31
31
  email : user.email
32
32
  password: user.password
33
33
 
34
+
35
+ # TODO create an indemma model
36
+ user_session.destroy = (doned, failed) ->
37
+ id = @_id
38
+ delete @_id
39
+ promise = core.models['user'].delete.call(@).done(doned).fail(failed)
40
+ @_id = id
41
+ promise
42
+
34
43
  user_session.route = "/#{user_session.resource}s/sessions"
35
44
 
36
45
  user_session
@@ -122,7 +131,7 @@ define 'aura/extensions/devise', () ->
122
131
  # TODO update the csrf token with the new one!
123
132
  # TODO better resource deletion control, create interface to
124
133
  # make delete requests
125
- session.instance.id = 0
134
+
126
135
  session.instance.destroy()
127
136
  .done (response, status, xhr) ->
128
137
  sandbox.current_user = null
@@ -72,6 +72,10 @@ define 'aura/extensions/states', ['application/states'], (states) ->
72
72
  # TODO load widgets before state.changed, load on state.change
73
73
  mediator.on 'state.changed', flow.changed
74
74
 
75
+ # TODO better integration with router to remove initial states widgets
76
+ mediator.on 'states.list', ->
77
+ mediator.emit 'states.listed', states
78
+
75
79
  # TODO store meta information about application states
76
80
  # application.states = Object.keys states
77
81
 
@@ -3,12 +3,24 @@ define 'value_objects/phone', ->
3
3
  # TODO locales support
4
4
  class @Phone
5
5
 
6
- constructor: (@area_code, @number) ->
7
- {@area_code, @number} = @area_code if typeof @area_code == 'object'
6
+ # TODO Externalize phone matchers?
7
+ PHONE_MATCHERS:
8
+ # TODO add area codes for RJ and ES when today is greater than 20/07/2014 (or earlieer)
9
+ 'pt-BR': /^(0?\d{2})(\d{0,9})/
8
10
 
11
+ constructor: (@area_code, @number) ->
9
12
 
10
- # TODO parse argument types to validate value object domain
13
+ # TODO better parse argument types to validate value object domain
11
14
  # constraints
15
+ if typeof @area_code == 'object'
16
+ {@area_code, @number} = @area_code
17
+ else if typeof @area_code == 'string' and not @number
18
+ serialized = @area_code.replace /[(+\-)\s]/g, ''
19
+ matches = @PHONE_MATCHERS['pt-BR'].exec serialized
20
+
21
+ if matches
22
+ @area_code = matches[1]
23
+ @number = matches[2]
12
24
 
13
25
  unless @number
14
26
  @number = @area_code
@@ -21,6 +33,7 @@ define 'value_objects/phone', ->
21
33
  validate: -> @area_code && @number
22
34
 
23
35
  toString: ->
36
+ # TODO only store integer number, and remove this strip from here
24
37
  striped_number = @number.replace /\-/g, ''
25
38
 
26
39
  if striped_number
data/lib/ende/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ende
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -143,7 +143,7 @@
143
143
  if ( current_route ) {
144
144
 
145
145
  //-- Don't dispatch the route we are already on
146
- if ( current_route.path === routes[i].path ) {
146
+ if ( current_route.path === routes[i].path && current_route.search === window.location.search) {
147
147
  return false;
148
148
  }
149
149
 
@@ -165,6 +165,9 @@
165
165
  //-- Update the current route
166
166
  current_route = routes[i];
167
167
 
168
+ //-- Update the current route search string
169
+ current_route.search = window.location.search
170
+
168
171
  //-- Dispatch
169
172
  return this.dispatch(routes[i], context);
170
173
  }
@@ -181,4 +184,4 @@
181
184
 
182
185
  if ( typeof define === "function" && define.amd ) {
183
186
  define( "Lennon", [], function () { return Lennon; } );
184
- }
187
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ende
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heitor Salazar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-21 00:00:00.000000000 Z
11
+ date: 2013-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler