javascripto-rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -1
- data/Rakefile +7 -0
- data/javascripto-rails.gemspec +1 -1
- data/lib/javascripto-rails/javascripto_helpers.rb +28 -4
- data/lib/javascripto-rails/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
1
|
Javascripto Rails
|
2
2
|
=================
|
3
|
-
Rails plugin gem for Javascripto Client-side Application Framework.
|
3
|
+
Rails 3 plugin gem for Javascripto Client-side Application Framework.
|
4
|
+
|
5
|
+
Installation
|
6
|
+
-------------
|
7
|
+
|
8
|
+
In your rails application's gem file, add the following and run bundle install.
|
9
|
+
|
10
|
+
gem 'javascripto-rails'
|
11
|
+
|
12
|
+
Add a call to javascripto_include to the head of your application layout.
|
13
|
+
|
14
|
+
haml
|
15
|
+
|
16
|
+
= javascripto_rails
|
17
|
+
|
18
|
+
erb
|
19
|
+
|
20
|
+
<%= javascripto_rails %>
|
21
|
+
|
22
|
+
|
23
|
+
|
data/Rakefile
CHANGED
data/javascripto-rails.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Blake Taylor"]
|
10
10
|
s.email = ["btaylor@agoragames.com"]
|
11
|
-
s.homepage = "http://
|
11
|
+
s.homepage = "http://javascripto.org"
|
12
12
|
s.summary = %q{Rails plugin gem for Javascripto Client-side Application Framework.}
|
13
13
|
# s.description = %q{TODO: Write a gem description}
|
14
14
|
|
@@ -17,10 +17,6 @@ module Javascripto
|
|
17
17
|
add_files(*files)
|
18
18
|
end
|
19
19
|
|
20
|
-
# Call To include require app_modules files.
|
21
|
-
def require_app_modules
|
22
|
-
add_files(*app_modules.map{ |app_module| "app/#{app_module}" })
|
23
|
-
end
|
24
20
|
|
25
21
|
# All Required Packages.
|
26
22
|
def required_packages
|
@@ -32,11 +28,39 @@ module Javascripto
|
|
32
28
|
@app_modules ||= []
|
33
29
|
end
|
34
30
|
|
31
|
+
def javascripto_include
|
32
|
+
|
33
|
+
# Require App Modules
|
34
|
+
add_files(*app_modules.map{ |app_module| "app/#{app_module}" })
|
35
|
+
|
36
|
+
content = []
|
37
|
+
|
38
|
+
# Render Packages
|
39
|
+
if required_packages.any?
|
40
|
+
required_packages.each do |package|
|
41
|
+
if package.cache
|
42
|
+
content << javascript_include_tag(package.package_files.map{ |file| file.resource_path }, :cache => package.package_name)
|
43
|
+
else
|
44
|
+
content << javascript_include_tag(package.package_files.map{ |file| file.resource_path })
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Render Initializers
|
50
|
+
if app_modules.any?
|
51
|
+
content << content_tag('script', (app_modules.map{ |m| "\n $(app.#{m});" } << "\n").join(),'type' => Mime::JS)
|
52
|
+
end
|
53
|
+
|
54
|
+
content.join("\n").html_safe
|
55
|
+
end
|
56
|
+
|
57
|
+
|
35
58
|
private
|
36
59
|
|
37
60
|
def add_files(*files)
|
38
61
|
required_packages.add_files(*files)
|
39
62
|
end
|
63
|
+
|
40
64
|
end
|
41
65
|
end
|
42
66
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Blake Taylor
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-20 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- lib/javascripto-rails/javascripto_helpers.rb
|
52
52
|
- lib/javascripto-rails/version.rb
|
53
53
|
has_rdoc: true
|
54
|
-
homepage: http://
|
54
|
+
homepage: http://javascripto.org
|
55
55
|
licenses: []
|
56
56
|
|
57
57
|
post_install_message:
|