et_fake_ccd 1.0.0 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f4521164ce6e915d1cac0c7c1ad03a3e824c469ee2c1fe7db671c369373975d
4
- data.tar.gz: aa2fb84f10c0aac9483763e4ce105a503cb4d935b4653fb61b45e92817e5822f
3
+ metadata.gz: 222da7c19a6414c1a8fbfaa7f2026085f3d27909c048dab3b2aa14f6ba40b6d2
4
+ data.tar.gz: 2a7185247e4b6e1427b567c4ac8ce74d859bc48f337180ee37dc689dd5a40db9
5
5
  SHA512:
6
- metadata.gz: f4a503334e2f745ec63b306072e20389c97cd3093ea803300ec2e1e17486534f08cc5343f6c491cc6f2f9cad9272a6d2a52a73390dc212f687e25669d0ab270f
7
- data.tar.gz: 8c5828eb3733c55809a6f27b0463c124660d57bcadd08b8d2e9add6d75f4647074afbb8e7fbccc5dde798566bc416d834c0ef163246ea630be0bc5360d47a537
6
+ metadata.gz: a503eaf45755544233ed09eb4f68ab120b0867b00de6be3e93bc52baa52e0cf535851d1fa0c378ee6cf1a4cd7d80be6cad2e6878d1604cfff640f6e2faba0901
7
+ data.tar.gz: 4df9c0162603be5d327a8b504799a11faceed3e151cdb6eae79af9f9b45062928630e1a4441956589400691957826a967f2c7939099781851bd9e3b40faf96bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_fake_ccd (1.0.0)
4
+ et_fake_ccd (1.0.1)
5
5
  activemodel (>= 5.2.3)
6
6
  iodine (~> 0.7)
7
7
  json-schema (~> 2.5)
data/README.md CHANGED
@@ -31,6 +31,16 @@ To run the server, use the command
31
31
  et_fake_ccd start
32
32
  ```
33
33
 
34
+ or if you want to specify which json schema file you want to use for validation (no default
35
+ is provided as it changes in CCD regularly using the config file), you can either specify the otion
36
+ 'create_case_schema' as shown below OR you can specify the environment variable ET_FAKE_CCD_CREATE_CASE_SCHEMA instead.
37
+
38
+ The 'master' definition of this file is here https://raw.githubusercontent.com/hmcts/et-ccd-export/develop/spec/json_schemas/case_create.json
39
+ so use wget or curl etc.. or just a browser to download it if you want real life validation.
40
+
41
+ ```
42
+ et_fake_ccd start --create_case_schema=<path_to_file>
43
+ ```
34
44
  ## Testing Using This Fake Server
35
45
 
36
46
  In general, this server will try to act like the normal CCD server but only in terms of accepting
data/lib/et_fake_ccd.rb CHANGED
@@ -8,7 +8,9 @@ module EtFakeCcd
8
8
  # Your code goes here...
9
9
  #
10
10
  def self.config
11
- Config.instance
11
+ Config.instance.tap do |instance|
12
+ yield instance if block_given?
13
+ end
12
14
  end
13
15
  end
14
16
 
@@ -10,7 +10,16 @@ module EtFakeCcd
10
10
 
11
11
  desc "start", "Run multiple services on one port"
12
12
  method_option :port, type: :numeric, default: 8080
13
+ method_option :create_case_schema, type: :string, default: ENV.fetch('ET_FAKE_CCD_CREATE_CASE_SCHEMA', nil)
14
+
13
15
  def start
16
+ if options.create_case_schema && !File.exist?(options.create_case_schema)
17
+ puts "Error - The file #{options.create_case_schema} does not exist."
18
+ return
19
+ end
20
+ ::EtFakeCcd.config do |c|
21
+ c.create_case_schema_file = options.create_case_schema
22
+ end
14
23
  Rack::Server.start app: EtFakeCcd::RootApp, Port: options.port, server: 'iodine'
15
24
  end
16
25
  end
@@ -1,3 +1,3 @@
1
1
  module EtFakeCcd
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et_fake_ccd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor