rbbt-util 5.5.53 → 5.5.54
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 +8 -8
- data/lib/rbbt/resource.rb +3 -4
- data/share/rbbt_commands/app/start +3 -3
- data/share/rbbt_commands/resource/exists +58 -0
- data/share/rbbt_commands/resource/find +47 -0
- data/share/rbbt_commands/resource/get +50 -0
- data/share/rbbt_commands/resource/produce +47 -0
- data/share/rbbt_commands/workflow/cmd +1 -1
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2Y1NzNhZTU3MzhiNTcyMzZiYTA1YzhlOTNmMmY0YmMwNzY1OTEzYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWMxZGNmNjk2NTBhNTMwOTBmYWQ3NDdjZTZjOGE5ZmI2YWI3NTFjNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmU5YTViMzQ3YzRjOTE1MzExMThiNjQ3NDIxODc3ZjVjZDFkNzE5ZjQ2ZDFm
|
10
|
+
NDYxMmI3MTllODg5NjU2MzA3MWM5Y2Y3MjcwNmUwNGU1ZThlOTliMWQ1MzQ1
|
11
|
+
Yjc3YzdlNGFlOWI1ODA1NTgyZDNmNWIxYTc3ZWE0OTE5ZGQ0NWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDJmZjk4NjFmMmQ0YjcwZWVjYjY0ZjMxYjUzYjM4MTM0YWZkN2FmMjI1NzVj
|
14
|
+
ZmMyMTAwZDUwYWY2YTgyODA1NzQxMmU3OGM1ZWEyMmVmMjBjYjdkZmE5MmFi
|
15
|
+
Njk0ZDJmNzc3OWRlYTQ4MmZiNjAwMjFhNzA3NTE5ZGViZjc1OGU=
|
data/lib/rbbt/resource.rb
CHANGED
@@ -57,7 +57,8 @@ module Resource
|
|
57
57
|
end
|
58
58
|
|
59
59
|
attr_accessor :server_missing_resource_cache
|
60
|
-
def get_from_server(path, final_path)
|
60
|
+
def get_from_server(path, final_path, remote_server = nil)
|
61
|
+
remote_server ||= self.remote_server
|
61
62
|
url = File.join(remote_server, '/resource/', self.to_s, 'get_file')
|
62
63
|
url << "?" << Misc.hash2GET_params(:file => path, :create => false)
|
63
64
|
|
@@ -67,19 +68,17 @@ module Resource
|
|
67
68
|
Net::HTTP.get_response URI(url) do |response|
|
68
69
|
case response
|
69
70
|
when Net::HTTPSuccess, Net::HTTPOK
|
70
|
-
|
71
71
|
Misc.sensiblewrite(final_path) do |file|
|
72
72
|
response.read_body do |chunk|
|
73
73
|
file.write chunk
|
74
74
|
end
|
75
75
|
end
|
76
|
-
|
77
76
|
when Net::HTTPRedirection, Net::HTTPFound
|
78
77
|
location = response['location']
|
79
78
|
Log.debug("Feching directory from: #{location}. Into: #{final_path}")
|
80
79
|
FileUtils.mkdir_p final_path unless File.exists? final_path
|
81
80
|
Misc.in_dir final_path do
|
82
|
-
CMD.cmd('tar xvfz -', :in => Open.open(location))
|
81
|
+
CMD.cmd('tar xvfz -', :in => Open.open(location, :nocache => true))
|
83
82
|
end
|
84
83
|
when Net::HTTPInternalServerError
|
85
84
|
@server_missing_resource_cache << url
|
@@ -12,7 +12,7 @@ app_dir = Rbbt.etc.app_dir.exists? ? Path.setup(Rbbt.etc.app_dir.read.strip) : R
|
|
12
12
|
|
13
13
|
app_dir = app_dir[app]
|
14
14
|
|
15
|
-
server = options[:server] || '
|
15
|
+
server = options[:server] || 'puma'
|
16
16
|
Misc.in_dir(app_dir) do
|
17
17
|
require 'rack'
|
18
18
|
ENV["RBBT_FINDER"] = "true" if options.include?(:finder)
|
@@ -21,8 +21,8 @@ Misc.in_dir(app_dir) do
|
|
21
21
|
config_ru_file = File.exists?('config.ru') ? 'config.ru' : Rbbt.share['config.ru'].find
|
22
22
|
|
23
23
|
if server == 'unicorn'
|
24
|
-
|
24
|
+
`unicorn -c #{ Rbbt.share['unicorn.rb'].find } '#{config_ru_file}' -p #{options[:port] || "2887"}`
|
25
25
|
else
|
26
|
-
|
26
|
+
Rack::Server.start(options.merge(:config => config_ru_file))
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbbt-util'
|
4
|
+
require 'rbbt/resource'
|
5
|
+
require 'rbbt/workflow'
|
6
|
+
|
7
|
+
options = SOPT.get <<EOF
|
8
|
+
-w--workflows* Workflows to use; 'all' for all in Rbbt.etc.workflows:
|
9
|
+
-r--requires* Files to require; 'all' for all in Rbbt.etc.requires:
|
10
|
+
-c--create Try to create file if claimed:
|
11
|
+
-h--help Help
|
12
|
+
EOF
|
13
|
+
|
14
|
+
if options[:help]
|
15
|
+
puts SOPT.doc
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
|
19
|
+
case options[:workflows]
|
20
|
+
when nil, false, "false", "none"
|
21
|
+
when "all"
|
22
|
+
Rbbt.etc.workflows.list.each do |workflow|
|
23
|
+
Workflow.require_workflow file
|
24
|
+
end if Rbbt.etc.workflows.exists?
|
25
|
+
else
|
26
|
+
options[:workflows].split(/[ ,;|]/).each do |workflow|
|
27
|
+
Workflow.require_workflow workflow
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
case options[:requires]
|
32
|
+
when nil, false, "false", "none"
|
33
|
+
when "all"
|
34
|
+
Rbbt.etc.requires.list.each do |file|
|
35
|
+
require file
|
36
|
+
end if Rbbt.etc.requires.exists?
|
37
|
+
else
|
38
|
+
options[:requires].split(/[ ,;|]/).each do |file|
|
39
|
+
require file
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
resource, path = ARGV
|
44
|
+
|
45
|
+
resource = Kernel.const_get(resource)
|
46
|
+
|
47
|
+
if options[:create]
|
48
|
+
exists = resource[path].exists?
|
49
|
+
else
|
50
|
+
exists = File.exists? resource[path].find
|
51
|
+
end
|
52
|
+
|
53
|
+
if exists
|
54
|
+
puts ["Found", resource[path].find] * ": "
|
55
|
+
else
|
56
|
+
puts ["Not found", resource[path]] * ": "
|
57
|
+
end
|
58
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbbt-util'
|
4
|
+
require 'rbbt/resource'
|
5
|
+
require 'rbbt/workflow'
|
6
|
+
|
7
|
+
options = SOPT.get <<EOF
|
8
|
+
-w--workflows* Workflows to use; 'all' for all in Rbbt.etc.workflows:
|
9
|
+
-r--requires* Files to require; 'all' for all in Rbbt.etc.requires:
|
10
|
+
-h--help Help
|
11
|
+
EOF
|
12
|
+
|
13
|
+
if options[:help]
|
14
|
+
puts SOPT.doc
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
case options[:workflows]
|
19
|
+
when nil, false, "false", "none"
|
20
|
+
when "all"
|
21
|
+
Rbbt.etc.workflows.list.each do |workflow|
|
22
|
+
Workflow.require_workflow file
|
23
|
+
end if Rbbt.etc.workflows.exists?
|
24
|
+
else
|
25
|
+
options[:workflows].split(/[ ,;|]/).each do |workflow|
|
26
|
+
Workflow.require_workflow workflow
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
case options[:requires]
|
31
|
+
when nil, false, "false", "none"
|
32
|
+
when "all"
|
33
|
+
Rbbt.etc.requires.list.each do |file|
|
34
|
+
require file
|
35
|
+
end if Rbbt.etc.requires.exists?
|
36
|
+
else
|
37
|
+
options[:requires].split(/[ ,;|]/).each do |file|
|
38
|
+
require file
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
resource, path = ARGV
|
43
|
+
|
44
|
+
resource = Kernel.const_get(resource)
|
45
|
+
|
46
|
+
puts resource[path].find
|
47
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbbt-util'
|
4
|
+
require 'rbbt/resource'
|
5
|
+
require 'rbbt/workflow'
|
6
|
+
|
7
|
+
options = SOPT.get <<EOF
|
8
|
+
-w--workflows* Workflows to use; 'all' for all in Rbbt.etc.workflows:
|
9
|
+
-r--requires* Files to require; 'all' for all in Rbbt.etc.requires:
|
10
|
+
-O--output* Where to save the file. Defaults to its proper location:
|
11
|
+
-s--server* Server to use:
|
12
|
+
-h--help Help
|
13
|
+
EOF
|
14
|
+
|
15
|
+
if options[:help]
|
16
|
+
puts SOPT.doc
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
|
20
|
+
case options[:workflows]
|
21
|
+
when nil, false, "false", "none"
|
22
|
+
when "all"
|
23
|
+
Rbbt.etc.workflows.list.each do |workflow|
|
24
|
+
Workflow.require_workflow file
|
25
|
+
end if Rbbt.etc.workflows.exists?
|
26
|
+
else
|
27
|
+
options[:workflows].split(/[ ,;|]/).each do |workflow|
|
28
|
+
Workflow.require_workflow workflow
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
case options[:requires]
|
33
|
+
when nil, false, "false", "none"
|
34
|
+
when "all"
|
35
|
+
Rbbt.etc.requires.list.each do |file|
|
36
|
+
require file
|
37
|
+
end if Rbbt.etc.requires.exists?
|
38
|
+
else
|
39
|
+
options[:requires].split(/[ ,;|]/).each do |file|
|
40
|
+
require file
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
resource, path = ARGV
|
45
|
+
|
46
|
+
resource = Kernel.const_get(resource)
|
47
|
+
|
48
|
+
output = options[:output] || resource[path].find(:user)
|
49
|
+
|
50
|
+
resource.get_from_server(path, output, options[:server])
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbbt-util'
|
4
|
+
require 'rbbt/resource'
|
5
|
+
require 'rbbt/workflow'
|
6
|
+
|
7
|
+
options = SOPT.get <<EOF
|
8
|
+
-w--workflows* Workflows to use; 'all' for all in Rbbt.etc.workflows:
|
9
|
+
-r--requires* Files to require; 'all' for all in Rbbt.etc.requires:
|
10
|
+
-h--help Help
|
11
|
+
EOF
|
12
|
+
|
13
|
+
if options[:help]
|
14
|
+
puts SOPT.doc
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
case options[:workflows]
|
19
|
+
when nil, false, "false", "none"
|
20
|
+
when "all"
|
21
|
+
Rbbt.etc.workflows.list.each do |workflow|
|
22
|
+
Workflow.require_workflow file
|
23
|
+
end if Rbbt.etc.workflows.exists?
|
24
|
+
else
|
25
|
+
options[:workflows].split(/[ ,;|]/).each do |workflow|
|
26
|
+
Workflow.require_workflow workflow
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
case options[:requires]
|
31
|
+
when nil, false, "false", "none"
|
32
|
+
when "all"
|
33
|
+
Rbbt.etc.requires.list.each do |file|
|
34
|
+
require file
|
35
|
+
end if Rbbt.etc.requires.exists?
|
36
|
+
else
|
37
|
+
options[:requires].split(/[ ,;|]/).each do |file|
|
38
|
+
require file
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
resource, path = ARGV
|
43
|
+
|
44
|
+
resource = Kernel.const_get(resource)
|
45
|
+
|
46
|
+
puts resource[path].produce.find
|
47
|
+
|
@@ -7,7 +7,7 @@ require 'rbbt/workflow'
|
|
7
7
|
workflow = ARGV.shift
|
8
8
|
|
9
9
|
Workflow.require_workflow workflow
|
10
|
-
dir = $command_dir =
|
10
|
+
dir = $command_dir = Workflow.workflows.last.libdir.share.rbbt_commands
|
11
11
|
def commands(prev)
|
12
12
|
rbbt_command_dir = $command_dir
|
13
13
|
|
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.5.
|
4
|
+
version: 5.5.54
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: narray
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: ZenTest
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,6 +200,10 @@ files:
|
|
186
200
|
- share/rbbt_commands/file_server/add
|
187
201
|
- share/rbbt_commands/file_server/list
|
188
202
|
- share/rbbt_commands/file_server/remove
|
203
|
+
- share/rbbt_commands/resource/exists
|
204
|
+
- share/rbbt_commands/resource/find
|
205
|
+
- share/rbbt_commands/resource/get
|
206
|
+
- share/rbbt_commands/resource/produce
|
189
207
|
- share/rbbt_commands/study/task
|
190
208
|
- share/rbbt_commands/tsv/attach
|
191
209
|
- share/rbbt_commands/tsv/change_id
|