Mongo storages, configuration
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
module RakeControl
|
||||
class Config
|
||||
attr_accessor :storage
|
||||
|
||||
def initialize
|
||||
@storage = :active_record
|
||||
end
|
||||
|
||||
def setup_storage_model
|
||||
case storage
|
||||
when :active_record, :activerecord
|
||||
require 'rake_control/storage/active_record/rake_control_run'
|
||||
when :mongoid
|
||||
require 'rake_control/storage/mongoid/rake_control_run'
|
||||
when :mongo_mapper, :mongomapper
|
||||
require 'rake_control/storage/mongo_mapper/rake_control_run'
|
||||
else
|
||||
raise Exception.new("Unknown storage: #{storage}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RakeControl
|
||||
class Run
|
||||
include MongoMapper::Document
|
||||
|
||||
key :name, String
|
||||
key :success, Boolean
|
||||
key :execution_time, Float
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
module RakeControl
|
||||
class Run
|
||||
include Mongoid::Document
|
||||
|
||||
field :name, type: String
|
||||
field :success, type: Boolean
|
||||
field :execution_time, type: Float
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user