Permalink
Browse files

added MoreHelpers extension

  • Loading branch information...
1 parent e2018be commit b3e25da4e1461d6f73f0c2480ab25e749ebf6559 @rkh committed Dec 6, 2009
Showing with 34 additions and 3 deletions.
  1. +4 −0 README.rdoc
  2. +2 −2 big_band.gemspec
  3. +1 −1 lib/big_band.rb
  4. +27 −0 lib/big_band/more_helpers.rb
View
@@ -128,6 +128,10 @@ get_compass again.
Adds more servers to Sinatra::Base#run! (currently unicorn and rainbows).
+=== MoreHelpers
+
+Adds more helper methods (coming soon).
+
=== Sass
BigBand::Sass extends SassScript with more functions like min or max.
View
@@ -1,8 +1,8 @@
SPEC = Gem::Specification.new do |s|
s.name = "big_band"
- s.version = "0.1.1"
- s.date = "2009-12-05"
+ s.version = "0.1.2"
+ s.date = "2009-12-06"
s.author = "Konstantin Haase"
s.email = "konstantin.mailinglists@googlemail.com"
s.homepage = "http://github.com/rkh/big_band"
View
@@ -180,7 +180,7 @@ def self.default_extensions(*extensions)
@default_extensions = [@nonenv_extensions, @env_extensions].flatten
end
- default_extensions :AdvancedRoutes, :BasicExtensions, :Compass, :MoreServer, :Sass,
+ default_extensions :AdvancedRoutes, :BasicExtensions, :Compass, :MoreServer, :MoreHelpers, :Sass,
:development => [:Reloader, :WebInspector]
end
@@ -0,0 +1,27 @@
+require "haml"
+require "big_band/integration" # so this is usable without sinatra
+
+class BigBand < Sinatra::Base
+
+ # Adds more helper methods (coming soon).
+ module MoreHelpers
+
+ module InstanceMethods
+ include Haml::Helpers
+
+ private
+
+ def haml_helper(&block)
+ return capture_haml(&block) unless is_haml?
+ yield
+ end
+
+ end
+
+ def self.registered(klass)
+ # Just in case #helpers does more magic some day.
+ klass.helpers InstanceMethods
+ end
+
+ end
+end

0 comments on commit b3e25da

Please sign in to comment.