midas-guilded 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -79,7 +79,7 @@ The Guilded-Base gem contains the framework to build Guilded components.
79
79
 
80
80
  Add to environment file:
81
81
 
82
- config.gem "guilded", :version => '0.0.5'
82
+ config.gem "guilded", :version => '0.0.7'
83
83
 
84
84
  Run:
85
85
 
data/guilded.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{guilded}
5
- s.version = "0.0.6"
5
+ s.version = "0.0.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["C. Jason Harrelson (midas)"]
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.6'
71
+ VERSION = '0.0.7'
72
72
  end
73
73
 
74
74
  ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
@@ -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( options={} ) #:nodoc:
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
- @combined_js_srcs << "#{@jquery_js}" << "#{@js_folder}#{@guilded_js}"
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}" if development?
258
+ return "#{part}.#{ext}" unless production?
257
259
 
258
- #TODO: switch this to take min, pack or compressed out if in development mode for efficiency in production
259
-
260
- possibles = {
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.each do |full_path, part_path|
268
- return part_path if File.exists?( full_path )
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
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)