elm-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 03d03b80441c84afa0a27ab7b73f5ac6c00cd214
4
+ data.tar.gz: a70b14851e5349b8525b0783a926dff3fffb18c2
5
+ SHA512:
6
+ metadata.gz: 64b1aec63a916a30fa2754a97c2c96f72089539691dfe5e2713f9bc4e88d7ff557955cb32fc4ab5e9d6bacca963de901c7a699fb0af796c14720419444029fe4
7
+ data.tar.gz: 331a1314e8ed0441a4057045f65439863a73b3a9c388c8d12d2d148c51906564574974fbc86cde5e495bf942034a1c918b7eb702202530f2571133d004a6ab09
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Frank Bonetti
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = ElmRails
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ <%= Elm::Compiler.compile(Dir.glob("app/assets/elm/**/*.elm")).html_safe %>
@@ -0,0 +1,21 @@
1
+ module ElmViewHelper
2
+
3
+ def elm_embed(module_name, args = {})
4
+ content_tag(:div) do
5
+ component_div + script_tag(module_name, args)
6
+ end
7
+ end
8
+
9
+ private
10
+
11
+ def component_div
12
+ content_tag(:div) {}
13
+ end
14
+
15
+ def script_tag(module_name, args)
16
+ content_tag(:script, type: "text/javascript") do
17
+ render(file: "elm/mount_script.js.erb", locals: { module_name: module_name, args: args })
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,29 @@
1
+ (function() {
2
+ var onLoad = function(func) {
3
+ if (window.attachEvent) {
4
+ window.attachEvent('onload', yourFunctionName);
5
+ } else {
6
+ if (window.onload) {
7
+ var curronload = window.onload;
8
+ var newonload = function(evt) {
9
+ curronload(evt);
10
+ func(evt);
11
+ };
12
+ window.onload = newonload;
13
+ } else {
14
+ window.onload = func;
15
+ }
16
+ }
17
+ };
18
+
19
+ var currentScript = document.currentScript || (function() {
20
+ var scripts = document.getElementsByTagName("script");
21
+ return scripts[scripts.length - 1];
22
+ })();
23
+
24
+ var embedDiv = currentScript.previousSibling;
25
+
26
+ onLoad(function() {
27
+ Elm.embed(<%= raw module_name %>, embedDiv, <%= raw args.to_json %>);
28
+ });
29
+ })();
@@ -0,0 +1,6 @@
1
+ module Elm
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Elm
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
data/lib/elm-rails.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'elm/rails/engine'
2
+ require 'elm/rails/version'
3
+ require 'elm-compiler'
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elm-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Frank Bonetti
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: elm-compiler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.1
41
+ description: Description of ElmRails.
42
+ email:
43
+ - frank.r.bonetti@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.rdoc
50
+ - Rakefile
51
+ - app/assets/javascripts/elm_components.js.erb
52
+ - app/helpers/elm_view_helper.rb
53
+ - app/views/elm/mount_script.js.erb
54
+ - lib/elm-rails.rb
55
+ - lib/elm/rails/engine.rb
56
+ - lib/elm/rails/version.rb
57
+ homepage: https://github.com/fbonetti/elm-rails
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.4.5.1
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Summary of ElmRails.
81
+ test_files: []