Sha256: 40d730821be666e76ee5b7f477b76f454f652a8214dba9817e833b9694643341
Contents?: true
Size: 1.4 KB
Versions: 2
Compression:
Stored size: 1.4 KB
Contents
# encoding: UTF-8 module Gjp # creates and updates spec files class SpecGenerator include Logger def initialize(project) @project = project end def generate_kit_spec @project.from_directory do destination_dir = File.join("output", "#{@project.name}-kit") FileUtils.mkdir_p(destination_dir) spec_path = File.join(destination_dir, "#{@project.name}-kit.spec") adapter = Gjp::KitSpecAdapter.new(@project) conflict_count = generate_merging("kit.spec", adapter.get_binding, spec_path, :generate_kit_spec) [spec_path, conflict_count] end end def generate_package_spec(name, pom, filter) @project.from_directory do destination_dir = File.join("output", name) FileUtils.mkdir_p(destination_dir) spec_path = File.join(destination_dir, "#{name}.spec") adapter = Gjp::PackageSpecAdapter.new(@project, name, Gjp::Pom.new(pom), filter) conflict_count = generate_merging("package.spec", adapter.get_binding, spec_path, "generate_#{name}_spec") [spec_path, conflict_count] end end # generates a spec file from a template and 3-way merges it def generate_merging(template, binding, path, tag_prefix) new_content = TemplateManager.new.generate(template, binding) @project.merge_new_content(new_content, path, "Spec generated", tag_prefix) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gjp-0.23.0 | lib/gjp/spec_generator.rb |
gjp-0.22.0 | lib/gjp/spec_generator.rb |