midas-guilded 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/guilded.gemspec +1 -1
- data/lib/guilded.rb +1 -1
- data/lib/guilded/guilder.rb +12 -15
- metadata +1 -1
data/README.rdoc
CHANGED
data/guilded.gemspec
CHANGED
data/lib/guilded.rb
CHANGED
@@ -68,7 +68,7 @@ require 'guilded/rails/view_helpers'
|
|
68
68
|
# <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
|
69
69
|
#
|
70
70
|
module Guilded
|
71
|
-
VERSION = '0.0.
|
71
|
+
VERSION = '0.0.7'
|
72
72
|
end
|
73
73
|
|
74
74
|
ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
|
data/lib/guilded/guilder.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'digest'
|
2
2
|
require 'singleton'
|
3
|
+
require 'guilded/exceptions'
|
3
4
|
|
4
5
|
module Guilded
|
5
6
|
|
@@ -25,7 +26,7 @@ module Guilded
|
|
25
26
|
|
26
27
|
attr_reader :initialized_at
|
27
28
|
|
28
|
-
def initialize
|
29
|
+
def initialize #:nodoc:
|
29
30
|
if defined?( GUILDED_CONFIG )
|
30
31
|
configure_guilded
|
31
32
|
else
|
@@ -178,7 +179,8 @@ module Guilded
|
|
178
179
|
#
|
179
180
|
def init_sources #:nodoc:
|
180
181
|
@combined_css_srcs << "#{@reset_css}" unless @reset_css.nil? || @reset_css.empty?
|
181
|
-
|
182
|
+
#@combined_js_srcs << "#{@jquery_js}" << "#{@js_folder}#{@guilded_js}"
|
183
|
+
resolve_js_libs( "#{@jquery_js}", "#{@js_folder}#{@guilded_js}" )
|
182
184
|
end
|
183
185
|
|
184
186
|
# Combines all JavaScript and CSS files into lists to include based on what Guilded components are on
|
@@ -207,7 +209,7 @@ module Guilded
|
|
207
209
|
# a jQuery plugin, etc.
|
208
210
|
#
|
209
211
|
def combine_js_sources( component, libs=[] ) #:nodoc:
|
210
|
-
resolve_js_libs( libs )
|
212
|
+
resolve_js_libs( *libs )
|
211
213
|
|
212
214
|
comp_src = add_guilded_js_path( component )
|
213
215
|
@combined_js_srcs.push( comp_src ) unless @combined_js_srcs.include?( comp_src )
|
@@ -219,7 +221,7 @@ module Guilded
|
|
219
221
|
# parts fo the name to try and get the debug version of the library. If it cannot
|
220
222
|
# find the debug version of the file, it will just remain what was initially provded.
|
221
223
|
#
|
222
|
-
def resolve_js_libs( libs ) #:nodoc:
|
224
|
+
def resolve_js_libs( *libs ) #:nodoc:
|
223
225
|
if development?
|
224
226
|
# Try to use an unpacked or unminimized version
|
225
227
|
libs.each do |lib|
|
@@ -253,19 +255,14 @@ module Guilded
|
|
253
255
|
part = "#{@js_folder}#{GUILDED_NS}#{source.to_s}"
|
254
256
|
ext = 'js'
|
255
257
|
|
256
|
-
return "#{part}.#{ext}"
|
258
|
+
return "#{part}.#{ext}" unless production?
|
257
259
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
"#{@js_path}#{part}.pack.#{ext}" => "#{part}.pack.#{ext}",
|
262
|
-
"#{@js_path}#{part}.min.#{ext}" => "#{part}.min.#{ext}",
|
263
|
-
"#{@js_path}#{part}.compressed.#{ext}" => "#{part}.compressed.#{ext}",
|
264
|
-
"#{@js_path}#{part}.#{ext}" => "#{part}.#{ext}"
|
265
|
-
}
|
260
|
+
possibles = [ "#{@js_path}#{part}.min.#{ext}", "#{@js_path}#{part}.pack.#{ext}", "#{@js_path}#{part}.compressed.#{ext}",
|
261
|
+
"#{@js_path}#{part}.#{ext}" ]
|
262
|
+
parts = [ "#{part}.min.#{ext}", "{part}.pack.#{ext}", "#{part}.compressed.#{ext}", "#{part}.#{ext}" ]
|
266
263
|
|
267
|
-
possibles.
|
268
|
-
return
|
264
|
+
possibles.each_with_index do |full_path, i|
|
265
|
+
return parts[i] if File.exists?( full_path )
|
269
266
|
end
|
270
267
|
|
271
268
|
"" # Should never reach here
|