vandal_ui 0.3.3 → 0.4.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 +4 -4
- data/README.md +23 -1
- data/app/controllers/vandal_ui/schemas_controller.rb +6 -0
- data/config/routes.rb +3 -0
- data/lib/vandal_ui.rb +1 -0
- data/lib/vandal_ui/engine.rb +4 -0
- data/lib/vandal_ui/tasks.rb +3 -1
- data/lib/vandal_ui/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 403cbddb72e485e62f024ea8cfc47e9e3efaccc1
|
4
|
+
data.tar.gz: 3785dabe03246e647faf9bb14976166065a77b87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39f13c66cf2a8f8f8c1969e05fddf897802070736554c1b8875324ecf24285c6645f32ef0002c9119055ade346c70b7dc80514974183d786ce0004af7f37bf61
|
7
|
+
data.tar.gz: 54c6994b1077e716b5a54ee647a7e83badccf35a64bc7d6b157eef1ed15bebe06838f61053495e0ad5ce89e5552d47525b849dc7f09a89c56b9d56c4cbc631f4
|
data/README.md
CHANGED
@@ -1 +1,23 @@
|
|
1
|
-
# Vandal
|
1
|
+
# Vandal UI
|
2
|
+
|
3
|
+
This is a Rails engine for
|
4
|
+
[Graphiti](https://graphiti-api.github.io/graphiti/guides/) APIs. It has
|
5
|
+
two main functions:
|
6
|
+
|
7
|
+
* `rake vandal:install` will copy static files to `public/<api_namespace>`.
|
8
|
+
* Mounting the engine adds an endpoint for a dynamically-generated
|
9
|
+
schema file:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
# config/routes.rb
|
13
|
+
|
14
|
+
scope path: ApplicationResource.endpoint_namespace, defaults: { format: :jsonapi } do
|
15
|
+
# ... routes ...
|
16
|
+
|
17
|
+
mount VandalUi::Engine, at: '/vandal'
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
If `ApplicationRecord.endpoint_namespace` is `/api/v1`, you'd get a
|
22
|
+
`/api/v1/vandal/schema.json` that would be referenced when loading the
|
23
|
+
UI.
|
data/config/routes.rb
ADDED
data/lib/vandal_ui.rb
CHANGED
data/lib/vandal_ui/tasks.rb
CHANGED
@@ -2,7 +2,9 @@ namespace :vandal do
|
|
2
2
|
task :install do
|
3
3
|
cfg = YAML.load_file("#{Rails.root}/.graphiticfg.yml")
|
4
4
|
namespace = cfg['namespace']
|
5
|
-
|
5
|
+
|
6
|
+
vandal_path = VandalUi::Engine.routes.find_script_name({})
|
7
|
+
schema_path = "#{vandal_path}/schema.json"
|
6
8
|
|
7
9
|
source = File.join(File.dirname(__FILE__), 'static')
|
8
10
|
destination = "#{Rails.root}/public/#{namespace}"
|
data/lib/vandal_ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vandal_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
@@ -66,9 +66,12 @@ files:
|
|
66
66
|
- Gemfile.lock
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
+
- app/controllers/vandal_ui/schemas_controller.rb
|
69
70
|
- bin/console
|
70
71
|
- bin/setup
|
72
|
+
- config/routes.rb
|
71
73
|
- lib/vandal_ui.rb
|
74
|
+
- lib/vandal_ui/engine.rb
|
72
75
|
- lib/vandal_ui/railtie.rb
|
73
76
|
- lib/vandal_ui/static/assets/img/squares.png
|
74
77
|
- lib/vandal_ui/static/css/app.ef4cd70f.css
|