Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-hive
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-hive
Commits
93df162a
Commit
93df162a
authored
12 years ago
by
Leo Gordon
Browse files
Options
Downloads
Patches
Plain Diff
concentrate the "Configurable" functionality in one class with the intention to use it wider
parent
8cc52d20
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/Hive/Configurable.pm
+46
-0
46 additions, 0 deletions
modules/Bio/EnsEMBL/Hive/Configurable.pm
modules/Bio/EnsEMBL/Hive/Meadow.pm
+3
-24
3 additions, 24 deletions
modules/Bio/EnsEMBL/Hive/Meadow.pm
with
49 additions
and
24 deletions
modules/Bio/EnsEMBL/Hive/Configurable.pm
0 → 100644
+
46
−
0
View file @
93df162a
# A base class for objects that we want to be configurable in the following sense:
# 1) have a pointer to the $config
# 2) know their context
# 3) automatically apply that context when getting and setting
package
Bio::EnsEMBL::Hive::
Configurable
;
use
strict
;
use
warnings
;
sub
config
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{'
_config
'}
=
shift
@_
;
}
return
$self
->
{'
_config
'};
}
sub
context
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{'
_context
'}
=
shift
@_
;
}
return
$self
->
{'
_context
'};
}
sub
config_get
{
my
$self
=
shift
@_
;
return
$self
->
config
->
get
(
@
{
$self
->
context
},
@
_
);
}
sub
config_set
{
my
$self
=
shift
@_
;
return
$self
->
config
->
set
(
@
{
$self
->
context
},
@
_
);
}
1
;
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Hive/Meadow.pm
+
3
−
24
View file @
93df162a
...
...
@@ -7,6 +7,8 @@ package Bio::EnsEMBL::Hive::Meadow;
use
strict
;
use
warnings
;
use
base
('
Bio::EnsEMBL::Hive::Configurable
');
sub
new
{
my
(
$class
,
$config
)
=
@_
;
...
...
@@ -14,6 +16,7 @@ sub new {
my
$self
=
bless
{},
$class
;
$self
->
config
(
$config
);
$self
->
context
(
[
'
Meadow
',
$self
->
type
,
$self
->
name
]
);
return
$self
;
}
...
...
@@ -35,30 +38,6 @@ sub signature {
}
sub
config
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{'
_config
'}
=
shift
@_
;
}
return
$self
->
{'
_config
'};
}
sub
config_get
{
my
$self
=
shift
@_
;
return
$self
->
config
->
get
('
Meadow
',
$self
->
type
,
$self
->
name
,
@
_
);
}
sub
config_set
{
my
$self
=
shift
@_
;
return
$self
->
config
->
set
('
Meadow
',
$self
->
type
,
$self
->
name
,
@
_
);
}
sub
pipeline_name
{
# if set, provides a filter for job-related queries
my
$self
=
shift
@_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment