rooler 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWY3OTk5MWIwOGJlNWEyYTcxZTBkYWJmOWFmZGI5Y2NkNTA0OWI2Ng==
4
+ ZmIxMGNkZDhjMjQ5MGYzMGE3ODkxMmViZTE2OGRjNWE5YjM2MzY5Mw==
5
5
  data.tar.gz: !binary |-
6
- YmIwZTNkYzk1NDVhYjA4MWQ3OTM0YTc5M2U4YTVkNWU0Y2U0ZmU4Nw==
6
+ YWQzNGVlNDY1NTFiOTY4YTFlYTBiM2U0MDQ4ZTY4YzYxM2IzZWIyYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTNkNjc1ZTM2MzUwMmZkYjYwYjVlNDA4NjEyMjI0NWM2YzUxNjFkZTY2MTRl
10
- NDI0ZjlmYTMxZTg1Yjc5Yjk4OWFiMDVhYzc2ZjgxZTNkNGI4YmI3OGQ5NWIx
11
- YWZlNTQ2NzAxMGNlOTI1N2UxYjc0YTM2ZTBmZDQ4MDFiNTY5ZGE=
9
+ MmVhZDljODc1ZmViZWY5ZTgyN2FlOTVjMDNmMjI0ZmFjODEyZmMzNTVkNzY3
10
+ OWQxNWU3NGNjMzY4MTY2MjcwN2M2MWE1OWFhMTdlYzQ1OWUyNjUyMWY0MDNj
11
+ YzhlYWIyNjIyY2EzZDAwNmRkMTQzYTc1MzQ3YWQzMTNmOTgyZGM=
12
12
  data.tar.gz: !binary |-
13
- MmZiMDIyMWY4MzVmYjNhYzQ4ZDZlNzZjMzllN2I2NzRjMjEyNTNhMjQ4MTdk
14
- M2Y1OTQ1NGU2NmM1YWY5ZDU4ZDIwMjU4YWM3NDdlZDg1N2ZlMmM1ZmQ3MTg1
15
- ZGM2MjczOTg1MzAwYTk3MGRhNGNhNDI2MjBlYzIzMTRmOTY5Y2I=
13
+ MWIwZmUxYWIyNzVmNTA2NWJjMzcwYTE0MDBiZWU0NTBhNzVhODExMTZkNzM4
14
+ ZGNiNGNjZTE3ODJlMzcyYzk2MjVmMGEwZjE4MDgxNzYxN2Q0NDdlOTg1YWEx
15
+ NjBiNWFlYmIxYzE0NjIyY2E0MjMyMjM5MmZmNmExMjc4NWE0ZGY=
@@ -2,6 +2,9 @@ require_dependency "rooler/application_controller"
2
2
 
3
3
  module Rooler
4
4
  class TemplatesController < ApplicationController
5
+ helper ApplicationHelper
6
+ include ApplicationHelper
7
+
5
8
  before_action :set_template, only: [:test, :show, :edit, :update, :destroy]
6
9
 
7
10
  def test
@@ -5,11 +5,12 @@ module Rooler
5
5
  Liquid::Template.parse(content).render(arguments, :filters => [Rooler::LiquidFilters]).html_safe
6
6
  end
7
7
 
8
- def print_tree(tree)
9
- content_tag :ul do
10
- content_tag :li, tree.name
11
- tree.children { |child| print_tree(child) if child } # Child might be 'nil'
12
- end
8
+ def render_tree(tree)
9
+ res = "<ul>"
10
+ res << "<li>#{tree.name}"
11
+ tree.children.each {|child| res << render_tree(child)}
12
+ res << "</li></ul>"
13
+ res
13
14
  end
14
15
 
15
16
  end
@@ -1,5 +1,3 @@
1
- require 'rubytree'
2
-
3
1
  module Rooler
4
2
  class LiquidInspector
5
3
 
@@ -38,7 +36,9 @@ module Rooler
38
36
 
39
37
 
40
38
  def liquid_methods(klass)
41
- klass::LiquidDropClass.public_instance_methods.map(&:to_sym) - Liquid::Drop.public_instance_methods.map(&:to_sym)
39
+ if klass.const_defined?(LiquidDropClass)
40
+ return klass::LiquidDropClass.public_instance_methods.map(&:to_sym) - ::Liquid::Drop.public_instance_methods.map(&:to_sym)
41
+ end
42
42
  end
43
43
 
44
44
  end
@@ -1,5 +1,3 @@
1
- require 'rubytree'
2
-
3
1
  module Rooler
4
2
  class Template < ActiveRecord::Base
5
3
  has_many :rules
@@ -6,3 +6,5 @@
6
6
  <%= f.input :body, :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'mini'} } %>
7
7
  <%= f.button :submit %>
8
8
  <% end %>
9
+
10
+ <%= render_tree(@template.liquid_method_tree).html_safe %>
data/lib/rooler.rb CHANGED
@@ -3,6 +3,7 @@ require 'rooler/liquid_filters'
3
3
  require 'liquid'
4
4
  require 'ckeditor'
5
5
  require 'simple_form'
6
+ require 'rubytree'
6
7
 
7
8
  module Rooler
8
9
  BaseController ||= ActionController::Base
@@ -1,3 +1,3 @@
1
1
  module Rooler
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rooler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yonah Forst