Commit 3765297e authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

task to generate graph of tags

parent f27faf60
......@@ -58,6 +58,8 @@ group :development do
# Github Page:
gem 'rails-erd'
gem 'ruby-graphviz'
# Manage the database application (use: localhost:3000/rails/db)
# Github Page:
#gem 'rails_db'
require 'graphviz'
namespace :graph do
desc 'Generate tags relation graph'
task generate_tags: :environment do
g =, :type => :graph )
LearningObject.all.each do |lo|
lo_node = g.add_nodes("lo:" +, label:
lo.tags.each do |t|
pattern = /(\'|\"|\.|\*|\/|\-|\\)/
name =,'')
t_node = g.add_nodes("tag:" +, label: name)
g.add_edges(lo_node, t_node)
g.output( dot: "" )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment