slender_data 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/slender_data/brest_loader.coffee +14 -4
  3. data/app/assets/javascripts/slender_data/loading_tracker.coffee +7 -7
  4. data/app/assets/javascripts/slender_data/persistence_manager.coffee +2 -2
  5. data/lib/slender_data/version.rb +1 -1
  6. data/spec/dummy/config/initializers/konacha.rb +4 -0
  7. data/spec/dummy/log/development.log +1244 -0
  8. data/spec/dummy/log/test.log +43 -0
  9. data/spec/dummy/spec/javascripts/brest_loader_spec.coffee +23 -5
  10. data/spec/dummy/tmp/cache/assets/development/sprockets/02dabf70b4ae4a034f349ce89b4831d8 +0 -0
  11. data/spec/dummy/tmp/cache/assets/development/sprockets/05175bd457a57c3ad73ab9a2c8696c9b +0 -0
  12. data/spec/dummy/tmp/cache/assets/development/sprockets/086e89c7529d5063e771b41793bfe311 +0 -0
  13. data/spec/dummy/tmp/cache/assets/development/sprockets/0eae13a2665f3282205b3b7450eab6b0 +0 -0
  14. data/spec/dummy/tmp/cache/assets/development/sprockets/14eca89f8dccac139fd132de35d22628 +0 -0
  15. data/spec/dummy/tmp/cache/assets/development/sprockets/16c8b12ef6dcb486a7b771e43bbcc117 +0 -0
  16. data/spec/dummy/tmp/cache/assets/development/sprockets/2193bfea38d2d0a1335ff6930d89e6f2 +0 -0
  17. data/spec/dummy/tmp/cache/assets/development/sprockets/2b22662f42e9f485aafa6a333faaa256 +0 -0
  18. data/spec/dummy/tmp/cache/assets/development/sprockets/2e2576241d2a4969c9277fe85851c92b +0 -0
  19. data/spec/dummy/tmp/cache/assets/development/sprockets/2ff315acad8ceec317fd566d792df64f +0 -0
  20. data/spec/dummy/tmp/cache/assets/development/sprockets/324a5040c964d5e8d293564383c49b91 +0 -0
  21. data/spec/dummy/tmp/cache/assets/development/sprockets/3999afdceee7ca8dcf53757221c62d71 +0 -0
  22. data/spec/dummy/tmp/cache/assets/development/sprockets/3ef50ccfe459d5c89ecc79a448586b49 +0 -0
  23. data/spec/dummy/tmp/cache/assets/development/sprockets/4e95d37e97e7394407441a0c18ebd4f6 +0 -0
  24. data/spec/dummy/tmp/cache/assets/development/sprockets/5b390f4782d6b77f5aec7ec56f3ad934 +0 -0
  25. data/spec/dummy/tmp/cache/assets/development/sprockets/5c41eeb2e98dc0833647e8547880435e +0 -0
  26. data/spec/dummy/tmp/cache/assets/development/sprockets/5cd2936d626662390288ab4c07ff3957 +0 -0
  27. data/spec/dummy/tmp/cache/assets/development/sprockets/643d60abdbcc813c95214920f12f09c3 +0 -0
  28. data/spec/dummy/tmp/cache/assets/development/sprockets/6597f36181468ff92ba4284afe001181 +0 -0
  29. data/spec/dummy/tmp/cache/assets/development/sprockets/69b7946c418b75e7ba78f9fc73d3e9b9 +0 -0
  30. data/spec/dummy/tmp/cache/assets/development/sprockets/6e4bc63f9308eb5929a77f7607101af1 +0 -0
  31. data/spec/dummy/tmp/cache/assets/development/sprockets/6ee2243cf1cf415b6267b84dd7b8ba77 +0 -0
  32. data/spec/dummy/tmp/cache/assets/development/sprockets/70ffa648dbbe0f2431e7f9307b569354 +0 -0
  33. data/spec/dummy/tmp/cache/assets/development/sprockets/731f0bc492f775825f046d500938fc5a +0 -0
  34. data/spec/dummy/tmp/cache/assets/development/sprockets/7abf5e8d9666225cb1d7881798dbd87a +0 -0
  35. data/spec/dummy/tmp/cache/assets/development/sprockets/873c5252aa4eab7409b712c5e276bad2 +0 -0
  36. data/spec/dummy/tmp/cache/assets/development/sprockets/87a6ddc523ccbf2673750499bede3fc9 +0 -0
  37. data/spec/dummy/tmp/cache/assets/development/sprockets/8a90082fa76a7f37dd92a9b9a9b9f593 +0 -0
  38. data/spec/dummy/tmp/cache/assets/development/sprockets/8c5b622a33c6c034ecb4e78f131c5f73 +0 -0
  39. data/spec/dummy/tmp/cache/assets/development/sprockets/8c9851849e82bb9670e56f046df437f9 +0 -0
  40. data/spec/dummy/tmp/cache/assets/development/sprockets/8fc1455d3af69de5da04bf2a2a3f0b74 +0 -0
  41. data/spec/dummy/tmp/cache/assets/development/sprockets/a5c506bb1d2a7e7ed9bc3cbaffb3f254 +0 -0
  42. data/spec/dummy/tmp/cache/assets/development/sprockets/a73a44bfca198fdf779532b644ec8af5 +0 -0
  43. data/spec/dummy/tmp/cache/assets/development/sprockets/aa4a22da44bd1b7dbdbb18f983d6c09b +0 -0
  44. data/spec/dummy/tmp/cache/assets/development/sprockets/ac1b8c30ad00cc489b7ec78bd6e2fc6c +0 -0
  45. data/spec/dummy/tmp/cache/assets/development/sprockets/ae8bd07980ad64ef8e9ac3fe38413c6d +0 -0
  46. data/spec/dummy/tmp/cache/assets/development/sprockets/b4c98527796e7db289c94d72cc105f97 +0 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/c6babc078901541de3f4cb5cc2703bea +0 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/cce1f28f0d1f5c2817e6eaf392bac615 +0 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/dc54acb6b8cd4b84b13f440d57db37b1 +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/dd51c50b2d8231175e8da83e8b057120 +0 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/df13b2e8a88a9dcdc4a830fdd8f8d7b8 +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/e0393ec0ca968f0d4182c82802da79d5 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/e43bfee690613c316a59f122315314e5 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/ed098798467603e71ea71b6db68c1e2b +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/ef2b922f05692ba49eb1f68801786b8e +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/f1b4ffa23205a95782c5c5050359429f +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/f2080a87aa027245a444b1486dce7792 +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/f37842723e3572ba18f02519dab4ee77 +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/f72501aca20f34d765720253853e6105 +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/feadb1611975b23f2647e1ac656ad90b +0 -0
  61. data/spec/dummy/tmp/cache/assets/test/sprockets/02dabf70b4ae4a034f349ce89b4831d8 +0 -0
  62. data/spec/dummy/tmp/cache/assets/test/sprockets/05175bd457a57c3ad73ab9a2c8696c9b +0 -0
  63. data/spec/dummy/tmp/cache/assets/test/sprockets/086e89c7529d5063e771b41793bfe311 +0 -0
  64. data/spec/dummy/tmp/cache/assets/test/sprockets/0eae13a2665f3282205b3b7450eab6b0 +0 -0
  65. data/spec/dummy/tmp/cache/assets/test/sprockets/14eca89f8dccac139fd132de35d22628 +0 -0
  66. data/spec/dummy/tmp/cache/assets/test/sprockets/16c8b12ef6dcb486a7b771e43bbcc117 +0 -0
  67. data/spec/dummy/tmp/cache/assets/test/sprockets/2e2576241d2a4969c9277fe85851c92b +0 -0
  68. data/spec/dummy/tmp/cache/assets/test/sprockets/2ff315acad8ceec317fd566d792df64f +0 -0
  69. data/spec/dummy/tmp/cache/assets/test/sprockets/324a5040c964d5e8d293564383c49b91 +0 -0
  70. data/spec/dummy/tmp/cache/assets/test/sprockets/3999afdceee7ca8dcf53757221c62d71 +0 -0
  71. data/spec/dummy/tmp/cache/assets/test/sprockets/3ef50ccfe459d5c89ecc79a448586b49 +0 -0
  72. data/spec/dummy/tmp/cache/assets/test/sprockets/5b390f4782d6b77f5aec7ec56f3ad934 +0 -0
  73. data/spec/dummy/tmp/cache/assets/test/sprockets/5cd2936d626662390288ab4c07ff3957 +0 -0
  74. data/spec/dummy/tmp/cache/assets/test/sprockets/643d60abdbcc813c95214920f12f09c3 +0 -0
  75. data/spec/dummy/tmp/cache/assets/test/sprockets/6597f36181468ff92ba4284afe001181 +0 -0
  76. data/spec/dummy/tmp/cache/assets/test/sprockets/6e4bc63f9308eb5929a77f7607101af1 +0 -0
  77. data/spec/dummy/tmp/cache/assets/test/sprockets/6ee2243cf1cf415b6267b84dd7b8ba77 +0 -0
  78. data/spec/dummy/tmp/cache/assets/test/sprockets/70ffa648dbbe0f2431e7f9307b569354 +0 -0
  79. data/spec/dummy/tmp/cache/assets/test/sprockets/7abf5e8d9666225cb1d7881798dbd87a +0 -0
  80. data/spec/dummy/tmp/cache/assets/test/sprockets/87a6ddc523ccbf2673750499bede3fc9 +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sprockets/8a90082fa76a7f37dd92a9b9a9b9f593 +0 -0
  82. data/spec/dummy/tmp/cache/assets/test/sprockets/8c5b622a33c6c034ecb4e78f131c5f73 +0 -0
  83. data/spec/dummy/tmp/cache/assets/test/sprockets/8c9851849e82bb9670e56f046df437f9 +0 -0
  84. data/spec/dummy/tmp/cache/assets/test/sprockets/8fc1455d3af69de5da04bf2a2a3f0b74 +0 -0
  85. data/spec/dummy/tmp/cache/assets/test/sprockets/a5c506bb1d2a7e7ed9bc3cbaffb3f254 +0 -0
  86. data/spec/dummy/tmp/cache/assets/test/sprockets/a73a44bfca198fdf779532b644ec8af5 +0 -0
  87. data/spec/dummy/tmp/cache/assets/test/sprockets/aa4a22da44bd1b7dbdbb18f983d6c09b +0 -0
  88. data/spec/dummy/tmp/cache/assets/test/sprockets/ac1b8c30ad00cc489b7ec78bd6e2fc6c +0 -0
  89. data/spec/dummy/tmp/cache/assets/test/sprockets/ae8bd07980ad64ef8e9ac3fe38413c6d +0 -0
  90. data/spec/dummy/tmp/cache/assets/test/sprockets/cce1f28f0d1f5c2817e6eaf392bac615 +0 -0
  91. data/spec/dummy/tmp/cache/assets/test/sprockets/dc54acb6b8cd4b84b13f440d57db37b1 +0 -0
  92. data/spec/dummy/tmp/cache/assets/test/sprockets/dd51c50b2d8231175e8da83e8b057120 +0 -0
  93. data/spec/dummy/tmp/cache/assets/test/sprockets/e0393ec0ca968f0d4182c82802da79d5 +0 -0
  94. data/spec/dummy/tmp/cache/assets/test/sprockets/e43bfee690613c316a59f122315314e5 +0 -0
  95. data/spec/dummy/tmp/cache/assets/test/sprockets/ef2b922f05692ba49eb1f68801786b8e +0 -0
  96. data/spec/dummy/tmp/cache/assets/test/sprockets/f1b4ffa23205a95782c5c5050359429f +0 -0
  97. data/spec/dummy/tmp/cache/assets/test/sprockets/f2080a87aa027245a444b1486dce7792 +0 -0
  98. data/spec/dummy/tmp/cache/assets/test/sprockets/f37842723e3572ba18f02519dab4ee77 +0 -0
  99. data/spec/dummy/tmp/cache/assets/test/sprockets/f72501aca20f34d765720253853e6105 +0 -0
  100. data/spec/dummy/tmp/cache/assets/test/sprockets/feadb1611975b23f2647e1ac656ad90b +0 -0
  101. metadata +30 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e2a4d6640c1c899ed463efac094b63e324ad259
4
- data.tar.gz: 13e669428df267a50b7a7c0a0c04f455ebf62997
3
+ metadata.gz: edfb448b592349bc27147d420b9e7e793ba2c48f
4
+ data.tar.gz: 3da1858b7dbf70899e60d5dd1f5a7d250eaa9fd7
5
5
  SHA512:
6
- metadata.gz: ddd326499a608b42c30345e0f054b71b9ee263e965bf5c545da0ea82eb94b0cee901d845ba9a525c432522bd6ce232a9d45cae45d8907d18683fd22926940485
7
- data.tar.gz: 17578f5f46ca6f2e56c69e56bf98c4402df15f01c09da3bee5218b8ff6982b4a0fcdfea2f5dec1727284fc9a61f1169b3e90b5015e6b611258df55f33f4ea8b7
6
+ metadata.gz: 200eed1ae5f04053007f93dbb3362ea3e12044529f1cee0a2fd26d12bfd751abf1254a30054039a45c94a65d423225cb255192d4c26887be43ec364f373899f1
7
+ data.tar.gz: dd510f888dd8b05d7b0ff21d8cc24e6b50e0544bd547eacd06cc7588987257e3d88ee5bbc2c4a51e022f29b5bebfaa850273a0a93e4dad01d186bdfce3207c04
@@ -59,9 +59,8 @@ class slender_data.BrestLoader extends slender_data.Parameterizable
59
59
  data = {}
60
60
  data[@ids_name] = multi_query.ids()
61
61
  jQuery.ajax
62
- url: @entries_url()
62
+ url: @entries_url(data)
63
63
  type: 'DELETE'
64
- data: data
65
64
  success: callback
66
65
 
67
66
 
@@ -72,8 +71,9 @@ class slender_data.BrestLoader extends slender_data.Parameterizable
72
71
 
73
72
 
74
73
  # Returns the url to access the collection of entries.
75
- entries_url: ->
76
- @_entries_url_result or= "#{@base_url}/#{@entries_name}.json"
74
+ entries_url: (params) ->
75
+ data = if params then "?#{@url_data_encode params}" else ""
76
+ "#{@base_url}/#{@entries_name}.json#{data}"
77
77
 
78
78
 
79
79
  # Merges the entries described by the given ids
@@ -137,3 +137,13 @@ class slender_data.BrestLoader extends slender_data.Parameterizable
137
137
  data: data
138
138
  success: callback
139
139
 
140
+
141
+ # URL-encodes the given JSON data.
142
+ url_data_encode: (params) ->
143
+ data = []
144
+ for own key, value of params
145
+ if _.isArray(value)
146
+ value = value.join '+'
147
+ data.push "#{key}=#{value}"
148
+ data = data.join '&'
149
+
@@ -18,13 +18,13 @@ class slender_data.LoadingTracker extends slender_data.Parameterizable
18
18
  # is currently loading.
19
19
  is_loading: (query) ->
20
20
  query = @_querify_single query
21
- console.log "LoadingTracker.is_loading: entry #{query.id()} loading status: #{@loading_entries[query.id()]?}"
21
+ console.log "LoadingTracker.is_loading: entry #{query.id()} loading status: #{@loading_entries[query.id()]?}" if window.JS_TRACING
22
22
  @loading_entries[query.id()]?
23
23
 
24
24
 
25
25
  # Notifies this LoadingTracker that the given entry has arrived.
26
26
  entry_arrived: (entry) ->
27
- console.log "LoadingTracker: received entry #{entry.id}"
27
+ console.log "LoadingTracker: received entry #{entry.id}" if window.JS_TRACING
28
28
 
29
29
  # Call the callbacks registered for the loaded entry.
30
30
  if (callbacks = @loading_entries[entry[@id_name]])
@@ -36,7 +36,7 @@ class slender_data.LoadingTracker extends slender_data.Parameterizable
36
36
 
37
37
  # Notifies this LoadingTracker that the given entries have arrived.
38
38
  entries_arrived: (entries) ->
39
- console.log "LoadingTracker: received entries #{(s.id for s in entries).join '+'}"
39
+ console.log "LoadingTracker: received entries #{(s.id for s in entries).join '+'}" if window.JS_TRACING
40
40
  @entry_arrived(entry) for entry in entries
41
41
  return
42
42
 
@@ -44,14 +44,14 @@ class slender_data.LoadingTracker extends slender_data.Parameterizable
44
44
  # Registers the given entry as currently loading from the server.
45
45
  start_loading: (query) ->
46
46
  query = @_querify_single query
47
- console.log "LoadingTracker: starting to load #{query.id()}"
47
+ console.log "LoadingTracker: starting to load #{query.id()}" if window.JS_TRACING
48
48
  @loading_entries[query.id()] ?= []
49
49
 
50
50
 
51
51
  # Registers the given entries as currently loading from the server.
52
52
  start_loadings: (multi_query) ->
53
53
  multi_query = @_querify_multi multi_query
54
- console.log "LoadingTracker: starting to load multiple #{multi_query.ids()}"
54
+ console.log "LoadingTracker: starting to load multiple #{multi_query.ids()}" if window.JS_TRACING
55
55
  @start_loading(query) for query in multi_query.transpose()
56
56
  return
57
57
 
@@ -63,11 +63,11 @@ class slender_data.LoadingTracker extends slender_data.Parameterizable
63
63
  query = @_querify_single query
64
64
 
65
65
  if @is_loading(query)
66
- console.log "LoadingTracker.wait_for_entry_loaded: entry #{query.id()} is loading, waiting for it"
66
+ console.log "LoadingTracker.wait_for_entry_loaded: entry #{query.id()} is loading, waiting for it" if window.JS_TRACING
67
67
  @loading_entries[query.id()].push callback
68
68
  return undefined
69
69
  else
70
- console.log "LoadingTracker.wait_for_entry_loaded: entry #{query.id()} is not loading"
70
+ console.log "LoadingTracker.wait_for_entry_loaded: entry #{query.id()} is not loading" if window.JS_TRACING
71
71
  return query
72
72
 
73
73
 
@@ -109,11 +109,11 @@ class slender_data.PersistenceManager extends slender_data.Parameterizable
109
109
  # Loads all described entries from any available data source.
110
110
  load_many: (multi_query, callback) ->
111
111
  multi_query = @_querify_multi multi_query
112
- console.log "PersistenceManager.load_many: loading #{multi_query.ids().join '+'}"
112
+ console.log "PersistenceManager.load_many: loading #{multi_query.ids().join '+'}" if window.JS_TRACING
113
113
  result = []
114
114
 
115
115
  cache_result = @get_many multi_query
116
- console.log "PersistenceManager.load_many: found #{(entry.id for entry in cache_result.found).join '+'} in cache."
116
+ console.log "PersistenceManager.load_many: found #{(entry.id for entry in cache_result.found).join '+'} in cache." if window.JS_TRACING
117
117
  result = _(result).union cache_result.found
118
118
  if cache_result.missing.empty()
119
119
  # All requested entries found in cache --> return them immediately.
@@ -1,3 +1,3 @@
1
1
  module SlenderData
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
@@ -0,0 +1,4 @@
1
+ Konacha.configure do |config|
2
+ require 'capybara/poltergeist'
3
+ config.driver = :poltergeist
4
+ end if defined?(Konacha)