...
 
Commits (2)
......@@ -7,7 +7,8 @@
*.csv
*.html
Gemfile
*.Gemfile
*Gemfile
*Gemfile.lock
*.bak
cache
create/*
......@@ -68,3 +69,4 @@ docs/_build/
# PyBuilder
target/
*yaml
......@@ -6,7 +6,7 @@ import os
from gemfileparser import GemfileParser
from .util import (GEM_EXCEPTIONS, SKIP_VERSION_CHECK, get_stricter,
from .util import (get_exceptions, skip_check, get_stricter,
least_satisfiable_version, version_satisfy_requirement)
try:
......@@ -14,6 +14,8 @@ try:
except:
from urllib2 import urlopen
GEM_EXCEPTIONS = []
SKIP_VERSION_CHECK = []
class DetailedDependency(object):
......@@ -269,7 +271,7 @@ class GemDeps(object):
Main Class to generate dependency list of a Ruby (on Rails) app.
'''
def __init__(self, appname, ignoresatisfied=True):
def __init__(self, appname, ignoresatisfied=True, exception_path=None, skip_path=None):
'''
Initialize necessary attributes.
'''
......@@ -277,6 +279,14 @@ class GemDeps(object):
self.original_list = []
self.dependency_list = {}
self.ignoresatisfied = ignoresatisfied
self.exceptions = []
self.skip = []
global GEM_EXCEPTIONS
global SKIP_VERSION_CHECK
if exception_path:
GEM_EXCEPTIONS = get_exceptions(exception_path)
if skip_path:
SKIP_VERSION_CHECK = skip_check(skip_path)
def process(self, path):
'''
......
......@@ -2,6 +2,19 @@
import re
from distutils.version import LooseVersion
import yaml
def get_exceptions(path):
with open(path, 'r') as filecontent:
exceptions = yaml.load(filecontent)
return exceptions
def skip_check(path):
with open(path, 'r') as filecontent:
skip_list = [line.strip() for line in filecontent.readlines()]
return skip_list
GEM_EXCEPTIONS = {'rake': 'rake',
......