glamping 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -166,7 +166,7 @@ module Glamping
166
166
  # sweep_page(Controller, "argument", 123)
167
167
  # sweep_page(:all)
168
168
  def sweep_page(*args)
169
- return FileUtils.rm_rf(PATH) if args.first == :all
169
+ return FileUtils.rm_rf(C.config.cache) if args.first == :all
170
170
  path, file = page_cache_path(R(*args))
171
171
  FileUtils.rm_rf Dir[file]
172
172
  end
@@ -522,7 +522,7 @@ module Glamping
522
522
  # Used by the web server to convert the current request to a string. If you need to
523
523
  # alter the way Glamping builds HTTP headers, consider overriding this method.
524
524
  def to_s
525
- "Status: #@status#{Z+(headers.map{|k,v|[*v].map{|x|[k,v]*": "}}*Z).gsub(Z*2,Z)+Z+Z}#@body"
525
+ "Status: #@status#{Z+(headers.inject([]){|a,o|[*o[1]].map{|x|a<<[o[0],v]*": "if v&&v.to_s.any?}}*Z)+Z+Z}#@body"
526
526
  end
527
527
  end
528
528
 
@@ -39,9 +39,14 @@
39
39
  # * The cache path will be set to <tt>public/cache/</tt> (See Glamping::Helpers::PageCaching)
40
40
  # * The view path will be set to <tt>app/views/</tt>.
41
41
  # * All files in <tt>public/</tt> will be served at /.
42
+ # * If you need to run code <em>after</em> the app has been initialize, but <em>before</em>
43
+ # the files are loaded, you can do that by using a block:
44
+ # Glamping.boot(binding) do
45
+ # puts "Do fancy stuff"
46
+ # end
42
47
  require 'glamping'
43
48
  Glamping.class_eval do
44
- BOOT = %q{
49
+ PRE = %q{
45
50
  root = ENV["GLAMPING_ROOT"] || File.dirname(File.expand_path(__FILE__))
46
51
  app_name = File.basename(__FILE__, ".rb").split('_').map{|word|word.capitalize}.join
47
52
  Glamping.goes(app_name)
@@ -51,7 +56,9 @@ Glamping.class_eval do
51
56
  app.config.cache = File.join(app.config.public, "cache")
52
57
 
53
58
  require 'glamping/db' if d=File.exists?(database_file = "config/database.yml")
54
-
59
+ }
60
+
61
+ POST = %q{
55
62
  (Dir["app/*/"] - ["app/views/"]).each do |mod_name|
56
63
  mod = app.const_get(File.basename(mod_name).capitalize)
57
64
  Dir[mod_name + "**/*.rb"].each do |file|
@@ -85,6 +92,8 @@ Glamping.class_eval do
85
92
  # Should always be called with <tt>binding</tt>.
86
93
  # Glamping.boot(binding)
87
94
  def self.boot(b)
88
- eval(BOOT,b)
95
+ eval(PRE,b)
96
+ yield if block_given?
97
+ eval(POST,b)
89
98
  end
90
99
  end
@@ -2,7 +2,7 @@ module Glamping #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glamping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Holm
@@ -30,7 +30,7 @@ cert_chain:
30
30
  pm5Kow==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2007-12-26 00:00:00 +01:00
33
+ date: 2008-01-07 00:00:00 +01:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file