sudojs-rails 0.4.3 → 0.4.4

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: b4d8260f96731a47886b44f0016f2c397b889587
4
- data.tar.gz: 3439116240bd58079ff7cb12f6c10f8028e08e1b
3
+ metadata.gz: 1b20dbdb854d617e86664287569193276efb8eb3
4
+ data.tar.gz: bbd5635d6ec760e77bd282873b391eae209c1999
5
5
  SHA512:
6
- metadata.gz: 5700e60dc5b4f0bb1fc33151892233f3214d60128698f24579dd628cac143ed84d77a623a80b1d8cb1c3753da5c734911afc2d7e56793185f50597ecb802b3db
7
- data.tar.gz: 9a41fc1345807e4c7394a25ae8f888d0a0b22b081b87b6eec9ecda82f78f69e5863be4f99f7774642f368668fb07f0bad7e5e62bd39d5af8dc17ce580080aa38
6
+ metadata.gz: 2fc9ebfdaec8ca14a8a3c71b140cf8e3b799f130eadf53b907a6ce8015fa5dbf55bf19fb954db424c30ded14d434ede30b16fbc4ba8aff6ded60b585117509c7
7
+ data.tar.gz: 250e7ce70971d386320e7ea248e76cb03dcfc615caf32d8a3a6d4b9f68594087753d51af2cca969755f25517ede251d0e32fe3936a0595237dca6e0ba984d065
data/README.md CHANGED
@@ -40,32 +40,32 @@ Before use, a few steps need to be followed to prepare your project for our pref
40
40
  + We place manifest files into an `app/assets/javascripts/manifests` directory. This means that your
41
41
  `app/views/layouts/application.html.*` file needs to be adjusted to account for this:
42
42
 
43
- <%= javascript_include_tag 'manifests/application.js' %>
43
+ <%= javascript_include_tag 'manifests/application.js' %>
44
+
44
45
 
45
46
  Preferably, you will **not** place this in your `head` tag
46
47
 
47
48
  + We assume that any Class Object not used more than once (i.e. is unique to a particular controller#action)
48
49
  will not go into `application.js` but be placed into its own manifest for that controller. For this to function,
49
- a helper method can be constructed:
50
+ a helper method can be constructed in app/helpers/application_helper.rb
51
+
50
52
 
51
- # in app/helpers/application_helper.rb
52
- def controller_javascript
53
- controller_manifest = File.join('manifests', "#{self.controller_name}.js")
54
- return '' if Rails.application.assets.find_asset(controller_manifest).nil?
53
+ def controller_javascript
54
+ controller_manifest = File.join('manifests', "#{self.controller_name}.js")
55
+ return '' if Rails.application.assets.find_asset(controller_manifest).nil?
56
+ return javascript_include_tag(controller_manifest)
57
+ end
55
58
 
56
- return javascript_include_tag(controller_manifest)
57
- end
58
59
 
59
60
  This allows the following, combined with the previous include tag:
60
61
 
61
- <%= javascript_include_tag 'manifests/application.js' %>
62
- <%= controller_javascript %>
62
+ <%= javascript_include_tag 'manifests/application.js' %>
63
+ <%= controller_javascript %>
63
64
 
64
65
  + When concatonating for `staging` and `production` environments the following code needs to have been inserted
65
66
  into your `config/environments/staging` and `config/environments/production` .rb files:
66
-
67
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
68
- config.assets.precompile += %w( manifests/* )
67
+
68
+ config.assets.precompile += %w( manifests/* )
69
69
 
70
70
  ### In Practice
71
71
 
@@ -1,3 +1,3 @@
1
1
  module Sudojs
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
@@ -846,8 +846,8 @@ sudo.DataView = function(el, data) {
846
846
  sudo.View.call(this, el, d);
847
847
  // implements the listener extension
848
848
  $.extend(this, sudo.extensions.listener);
849
- // dataview's models are observable
850
- $.extend(this.model, sudo.extensions.observable);
849
+ // dataview's models are observable, make it so if not already
850
+ if(!this.model.observe) $.extend(this.model, sudo.extensions.observable);
851
851
  // dont autoRender on the setting of events,
852
852
  // add to this to prevent others if needed
853
853
  this.autoRenderBlacklist = {event: true, events: true};
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sudojs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - robrobbins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-17 00:00:00.000000000 Z
11
+ date: 2013-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec