graphql_scaffold_fan 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/generators/graphql_scaffold/init_generator.rb +17 -0
- data/lib/graphql_scaffold_fan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00fb9e47f055bb4553d193ea6527cc4a5168b711cbf2e8567d5ab8b79fcff526
|
4
|
+
data.tar.gz: dd7cfda4ab899da2d4246a229bdbf2ff6a3d57194daecf0a65056291e53096e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a153c02f23d249c3f9145d497b572cb68ac6460b77c98908213a4eddca3c991125d2f0e0602b5331e93bda301967b593b5514a085dc2202284c183bdbda6e991
|
7
|
+
data.tar.gz: dd5d943dfa1d47fc0f2177efff3c58fbac0ee722a90de4d46e0048847dc149742ee7f0cd03b456e88fe1e042b7ace3f5b4433612abd6ffdf8492bf9d142f301b
|
data/Gemfile.lock
CHANGED
@@ -41,6 +41,23 @@ module GraphqlScaffold
|
|
41
41
|
template 'admin_controller.haml', file_path
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
def add_route
|
46
|
+
route_dir_path = 'config'
|
47
|
+
route_file_path = route_dir_path + '/routes.rb'
|
48
|
+
|
49
|
+
FileUtils.mkdir_p(route_dir_path) unless File.exist?(route_dir_path)
|
50
|
+
|
51
|
+
if File.exist?(route_file_path)
|
52
|
+
file = File.open(route_file_path)
|
53
|
+
file_data = file.read
|
54
|
+
new_file_data = file_data.insert(-6, "\n mount GraphqlPlayground::Rails::Engine, at: '/graphiql_admin', graphql_path: 'api/admin/graphql', as: :admin_graphiql\n post 'api/admin/graphql', to: 'graphql_admin#execute'")
|
55
|
+
File.write(file, new_file_data)
|
56
|
+
p 'Write to routes.rb successfully'
|
57
|
+
else
|
58
|
+
p 'Please create routes.rb file under config folder firstly'
|
59
|
+
end
|
60
|
+
end
|
44
61
|
end
|
45
62
|
end
|
46
63
|
end
|