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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84f167b5a1e8c21a585366673d66334bf50ef2b1a7c7734bad0876c1688fbaab
4
- data.tar.gz: d7b35e8aa095be976130c52cc3cfd76b46dcb95af51a3d37d5578b705f56fde8
3
+ metadata.gz: 00fb9e47f055bb4553d193ea6527cc4a5168b711cbf2e8567d5ab8b79fcff526
4
+ data.tar.gz: dd7cfda4ab899da2d4246a229bdbf2ff6a3d57194daecf0a65056291e53096e1
5
5
  SHA512:
6
- metadata.gz: 2866addc1ca028afc26af9017467d623c4010d574183d5cddb0a0a0e2fb7ba42b52fcc9dd5b2b437893b41545df0df7c5023adfd09e805fbfc9d38250a741331
7
- data.tar.gz: 284f2af7999e7e3fb32cffeeecb828f567a8e566ac0f7e3fa930d65d79f59484d9c7ae8e5e7c18cff138bfbc0d46beddd478873117bcc84cee34d67529c7f3be
6
+ metadata.gz: a153c02f23d249c3f9145d497b572cb68ac6460b77c98908213a4eddca3c991125d2f0e0602b5331e93bda301967b593b5514a085dc2202284c183bdbda6e991
7
+ data.tar.gz: dd5d943dfa1d47fc0f2177efff3c58fbac0ee722a90de4d46e0048847dc149742ee7f0cd03b456e88fe1e042b7ace3f5b4433612abd6ffdf8492bf9d142f301b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_scaffold_fan (0.1.4)
4
+ graphql_scaffold_fan (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlScaffoldFan
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_scaffold_fan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fan Zhang