revelry_core 0.1.5 → 0.1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 855f8fc6939e648080ebf33d4ac60c84978ed1f2
4
- data.tar.gz: fa487e49dcc63258fa306d8035d84c4169832043
3
+ metadata.gz: 686caccddad7ce4f92fd9a0125cefc79a28caa30
4
+ data.tar.gz: 7f2bb67ff6af72a14b6faa34b4bd50826f07f0cb
5
5
  SHA512:
6
- metadata.gz: ba4f442656e2122fa87c357a45b64cf1a1b4d9fcd9738cbf291f292df50f37c8c528693f63123826a5e939e82d68931ebe22aaa63a4277add7918c15b83edb21
7
- data.tar.gz: 1960cc598257bd910279864d22306dc4979a32628a0467872968b6b57751022d0f4d3ceb6818d21bb6908f2b6f07ab6273cf61c72ded11b36ae936262c89ab3b
6
+ metadata.gz: 4d353de8d7b46679b47757eadc251d7c5a7610460fc7eaa015a0d220c3baf86c40de32f91a76f695e1d4222fad80c0449abadece47c34ebc0f8a0babff63a5a9
7
+ data.tar.gz: 8e84eaf3d47975ca333418799b99e279dc9b40c3dc460329f348f6a9cfe201b4a7ed6e66905dbaf734da7cd4779d34aba8445e84384b2c96d0f2e0626f0dab0e
@@ -3,7 +3,7 @@ Rev.registerComponent 'Router',
3
3
 
4
4
  statics:
5
5
  # Dump of the route table from the rails application
6
- routesFromRails: <%= Hash[Rails.application.routes.routes.select{ |r| r.verb.match('GET') }.sort { |r| r.precedence }.map { |x| [x.path.ast.to_s.gsub(/\A\//,''), x.defaults] }].to_json %>
6
+ routesFromRails: <%= Rails.application.routes.routes.select{ |r| r.verb.match('GET') }.sort { |r| r.precedence }.map { |x| [x.path.ast.to_s.gsub(/\A\//,''), x.defaults] }.to_json %>
7
7
 
8
8
  # Convert 'defaults' from Rails route, which looks like
9
9
  # { controller: 'foo', action: 'new' } into a path as array like this:
@@ -29,10 +29,10 @@ Rev.registerComponent 'Router',
29
29
  routerConfig =
30
30
  routes: {}
31
31
 
32
- _(Rev.Components.Router.routesFromRails).each (value, key)=>
32
+ _(Rev.Components.Router.routesFromRails).each (pair)=>
33
+ [key, value] = pair
33
34
  return unless value.controller && value.action
34
- actionName = Rev.Components.Router.routeFunctionName(value)
35
- routerConfig.routes[key] = actionName
35
+ routerConfig.routes[key] ||= Rev.Components.Router.routeFunctionName(value)
36
36
  routerConfig
37
37
 
38
38
  ### INSTANCE METHODS ###
@@ -80,7 +80,10 @@ Rev.registerComponent 'Router',
80
80
  # render. If we get them back successfully, swap the page. If we fail, fall
81
81
  # back to server side render.
82
82
  Backbone.ajax
83
- url: "#{ @locationURL() }.props"
83
+ url: @locationURL()
84
+ beforeSend: (xhr) ->
85
+ xhr.setRequestHeader "Content-Type", "text/reactprops"
86
+ xhr.setRequestHeader "Accept", "text/reactprops"
84
87
  success: @makePropsFetchSuccessHandler(templatePath)
85
88
  error: @onPropsFetchFailure
86
89
  true
@@ -32,7 +32,7 @@ module Revelry
32
32
  # Enable controllers to respond to .props format, which returns the same
33
33
  # props that execjs uses for serverside render (as a JSON object)
34
34
  initializer "revelry.setup_props_renderer", :group => :all do |app|
35
- Mime::Type.register_alias "text/reactprops", :props
35
+ Mime::Type.register "text/reactprops", :props
36
36
 
37
37
  ActionController.add_renderer :props do |foo, opts|
38
38
  self.response_body = render_to_string template: Revelry::Core::PropsTemplate.new('', 'path', ActionView::Template.registered_template_handler(:erb), format: Mime[:erb], virtual_path: 'path')
@@ -1,5 +1,5 @@
1
1
  module Revelry
2
2
  module Core
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revelry_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Revelry Labs, LLC