walle-server 0.0.1

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.
Files changed (7) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +6 -0
  3. data/LICENSE +6 -0
  4. data/README.md +0 -0
  5. data/bin/walle +19 -0
  6. data/walle.rb +43 -0
  7. metadata +48 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ec2fa7d551feb1033cd564281560460541eb83b67193b5e7ff7e9f80a878d9b7
4
+ data.tar.gz: 7e6188414b256df1f973d494c334e89ac77c8f0ff57535a48c9b3dfc28b42994
5
+ SHA512:
6
+ metadata.gz: d24877423b44f01165987e41f4d893d51404a874d5a66c9ced5f256863a6dd315f71575f4a1477c46cad7a481682a5a366c627d4d73f2ea87e2357eadce7caf7
7
+ data.tar.gz: c80592f69f38c1139e5eaecc1a724743a940d63c5f5649c26736fc27a8368808700973dccf02c694463b8b1b9764e92e180b759c9f369c0fcff290fb48593d71
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ ruby "2.6.5"
4
+
5
+ gem "sinatra"
6
+ gem "thin"
data/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ Copyright (c) 2018 Niklas Hanft
2
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+
4
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
File without changes
data/bin/walle ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ usage = "Usage: ski :project run :pipeline"
6
+
7
+ # This will hold the options we parse
8
+ options = {}
9
+
10
+ OptionParser.new do |opts|
11
+ opts.on('-P', '--project PROJECT', 'Given project') do |project|
12
+ options[:project] = project
13
+ end
14
+ opts.on('-p', '--pipeline PIPELINE', 'Given pipeline') do |pipeline|
15
+ options[:pipeline] = pipeline
16
+ end
17
+ end.parse!
18
+
19
+ require_relative '../walle'
data/walle.rb ADDED
@@ -0,0 +1,43 @@
1
+ require 'sinatra'
2
+
3
+ # configs = Dir.glob("conf/*.json")
4
+ # configs = configs.map {|config_path| JSON.parse(File.read config_path) }
5
+
6
+ config = JSON.parse(File.read("./config.json"))
7
+
8
+ app = Sinatra.new do
9
+
10
+ before "*" do
11
+ #halt 404 unless request.host == config["domain"]
12
+ end
13
+
14
+ get "*" do
15
+
16
+ if File.join(request.path).end_with?(".html", ".ico", ".png", ".jpg", ".txt")
17
+ return send_file request.path
18
+ end
19
+
20
+ erb (request.path + "/index").to_sym
21
+
22
+ end
23
+
24
+ configure do
25
+ set(:views, config["base_directory"])
26
+ enable :sessions if config["enable_sessions"]
27
+ end
28
+
29
+ error do
30
+ halt 500
31
+ end
32
+
33
+ not_found do
34
+ halt 404
35
+ end
36
+
37
+ error Errno::ENOENT do
38
+ halt 404
39
+ end
40
+
41
+ end
42
+
43
+ app.run!
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: walle-server
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Niklas Hanft
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-10-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: README.md
14
+ email: hello@niklashanft.com
15
+ executables:
16
+ - walle
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Gemfile
21
+ - LICENSE
22
+ - README.md
23
+ - bin/walle
24
+ - walle.rb
25
+ homepage: https://github.com/nhh/walle
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '2.5'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubygems_version: 3.0.6
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Bring ruby to the masses (webserver)
48
+ test_files: []