Sha256: 857c7f327436e202d1628d3be9aa48e3c2e9ee82f023d0d606fa4e23ec64bcf0

Contents?: true

Size: 576 Bytes

Versions: 8

Compression:

Stored size: 576 Bytes

Contents

namespace :db do
  namespace :diagrams do

    desc "Generate DB diagrams and convert to PS with Graphviz"
    task :ps => 'db:diagrams' do
      ModalDiagrams.parameters.output_tools.each do |cmd|
        out_dir = Rails.root.join("db/diagrams/#{cmd}_ps")
        mkdir_p out_dir
        Dir[Rails.root.join('db/diagrams/*.dot')].each do |fn|
          fn = Pathname(fn)
          out_fn = out_dir.join(fn.basename.sub_ext('.ps'))
          `#{cmd} '#{fn}' -o '#{out_fn}' -Tps2`
        end
        puts "Output has been generated in #{out_dir}"
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
modaldiagrams-1.1.6 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.5 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.4 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.3 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.2 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.1 lib/tasks/diagrams_ps.rake
modaldiagrams-1.1.0 lib/tasks/diagrams_ps.rake
modaldiagrams-1.0.1 lib/tasks/diagrams_ps.rake