Skip to content

Commit 847a63d

Browse files
committed
Remove RABL dependency [Issue 19]
gazay#19
1 parent 155950f commit 847a63d

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ alert(customNamespace.yourHash)
126126
Now you can write your variables assign logic to templates with [Rabl](https://github.com/nesquena/rabl).
127127
The way of writing Rabl templates is very clearly described in their repo.
128128

129+
Add Rabl to your Gemfile
130+
131+
`Gemfile`
132+
133+
``` ruby
134+
gem 'rabl'
135+
```
136+
129137
Profit of using Rabl with gon:
130138

131139
1. You can clean your controllers now!

gon.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
1919
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
2020
s.require_paths = ["lib"]
2121
s.add_dependency "actionpack", '>= 2.3.0'
22-
s.add_dependency "rabl"
2322
s.add_dependency "json"
23+
s.add_development_dependency "rabl"
2424
s.add_development_dependency "rspec"
2525
s.add_development_dependency "jbuilder"
2626
end

lib/gon.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
require 'action_view'
55
require 'action_controller'
66
require 'gon/helpers'
7-
require 'gon/rabl'
7+
if defined?(Rabl)
8+
require 'gon/rabl'
9+
end
810
if RUBY_VERSION =~ /9/ && defined?(Jbuilder)
911
require 'gon/jbuilder'
1012
end

0 commit comments

Comments
 (0)