Top Level Namespace
Defined Under Namespace
Modules: Dry, Mihari
Classes: AddYAMLToRulesSchema, AddeMetadataToArtifactSchema, AddeSourceToArtifactSchema, ArtifactValidator, EnrichmentCreatedAtSchema, EnrichmentsSchema, EnrichmentsV45Schema, InitialSchema, RuleSchema
Instance Method Summary
collapse
Instance Method Details
#adapter ⇒ Object
140
141
142
143
144
145
|
# File 'lib/mihari/database.rb', line 140
def adapter
return "postgresql" if Mihari.config.database.start_with?("postgresql://", "postgres://")
return "mysql2" if Mihari.config.database.start_with?("mysql2://")
"sqlite3"
end
|
#development_env? ⇒ Boolean
16
17
18
|
# File 'lib/mihari/database.rb', line 16
def development_env?
env == "development"
end
|
#env ⇒ Object
8
9
10
|
# File 'lib/mihari/database.rb', line 8
def env
ENV["APP_ENV"] || ENV["RACK_ENV"]
end
|
#test_env? ⇒ Boolean
12
13
14
|
# File 'lib/mihari/database.rb', line 12
def test_env?
env == "test"
end
|
#truthy?(value) ⇒ Boolean
63
64
65
66
67
68
|
# File 'lib/mihari.rb', line 63
def truthy?(value)
return true if value == "true"
return true if value == true
false
end
|