javascripto-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/README.md +3 -0
- data/Rakefile +2 -0
- data/javascripto-rails.gemspec +23 -0
- data/lib/javascripto-rails/javascripto_helpers.rb +47 -0
- data/lib/javascripto-rails/version.rb +5 -0
- data/lib/javascripto-rails.rb +36 -0
- metadata +86 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "javascripto-rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "javascripto-rails"
|
7
|
+
s.version = Javascripto::Rails::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Blake Taylor"]
|
10
|
+
s.email = ["btaylor@agoragames.com"]
|
11
|
+
s.homepage = "http://rubygems.org/gems/javascripto_rails"
|
12
|
+
s.summary = %q{Rails plugin gem for Javascripto Client-side Application Framework.}
|
13
|
+
# s.description = %q{TODO: Write a gem description}
|
14
|
+
|
15
|
+
s.rubyforge_project = "javascripto-rails"
|
16
|
+
|
17
|
+
s.add_runtime_dependency "javascripto", ">= 0.0.1"
|
18
|
+
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'javascripto'
|
2
|
+
|
3
|
+
module Javascripto
|
4
|
+
module Rails
|
5
|
+
module JavascriptoHelper
|
6
|
+
|
7
|
+
# Register ui componenets for intialization and ensure requires files
|
8
|
+
# are included in packages delievered to client.
|
9
|
+
def app(*app_modules)
|
10
|
+
self.app_modules.push *app_modules
|
11
|
+
self.app_modules.compact!
|
12
|
+
self.app_modules.uniq!
|
13
|
+
end
|
14
|
+
|
15
|
+
# Include files to be loaded directly.
|
16
|
+
def javascript(*files)
|
17
|
+
add_files(*files)
|
18
|
+
end
|
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
|
+
|
25
|
+
# All Required Packages.
|
26
|
+
def required_packages
|
27
|
+
@required_packages ||= Javascripto::RequiredPackages.new
|
28
|
+
end
|
29
|
+
|
30
|
+
# App modules that need to be invoked.
|
31
|
+
def app_modules
|
32
|
+
@app_modules ||= []
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def add_files(*files)
|
38
|
+
required_packages.add_files(*files)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
module ApplicationHelper
|
45
|
+
include Javascripto::Rails::JavascriptoHelper
|
46
|
+
end
|
47
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'javascripto/file'
|
2
|
+
require 'javascripto-rails/javascripto_helpers'
|
3
|
+
|
4
|
+
module Javascripto
|
5
|
+
module Rails
|
6
|
+
class Railtie < ::Rails::Railtie
|
7
|
+
config.before_configuration do
|
8
|
+
module ::Javascripto
|
9
|
+
|
10
|
+
@@config = YAML.load_file(::Rails.root.join('config/javascripto.yml'))
|
11
|
+
|
12
|
+
Javascripto::File.js_root = ::Rails.root.join('public/javascripts')
|
13
|
+
|
14
|
+
package_config = @@config['packages'] || []
|
15
|
+
# Auto require config in the first packages, if there is no package, create one with
|
16
|
+
# just config. This will have the effect of making sure anything referenced in this file is
|
17
|
+
# auto packaged in the first package as well as ensuring that config is always packaged first.
|
18
|
+
|
19
|
+
if package_config.first
|
20
|
+
package_config.first.each_value do |value|
|
21
|
+
value.unshift 'config'
|
22
|
+
end
|
23
|
+
else
|
24
|
+
package_config << {'defaults' => ['config']}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Build Packages
|
28
|
+
package_config.each do |config|
|
29
|
+
name, files = config.first.to_a
|
30
|
+
Package.new(name, files.map{ |file| File.get_file(file) })
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: javascripto-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Blake Taylor
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-01-17 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: javascripto
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
- 1
|
32
|
+
version: 0.0.1
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description:
|
36
|
+
email:
|
37
|
+
- btaylor@agoragames.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- .gitignore
|
46
|
+
- Gemfile
|
47
|
+
- README.md
|
48
|
+
- Rakefile
|
49
|
+
- javascripto-rails.gemspec
|
50
|
+
- lib/javascripto-rails.rb
|
51
|
+
- lib/javascripto-rails/javascripto_helpers.rb
|
52
|
+
- lib/javascripto-rails/version.rb
|
53
|
+
has_rdoc: true
|
54
|
+
homepage: http://rubygems.org/gems/javascripto_rails
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
requirements: []
|
79
|
+
|
80
|
+
rubyforge_project: javascripto-rails
|
81
|
+
rubygems_version: 1.3.7
|
82
|
+
signing_key:
|
83
|
+
specification_version: 3
|
84
|
+
summary: Rails plugin gem for Javascripto Client-side Application Framework.
|
85
|
+
test_files: []
|
86
|
+
|