Skip to content

Commit

Permalink
Removes TD dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Minero Aoki committed Feb 10, 2017
1 parent 948bcc6 commit f29bddd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 171 deletions.
1 change: 0 additions & 1 deletion bricolage.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency 'pg', '~> 0.18.0'
s.add_dependency 'aws-sdk', '~> 2'
s.add_dependency 'mysql2'
s.add_dependency 'td'
s.add_dependency 'redis', ">= 3.0.0"
s.add_development_dependency 'test-unit'
s.add_development_dependency 'pry'
Expand Down
20 changes: 0 additions & 20 deletions jobclass/td-delete.rb

This file was deleted.

30 changes: 0 additions & 30 deletions jobclass/td-export.rb

This file was deleted.

22 changes: 18 additions & 4 deletions lib/bricolage/jobclass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,27 @@ def JobClass.define(id, &block)
CLASSES[id] = c
end

srcdir = Pathname(__FILE__).realpath.parent.parent.parent.cleanpath
LOAD_PATH = [srcdir + 'jobclass']
LOAD_PATHES = []

def JobClass.add_load_path(path)
LOAD_PATHES.push path
end

def JobClass.primary_load_path
load_path_for_lib_file(__FILE__)
end

def JobClass.load_path_for_lib_file(path)
srcdir = Pathname(path).realpath.parent.parent.parent.cleanpath
srcdir + 'jobclass'
end

add_load_path primary_load_path

def JobClass.get(id)
unless CLASSES[id.to_s]
begin
path = LOAD_PATH.map {|prefix| prefix + "#{id}.rb" }.detect(&:exist?)
path = LOAD_PATHES.map {|prefix| prefix + "#{id}.rb" }.detect(&:exist?)
raise ParameterError, "no such job class: #{id}" unless path
::Bricolage.module_eval File.read(path), path.to_path, 1
rescue SystemCallError => err
Expand All @@ -35,7 +49,7 @@ def JobClass.get(id)
end

def JobClass.list
LOAD_PATH.map {|dir|
LOAD_PATHES.map {|dir|
Dir.glob("#{dir}/*.rb").map {|path| File.basename(path, '.rb') }
}.flatten.uniq.sort
end
Expand Down
116 changes: 0 additions & 116 deletions lib/bricolage/tddatasource.rb

This file was deleted.

0 comments on commit f29bddd

Please sign in to comment.