coffee_controllers-rails 0.1.0 → 1.0.0

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: 7acdddf3c69fe0a7aab001488b1caa90edfd06b3
4
- data.tar.gz: d79a31550584963d415cf9aaca29bf8943f5da69
3
+ metadata.gz: 20cff1742f76502e27deb389e261ac0d57c2bb42
4
+ data.tar.gz: c423f32d9217ac2eff47bee6d4198314fa7cb835
5
5
  SHA512:
6
- metadata.gz: 63a6bb69b53727e8d43f9473d1f9c3435a649b7788152fb849e71d7e0dfecafca79618643fca65320e45537baea4009b6197de5ddd94b00c479fe57966dfc096
7
- data.tar.gz: 98cd832dab76a1e8add4e81741526966effc22be6045b74fc22c5f0aa2b3e29763370d861cba88202be0c893d43128629091dd3b3efcacda6d3751bb6b93671d
6
+ metadata.gz: faab6c7797857d865c99ced441019cf079bbb610902c5946b3d06ed5cee74847af2edea547fb39263251275225bdba48cba327b65daab2393a93c278fd0077ce
7
+ data.tar.gz: 1ca87eef6c348e3a26890b18f057f015f2cbef7e83382062667334f1fabb7b37c0281641cf4538c6a22b98012cce994e1c9df239648b20af1cbdccc08fc9483e
data/README.md CHANGED
@@ -28,7 +28,7 @@ It depends of [coffee-rails](https://github.com/rails/coffee-rails) that is also
28
28
  In your `application.js` file, add:
29
29
 
30
30
  ```javascript
31
- //= require coffee_controllers/main
31
+ //= require coffee_controllers/all
32
32
  ```
33
33
 
34
34
  In your views layout file, say `application.html.erb`, add this to the `body` tag:
@@ -0,0 +1,2 @@
1
+ //= require coffee_controllers/core
2
+ //= require coffee_controllers/loader
@@ -2,21 +2,8 @@
2
2
  @Controllers ?= {}
3
3
  @ActiveController = null
4
4
 
5
- # Attach a function to be executed when the DOM is loaded
6
- ready = (fn) ->
7
- unless document.readyState is "loading"
8
- fn()
9
- else
10
- document.addEventListener "DOMContentLoaded", fn
11
- return
12
-
13
- ready ->
14
- # Run the specific scripts that have to be run after the DOM is loaded
15
- runSpecificActionScript()
16
- return
17
-
18
5
  # Call the script function related to the current action of the current controller
19
- @runSpecificActionScript = ->
6
+ @runCoffeeController = ->
20
7
  body = document.querySelectorAll('body')[0]
21
8
  currentController = body.getAttribute 'data-controller'
22
9
 
@@ -0,0 +1,12 @@
1
+ # Attach a function to be executed when the DOM is loaded
2
+ ready = (fn) ->
3
+ unless document.readyState is "loading"
4
+ fn()
5
+ else
6
+ document.addEventListener "DOMContentLoaded", fn
7
+ return
8
+
9
+ ready ->
10
+ # Run the specific scripts that have to be run after the DOM is loaded
11
+ runCoffeeController()
12
+ return
@@ -1,5 +1,5 @@
1
1
  module CoffeeControllers
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee_controllers-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Ferraz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails
@@ -77,7 +77,9 @@ files:
77
77
  - MIT-LICENSE
78
78
  - README.md
79
79
  - Rakefile
80
- - app/assets/javascripts/coffee_controllers/main.js.coffee
80
+ - app/assets/javascripts/coffee_controllers/all.js
81
+ - app/assets/javascripts/coffee_controllers/core.js.coffee
82
+ - app/assets/javascripts/coffee_controllers/loader.js.coffee
81
83
  - lib/coffee_controllers-rails.rb
82
84
  - lib/coffee_controllers/rails.rb
83
85
  - lib/coffee_controllers/rails/engine.rb