darkhelmet-darkext 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.8.3 2009-2-23
2
+
3
+ * Fix up sinatra stuff to be extensions
4
+ * Don't include sinatra stuff by default. you must require explicitly.
5
+
1
6
  == 0.8.2 2009-2-21
2
7
 
3
8
  * Okay the one needed to be there...
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 8
3
- :patch: 2
3
+ :patch: 3
4
4
  :major: 0
@@ -1,6 +1,8 @@
1
- module Darkext
2
- module Sinatra
3
- module Helpers
1
+ require 'sinatra/base'
2
+
3
+ module Sinatra
4
+ module DarkHelpers
5
+ module HelperMethods
4
6
  def view(view, options = {})
5
7
  html = haml(view,options)
6
8
  flash.clear
@@ -13,11 +15,11 @@ module Darkext
13
15
  end
14
16
 
15
17
  def css_link_tag(sheet, media = 'screen,projection')
16
- partial("%link{ :type => 'text/css', :href => '/stylesheets/#{sheet}.css', :rel => 'stylesheet', :media => '#{media}' }")
18
+ partial("%link{ :type => 'text/css', :href => 'stylesheets/#{sheet}.css', :rel => 'stylesheet', :media => '#{media}' }")
17
19
  end
18
20
 
19
21
  def js_script_tag(script)
20
- partial("%script{ :type => 'text/javascript', :src => '/javascripts/#{script}.js' }")
22
+ partial("%script{ :type => 'text/javascript', :src => 'javascripts/#{script}.js' }")
21
23
  end
22
24
 
23
25
  def js_tag(script)
@@ -35,7 +37,7 @@ module Darkext
35
37
  end
36
38
 
37
39
  def host
38
- port = request.env['SERVER_PORT']
40
+ port = request.env['SERVER_PORT'].to_i
39
41
  port = port == 80 ? "" : ":#{port}"
40
42
  "#{protocol}://#{server_name}#{port}"
41
43
  end
@@ -56,5 +58,11 @@ module Darkext
56
58
  "#{host}#{options.site_base}"
57
59
  end
58
60
  end
61
+
62
+ def self.registered(app)
63
+ app.helpers HelperMethods
64
+ end
59
65
  end
66
+
67
+ register DarkHelpers
60
68
  end
data/lib/darkext.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
- Dir[File.join(File.join(File.dirname(__FILE__), 'darkext'), '*.rb')].sort.each { |lib| require lib }
4
+ Dir[File.join(File.join(File.dirname(__FILE__), 'darkext'), '*.rb')].sort.each do |lib|
5
+ require lib unless lib.include?('sinatra') # don't include sinatra stuff by defaults
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkhelmet-darkext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Huckstep
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-21 00:00:00 -08:00
12
+ date: 2009-02-23 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15