rack-rscript 0.7.1 → 0.8.0

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
  SHA1:
3
- metadata.gz: c1aecdceddae7e8344cdbf8798790c72ec9dc20d
4
- data.tar.gz: 7f0c196b9ceeab8c7ef2f2cbbfcb35fb7b666455
3
+ metadata.gz: 31ffa65b11727294cc6039058ff7d8834a0c5a5a
4
+ data.tar.gz: 1db517ed4dd53d389f4a9a704d257c42093c334c
5
5
  SHA512:
6
- metadata.gz: 7b7067382b26de914c7005f283a7574bc79e1a7e9e0b227271facfa304d9de42d311883850708711c96dd36cdeb5ec38c9453aa695ebcc9150982ff66ee3470a
7
- data.tar.gz: bc4e243eb52d0d27bf53a7b8b93416e1a97e32f02600b8193f8c4dc5e73edadaeb495bfad43be6b0b6088609b04fe17154ae2f081f04e6d24df650bf0a592e72
6
+ metadata.gz: 5e0c296771d9e7813e15ce33beb89544e64f5ec60d38c6efc3db4488006f1ddb052d59e44f89d408d28208347c96e1d301d51cf7ef20d49e2df65355daa3d71c
7
+ data.tar.gz: c15ffc86a08c9b0b8d1771f9cf8dbdef69927336fa2fa894d26e84a4d3afae83f807cd253e1b9e03abb4b743c36c686b2a4ce1a429830c9eeabd888ec003c3dd
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rack-rscript.rb CHANGED
@@ -26,22 +26,22 @@ class RackRscript
26
26
  include AppRoutes
27
27
 
28
28
 
29
- def initialize(raw_opts={})
29
+ def initialize(logfile: '', logrotate: 'daily', pkg_src: '', cache: true)
30
30
 
31
31
  @params = {}
32
32
  @templates = {}
33
33
 
34
- @rrscript = RScript.new
34
+ @rrscript = RScript.new logfile: logfile, logrotate: logrotate, \
35
+ pkg_src: pkg_src, cache: cache
35
36
 
36
- opts = {logfile: '', logrotate: 'daily', pkg_src: ''}.merge(raw_opts)
37
- @url_base = opts[:pkg_src] # web server serving the RSF files
37
+ @url_base = pkg_src # web server serving the RSF files
38
38
  @url_base += '/' unless @url_base[-1] == '/'
39
39
 
40
40
  @log = false
41
41
 
42
- if opts[:logfile].length > 0 then
42
+ if logfile.length > 0 then
43
43
  @log = true
44
- @logger = Logger.new(opts[:logfile], opts[:logrotate])
44
+ @logger = Logger.new(logfile, logrotate)
45
45
  end
46
46
 
47
47
  super() # required for app-routes initialize method to exectue
@@ -89,6 +89,8 @@ class RackRscript
89
89
 
90
90
  passthru_proc = lambda{|c, ct| [c,ct]}
91
91
 
92
+
93
+
92
94
  ct_list = {
93
95
  'text/html' => passthru_proc,
94
96
  'text/haml' => tilt_proc,
@@ -101,6 +103,7 @@ class RackRscript
101
103
  'image/png' => passthru_proc,
102
104
  'image/jpeg' => passthru_proc
103
105
  }
106
+
104
107
  content_type ||= 'text/html'
105
108
  status_code ||= 200
106
109
  proc = ct_list[content_type]
@@ -109,7 +112,7 @@ class RackRscript
109
112
 
110
113
  [status_code, {"Content-Type" => content_type}, [content]]
111
114
  end
112
- end
115
+ end
113
116
 
114
117
  def clear_cache()
115
118
  @rrscript.reset
@@ -159,6 +162,11 @@ class RackRscript
159
162
  def redirect(url)
160
163
  Redirect.new url
161
164
  end
165
+
166
+ # j2 140616 not yet used and still needs to be tested
167
+ def transform(xsl, xml)
168
+ Rexslt.new(xsl, xml).to_s
169
+ end
162
170
 
163
171
  def haml(name,options={})
164
172
  render name, :haml, options
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-rscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  SPldGmxByaKACzPfwVD1OWtnfTgqGsJzquNqO244CsVqGhH2zKMpfEJWX9h/FVqy
32
32
  XUT2A0hr22sJdA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-09-17 00:00:00.000000000 Z
34
+ date: 2016-06-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack
@@ -39,20 +39,20 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '1.5'
42
+ version: '1.6'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.5.2
45
+ version: 1.6.4
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '1.5'
52
+ version: '1.6'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.5.2
55
+ version: 1.6.4
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: app-routes
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  version: '0.2'
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.2.2
85
+ version: 0.2.4
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,7 +92,7 @@ dependencies:
92
92
  version: '0.2'
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 0.2.2
95
+ version: 0.2.4
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: haml
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -102,7 +102,7 @@ dependencies:
102
102
  version: '4.0'
103
103
  - - ">="
104
104
  - !ruby/object:Gem::Version
105
- version: 4.0.5
105
+ version: 4.0.7
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
@@ -112,7 +112,7 @@ dependencies:
112
112
  version: '4.0'
113
113
  - - ">="
114
114
  - !ruby/object:Gem::Version
115
- version: 4.0.5
115
+ version: 4.0.7
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: tilt
118
118
  requirement: !ruby/object:Gem::Requirement
@@ -139,20 +139,20 @@ dependencies:
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: '2.0'
142
+ version: '3.0'
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 2.0.2
145
+ version: 3.0.7
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '2.0'
152
+ version: '3.0'
153
153
  - - ">="
154
154
  - !ruby/object:Gem::Version
155
- version: 2.0.2
155
+ version: 3.0.7
156
156
  description:
157
157
  email: james@r0bertson.co.uk
158
158
  executables: []
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project:
183
- rubygems_version: 2.4.8
183
+ rubygems_version: 2.5.1
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: Rack-Rscript is a light-weight alternative to Sinatra-Rscript.
metadata.gz.sig CHANGED
Binary file