graphiti-openapi 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 016af749520b2022ed87226b8f5b3305a853d15c730df746e6f0a8b9f3cf4777
4
- data.tar.gz: 116ec81ab98c31c7abaf99b5fbae113bcd359b871a74aa0629ad9fe94f00757f
3
+ metadata.gz: b55696fb0c02cb5599196242b625518765fa1d0f11247d3cb8a0f38a454873cc
4
+ data.tar.gz: f610802337a202875a5393d399428c2a8e11695857a11bcbe3625b528f978a5b
5
5
  SHA512:
6
- metadata.gz: cf1c3e0dea0bdf856719aff1f5734c9cad78cec2b8f0435be81b5999592af4a1297fab10ea949ac1df4bf784ae20ca8fbdfe9ab93b779f538def9320ee99822b
7
- data.tar.gz: 64c04d3e8fffcf7ae3920f4aed68f8cc02636e9557c9506226ee859c0ec8d0b946d6128692287eefe2c9533536d5bbd4794af5b850ec92d32aecce898aa37214
6
+ metadata.gz: bf849703c5509c968d7a0cde588da465530871409e78b6dc9b941cc28f0c03a319cf4a3604b4b847b163e4e266b389bb4538c2f772f290c86e7dc812981bb71c
7
+ data.tar.gz: 8a3ff8978c98f24e1679b568d91277ed8a9ebc63c31ca26fd881056895e6f5ebbb3e0c7f801ce2a1a036bb04cd260bb9e7bea7362c951270b5e8e5f3b65622b4
@@ -1,5 +1,5 @@
1
1
  module Graphiti
2
2
  module OpenAPI
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require "open-uri"
3
+ require "pathname"
2
4
 
3
5
  jsonapi_schema = 'public/schemas/jsonapi.json'
4
6
 
@@ -12,7 +14,7 @@ namespace :graphiti do
12
14
  system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}"
13
15
  end
14
16
 
15
- task generate: :environment do
17
+ task generate: %W[environment #{jsonapi_schema}] do
16
18
  generator = Graphiti::OpenAPI::Generator.new
17
19
  api = Rails.root.join("public#{ApplicationResource.endpoint_namespace}")
18
20
  api.join("openapi.json").write(generator.to_openapi.to_json)
@@ -26,8 +28,6 @@ namespace :assets do
26
28
  end
27
29
 
28
30
  file jsonapi_schema do |t|
29
- require 'open-uri'
30
-
31
- # mkdir_p(File.dirname(t.name))
31
+ Pathname(t.name).dirname.mkpath
32
32
  File.write(t.name, open('http://jsonapi.org/schema').read)
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Semyonov