miga-base 1.0.2.0 → 1.0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42180f18b6cf955c87a7bd4e5d798bba23f529e5a0571409186e6be566067907
4
- data.tar.gz: 85d1f429054d5b773938018bd91523dbf0d5f040e266e8bb3bf263eea48b08d7
3
+ metadata.gz: 3fdcceb4a8c5751e23241e0db5390e8d10f4aa2d62077b3bc73508d9da15bd75
4
+ data.tar.gz: 9c221524ad7f8e7240a9f7b02c9fe2275a3728a7290d22cfedce26972c7d7db8
5
5
  SHA512:
6
- metadata.gz: 0d238933adb3c6799b66c5d5e36854c49dd24cc86a330a45c10531fe341a70b5e684a9f6a35e899f582ed64d33494e4300fa4c37236696187b0e2df7da195ad2
7
- data.tar.gz: 31ab6d81294dee95801cdc3c38c515493e65d9b727659f856af474212e5ef5dd44d0c733f92d432e1b5d946bbf45580b70a6a815d4163c894ba967bfef343a0c
6
+ metadata.gz: 8f05075e290329eb9a4b9a889c0fae6c379dca8e949a0beefb84de2e7d37f3bdfe04e7ccad63c2dd6258cacf2e3ce47e4b2a39bdd1abbb796eea6338e54d0fb6
7
+ data.tar.gz: d6358abaa5041631b3b3bd9e6a74656aae7739d14b031b2218382084f3d7384fb679bff7423ac0c31c673339fe80ab02a173df7042814fedd8dfb325ec6c0005
@@ -0,0 +1,26 @@
1
+ # @package MiGA
2
+ # @license Artistic-2.0
3
+
4
+ require 'miga/cli/action'
5
+
6
+ class MiGA::Cli::Action::Env < MiGA::Cli::Action
7
+ def parse_cli
8
+ cli.parse { |_| }
9
+ end
10
+
11
+ def perform
12
+ puts <<~BASH
13
+ MIGA="#{MiGA::MiGA.root_path}"
14
+ MIGA_HOME=${MIGA_HOME:-"$HOME"}
15
+ . "$MIGA_HOME/.miga_rc"
16
+ # Ensure MiGA & submodules are first in PATH
17
+ export PATH="$MIGA/bin:$PATH"
18
+ for util in enveomics/Scripts FastAAI/FastAAI multitrim ; do
19
+ export PATH="$MIGA/utils/$util:$PATH"
20
+ done
21
+ BASH
22
+ end
23
+
24
+ def empty_action
25
+ end
26
+ end
data/lib/miga/cli/base.rb CHANGED
@@ -41,6 +41,7 @@ module MiGA::Cli::Base
41
41
  lair: 'Control groups of daemons for several MiGA projects',
42
42
  date: 'Return the current date in standard MiGA format',
43
43
  console: 'Open an IRB console with MiGA',
44
+ env: 'Shell code to load MiGA environment',
44
45
  # Taxonomy
45
46
  tax_set: 'Register taxonomic information for datasets',
46
47
  tax_test: 'Return test of taxonomic distributions for query datasets',
data/lib/miga/version.rb CHANGED
@@ -12,7 +12,7 @@ module MiGA
12
12
  # - String indicating release status:
13
13
  # - rc* release candidate, not released as gem
14
14
  # - [0-9]+ stable release, released as gem
15
- VERSION = [1.0, 2, 0].freeze
15
+ VERSION = [1.0, 3, 0].freeze
16
16
 
17
17
  ##
18
18
  # Nickname for the current major.minor version.
@@ -20,7 +20,7 @@ module MiGA
20
20
 
21
21
  ##
22
22
  # Date of the current gem release.
23
- VERSION_DATE = Date.new(2021, 4, 13)
23
+ VERSION_DATE = Date.new(2021, 6, 4)
24
24
 
25
25
  ##
26
26
  # References of MiGA
data/scripts/miga.bash CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/bin/bash
2
2
 
3
+ ###
3
4
  # Setup environment
4
5
  set -e
5
- MIGA_HOME=${MIGA_HOME:-"$HOME"}
6
+ eval "$("$MIGA/bin/miga" env)"
6
7
  SCRIPT=${SCRIPT:-$(basename "$0" .bash)}
7
- # shellcheck source=/dev/null
8
- . "$MIGA_HOME/.miga_rc"
9
-
10
- # Ensure MiGA & submodules are first in PATH
11
- export PATH="$MIGA/bin:$PATH"
12
- for util in enveomics/Scripts FastAAI/FastAAI multitrim ; do
13
- export PATH="$MIGA/utils/$util:$PATH"
14
- done
15
8
 
9
+ ###
16
10
  # Ancillary functions
11
+
12
+ # Evaluates if the first passed argument is an existing file
17
13
  function exists { [[ -e "$1" ]] ; }
14
+
15
+ # Evaluates if the first passed argument is a function
18
16
  function fx_exists { [[ $(type -t "$1") == "function" ]] ; }
17
+
18
+ # Initiate a project-wide run
19
19
  function miga_start_project_step {
20
20
  local dir="$1"
21
21
  local dir_r="${dir}.running"
@@ -24,6 +24,8 @@ function miga_start_project_step {
24
24
  cd "$dir_r"
25
25
  miga date > "miga-project.start"
26
26
  }
27
+
28
+ # Finalize a project-wide run
27
29
  function miga_end_project_step {
28
30
  local dir="$1"
29
31
  local dir_r="${dir}.running"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2.0
4
+ version: 1.0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons
@@ -141,6 +141,7 @@ files:
141
141
  - lib/miga/cli/action/doctor.rb
142
142
  - lib/miga/cli/action/doctor/base.rb
143
143
  - lib/miga/cli/action/edit.rb
144
+ - lib/miga/cli/action/env.rb
144
145
  - lib/miga/cli/action/files.rb
145
146
  - lib/miga/cli/action/find.rb
146
147
  - lib/miga/cli/action/generic.rb