iroki 0.0.27 → 0.0.28
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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/bin/iroki_docker +23 -5
- data/exe/iroki +9 -1
- data/lib/iroki/color/color.rb +8 -0
- data/lib/iroki/main/main.rb +14 -1
- data/lib/iroki/utils/utils.rb +4 -0
- data/lib/iroki/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fb0a7ac745f83ec8341cbfbac699f9ac3c5f54b
|
4
|
+
data.tar.gz: decf8043b7d513ce31aef186155133d63758ddcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e823649d07424f55164ed15ecf1af65d2a72f2b7aeb1e6e57003cef2ee009b2b5c6d0b6a3a68c64cf32805499b3f99093a5a60b4842b41f9b3ed3583fa77fa7
|
7
|
+
data.tar.gz: 33f53a9b7853311080a57af7815ff5572d4f00fd2e19099b3a9bb615d14b641adbaad35b22a32fffa9fe44aebce9710e86a904b325a2044700af4d3bbcdd286e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/bin/iroki_docker
CHANGED
@@ -5,17 +5,35 @@ use File::Spec;
|
|
5
5
|
my @args = ();
|
6
6
|
|
7
7
|
foreach my $arg (@ARGV) {
|
8
|
-
if ($arg =~ /^-/) {
|
8
|
+
if ($arg =~ /^-/) { # arg is a flag
|
9
9
|
push @args, $arg;
|
10
|
-
|
10
|
+
|
11
|
+
# check if next arg should expand (these are file inputs)
|
12
|
+
if ($arg eq "-c" || $arg eq "--color-map" ||
|
13
|
+
$arg eq "-i" || $arg eq "--biom" ||
|
14
|
+
$arg eq "-f" || $arg eq "--infile" ||
|
15
|
+
$arg eq "-o" || $arg eq "--outfile" ||
|
16
|
+
$arg eq "-n" || $arg eq "--name-map") {
|
17
|
+
|
18
|
+
$expand = 1;
|
19
|
+
} else {
|
20
|
+
$expand = 0;
|
21
|
+
}
|
22
|
+
} elsif ($expand) { # an arg that is a path, expand it
|
11
23
|
my $path = File::Spec->rel2abs($arg);
|
24
|
+
|
12
25
|
push @args, $path;
|
26
|
+
} else { # an arg that is not a path and not a flag
|
27
|
+
push @args, $arg;
|
13
28
|
}
|
14
29
|
}
|
15
30
|
|
16
31
|
my $img = "mooreryan/iroki";
|
17
|
-
my $
|
32
|
+
my $pull = "docker pull $img";
|
33
|
+
my $run = "docker run -v \"\$HOME:\$HOME\" $img @args";
|
18
34
|
|
19
|
-
print "\nRUNNING COMMAND: $
|
35
|
+
print "\n\n\nRUNNING COMMAND: $pull\n\n\n";
|
36
|
+
system("$pull");
|
20
37
|
|
21
|
-
|
38
|
+
print "\n\n\nRUNNING COMMAND: $run\n\n\n";
|
39
|
+
exec("$run");
|
data/exe/iroki
CHANGED
@@ -30,6 +30,8 @@ opts = Trollop.options do
|
|
30
30
|
|
31
31
|
Iroki command line program.
|
32
32
|
|
33
|
+
See https://github.com/mooreryan/iroki/wiki for the Iroki manual.
|
34
|
+
|
33
35
|
Options:
|
34
36
|
EOS
|
35
37
|
|
@@ -78,6 +80,11 @@ opts = Trollop.options do
|
|
78
80
|
opt(:outfile,
|
79
81
|
"Name of outfile",
|
80
82
|
type: :string)
|
83
|
+
|
84
|
+
opt(:default_color,
|
85
|
+
"Default color",
|
86
|
+
type: :string,
|
87
|
+
default: "black")
|
81
88
|
end
|
82
89
|
|
83
90
|
Iroki::Main.main(
|
@@ -92,5 +99,6 @@ Iroki::Main.main(
|
|
92
99
|
auto_color: opts[:auto_color],
|
93
100
|
display_auto_color_options: opts[:display_auto_color_options],
|
94
101
|
newick_f: opts[:infile],
|
95
|
-
out_f: opts[:outfile]
|
102
|
+
out_f: opts[:outfile],
|
103
|
+
default_color: opts[:default_color]
|
96
104
|
)
|
data/lib/iroki/color/color.rb
CHANGED
@@ -731,5 +731,13 @@ module Iroki
|
|
731
731
|
hex = colors[col]
|
732
732
|
%Q{[&!color="#{hex.upcase}"]}
|
733
733
|
end
|
734
|
+
|
735
|
+
def self.default_color_tag= tag_hash
|
736
|
+
@@default_color = tag_hash
|
737
|
+
end
|
738
|
+
|
739
|
+
def self.default_color_tag
|
740
|
+
@@default_color ||= nil
|
741
|
+
end
|
734
742
|
end
|
735
743
|
end
|
data/lib/iroki/main/main.rb
CHANGED
@@ -183,7 +183,8 @@ module Iroki
|
|
183
183
|
auto_color: nil,
|
184
184
|
display_auto_color_options: nil,
|
185
185
|
newick_f: nil,
|
186
|
-
out_f: nil
|
186
|
+
out_f: nil,
|
187
|
+
default_color: "black")
|
187
188
|
|
188
189
|
args = method(__method__).parameters.map { |arg| arg[1] }
|
189
190
|
AbortIf::logger.info "Args " + args.map { |arg| "#{arg} = #{eval(arg.to_s).inspect}" }.join(', ')
|
@@ -345,6 +346,18 @@ module Iroki
|
|
345
346
|
patterns = nil
|
346
347
|
end
|
347
348
|
|
349
|
+
# set default color if needed
|
350
|
+
if default_color && default_color != "black"
|
351
|
+
|
352
|
+
abort_if !default_color.hex? && !Iroki::Color::COLORS[default_color],
|
353
|
+
"--default-color must be a hex code (don't forget the '#' or a valid color. Got '#{default_color}'."
|
354
|
+
|
355
|
+
Iroki::Color::default_color_tag = { label: Iroki::Color.get_tag(default_color),
|
356
|
+
branch: Iroki::Color.get_tag(default_color), }
|
357
|
+
end
|
358
|
+
|
359
|
+
|
360
|
+
|
348
361
|
####################
|
349
362
|
# get color patterns
|
350
363
|
#################################################################
|
data/lib/iroki/utils/utils.rb
CHANGED
data/lib/iroki/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iroki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|