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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ca039ed24cf2290a693a3114f6c814394126950
4
- data.tar.gz: c3b20c6c65d8fedc44bb81e2416ee8a80ab7dd49
3
+ metadata.gz: 4ca7d3b849626bd7477fd623f803efef91abf3a8
4
+ data.tar.gz: a448481684afb1dad860df02c8aac6f8419c9254
5
5
  SHA512:
6
- metadata.gz: d9498a71459b3944f2054b5636ba09f7f7c3c0436697dbccb822849c8af7b3e65c977594bd2731d2b151c5596cfa189de440b993888379033e6383b303bf6828
7
- data.tar.gz: 6371c78a68ff96cd6f376e20d05832fb97f6659e28e47b48258fe1e92fe27e46808a7165e3785c63716427d1d1f4cb7ba34353eb1347cd67de3fa22ffc63bfbd
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
- [500, global_headers, [{:status => 'internal-server-error'}.to_json]]
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Moonrope
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
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.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-22 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json