dandelion_s1 0.1.10 → 0.2.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1abc77664106f95480a31a3b78bf9d81f484c7c
4
- data.tar.gz: 67fdcc611da10351e1ab06f74561dca6fe7c0749
3
+ metadata.gz: 7e9ff3cb5efdc68ee7385d5c1b8d975202d96526
4
+ data.tar.gz: 52f232490fdfdf27eeb3ddb9a875545a9710971e
5
5
  SHA512:
6
- metadata.gz: b57263c28523cdc4210c931db2712cfe4d81ac06080b6287eec211f221b4fcc2d4557eb90c9baa485e97260946f0c4afa70d92b6f97e962f917df82a00489f5b
7
- data.tar.gz: 494e8620838dc3296816f98762f3e8fc324d6c130b641ed1e67f631674054b87f67e5b5a1851d47bb6037336c8996ae88678da6ffddc72b65b39a9e3c2e49a79
6
+ metadata.gz: f54b7004459dfd27f7c62ca188bfea688a1035c9707cc3f5c6b45a7bfcd71e1c8acfd5c31f6f1aeadbd2f0b01a32ade832fcb9db2a434b9479ae89ccad9d368d
7
+ data.tar.gz: 7dd3280337401fe36b4d6834508b622b801cbfaef7749e582f3790f128d6f216f332a44adc26cf99e6252d2db331c20173a0ba851764916083cc35d631ebad7b
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/dandelion_s1.rb CHANGED
@@ -10,7 +10,7 @@ class DandelionS1 < RackRscript
10
10
 
11
11
  def initialize(h={})
12
12
 
13
- raw_opts = {root: 'www', access: {}, static: []}.merge h
13
+ raw_opts = {root: 'www', access: {}, static: [], log: nil}.merge h
14
14
  @app_root = Dir.pwd
15
15
 
16
16
  @static = raw_opts[:static]
@@ -24,7 +24,7 @@ class DandelionS1 < RackRscript
24
24
  @access_list = conf_access.inject({}) \
25
25
  {|r,x| k,v = x; r.merge(k.to_s => v.split)}
26
26
 
27
- super(logfile: h[:logfile], pkg_src: h[:pkg_src], rsc_host: h[:rsc_host],
27
+ super(log: h[:log], pkg_src: h[:pkg_src], rsc_host: h[:rsc_host],
28
28
  rsc_package_src: h[:rsc_package_src])
29
29
  end
30
30
 
@@ -38,7 +38,8 @@ class DandelionS1 < RackRscript
38
38
  super(e)
39
39
  elsif private_user.is_a? String and private_user == e['REMOTE_USER']
40
40
  super(e)
41
- elsif private_user.is_a? Array and private_user.any? {|x| x == e['REMOTE_USER']}
41
+ elsif private_user.is_a? Array and
42
+ private_user.any? {|x| x == e['REMOTE_USER']}
42
43
  super(e)
43
44
  else
44
45
  request = '/unauthorised/'
@@ -56,7 +57,11 @@ class DandelionS1 < RackRscript
56
57
  get /^(\/(?:#{@static.join('|')}).*)/ do |path|
57
58
 
58
59
  filepath = File.join(@app_root, @root, path)
59
- log("root: %s path: %s" % [@root, path])
60
+
61
+ if @log then
62
+ @log.info 'DandelionS1/default_routes: ' +
63
+ "root: %s path: %s" % [@root, path]
64
+ end
60
65
 
61
66
  if path.length < 1 or path[-1] == '/' then
62
67
  path += 'index.html'
@@ -66,7 +71,7 @@ class DandelionS1 < RackRscript
66
71
  elsif File.exists? filepath then
67
72
  h = {xml: 'application/xml', html: 'text/html', png: 'image/png',
68
73
  jpg: 'image/jpeg', txt: 'text/plain', css: 'text/css',
69
- xsl: 'application/xml'}
74
+ xsl: 'application/xml', svg: 'image/svg+xml'}
70
75
  content_type = h[filepath[/\w+$/].to_sym]
71
76
  [File.read(filepath), content_type || 'text/plain']
72
77
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dandelion_s1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  pyJm5LdEycjtTNHCuWHnBmZ5AVetwku2PZdaJAb5ygezNQbu5ynq/HBIMWdTabUY
32
32
  Zfqb8EuDqrBL9w==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-06-07 00:00:00.000000000 Z
34
+ date: 2017-11-13 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack-rscript
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '1.0'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.0.1
45
+ version: 1.0.2
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '1.0'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.0.1
55
+ version: 1.0.2
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: simple-config
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.6.8
103
+ rubygems_version: 2.6.13
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: A kind of Rack-Rscript web server which facilitates static files, basic authentication,
metadata.gz.sig CHANGED
Binary file