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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aae04ed8e3f6a08a9ae999b4b5830a8d9a6bf282
4
- data.tar.gz: 17b1f689e3234d1795804630eb4c5cbc48ab379f
3
+ metadata.gz: 987ec07cf6ea9f1350521c964ceb73487ad3ad9f
4
+ data.tar.gz: ee201f53ef12b70819ae1287bff7b92d359d6470
5
5
  SHA512:
6
- metadata.gz: 1acd0ed7c24e9ac530b426d02344cda77db59a4d37a039d9b257b81661d4acd9119a4b8efe2ef475ae5c9109f0c3ea7ac4563de616399f97cde96b74595b733c
7
- data.tar.gz: fdb36adc64ff04ab63beb0d51badbe795b6db0f4295e4faaa8301ca00961dd577bf141b06b4db55dca2538c7338fd2434d8650a2beafc4d566d2adb5b2f04a38
6
+ metadata.gz: 99ce7b72d027d8134e33c9d47dab3582f46f5ba627720b1a2ac4c0b65200f46a2d7486bd4f19664ec4fd43234e3138190d2eb7b5ee0adc9a3d8371942c739028
7
+ data.tar.gz: 8d6d19293b7a773e32bc889584839eec1e0ae63c1bbc43fce34b56fd4be677002e73f34055e7b8ac59409eaaac09c79a2b311445a204c79403c04148d9a4d5e4
@@ -1,3 +1,3 @@
1
1
  module Turboctrl
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
@@ -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.0
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