midas-guilded 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,6 @@ Manifest.txt
3
3
  PostInstall.txt
4
4
  README.rdoc
5
5
  Rakefile
6
- init.rb
7
6
  lib/guilded.rb
8
7
  lib/guilded/base.rb
9
8
  lib/guilded/component_def.rb
@@ -9,4 +9,6 @@ require 'guilded/rails/view_helpers'
9
9
 
10
10
  module Guilded
11
11
  VERSION = '0.0.1'
12
- end
12
+ end
13
+
14
+ ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
@@ -68,6 +68,7 @@ module Guilded
68
68
  @combined_css_srcs.each { |css| to_init << "<link href=\"/stylesheets/#{css}\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />" }
69
69
  @combined_js_srcs.each { |js| to_init << "<script type=\"text/javascript\" src=\"/javascripts/#{js}\"></script>" }
70
70
  to_init << generate_javascript_init
71
+ reset!
71
72
  end
72
73
 
73
74
  # Writes an initialization method that calls each Guilded components initialization method. This
@@ -77,9 +78,9 @@ module Guilded
77
78
  code = "<script type=\"text/javascript\">"
78
79
  code << "var initGuildedElements = function(){"
79
80
  @g_elements.each_value do |guilded_def|
80
- to_init << "g.#{guilded_def.kind.to_s.camelize( :lower )}Init( #{guilded_def.options.to_json} );" unless guilded_def.exclude_js?
81
+ code << "g.#{guilded_def.kind.to_s.camelize( :lower )}Init( #{guilded_def.options.to_json} );" unless guilded_def.exclude_js?
81
82
  end
82
- to_init << "};jQuery('document').ready( initGuildedElements );</script>"
83
+ code << "};jQuery('document').ready( initGuildedElements );</script>"
83
84
  end
84
85
 
85
86
  def js_cache_name
@@ -202,6 +203,8 @@ module Guilded
202
203
  possibles.each do |full_path, part_path|
203
204
  return part_path if File.exists?( full_path )
204
205
  end
206
+
207
+ "#{part}.#{ext}"
205
208
  end
206
209
 
207
210
  def combine_css_sources( component, skin, styles=[] ) #:doc:
@@ -15,6 +15,8 @@ module Guilded
15
15
  html = stylesheet_link_tag( g.combined_css_srcs, :cache => "cache/#{g.css_cache_name}" )
16
16
  html << javascript_include_tag( g.combined_js_srcs, :cache => "cache/#{g.js_cache_name}" )
17
17
  html << g.generate_javascript_init
18
+ g.reset!
19
+ html
18
20
  end
19
21
 
20
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-guilded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - midas
@@ -50,7 +50,6 @@ files:
50
50
  - PostInstall.txt
51
51
  - README.rdoc
52
52
  - Rakefile
53
- - init.rb
54
53
  - lib/guilded.rb
55
54
  - lib/guilded/base.rb
56
55
  - lib/guilded/component_def.rb
data/init.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'guilded'
2
-
3
- ActionView::Base.send( :include, Guilded::Rails::ViewHelpers )