ramen-rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ramen-rails/ramen_after_filter.rb +7 -0
- data/lib/ramen-rails/version.rb +1 -1
- data/spec/lib/ramen_after_filter_spec.rb +21 -4
- 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: 75812823bdafd977f5b705436041811fdc3c52f6
|
4
|
+
data.tar.gz: 291339958c984c2ddf12ba64c67a7a4a41f2745e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 176508cd313e9512f0ecb12ae171f488964576dc528f48dacf9c0144c15d3f8fe4ab5da8d80d914a21f183c64d442f8a5112317f641acee14e94fb4f8a739ef0
|
7
|
+
data.tar.gz: 2a880d453aa10b4cfc843133eb6658218d9c166611605dc3a207d318b55807722e2d24073f8362f9de37df0578df022dfa58cd5913e4d88e869e30c04807148d
|
@@ -161,6 +161,13 @@ module RamenRails
|
|
161
161
|
obj[:custom_links] = ramen_custom_links if ramen_custom_links.present?
|
162
162
|
|
163
163
|
super(obj, organization_secret: ramen_org_secret)
|
164
|
+
|
165
|
+
rescue InvalidUserObject => e
|
166
|
+
::Rails.logger.debug "InvalidUserObject exception. Not rendering Ramen script tag. Error details: #{e.inspect}"
|
167
|
+
"<!-- Exception in ramen script tag. See logs. -->"
|
168
|
+
rescue => e
|
169
|
+
::Rails.logger.debug "Exception in ramen-rails script tag method. Not rendering Ramen script tag. Error details: #{e.inspect}"
|
170
|
+
"<!-- Exception in ramen script tag. See logs. -->"
|
164
171
|
end
|
165
172
|
|
166
173
|
end
|
data/lib/ramen-rails/version.rb
CHANGED
@@ -13,6 +13,24 @@ describe 'After filter' do
|
|
13
13
|
body: "<html><body>hi</body>"
|
14
14
|
}
|
15
15
|
})
|
16
|
+
|
17
|
+
module Rails
|
18
|
+
class LogProxy
|
19
|
+
def debug(msg)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.env
|
24
|
+
Hashie::Mash.new({
|
25
|
+
:development? => nil,
|
26
|
+
:production? => nil
|
27
|
+
})
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.logger
|
31
|
+
LogProxy.new
|
32
|
+
end
|
33
|
+
end
|
16
34
|
end
|
17
35
|
|
18
36
|
describe "with no config" do
|
@@ -45,10 +63,9 @@ describe 'After filter' do
|
|
45
63
|
@dummy.current_user = {email: 'ryan@ramen.is', id: 'person-1234'}
|
46
64
|
end
|
47
65
|
|
48
|
-
it "should
|
49
|
-
|
50
|
-
|
51
|
-
end.to raise_error(RamenRails::RamenAfterFilter::InvalidUserObject)
|
66
|
+
it "should render a comment erro" do
|
67
|
+
RamenRails::RamenAfterFilter.filter(@dummy)
|
68
|
+
expect(@dummy.response.body).to include("See logs")
|
52
69
|
end
|
53
70
|
end
|
54
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ramen-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Angilly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|