rbbt-rest 1.2.28 → 1.2.29

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjcwODZiOTgzOTgzNTg2ZjBjNDBkOTYzYmUzMWVlOWM2MDFhZDY0NA==
4
+ M2ZiYTdmYzg0MWE3ZWIxNWI3MWE1MGZlNzQzZjcyZThiYmE1ZTE4Mw==
5
5
  data.tar.gz: !binary |-
6
- YzZmZTZlNTJhODcyOWY0ZjA1ZDU2YTY0YzRiN2NlODIxZGZlMTIyNQ==
6
+ YjdlNzdiZGNjZjYxZTgwYTMwYmI2N2Q4YTc2NmQ5NTk3MGE5N2JiYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjRhZjU5N2NlOWIzYWQzMzA3MjcxNWNjYWQ5M2E5YmRlZDE5NWY0NDU1ZjJh
10
- ODczYjc3M2E0Mzg5ZmNiNWZjMTU2NGNlMWJmYmFkMDk1Y2IyYTk2ZTU4ZTVj
11
- ZWY3MzMzNDQ2MzBiYWUwMTU0ZGJkMTE3ZDRkNjE5MjdmOGI1MmM=
9
+ MWNmMDA5NGZjNTIyNDRiODY4NDEwOGQ1MmY3MTg3MDI0YWQ5NjljZTdjZWRk
10
+ OTVhYzQ2ZmE5ZmM2MzI1MDRiMmVkZjliZmI0YmMzZjI2ODQzMGM0ZjM3ZDQx
11
+ NmMxNDM5Nzk5NmQ0YTAwYTJlMzcyMzhmMzA3MmI5YWNjYTYxMTA=
12
12
  data.tar.gz: !binary |-
13
- ZDc1NDFlZTNiMTlhNTFkMjE5MWUzNmE2NGE3ZjI4YzZlNDAyNjdjMjhlZDNj
14
- NTNmYjI1NWRmNGIxZDFhYWZiOGM2ZmEwMTc0Y2UxYzQ0NDU2ZWNjMTRkYTNm
15
- Mjg4YzU5OWQxZjFkNmU1MjMyZmU3YzE5OTE0YTdiNWIwZjE4MjI=
13
+ NzgyMjgzYjMzN2ZlNzlkNDI0Yzk3OTE0YzlhYmE0NjVjYTY4ZDA4ZmIzZDU1
14
+ OTE4MTVlMWZhYjA3YWZjMDU5Y2ZiMDE4NGRkYjdiYzAzMTFkYjM0OGFhNTY1
15
+ ZTI3NDc5YWE5ZDYyOTNmYjZkNGMwZTI3ZWIwMjg1MGU4OWViN2U=
@@ -103,7 +103,7 @@ module RbbtRESTHelpers
103
103
  step.abort if pid and Misc.pid_exists? pid
104
104
  step.pid = nil
105
105
  rescue Exception
106
- Log.medium $!.message
106
+ Log.medium{$!.message}
107
107
  end
108
108
  step.clean
109
109
  end
@@ -143,10 +143,10 @@ module RbbtRESTHelpers
143
143
  else
144
144
  # check for problems
145
145
  if File.exists?(step.info_file) and Time.now - File.atime(step.info_file) > 60
146
- Log.debug("Checking on #{step.info_file}")
146
+ Log.debug{ "Checking on #{step.info_file}" }
147
147
  running = step.running?
148
148
  if FalseClass === running
149
- Log.debug("Aborting zombie #{step.info_file}")
149
+ Log.debug{ "Aborting zombie #{step.info_file}" }
150
150
  step.abort unless step.done?
151
151
  raise RbbtRESTHelpers::Retry
152
152
  end
@@ -9,7 +9,7 @@ module RbbtRESTHelpers
9
9
  if @step
10
10
  @step.log(status, message = nil)
11
11
  else
12
- Log.info("[#{ status }] #{ message }")
12
+ Log.info{ "[#{ status }] #{ message }" }
13
13
  end
14
14
  end
15
15
 
@@ -40,13 +40,13 @@ module RbbtRESTHelpers
40
40
  if layout_file
41
41
  Haml::Engine.new(Open.read(layout_file), :filename => layout_file, :ugly => production?).render(self, locals) do
42
42
  cache(cache, locals.merge(:_template_file => template_file, :user => user).merge(cache_options)) do
43
- Log.debug("Rendering #{template_file} with layout")
43
+ Log.debug{ "Rendering #{template_file} with layout" }
44
44
  Haml::Engine.new(Open.read(template_file), :filename => template_file, :ugly => production?).render(self, locals)
45
45
  end
46
46
  end
47
47
  else
48
48
  cache(cache, locals.merge(:_template_file => template_file, :user => user).merge(cache_options)) do
49
- Log.debug("Rendering #{template_file} without layout")
49
+ Log.debug{ "Rendering #{template_file} without layout" }
50
50
  Haml::Engine.new(Open.read(template_file), :filename => template_file, :ugly => production?).render(self, locals)
51
51
  end
52
52
  end
@@ -36,7 +36,7 @@ module RbbtRESTHelpers
36
36
  filename = File.join(settings.file_dir, "all_js-#{md5}.js")
37
37
 
38
38
  if not File.exists?(filename)
39
- Log.debug("Regenerating JS Compressed file: #{ filename }")
39
+ Log.debug{ "Regenerating JS Compressed file: #{ filename }" }
40
40
 
41
41
  text = recorded_js_files.collect{|file|
42
42
  begin
@@ -13,7 +13,7 @@ module Sinatra
13
13
  def authorize!
14
14
  return true if authorized?
15
15
  target_url = request.env["REQUEST_URI"]
16
- Log.warn("Unauthorized access to #{target_url}")
16
+ Log.warn{ "Unauthorized access to #{target_url}" }
17
17
  session[:target_url] = target_url
18
18
  redirect '/login'
19
19
  end
@@ -51,7 +51,7 @@ module Sinatra
51
51
  pass = params[:pass]
52
52
 
53
53
  if settings.users.include?(user) and settings.users[user] == pass
54
- Log.warn("Successful login #{[user, pass] * ": "}")
54
+ Log.warn{ "Successful login #{[user, pass] * ": "}" }
55
55
  session[:authorized] = true
56
56
  session[:user] = user
57
57
  if session[:target_url]
@@ -61,7 +61,7 @@ module Sinatra
61
61
  redirect '/'
62
62
  end
63
63
  else
64
- Log.warn("Failed login attempt #{[user, pass] * ": "}")
64
+ Log.warn{ "Failed login attempt #{[user, pass] * ": "}" }
65
65
  session[:authorized] = false
66
66
  redirect '/login'
67
67
  end
@@ -87,12 +87,12 @@ module EntityRESTHelpers
87
87
  true
88
88
  when File.exists?(check_file)
89
89
  begin
90
- Log.debug("Checking action template: #{path}")
90
+ Log.debug{"Checking action template: #{path}"}
91
91
  code = File.read(check_file)
92
92
  accept = eval code
93
93
  not accept
94
94
  rescue
95
- Log.debug("Error Checking action template #{path}: #{$!.message}")
95
+ Log.debug{"Error Checking action template #{path}: #{$!.message}"}
96
96
  true
97
97
  end
98
98
  else
@@ -223,12 +223,12 @@ module EntityRESTHelpers
223
223
  true
224
224
  when File.exists?(check_file)
225
225
  begin
226
- Log.debug("Checking action template: #{path}")
226
+ Log.debug{ "Checking action template: #{path}" }
227
227
  code = File.read(check_file)
228
228
  accept = eval code
229
229
  not accept
230
230
  rescue
231
- Log.debug("Error Checking action template #{path}: #{$!.message}")
231
+ Log.debug{ "Error Checking action template #{path}: #{$!.message}" }
232
232
  true
233
233
  end
234
234
  else
@@ -345,12 +345,12 @@ module EntityRESTHelpers
345
345
  true
346
346
  when File.exists?(check_file)
347
347
  begin
348
- Log.debug("Checking action template: #{path}")
348
+ Log.debug{ "Checking action template: #{path}" }
349
349
  code = File.read(check_file)
350
350
  accept = eval code
351
351
  not accept
352
352
  rescue
353
- Log.debug("Error Checking action template #{path}: #{$!.message}")
353
+ Log.debug{ "Error Checking action template #{path}: #{$!.message}" }
354
354
  true
355
355
  end
356
356
  else
@@ -63,7 +63,7 @@ module Entity
63
63
  begin
64
64
  RbbtRESTHelpers.load_tsv(path).first
65
65
  rescue
66
- Log.error("Error loading map #{ path }: #{$!.message}")
66
+ Log.error{"Error loading map #{ path }: #{$!.message}"}
67
67
  nil
68
68
  end
69
69
  end
@@ -25,10 +25,13 @@ module Sinatra
25
25
 
26
26
  raise "For security reasons the file path must not leave the resource root directory" unless Misc.path_relative_to(resource.root, path)
27
27
 
28
- Log.debug("Serving resource: #{[resource, directory, path, path.find] * " | "}")
28
+ Log.debug{"Serving resource: #{[resource, directory, path, path.find] * " | "}"}
29
29
 
30
- raise "Directory does not exist" unless path.exists? or create
31
- raise "Directory does not exist and can not create it" unless path.exists? or path.produce.exists?
30
+ if create
31
+ raise "Directory does not exist and cannot be created" unless path.exists?
32
+ else
33
+ raise "Directory does not exist" unless Open.exists? path.find
34
+ end
32
35
 
33
36
  headers['Content-Encoding'] = 'gzip'
34
37
  stream do |out|
@@ -60,7 +63,7 @@ module Sinatra
60
63
 
61
64
  raise "For security reasons the file path must not leave the resource root directory" unless Misc.path_relative_to(resource.root, path)
62
65
 
63
- Log.debug("Resource: #{[resource, file, path, path.find] * " | "}")
66
+ Log.debug{"Resource: #{[resource, file, path, path.find] * " | "}"}
64
67
 
65
68
  raise "File does not exist and can not create it" unless path.exists?
66
69
 
@@ -42,7 +42,7 @@ module Sinatra
42
42
  set :allow_headers, ['URI']
43
43
 
44
44
  before do
45
- Log.info("#{request.request_method} #{request.ip}: " << request.path_info << ". Params: " << Misc.fingerprint(params))
45
+ Log.info{ "#{request.request_method} #{request.ip}: " << request.path_info << ". Params: " << Misc.fingerprint(params) }
46
46
  process_common_parameters
47
47
 
48
48
  if profile
@@ -51,7 +51,7 @@ module Sinatra
51
51
  end
52
52
 
53
53
  after do
54
- Log.info("#{request.request_method} #{request.ip}: " << request.path_info << ". Status: " << response.status.to_s)
54
+ Log.info{ "#{request.request_method} #{request.ip}: " << request.path_info << ". Status: " << response.status.to_s }
55
55
 
56
56
  if profile
57
57
  result = RubyProf.stop
@@ -60,7 +60,7 @@ module Sinatra
60
60
  dir = settings.file_dir
61
61
  FileUtils.mkdir_p dir unless File.exists? dir
62
62
  printer.print(:path => dir, :profile => 'profile')
63
- Log.info("Profile saved at #{ dir }: #{request.env["REQUEST_URI"]}")
63
+ Log.info{ "Profile saved at #{ dir }: #{request.env["REQUEST_URI"]}" }
64
64
  end
65
65
  response.header["URI"] = request.env["REQUEST_URI"]
66
66
  end
@@ -93,7 +93,7 @@ module Sinatra
93
93
 
94
94
  @cache_type = production? ? :synchronous : :none
95
95
  cache('css', :_template_file => file, :_send_file => true) do
96
- Log.debug("Rendering stylesheets")
96
+ Log.debug{ "Rendering stylesheets" }
97
97
  renderer = Sass::Engine.new(Open.read(file), :filename => file,
98
98
  :style => production? ? :compressed : nil,
99
99
  :debug_info => development? ? true : false)
@@ -37,7 +37,7 @@ module Sinatra
37
37
 
38
38
  add_workflow_resource(workflow) if add_resource
39
39
 
40
- Log.debug("Adding #{ workflow } to REST server")
40
+ Log.debug{ "Adding #{ workflow } to REST server" }
41
41
 
42
42
  self.instance_eval workflow.libdir.lib['sinatra.rb'].read, workflow.libdir.lib['sinatra.rb'].find if workflow.respond_to?(:libdir) and File.exists? workflow.libdir.lib['sinatra.rb']
43
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.28
4
+ version: 1.2.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez