gin 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.0.1 / 2013-03-07
2
+
3
+ * Minor Enhancements
4
+ * Print halts to logger in development mode
5
+
1
6
  === 1.0.0 / 2013-03-07
2
7
 
3
8
  * Birthday!
data/lib/gin.rb CHANGED
@@ -5,7 +5,7 @@ require 'rack-protection'
5
5
 
6
6
 
7
7
  class Gin
8
- VERSION = '1.0.0'
8
+ VERSION = '1.0.1'
9
9
 
10
10
  LIB_DIR = File.expand_path("..", __FILE__) #:nodoc:
11
11
  PUBLIC_DIR = File.expand_path("../../public/", __FILE__) #:nodoc:
@@ -139,6 +139,11 @@ class Gin::Controller
139
139
  # halt 302, {'Location' => 'http://example.com'}, "You are being redirected"
140
140
 
141
141
  def halt *resp
142
+ if @app.development?
143
+ line = caller.find{|l| !l.start_with?(Gin::LIB_DIR) && !l.include?("/ruby/gems/")}
144
+ logger << "[HALT] #{line}\n" if line
145
+ end
146
+
142
147
  resp = resp.first if resp.length == 1
143
148
  throw :halt, resp
144
149
  end
@@ -69,7 +69,7 @@ class ControllerTest < Test::Unit::TestCase
69
69
  def setup
70
70
  MockApp.instance_variable_set("@environment", nil)
71
71
  MockApp.instance_variable_set("@asset_host", nil)
72
- @app = MockApp.new
72
+ @app = MockApp.new Logger.new(StringIO.new)
73
73
  @ctrl = BarController.new(@app, rack_env)
74
74
  end
75
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: -1476992371774914405
153
+ hash: 1873485601668633173
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  none: false
156
156
  requirements: