riotjs-rails 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +2 -0
- data/LICENSE.md +21 -0
- data/Rakefile +1 -0
- data/Readme.md +11 -0
- data/lib/riotjs-rails.rb +10 -0
- data/lib/riotjs-rails/version.rb +5 -0
- data/riotjs-rails.gemspec +22 -0
- data/vendor/assets/javascripts/riot.js +91 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 950db1e9e68b90e26df21e1ad1ea6dd75e2e2578
|
4
|
+
data.tar.gz: e97dbf04427a378eebc24d5ed22dd66fea3e4d73
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 04a4d75870949d91ea39621549ac1ec979fc9cd229efcb2cdc360709aa95c390948c282f112f2c68fd04d78b2416f74d9f20cce2f956423333ff86233d5fa500
|
7
|
+
data.tar.gz: 96095d2903f1ea83242241a151eb8366b0ab9c2d0743e699b0512eb6ae4d3fa42dd4839d2787c922538ff51012b21a4fecdce8546c17084355b1e9c2a12c9deb
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Adam Butler
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/Readme.md
ADDED
data/lib/riotjs-rails.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "riotjs-rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "riotjs-rails"
|
7
|
+
s.version = Riot::Rails::VERSION
|
8
|
+
s.authors = ["Adam Butler"]
|
9
|
+
s.email = ["adam@lab.io"]
|
10
|
+
s.homepage = "https://github.com/adambutler/riotjs-rails"
|
11
|
+
s.summary = %q{riot.js asset pipeline provider/wrapper}
|
12
|
+
s.description = "A simple asset-pipeline wrapper for riot.js by moot"
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.rubyforge_project = "riotjs-rails"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Riot.js 0.9.0 | moot.it/riotjs
|
4
|
+
|
5
|
+
(c) 2013 Tero Piirainen, Moot Inc
|
6
|
+
|
7
|
+
@license: MIT
|
8
|
+
|
9
|
+
*/
|
10
|
+
(function($, win) {
|
11
|
+
|
12
|
+
// Precompiled templates (JavaScript functions)
|
13
|
+
var FN = {},
|
14
|
+
slice = [].slice;
|
15
|
+
|
16
|
+
|
17
|
+
// Render a template with data
|
18
|
+
$.render = function(template, data) {
|
19
|
+
return (FN[template] = FN[template] || Function("_", "return '" +
|
20
|
+
$.trim(template).replace(/\n/g, "\\n").replace(/\{([^\}]+)\}/g, "'+_.$1+'") + "'")
|
21
|
+
)(data);
|
22
|
+
}
|
23
|
+
|
24
|
+
// A convenience render method to return a jQuery element
|
25
|
+
$.el = function(template, data) {
|
26
|
+
return $($.render(template, data));
|
27
|
+
}
|
28
|
+
|
29
|
+
// A classic pattern for separating concerns
|
30
|
+
$.observable = function(obj) {
|
31
|
+
var jq = $({});
|
32
|
+
|
33
|
+
$.each(['on', 'one', 'emit', 'off'], function(i, name) {
|
34
|
+
obj[name] = function(names, fn) {
|
35
|
+
|
36
|
+
if (i < 2) {
|
37
|
+
jq[name](names, function(e) {
|
38
|
+
var args = slice.call(arguments, 1)
|
39
|
+
if (names.split(" ")[1]) args.unshift(e.type)
|
40
|
+
fn.apply(obj, args)
|
41
|
+
})
|
42
|
+
|
43
|
+
} else if (i == 2) {
|
44
|
+
jq.trigger(names, slice.call(arguments, 1));
|
45
|
+
|
46
|
+
} else {
|
47
|
+
jq.off(names, fn);
|
48
|
+
}
|
49
|
+
|
50
|
+
return obj;
|
51
|
+
}
|
52
|
+
})
|
53
|
+
|
54
|
+
return obj;
|
55
|
+
}
|
56
|
+
|
57
|
+
// jQueried window object
|
58
|
+
win = $(win);
|
59
|
+
|
60
|
+
// emit window.popstate event consistently on page load, on every browser
|
61
|
+
var page_popped;
|
62
|
+
|
63
|
+
win.on("load", function(e) {
|
64
|
+
setTimeout(function() {
|
65
|
+
if (!page_popped) win.trigger("popstate")
|
66
|
+
}, 1);
|
67
|
+
|
68
|
+
}).on("popstate", function(e) {
|
69
|
+
if (!page_popped) page_popped = true;
|
70
|
+
|
71
|
+
})
|
72
|
+
|
73
|
+
// Change the browser URL or listen to changes on the URL
|
74
|
+
$.route = function(to) {
|
75
|
+
|
76
|
+
// listen
|
77
|
+
if ($.isFunction(to)) {
|
78
|
+
win.on("popstate", function(e, hash) {
|
79
|
+
to(hash || location.hash)
|
80
|
+
})
|
81
|
+
|
82
|
+
// fire
|
83
|
+
} else if (to != location.hash) {
|
84
|
+
if (history.pushState) history.pushState("", "", to)
|
85
|
+
win.trigger("popstate", [to]);
|
86
|
+
}
|
87
|
+
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
})(jQuery, window)
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: riotjs-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Butler
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple asset-pipeline wrapper for riot.js by moot
|
14
|
+
email:
|
15
|
+
- adam@lab.io
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- Gemfile
|
22
|
+
- LICENSE.md
|
23
|
+
- Rakefile
|
24
|
+
- Readme.md
|
25
|
+
- lib/riotjs-rails.rb
|
26
|
+
- lib/riotjs-rails/version.rb
|
27
|
+
- riotjs-rails.gemspec
|
28
|
+
- vendor/assets/javascripts/riot.js
|
29
|
+
homepage: https://github.com/adambutler/riotjs-rails
|
30
|
+
licenses:
|
31
|
+
- MIT
|
32
|
+
metadata: {}
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
requirements: []
|
48
|
+
rubyforge_project: riotjs-rails
|
49
|
+
rubygems_version: 2.0.3
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: riot.js asset pipeline provider/wrapper
|
53
|
+
test_files: []
|