Sha256: 8761da1207b248e52a7d68795dbefced454ded6296cd3fa892131d063fdb6694

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

require 'yaml'

module Archruby
  module Presenters

    class Yaml
      def render architecture
        constraints_breaks = architecture.constraints_breaks
        file = File.new('constraints_breaks.yml', 'w')
        contraints = []
        constraints_breaks.each do |constraint_break|
          constraint = {}
          constraint[constraint_break.type] = {}
          constraint[constraint_break.type]['class_origin'] = constraint_break.class_origin
          constraint[constraint_break.type]['line_origin'] = constraint_break.line_origin
          constraint[constraint_break.type]['class_target'] = constraint_break.class_target
          constraint[constraint_break.type]['module_origin'] = constraint_break.module_origin
          constraint[constraint_break.type]['module_target'] = constraint_break.module_target
          constraint[constraint_break.type]['message'] = constraint_break.msg
          contraints << constraint
        end
        file.write contraints.to_yaml
        file.close
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
archruby-0.3.0 lib/archruby/presenters/yaml.rb
archruby-0.2.0 lib/archruby/presenters/yaml.rb
archruby-0.1.1 lib/archruby/presenters/yaml.rb
archruby-0.1.0 lib/archruby/presenters/yaml.rb