marionette-rails 0.9.11 → 0.9.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- // Backbone.Marionette, v0.9.11
1
+ // Backbone.Marionette, v0.9.12
2
2
  // Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
3
3
  // Distributed under MIT license
4
4
  // http://github.com/derickbailey/backbone.marionette
@@ -752,17 +752,29 @@ Marionette.Layout = Marionette.ItemView.extend({
752
752
 
753
753
  var that = this;
754
754
  _.each(this.regions, function (region, name) {
755
- if ( typeof region != 'string'
756
- && typeof region.selector != 'string' ) {
757
- throw new Exception('Region must be specified as a selector ' +
758
- 'string or an object with selector property');
755
+ var regionIsString = (typeof region === "string");
756
+ var regionSelectorIsString = (typeof region.selector === "string");
757
+ var regionTypeIsUndefined = (typeof region.regionType === "undefined");
758
+
759
+ if (!regionIsString && !regionSelectorIsString) {
760
+ throw new Error("Region must be specified as a selector string or an object with selector property");
761
+ }
762
+
763
+ var selector, RegionType;
764
+
765
+ if (regionIsString) {
766
+ selector = region;
767
+ } else {
768
+ selector = region.selector;
759
769
  }
760
770
 
761
- var selector = typeof region === 'string' ? region : region.selector;
762
- var regionType = typeof region.regionType === 'undefined'
763
- ? that.regionType : region.regionType;
771
+ if (regionTypeIsUndefined){
772
+ RegionType = that.regionType;
773
+ } else {
774
+ RegionType = region.regionType;
775
+ }
764
776
 
765
- var regionManager = new regionType({
777
+ var regionManager = new RegionType({
766
778
  el: selector,
767
779
  getEl: function(selector){
768
780
  return that.$(selector);
@@ -848,18 +860,18 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
848
860
  // addRegions({something: "#someRegion"})
849
861
  // addRegions{{something: Region.extend({el: "#someRegion"}) });
850
862
  addRegions: function(regions){
851
- var regionValue, regionObj, region;
863
+ var RegionValue, regionObj, region;
852
864
 
853
865
  for(region in regions){
854
866
  if (regions.hasOwnProperty(region)){
855
- regionValue = regions[region];
867
+ RegionValue = regions[region];
856
868
 
857
- if (typeof regionValue === "string"){
869
+ if (typeof RegionValue === "string"){
858
870
  regionObj = new Marionette.Region({
859
- el: regionValue
871
+ el: RegionValue
860
872
  });
861
873
  } else {
862
- regionObj = new regionValue();
874
+ regionObj = new RegionValue();
863
875
  }
864
876
 
865
877
  this[region] = regionObj;
metadata CHANGED
@@ -1,65 +1,81 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: marionette-rails
3
- version: !ruby/object:Gem::Version
4
- version: 0.9.11
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 9
8
+ - 12
9
+ version: 0.9.12
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Godfrey Chan
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-08-16 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-09-26 00:00:00 -07:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 3.1.0
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 3
29
+ - 1
30
+ - 0
29
31
  version: 3.1.0
32
+ type: :runtime
33
+ version_requirements: *id001
30
34
  description: Vendors Backbone.Marionette for use with asset pipeline.
31
- email:
35
+ email:
32
36
  - godfreykfc@gmail.com
33
37
  executables: []
38
+
34
39
  extensions: []
40
+
35
41
  extra_rdoc_files: []
36
- files:
42
+
43
+ files:
37
44
  - lib/marionette-rails.rb
38
45
  - vendor/assets/javascripts/backbone.marionette.js
39
46
  - LICENSE
40
47
  - README.md
48
+ has_rdoc: true
41
49
  homepage: https://github.com/chancancode/marionette-rails
42
50
  licenses: []
51
+
43
52
  post_install_message:
44
53
  rdoc_options: []
45
- require_paths:
54
+
55
+ require_paths:
46
56
  - lib
47
- required_ruby_version: !ruby/object:Gem::Requirement
48
- none: false
49
- requirements:
50
- - - ! '>='
51
- - !ruby/object:Gem::Version
52
- version: '0'
53
- required_rubygems_version: !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ! '>='
57
- - !ruby/object:Gem::Version
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 1
70
+ - 3
71
+ - 6
58
72
  version: 1.3.6
59
73
  requirements: []
74
+
60
75
  rubyforge_project:
61
- rubygems_version: 1.8.24
76
+ rubygems_version: 1.3.6
62
77
  signing_key:
63
78
  specification_version: 3
64
79
  summary: Backbone.Marionette for Rails
65
80
  test_files: []
81
+