file_sv 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/file_sv +9 -2
- data/lib/file_sv/global_settings.rb +4 -0
- data/lib/file_sv/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72954e0e4bfe4eda783ccb40b4219bcd7a915a86c328e9157625c9151d085de4
|
4
|
+
data.tar.gz: e250a4b0320757bc1577a538be9e59c72ec12a25f4b3a4e442bde182784a3cdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3c6837fcb24dcad7355cf32f7c2f868393935224f32826ee5d585e522fdd07ddb42d8d761362ead1ed997cc4eb88550e30c3dc569a3affd4ae088034364ffb
|
7
|
+
data.tar.gz: 42f8f2b8c2a149ebbdb61924dd3aaede4797da0dc3ebb3ab13945bc7cc719f3b3e32330b546c927320e3dd42c6d951ad5ac99adefcdf271f9eecf1d85e79060a
|
data/exe/file_sv
CHANGED
@@ -6,16 +6,23 @@ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
|
6
6
|
|
7
7
|
# Executable for Generic Test
|
8
8
|
class Exe < Thor
|
9
|
+
def self.exit_on_failure?
|
10
|
+
true
|
11
|
+
end
|
12
|
+
|
9
13
|
desc "plan folder", "Show plan for service virtualization based on folder"
|
10
|
-
def plan(folder)
|
14
|
+
def plan(folder = nil)
|
11
15
|
require "file_sv"
|
16
|
+
if (!folder && GlobalSettings.serving_folder)
|
17
|
+
folder = GlobalSettings.serving_folder unless folder
|
18
|
+
end
|
12
19
|
ServiceLoader.create_plan_for folder
|
13
20
|
end
|
14
21
|
|
15
22
|
option :crt, default: nil, banner: "HTTPS CRT"
|
16
23
|
option :key, default: nil, banner: "HTTPS key"
|
17
24
|
desc "serve folder", "Serve virtual service based on folder"
|
18
|
-
def serve(folder)
|
25
|
+
def serve(folder = nil)
|
19
26
|
plan folder
|
20
27
|
ServiceLoader.serve_plan options
|
21
28
|
end
|
@@ -10,6 +10,8 @@ class GlobalSettings
|
|
10
10
|
|
11
11
|
@https = false
|
12
12
|
|
13
|
+
@serving_folder = '.'
|
14
|
+
|
13
15
|
@ignore_status_codes = nil
|
14
16
|
class << self
|
15
17
|
# @return [String] Default REST method when none specified by filename
|
@@ -26,6 +28,8 @@ class GlobalSettings
|
|
26
28
|
attr_accessor :key
|
27
29
|
# @return [Array] List of http status codes to ignore
|
28
30
|
attr_accessor :ignore_status_codes
|
31
|
+
# @return [String] Path from current location to serve folders from
|
32
|
+
attr_accessor :serving_folder
|
29
33
|
|
30
34
|
# @param [Integer] status_code HTTP status code
|
31
35
|
# @return [Boolean] Whether status code is currently ignored
|
data/lib/file_sv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_sv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garratt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.5.3
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: REST service virtualisation through file structure.
|