rbbt-rest 1.8.146 → 1.8.150

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70de3a851bb361a775fa933d6a72992bddf25bcf6936a8b46b88afd764138337
4
- data.tar.gz: dd39b1ab852febb1102fdc71b7614c5f9e610f987bb9c39e922f359f47cadb4f
3
+ metadata.gz: 1879b80d1d7873e206a425939bf4de751ce2d105990fb0fbf12bc8b6daf29cf2
4
+ data.tar.gz: 10b027be58fef0428acd946102267e6dd789d17c4df5a5af61b0ac2b2b8c0298
5
5
  SHA512:
6
- metadata.gz: b826421f184bdd68b4ded24cb87c51594880ef6f189ba1d86dbe089f1a6488c298939190c124183bd8a2a9dca890dba2dd5324935057b896b131c9bfa387bb2e
7
- data.tar.gz: eb7a5c2c67998fd0ea16c75f31baaa4c5976073dd01f7b78b02d43e7bf203c013280a53473dda9fc54a7b9182e31eae0f0134529f457bb702e49e7d7f763749b
6
+ metadata.gz: a800de9e65f448d8e4951f7e98ff4415f072732d93ee6374896166e13e05a9a2ec8c09533ffd3415603f80195f3d79a2f8fd35b96504b7f0013ccaa0ba3f8c9e
7
+ data.tar.gz: 5b1e2a4225567a64de9a4208c4bc1d840005e4f087ebd64e7688c807663c6adeeaa608e1f908b717d7205ba8f240a07fcc4b5305a6e1cfa03496323169613435
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2013 Miguel Vázquez García
1
+ Copyright (c) 2010-2022 Miguel Vázquez García
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -21,6 +21,7 @@ begin
21
21
  gem.add_dependency('json')
22
22
  gem.add_dependency('haml')
23
23
  gem.add_dependency('rest-client')
24
+ gem.add_dependency('therubyracer')
24
25
  gem.add_dependency('sinatra-authorization')
25
26
  gem.add_dependency('sinatra-cross_origin')
26
27
  gem.add_dependency('sinatra-contrib')
@@ -4,6 +4,17 @@ require 'rbbt/rest/common/table'
4
4
 
5
5
  module RbbtRESTHelpers
6
6
 
7
+ def escape_url(url)
8
+ base, _sep, query = url.partition("?")
9
+ base = base.split("/").collect{|p| CGI.escape(p) }* "/"
10
+ if query && ! query.empty?
11
+ query = query.split("&").collect{|e| e.split("=").collect{|pe| CGI.escape(pe) } * "=" } * "&"
12
+ [base, query] * "?"
13
+ else
14
+ base
15
+ end
16
+ end
17
+
7
18
  MEMORY_CACHE = {}
8
19
 
9
20
  def old_cache(path, check)
@@ -164,15 +175,13 @@ module RbbtRESTHelpers
164
175
  list_id = "List of #{type} in table #{ @fragment }"
165
176
  list_id << " (#{ @filter })" if @filter
166
177
  Entity::List.save_list(type.to_s, list_id, list, user)
167
- header "Location", Entity::REST.entity_list_url(list_id, type)
168
- url = Entity::REST.entity_list_url(list_id, type)
178
+ url = Entity::REST.entity_list_url(list_id, type)
169
179
  url = url + '?_layout=false' unless @layout
170
- url = URI.encode(url)
180
+ url = escape_url(url)
171
181
  redirect to(url)
172
182
  when "map"
173
183
  raw_tsv, tsv_options = load_tsv(fragment_file)
174
184
  raw_tsv.unnamed = true
175
- Log.tsv raw_tsv
176
185
  tsv = tsv_process(raw_tsv)
177
186
 
178
187
  field = tsv.key_field
@@ -189,7 +198,7 @@ module RbbtRESTHelpers
189
198
  Entity::Map.save_map(type.to_s, column, map_id, tsv, user)
190
199
  url = Entity::REST.entity_map_url(map_id, type, column)
191
200
  url = url + '?_layout=false' unless @layout
192
- url = URI.encode(url)
201
+ url = escape_url(url)
193
202
  redirect to(url)
194
203
  when "excel"
195
204
  require 'rbbt/tsv/excel'
@@ -292,7 +292,7 @@ module Sinatra
292
292
  job = consume_parameter(:job)
293
293
  filename = params[:splat].first
294
294
 
295
- raise Workflow::TaskNotFoundException.new workflow, task unless workflow.tasks.include? task.to_sym
295
+ raise Workflow::TaskNotFoundException.new workflow, task unless workflow.tasks.include?(task.to_sym)
296
296
 
297
297
  execution_type = execution_type(workflow, task)
298
298
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  - files = job.files
3
3
  - task = job.task_name
4
- - workflow = job.workflow
4
+ - workflow = job.workflow if job.workflow
5
5
  - jobname = job.name
6
6
  - files.reject!{|f| File.basename(File.dirname(f)) == ".html"}
7
7
 
@@ -1,5 +1,8 @@
1
1
  .ui.buttons.job_control
2
- %a.ui.small.basic.red.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_update=clean") clean job
2
+ - if Open.exists?(job.info_file)
3
+ %a.ui.small.basic.red.button(href="/#{[workflow.to_s, task, jobname] * "/"}?_update=clean") clean job
4
+ - else
5
+ %a.ui.small.basic.red.button.disabled(href="/#{[workflow.to_s, task, jobname] * "/"}?_update=clean") clean job
3
6
  %a.ui.small.basic.blue.button(href="/#{[workflow.to_s, task, jobname, "info"] * "/"}") job info
4
7
  - if job.files.any?
5
8
  %a.ui.small.basic.blue.button(href="/#{[workflow.to_s, task, jobname, "files"] * "/"}") job files
@@ -21,7 +21,6 @@ function format_page(num, size, field){
21
21
  if ( undefined !== size) parts.push(size)
22
22
  if ( undefined !== field) parts.push(field)
23
23
 
24
- console.log(parts.join("~"))
25
24
  return parts.join("~")
26
25
  }
27
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.146
4
+ version: 1.8.150
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: therubyracer
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: sinatra-authorization
127
141
  requirement: !ruby/object:Gem::Requirement