rbbt-rest 1.8.132 → 1.8.133

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: 464fd570357391510764587f5d9e2f95afa8710e788d17416827cdcf4c6c545a
4
- data.tar.gz: 7ef1b6650b360534dd2faf6217e517c165a0c09fe609c4b3c4fca47e6c257e6a
3
+ metadata.gz: dbd372404c5852b1fbb2ff81458ac565c59aef590d691684e133ae25d8f4870d
4
+ data.tar.gz: 5d60c4e944ec6f9c5a38b46a907ae393bbcd876dca7cdef277f8caafa488c9af
5
5
  SHA512:
6
- metadata.gz: 5fc9136e2be86b9cb4c4276951904f5b72b72a9403edbcfb560e3f7f45e638439ca202f1975409743a95fd14565777d81459ceacbe8ecf8a7c3b7b76dd98ab4b
7
- data.tar.gz: a74fc7287fa78a6a758cdacf0814e6610a33d7bbdb3087f6bb40849746742f87c8711ea29c288b0f689e8f85da3de0830a21c482b4b8273302a0d54dc80fddbe
6
+ metadata.gz: 7476ccde9c44721f3d1374b9640aeffda1223ea422b6fad58f6dff36ea14cbe61b342cd3867b50a44ec699397504bc2de2ed45f11f6ae6e524d1ada1d21ce13a
7
+ data.tar.gz: 5ded5d4e71d4ce4e330de4d18a7485daeb65ea78b2053de9e56c88c47ce8d0cb4c15462ae354b4bee622d07bb2e2e6cd51d10f8d7d6a5a5332cb502411e2a01b
@@ -69,6 +69,8 @@ module Sinatra
69
69
  entity_type = consume_parameter :entity_type
70
70
  entity = consume_parameter :entity
71
71
 
72
+ entity = Entity::REST.restore_element(entity)
73
+
72
74
  entity_type = Entity::REST.restore_element(entity_type)
73
75
 
74
76
  entity = setup_entity(entity_type, entity, @clean_params)
@@ -83,6 +85,8 @@ module Sinatra
83
85
  entity = consume_parameter :entity
84
86
  action = consume_parameter :action
85
87
 
88
+ entity = Entity::REST.restore_element(entity)
89
+
86
90
  entity_type = Entity::REST.restore_element(entity_type)
87
91
 
88
92
  entity = setup_entity(entity_type, entity, @clean_params)
@@ -14,11 +14,11 @@ module Entity
14
14
  #{{{ MISC
15
15
 
16
16
  def self.clean_element(elem)
17
- elem.gsub('/', '-..-').gsub('%', 'o-o').gsub('[','(.-(').gsub(']',').-)')
17
+ elem.gsub('/', '-..-').gsub("|", '-...-').gsub('%', 'o-o').gsub('[','(.-(').gsub(']',').-)')
18
18
  end
19
19
 
20
20
  def self.restore_element(elem)
21
- CGI.unescape(CGI.unescape(elem.gsub('-..-', '/').gsub('o-o', '%').gsub('(.-(','[').gsub(').-)',']')))
21
+ CGI.unescape(CGI.unescape(elem.gsub('-..-', '/').gsub('-...-', '|').gsub('o-o', '%').gsub('(.-(','[').gsub(').-)',']')))
22
22
  end
23
23
 
24
24
  def self.setup(mod)
@@ -84,13 +84,13 @@ module Entity
84
84
  end
85
85
 
86
86
 
87
- url = File.join('/', 'entity', Entity::REST.clean_element(type.to_s), entity)
87
+ url = File.join('/', 'entity', Entity::REST.clean_element(type.to_s), Entity::REST.clean_element(entity))
88
88
  url << "?" << Misc.hash2GET_params(params) if params.any?
89
89
  url
90
90
  end
91
91
 
92
92
  def self.entity_action_url(entity, type, action, params = {})
93
- url = File.join('/', 'entity_action', Entity::REST.clean_element(type.to_s), action.to_s, entity)
93
+ url = File.join('/', 'entity_action', Entity::REST.clean_element(type.to_s), action.to_s, Entity::REST.clean_element(entity))
94
94
  url << "?" << Misc.hash2GET_params(params) if params.any?
95
95
  url
96
96
  end
@@ -0,0 +1,15 @@
1
+ - filename = 'R-png_' << rand(10000).to_s unless defined? filename and filename
2
+ - text = filename unless defined? text and text
3
+
4
+ - size = 3 unless defined? size and size
5
+ - width = size unless defined? width and width
6
+ - height = size unless defined? height and height
7
+ - plot = block.call unless (defined? plot and plot) or not defined? block
8
+ - plot_options = {} unless defined? plot_options and plot_options
9
+
10
+ - filename += '.png' unless filename =~ /\.png$/i
11
+ - require 'rbbt/util/R'
12
+
13
+ = resource filename, text, :image do |filename|
14
+ - R::PNG.ggplot(filename, data, plot, width, height, plot_options)
15
+
@@ -7,6 +7,7 @@
7
7
  - plot = block.call unless (defined? plot and plot) or not defined? block
8
8
 
9
9
  - filename += '.png' unless filename =~ /\.png$/i
10
+ - require 'rbbt/util/R'
10
11
  = resource filename, text, :image do |filename|
11
12
  - TmpFile.with_file(plot) do |plot_file|
12
13
  - if defined? data
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.132
4
+ version: 1.8.133
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-07 00:00:00.000000000 Z
11
+ date: 2020-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -1855,6 +1855,7 @@ files:
1855
1855
  - share/views/public/robots.txt
1856
1856
  - share/views/public/spain_logo.svg
1857
1857
  - share/views/tasks.haml
1858
+ - share/views/tools/Rggplot.haml
1858
1859
  - share/views/tools/Rpng.haml
1859
1860
  - share/views/tools/nvd3.haml
1860
1861
  - share/views/tools/nvd3/chart.haml