graphql_scaffold_fan 0.1.3 → 0.1.4

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: 5ba50341e941f5a2367cb3a550f3701fc59eacbbb550184a9e697229b07e8ae4
4
- data.tar.gz: 687c142252f59cb524e2e3f01b8bc3aac8ed8cca769659e4cf5171b2c5710de1
3
+ metadata.gz: 84f167b5a1e8c21a585366673d66334bf50ef2b1a7c7734bad0876c1688fbaab
4
+ data.tar.gz: d7b35e8aa095be976130c52cc3cfd76b46dcb95af51a3d37d5578b705f56fde8
5
5
  SHA512:
6
- metadata.gz: 63d9ae28ce65ecae2f72ccddde40639eb6185624b12ce6a585d48ff8f70d858d73fa923b6ef3b25b9529c849b17f3d425d87e585a4cb145c79faed8267ab4b39
7
- data.tar.gz: d482fe72bcffba00321c07c0e708864182812655197a415319f8eeca4d695c5d4cf2d6f33edd79ce02a4975c84d3bfe79db938b32bc494be7d469fe07e84ceef
6
+ metadata.gz: 2866addc1ca028afc26af9017467d623c4010d574183d5cddb0a0a0e2fb7ba42b52fcc9dd5b2b437893b41545df0df7c5023adfd09e805fbfc9d38250a741331
7
+ data.tar.gz: 284f2af7999e7e3fb32cffeeecb828f567a8e566ac0f7e3fa930d65d79f59484d9c7ae8e5e7c18cff138bfbc0d46beddd478873117bcc84cee34d67529c7f3be
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in graphql_scaffold_fan.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rake', '~> 13.0'
8
+ gem 'rake', '~> 13.0'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_scaffold_fan (0.1.2)
4
+ graphql_scaffold_fan (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -9,6 +9,7 @@ TODO: Delete this and the text above, and describe your gem
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
+ gem 'graphql'
12
13
  gem 'graphql_scaffold_fan'
13
14
  ```
14
15
 
@@ -22,7 +23,12 @@ Or install it yourself as:
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ Run `rails generate -h` to see if the GraphqlScaffold genertors have been loaded correctly
27
+ Example commands:
28
+ `rails generate graphql_scaffold:init <ProjectName>` Initial command will use the root folder name as its ProjectName, so be free to enter any character here.
29
+ `rails generate graphql_scaffold:mutation <MutationName>`
30
+ `rails generate graphql_scaffold:type <TypeName>`
31
+
26
32
 
27
33
  ## Development
28
34
 
@@ -19,7 +19,7 @@ module GraphqlScaffold
19
19
  def create_admin_schema_file
20
20
  @top_folder_name = File.basename(Dir.getwd)
21
21
  dir_path = 'app/graphql'
22
- file_path = dir_path + "#{@top_folder_name.underscore}_admin_schema.rb"
22
+ file_path = dir_path + "/#{@top_folder_name.underscore}_admin_schema.rb"
23
23
  FileUtils.mkdir_p(dir_path) unless File.exist?(dir_path)
24
24
 
25
25
  if File.exist?(file_path)
@@ -6,9 +6,9 @@ module GraphqlScaffold
6
6
 
7
7
  def create_base_admin_mutation_file
8
8
  mutations_dir_path = 'app/graphql/mutations'
9
- generator_path = mutation_type_dir_path + '/base_admin_mutation.rb'
9
+ generator_path = mutations_dir_path + '/base_admin_mutation.rb'
10
10
 
11
- FileUtils.mkdir_p(mutation_type_dir_path) unless File.exist?(mutation_type_dir_path)
11
+ FileUtils.mkdir_p(mutations_dir_path) unless File.exist?(mutations_dir_path)
12
12
 
13
13
  if File.exist?(generator_path)
14
14
  p 'File base_admin_mutation.rb already exists'
@@ -117,7 +117,7 @@ module GraphqlScaffold
117
117
  file_data = file.read
118
118
  new_file_data = file_data.insert(-15, " has_admin_mutation :#{class_name}\n ")
119
119
  File.write(file, new_file_data)
120
- p 'Write to query_type.rb successfully'
120
+ p 'Write to mutation_type.rb successfully'
121
121
  else
122
122
  template 'mutation_type.haml', generator_path
123
123
  end
@@ -5,7 +5,7 @@ module Mutations
5
5
  type Types::Admin::<%= class_name %>Type
6
6
 
7
7
  def resolve(id:)
8
- <%= class_name.underscore %> = ::<%= class_name %>.find(id)
8
+ <%= class_name.underscore %> = <%= class_name %>.find(id)
9
9
  <%= class_name.underscore %>.destroy!
10
10
  <%= class_name.underscore %>
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlScaffoldFan
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fan Zhang