diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-01 15:07:50 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-01 15:07:50 +0100 |
commit | 4c829391facb546ab39b7f3427c4e148573d1d34 (patch) | |
tree | 729c1c8b77d23a444d8d97b5f66491b6bd9104f3 | |
parent | aaa4c55a53c2f10ced785be12506934468067ec0 (diff) | |
download | morph-4c829391facb546ab39b7f3427c4e148573d1d34.tar.gz |
import: Move more stuff to base class.
-rw-r--r-- | import/importer_base.rb | 9 | ||||
-rw-r--r-- | import/omnibus.to_chunk | 4 | ||||
-rwxr-xr-x | import/rubygems.to_chunk | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/import/importer_base.rb b/import/importer_base.rb index aa91ff6e..5142a0eb 100644 --- a/import/importer_base.rb +++ b/import/importer_base.rb @@ -23,6 +23,15 @@ module Importer @logger ||= create_logger end + def error(message) + log.error(message) + STDERR.puts(message) + end + + def write_morph(file, morph) + file.write(YAML.dump(morph)) + end + private def create_logger diff --git a/import/omnibus.to_chunk b/import/omnibus.to_chunk index 2edafc17..daae795b 100644 --- a/import/omnibus.to_chunk +++ b/import/omnibus.to_chunk @@ -90,10 +90,6 @@ class OmnibusChunkMorphologyGenerator } end - def write_morph(file, morph) - file.write(YAML.dump(morph)) - end - def run project = Omnibus::Project.load(TARGET_PROJECT) diff --git a/import/rubygems.to_chunk b/import/rubygems.to_chunk index 6cb54908..b15bd0bc 100755 --- a/import/rubygems.to_chunk +++ b/import/rubygems.to_chunk @@ -213,10 +213,6 @@ class RubyGemChunkMorphologyGenerator spec.dependencies.select {|d| d.type == :runtime} end - def write_morph(file, morph) - file.write(YAML.dump(morph)) - end - def run source_dir_name, gem_name, expected_version = parse_options(ARGV) |