Module: JRails
- Defined in:
- lib/jrails.rb,
lib/jrails/engine.rb
Defined Under Namespace
Modules: SelectorAssertions
Classes: Engine
Constant Summary
collapse
- JQUERY_VAR =
'jQuery'
- @@config =
{
:google => false,
:jquery_version => "1.7.2",
:jqueryui_version => "1.9.1",
:compressed => true
}
Class Method Summary
collapse
Class Method Details
.compressed? ⇒ Boolean
33
|
# File 'lib/jrails.rb', line 33
def self.compressed? ; @@config[:compressed] ; end
|
.config ⇒ Object
31
|
# File 'lib/jrails.rb', line 31
def self.config ; @@config ; end
|
.google? ⇒ Boolean
32
|
# File 'lib/jrails.rb', line 32
def self.google? ; @@config[:google] ; end
|
.jquery_path ⇒ Object
34
|
# File 'lib/jrails.rb', line 34
def self.jquery_path ; @@jquery_path ; end
|
.jqueryui_i18n_path ⇒ Object
36
|
# File 'lib/jrails.rb', line 36
def self.jqueryui_i18n_path ; @@jqueryui_i18n_path ; end
|
.jqueryui_path ⇒ Object
35
|
# File 'lib/jrails.rb', line 35
def self.jqueryui_path ; @@jqueryui_path ; end
|
.load_config ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/jrails.rb', line 14
def self.load_config
config_file = File.join("./", "config", "jrails.yml")
if File.exist? config_file
loaded_config = YAML.load_file(config_file)
if loaded_config and loaded_config.key? Rails.env
@@config.merge!(loaded_config[Rails.env].symbolize_keys)
if google?
@@jquery_path = "http://ajax.googleapis.com/ajax/libs/jquery/#{@@config[:jquery_version]}/jquery#{".min" if compressed?}.js"
@@jqueryui_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/#{@@config[:jqueryui_version]}/jquery-ui#{".min" if compressed?}.js"
@@jqueryui_i18n_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/#{@@config[:jqueryui_version]}/i18n/jquery-ui-i18n#{".min" if compressed?}.js"
end
else
raise Exception.new "Failed finding '#{Rails.env}' environment in config. check your 'config/jrails.yml' or delete that file "
end
end
end
|