summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-09-11 15:13:09 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-09-11 15:13:09 +0100
commit919c916c11df8eb65207711b32f1f7d279745d67 (patch)
tree76db58f47af17c21afd331f4ae8230a1f14212df
parent7ed4b00cebd9a459ef8e50ef3f5e0760ef5ea985 (diff)
downloadmorph-919c916c11df8eb65207711b32f1f7d279745d67.tar.gz
import: Move build-dep whitelist to static data
-rwxr-xr-ximport/rubygems.to_chunk12
-rw-r--r--import/rubygems.yaml4
2 files changed, 10 insertions, 6 deletions
diff --git a/import/rubygems.to_chunk b/import/rubygems.to_chunk
index 5c11969d..c2b018a9 100755
--- a/import/rubygems.to_chunk
+++ b/import/rubygems.to_chunk
@@ -22,11 +22,6 @@ require 'logger'
require 'optparse'
require 'yaml'
-BUILD_DEPENDENCY_WHITELIST = [
- 'hoe',
- # rake is bundled with Ruby, so it is not included in the whitelist.
-]
-
# Log information was passed in from the main import process, probably.
# This global constant approach seems a little ugly, but it seems to be
# recommended here:
@@ -63,6 +58,11 @@ def spec_is_from_current_source_tree(spec)
end
class RubyGemChunkMorphologyGenerator
+ def initialize
+ local_data = YAML.load_file("rubygems.yaml")
+ @build_dependency_whitelist = local_data['build-dependency-whitelist']
+ end
+
def parse_options(arguments)
# No options so far ..
opts = OptionParser.new
@@ -213,7 +213,7 @@ class RubyGemChunkMorphologyGenerator
def build_deps_for_gem(spec)
deps = spec.dependencies.select do |d|
- d.type == :development && BUILD_DEPENDENCY_WHITELIST.member?(d.name)
+ d.type == :development && @build_dependency_whitelist.member?(d.name)
end
end
diff --git a/import/rubygems.yaml b/import/rubygems.yaml
index 8fdf57b3..9574408c 100644
--- a/import/rubygems.yaml
+++ b/import/rubygems.yaml
@@ -1,5 +1,9 @@
---
+build-dependency-whitelist:
+ - hoe
+ # rake is bundled with Ruby, so it is not included in the whitelist.
+
# The following Gems don't provide a source_code_uri in their Gem metadata.
# Ideally ... they would do.
known-source-uris: