rbbt-util 5.21.128 → 5.21.129

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
  SHA1:
3
- metadata.gz: d2e38a07f3d52f96131185d87edc11c40f7a5ea5
4
- data.tar.gz: 920dab12666bcce73c7121959c22d99a0c2b2b57
3
+ metadata.gz: f5f684d18bdb89966ce14703094359d62b64708d
4
+ data.tar.gz: 7298dc99105519116914c348280ef3a2f751ef5b
5
5
  SHA512:
6
- metadata.gz: 98919775334053530f302b4e98d31cefcec11bc38f3b1809c27ffec15befccd2a6819841aaa15389334fb2813fdf95253037696c0488de33f7d3b50c5ec98715
7
- data.tar.gz: 1e2eae9c61741de2c300b935efd98009ba9babb8e5947d7b4c048a4be1eabfc28c2f2e79021f1b77df442340a7ed7cbbf3bf414501408141b00129c5e41df556
6
+ metadata.gz: 9ddbbf8a627aca9d41640c4bda71fd44f3a29366cd3c0d015b23ac7c1e86b1ea964c04fc19719a10732f3fadd2506e2118dfea9aa55e782c820e595d9f639b40
7
+ data.tar.gz: 78800e637163f3ddfc6cee51ea06a19a58d9e47baa87ec73327268414c72c731236f49dd1f6d0a18b25eebaf1df6f4c7063ee52fbb626441ab41c55eb24e990e
@@ -1,6 +1,6 @@
1
1
  module Misc
2
2
  ARRAY_MAX_LENGTH = 1000
3
- STRING_MAX_LENGTH = ARRAY_MAX_LENGTH * 10
3
+ STRING_MAX_LENGTH = ARRAY_MAX_LENGTH * 100
4
4
 
5
5
  def self.break_lines(text, char_size=80)
6
6
  text = text.gsub("\n", " ")
@@ -1,4 +1,36 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'rbbt-util'
3
+ require 'rbbt/util/simpleopt'
4
+
5
+ $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands
6
+
7
+ options = SOPT.setup <<EOF
8
+
9
+ Run a web server over a simgle template
10
+
11
+ $ rbbt app template [options] <filename.haml>
12
+
13
+ -e--environment*
14
+ -p--port*
15
+ -s--server*
16
+ -b--bind*
17
+ -e--environment*
18
+ -R--RServe_session*
19
+ --finder
20
+ --views*
21
+ -W--workflows*"
22
+ -h--help Print this help
23
+
24
+ EOF
25
+ if options[:help]
26
+ if defined? rbbt_usage
27
+ rbbt_usage
28
+ else
29
+ puts SOPT.doc
30
+ end
31
+ exit 0
32
+ end
33
+
2
34
 
3
35
  require 'rbbt/util/simpleopt'
4
36
  require 'rbbt/workflow'
@@ -13,10 +45,11 @@ require 'rbbt/rest/knowledge_base'
13
45
  require 'rbbt/rest/helpers'
14
46
  require 'rbbt/rest/web_tool'
15
47
 
16
- options = SOPT.get "-e--environment*:-p--port*:-s--server*:-b--bind*:-e--environment*:-R--RServe_session*:--finder:--views*:-W--workflows*"
17
48
 
18
49
  template = ARGV.first
19
50
 
51
+ raise ParameterException, "No template specified" if template.nil?
52
+
20
53
  template = File.expand_path(template)
21
54
  template = template.sub('.haml','')
22
55
 
@@ -44,13 +44,13 @@ positive = false if positive.nil?
44
44
  require 'rbbt/util/R'
45
45
  if png
46
46
  R.run <<-EOF
47
- data = rbbt.tsv('#{file}')
48
- rbbt.pheatmap('#{png}', data, positive=#{R.ruby2R positive})
47
+ data = rbbt.tsv2matrix(rbbt.tsv('#{file}'))
48
+ rbbt.pheatmap('#{png}', data, width=#{ width }, height=#{ height }, take_log=#{R.ruby2R logs}, positive=#{R.ruby2R positive})
49
49
  EOF
50
50
  else
51
51
  TmpFile.with_file(nil, :extension => 'png') do |png|
52
52
  R.run <<-EOF
53
- data = rbbt.tsv('#{file}')
53
+ data = rbbt.tsv2matrix(rbbt.tsv('#{file}'))
54
54
  rbbt.pheatmap('#{png}', data, width=#{ width }, height=#{ height }, take_log=#{R.ruby2R logs}, positive=#{R.ruby2R positive})
55
55
  EOF
56
56
  `op #{png}`
@@ -1,16 +1,37 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rbbt'
3
+ require 'rbbt-util'
4
4
  require 'rbbt/util/simpleopt'
5
- require 'rbbt/workflow'
6
5
 
6
+ $0 = "rbbt #{$previous_commands*" "} #{ File.basename(__FILE__) }" if $previous_commands
7
+
8
+ options = SOPT.setup <<EOF
9
+
10
+ Run a workflow command
11
+
12
+ $ rbbt workflow cmd <workflow> <command> [<subcommands>] [<options>] [<arg> ...]
13
+
14
+ EOF
7
15
  workflow = ARGV.shift
8
16
 
17
+ if workflow == '-h'
18
+ if defined? rbbt_usage
19
+ rbbt_usage
20
+ else
21
+ puts SOPT.doc
22
+ end
23
+ exit 0
24
+ end
25
+
26
+ raise ParameterException, "No workflow specified" if workflow.nil?
27
+
28
+ require 'rbbt/workflow'
29
+
9
30
  wf = Workflow.require_workflow workflow
10
- dir = $command_dir = wf.libdir.share.rbbt_commands
31
+ dir = $command_dir = wf.libdir.share.rbbt_commands.find
11
32
 
12
33
  def prev_dir(prev)
13
- rbbt_command_dir = $rbbt_command_dir
34
+ rbbt_command_dir = $command_dir
14
35
 
15
36
  prev.each do |previous_command|
16
37
  rbbt_command_dir = rbbt_command_dir[previous_command]
@@ -30,12 +51,16 @@ end
30
51
 
31
52
  prev = []
32
53
 
54
+ $previous_commands << 'cmd'
55
+ $previous_commands << workflow
56
+
33
57
  begin
34
58
  while ARGV.any?
35
59
  command = ARGV.shift
36
60
  case
37
61
  when File.directory?(dir[command].find)
38
62
  prev << command
63
+ $previous_commands << command
39
64
  dir = dir[command]
40
65
  when File.directory?(dir[command].find)
41
66
  prev << command
@@ -63,7 +88,7 @@ puts Log.color :magenta, "## COMMANDS"
63
88
  puts
64
89
  puts Log.color :magenta, "Command:"
65
90
  puts
66
- puts " #{File.basename($0)} #{$previous_commands * " "} cmd"
91
+ puts " rbbt #{$previous_commands * " "} "
67
92
  puts
68
93
  puts Log.color :magenta, "Subcommands:"
69
94
  puts
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.21.128
4
+ version: 5.21.129
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-04 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake