Sha256: 93b40fe5515ce4b0d7b9c00cfb0e812f2e7f9d0417b59cc93636d0bfcca8a2aa
Contents?: true
Size: 943 Bytes
Versions: 14
Compression:
Stored size: 943 Bytes
Contents
# encoding: UTF-8 module Tetra # adds methods to generate a spec file from a package object module Speccable include Tetra::Generatable # saves a specfile for this object in correct directories # returns the spec path and the conflict count with the previously generated # version, if any # destination_dir/name/name.spec def _to_spec(project, name, template_spec_name, destination_dir) project.from_directory do spec_name = "#{name}.spec" spec_dir = File.join(destination_dir, name) FileUtils.mkdir_p(spec_dir) spec_path = File.join(spec_dir, spec_name) new_content = generate(template_spec_name, binding) label = "Spec for #{name} generated" conflict_count = project.merge_new_content(new_content, spec_path, label, "#{name}-spec") [spec_path, conflict_count] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems