mack-javascript 0.7.1.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,15 +6,15 @@
6
6
  class JavascriptGenerator < Genosaurus
7
7
 
8
8
  def setup
9
- error = %{ 'js_framework' is not specified in your app_config/default.yml file.
10
- To fix this error, please open your {PROJ}/config/app_config/default.yml file, then uncomment
9
+ error = %{ 'js_framework' is not specified in your configatron/default.rb file.
10
+ To fix this error, please open your {PROJ}/config/configatron/default.rb file, then uncomment
11
11
  the line that says "# js_framework: jquery" (or prototype, if you specified prototype as the js framework).
12
12
  Once you have uncomment that line, please re-run 'rake generate:javascript' again. Thanks!}
13
- raise error unless app_config.mack.js_framework
13
+ raise error if configatron.mack.js_framework.nil?
14
14
  end
15
15
 
16
16
  def js_framework # :nodoc:
17
- app_config.mack.js_framework
17
+ configatron.mack.js_framework
18
18
  end
19
19
 
20
20
  end
@@ -1,4 +1,4 @@
1
- <% case app_config.mack.js_framework -%>
1
+ <% case configatron.mack.js_framework -%>
2
2
  <% when 'prototype' -%>
3
3
  <% ["controls.js", "dragdrop.js", "effects.js", "prototype.js"].each do |f| -%>
4
4
  <%= f %>_javascript_file:
@@ -51,7 +51,7 @@ module Mack
51
51
 
52
52
  private
53
53
  def framework_name
54
- @@framework_name ||= app_config.mack.js_framework.camelcase
54
+ @@framework_name ||= configatron.mack.js_framework.camelcase
55
55
  end
56
56
  end
57
57
 
@@ -19,4 +19,19 @@ end
19
19
  dir_globs = Dir.glob(File.join(fl, "view_helpers", "**/*.rb"))
20
20
  dir_globs.each do |d|
21
21
  require d
22
+ end
23
+
24
+ if configatron.mack.js_framework
25
+ case configatron.mack.js_framework.to_s
26
+ when 'prototype'
27
+ file_list = ["controls.js", "dragdrop.js", "effects.js", "prototype.js"]
28
+ when 'jquery'
29
+ file_list = ["jquery.js", "jquery-ui.js", "jquery-fx.js"]
30
+ end
31
+
32
+ file_list.each do |file|
33
+ assets_mgr.defaults do |a|
34
+ a.add_js file
35
+ end
36
+ end
22
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mack-javascript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerardo Pis-Lopez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-14 00:00:00 -04:00
12
+ date: 2008-10-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements: []
74
74
 
75
75
  rubyforge_project: magrathea
76
- rubygems_version: 1.2.0
76
+ rubygems_version: 1.3.0
77
77
  signing_key:
78
78
  specification_version: 2
79
79
  summary: JavaScript in Mack