/lib/gitpusher/service/factory.rb
Ruby | 14 lines | 14 code | 0 blank | 0 comment | 0 complexity | 67bd5b6d804c0d9c2a5a582f5c6aec85 MD5 | raw file
- module GitPusher
- module Service
- class Factory
- def self.create(config)
- case config[:type]
- when /github/i then GitPusher::Service::GitHub.new(config)
- when /bitbucket/i then GitPusher::Service::BitBucket.new(config)
- else
- raise "unknown service type : #{config[:type]}"
- end
- end
- end
- end
- end