turboctrl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turboctrl/version.rb +1 -1
- data/vendor/assets/javascripts/turboctrl.js.coffee +18 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987ec07cf6ea9f1350521c964ceb73487ad3ad9f
|
4
|
+
data.tar.gz: ee201f53ef12b70819ae1287bff7b92d359d6470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99ce7b72d027d8134e33c9d47dab3582f46f5ba627720b1a2ac4c0b65200f46a2d7486bd4f19664ec4fd43234e3138190d2eb7b5ee0adc9a3d8371942c739028
|
7
|
+
data.tar.gz: 8d6d19293b7a773e32bc889584839eec1e0ae63c1bbc43fce34b56fd4be677002e73f34055e7b8ac59409eaaac09c79a2b311445a204c79403c04148d9a4d5e4
|
data/lib/turboctrl/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
$.extend String.prototype, camelize: ->
|
2
|
+
@replace /(?:^|[-_])(\w)/g, (_, c) ->
|
3
|
+
if c then c.toUpperCase() else ''
|
4
|
+
|
5
|
+
$(document).on 'ready page:load', (event) ->
|
6
|
+
ctrl = $('body').data('turboctrl-controller').camelize();
|
7
|
+
action = $('body').data('turboctrl-action')
|
8
|
+
try
|
9
|
+
klass = eval ctrl
|
10
|
+
|
11
|
+
if typeof klass is 'function'
|
12
|
+
instance = new klass
|
13
|
+
|
14
|
+
try
|
15
|
+
method = eval "instance.#{action}"
|
16
|
+
|
17
|
+
if typeof method is 'function'
|
18
|
+
method(event)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turboctrl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Komagata
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- test/dummy/public/favicon.ico
|
96
96
|
- test/test_helper.rb
|
97
97
|
- test/turboctrl_test.rb
|
98
|
+
- vendor/assets/javascripts/turboctrl.js.coffee
|
98
99
|
homepage: https://github.com/komagata/turboctrl
|
99
100
|
licenses:
|
100
101
|
- MIT
|