moonrope 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/moonrope/base.rb +4 -0
- data/lib/moonrope/rack_middleware.rb +11 -1
- data/lib/moonrope/railtie.rb +3 -0
- data/lib/moonrope/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ca7d3b849626bd7477fd623f803efef91abf3a8
|
4
|
+
data.tar.gz: a448481684afb1dad860df02c8aac6f8419c9254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4eaaf33ce1636336e0d3f4ab4a600dba3d73e63e1e46c8b420c3f576675ce7349b869805f6de11a8392cb4cd992755671a038da03cf8a88a4a8bcdb0645387f
|
7
|
+
data.tar.gz: d0f623ea767e7a2e5efdb52c8dd531ebf6e2a1170d42d1833443fb49d98034fa7a8d2f9a074759b3708e8750e4786a669b29bbe51123e9610e5262b462a1088b
|
data/lib/moonrope/base.rb
CHANGED
@@ -35,6 +35,9 @@ module Moonrope
|
|
35
35
|
# @return [String] the directory the base was loaded from (if relevant)
|
36
36
|
attr_accessor :loaded_from
|
37
37
|
|
38
|
+
# @return [String] the moonrope environment
|
39
|
+
attr_accessor :environment
|
40
|
+
|
38
41
|
#
|
39
42
|
# Initialize a new instance of the Moonrope::Base
|
40
43
|
#
|
@@ -42,6 +45,7 @@ module Moonrope
|
|
42
45
|
#
|
43
46
|
def initialize(&block)
|
44
47
|
unload
|
48
|
+
@environment = 'development'
|
45
49
|
@dsl = Moonrope::DSL::BaseDSL.new(self)
|
46
50
|
@dsl.instance_eval(&block) if block_given?
|
47
51
|
end
|
@@ -57,7 +57,17 @@ module Moonrope
|
|
57
57
|
Moonrope.logger.info e.class
|
58
58
|
Moonrope.logger.info e.message
|
59
59
|
Moonrope.logger.info e.backtrace.join("\n")
|
60
|
-
|
60
|
+
|
61
|
+
response = {:status => 'internal-server-error'}
|
62
|
+
|
63
|
+
# If in development, return more details about the exception which was raised.
|
64
|
+
if @base.environment == 'development'
|
65
|
+
response[:error] = e.class.to_s
|
66
|
+
response[:message] = e.message
|
67
|
+
response[:backtrace] = e.backtrace[0,6]
|
68
|
+
end
|
69
|
+
|
70
|
+
[500, global_headers, [response.to_json]]
|
61
71
|
end
|
62
72
|
|
63
73
|
else
|
data/lib/moonrope/railtie.rb
CHANGED
@@ -15,6 +15,9 @@ module Moonrope
|
|
15
15
|
|
16
16
|
# Set the logger
|
17
17
|
Moonrope.logger = Rails.logger
|
18
|
+
|
19
|
+
# Set the environment to match the Rails environment
|
20
|
+
app.config.moonrope.environment = Rails.env.to_s
|
18
21
|
|
19
22
|
# Set the request regex if one has been set
|
20
23
|
if app.config.respond_to?(:moonrope_request_path_regex) && app.config.moonrope_request_path_regex.is_a?(Regexp)
|
data/lib/moonrope/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moonrope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|