souls 0.16.0 → 0.16.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 228bc348ee98475ded06a4f957c7ebd98d0b3cd7559fa6526df7b7ac8b587a19
4
- data.tar.gz: 39ad6984a3317fb407a18ef4fe0acf32ead125edb03787e667f580cfdc334ec8
3
+ metadata.gz: ecbbcfd268702626603691c3b4e206e3787c2b3a52db1c130d7d36cbb039b513
4
+ data.tar.gz: 761fd5f0a11eb5101f41c2cec69d0e3b8ffb6647e09c4bae308ae54ab8c5103e
5
5
  SHA512:
6
- metadata.gz: f70d561219a5443ffca7e717dfb1106c080090e1345991b9c3721b0cc61789527cb8e5b97dbab500f32bc6a15b71276dcb654a5f8822333103e36f1d4dc0e90c
7
- data.tar.gz: 96ecddf8f92a715dec2be50ccffb327d5e0ec7f0d6427b6002414ed6f0a72f0313ca0e5793e2590efe61d5efa63a13f1e0ab78c7d73dece6a3b6c4d311b37017
6
+ metadata.gz: 4ba3b4de41c6e00bfe330f0a84654a4cf033219a8a3b1a7ce81406a2ec0107a30b4df8b218e70dc02f454dad0a9526ccc9a10d3f1bf0ef32527b3c4b41c4d4ee
7
+ data.tar.gz: 5af9857415389ae10597b7111063bc4166d8ab337a8ef4e4bb2a25f3f932dca88d6bebfbd3bf4e94861790f11c8a2642efc66e6d04d8388d78f4bfc5c6f37e78
data/.irbrc CHANGED
@@ -0,0 +1 @@
1
+ require "./lib/souls"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.15.9)
4
+ souls (0.16.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,13 +19,13 @@ GEM
19
19
  concurrent-ruby (1.1.8)
20
20
  diff-lcs (1.4.4)
21
21
  ffi (1.14.2)
22
- i18n (1.8.8)
22
+ i18n (1.8.9)
23
23
  concurrent-ruby (~> 1.0)
24
24
  language_server-protocol (3.15.0.1)
25
25
  listen (3.4.1)
26
26
  rb-fsevent (~> 0.10, >= 0.10.3)
27
27
  rb-inotify (~> 0.9, >= 0.9.10)
28
- minitest (5.14.3)
28
+ minitest (5.14.4)
29
29
  parallel (1.20.1)
30
30
  parser (2.7.2.0)
31
31
  ast (~> 2.4.1)
@@ -34,8 +34,8 @@ GEM
34
34
  rb-fsevent (0.10.4)
35
35
  rb-inotify (0.10.1)
36
36
  ffi (~> 1.0)
37
- rbs (1.0.4)
38
- regexp_parser (2.0.3)
37
+ rbs (1.0.6)
38
+ regexp_parser (2.1.1)
39
39
  rexml (3.2.4)
40
40
  rspec (3.1.0)
41
41
  rspec-core (~> 3.1.0)
@@ -76,7 +76,7 @@ GEM
76
76
  zeitwerk (2.4.2)
77
77
 
78
78
  PLATFORMS
79
- ruby
79
+ x86_64-darwin-20
80
80
 
81
81
  DEPENDENCIES
82
82
  activesupport (= 6.1.0)
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  steep (= 0.39.0)
88
88
 
89
89
  BUNDLED WITH
90
- 2.2.4
90
+ 2.2.11
data/README.md CHANGED
@@ -76,72 +76,10 @@ And Create Your APP
76
76
  4. Media Web
77
77
  5. Admin Web
78
78
 
79
- ## Usage - 1. GraphQL API
80
79
 
81
- ```bash
82
- # Ruby version (using rbenv)
83
- $ ruby -v
84
- ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
80
+ ## SOULs Document
85
81
 
86
- # Install xcode
87
- $ xcode-select --install
88
-
89
- # Install PostgreSQL (Mac env)
90
- $ brew install postgresql
91
-
92
- # Install redis
93
- $ brew install redis
94
-
95
- # Version Check
96
- $ souls -v
97
-
98
- # Init SOULs App
99
- $ souls new app_name
100
- $ cd app_name
101
- $ bundle
102
-
103
- # Run Dev & Test DB
104
- $ souls i run_psql
105
-
106
- # Create DB
107
- $ souls db:create
108
-
109
- # Migrate DB
110
- $ souls db:migrate
111
-
112
- # Create Test DB
113
- $ souls db:seed
114
-
115
- # Development (localhost:3000/playground)
116
- $ souls s
117
-
118
- # Development with Worker (localhost:3000/playground; localhost:3000/sidekiq)
119
- $ foreman start -f Procfile.dev
120
-
121
- # Test
122
- $ bundle exec rspec
123
-
124
- # Deploy (Edit: ./cloudbuild.yml)
125
- $ souls deploy
126
-
127
- # Run Infra Command
128
- $ souls i `method_name`
129
- ```
130
-
131
- ## SOULs Scaffold
132
- SOULs Scaffold creates CRUD API from `./db/schema.rb`
133
-
134
- ```bash
135
- # Create migration file
136
- $ souls g migration user
137
-
138
- # Edit migration file
139
- # Migrate DB
140
- $ souls db:migrate
141
-
142
- # SOULs Scaffold
143
- $ souls g migrate user
144
- ```
82
+ - [SOULs Document](https://elsoul.github.io/souls_doc/)
145
83
 
146
84
 
147
85
 
data/exe/souls CHANGED
@@ -25,7 +25,7 @@ begin
25
25
  when "service"
26
26
  system "bundle exec rake run_server"
27
27
  else
28
- `bundle exec puma -p 3000 -e development`
28
+ system "foreman start -f Procfile.dev"
29
29
  end
30
30
  when "c", "console"
31
31
  strain = Souls.configuration.strain
@@ -33,7 +33,12 @@ begin
33
33
  when "media", "admin"
34
34
  system "yarn dev"
35
35
  else
36
- `bundle exec irb`
36
+ case ARGV[1]
37
+ when "RACK_ENV=production"
38
+ system "bundle exec irb RACK_ENV=production"
39
+ else
40
+ system "bundle exec irb"
41
+ end
37
42
  end
38
43
  when "i", "infra"
39
44
  Souls.send ARGV[1]
@@ -66,7 +71,7 @@ begin
66
71
  when "migrate_all"
67
72
  Souls::Init.migrate_all
68
73
  when "migration"
69
- STDOUT.write `rake db:create_migration NAME=#{ARGV[2]}`
74
+ system "rake db:create_migration NAME=create_#{ARGV[2]}"
70
75
  when "rspec_factory"
71
76
  Souls::Init.rspec_factory class_name: ARGV[2]
72
77
  when "rspec_model"
@@ -82,23 +87,35 @@ begin
82
87
  else
83
88
  "SOULs!"
84
89
  end
90
+ when "d"
91
+ Souls::Init.delete_all class_name: ARGV[1]
85
92
  when "db:create"
86
- STDOUT.write `rake db:create && rake db:create RACK_ENV=test`
93
+ system "rake db:create && rake db:create RACK_ENV=test"
87
94
  when "db:migrate"
88
- STDOUT.write `rake db:migrate && rake db:migrate RACK_ENV=test`
95
+ case ARGV[1]
96
+ when "RACK_ENV=production"
97
+ system "rake db:migrate RACK_ENV=production"
98
+ else
99
+ system "rake db:migrate && rake db:migrate RACK_ENV=test"
100
+ end
89
101
  when "db:seed"
90
- STDOUT.write `rake db:seed`
102
+ system "rake db:seed"
91
103
  when "db:migrate:reset"
92
- STDOUT.write `rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test`
104
+ case ARGV[1]
105
+ when "RACK_ENV=production"
106
+ system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
107
+ else
108
+ system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
109
+ end
93
110
  when "t", "test"
94
- STDOUT.write `rubocop`
95
- STDOUT.write `bundle exec rspec`
111
+ system "rubocop -a"
112
+ system "bundle exec rspec"
96
113
  when "run"
97
- STDOUT.write `docker build . -t souls:latest`
98
- STDOUT.write `docker run --rm -p 3000:3000 souls:latest`
114
+ system "docker build . -t souls:latest"
115
+ system "docker run --rm -p 3000:3000 souls:latest"
99
116
  when "deploy"
100
117
  project_id = Souls.configuration.project_id
101
- STDOUT.write `gcloud builds submit --config=cloudbuild.yml --project #{project_id}`
118
+ system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
102
119
  else
103
120
  puts "Welcome to SOULs!"
104
121
  end
data/lib/souls.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require "souls/version"
2
+ require "active_support/core_ext/string/inflections"
2
3
  require "souls/init"
3
4
  require "souls/generate"
4
5
  require "json"
5
- require "active_support/core_ext/string/inflections"
6
6
  require "fileutils"
7
7
 
8
8
  module Souls
@@ -135,7 +135,7 @@ module Souls
135
135
  EOS
136
136
  else
137
137
  new_line.write <<-EOS
138
- let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
138
+ let!(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
139
139
 
140
140
  let(:query) do
141
141
  %(query {
@@ -280,6 +280,26 @@ end
280
280
  rspec_resolver_params class_name: singularized_class_name
281
281
  rspec_resolver_end class_name: singularized_class_name
282
282
  end
283
+
284
+ def delete_all class_name: "souls"
285
+ singularized_class_name = class_name.singularize.underscore
286
+ pluralized_class_name = class_name.pluralize.underscore
287
+ FileUtils.rm "./app/models/#{singularized_class_name}.rb"
288
+ FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
289
+ FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
290
+ FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
291
+ FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
292
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
293
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
294
+ FileUtils.rm "./spec/factories/#{pluralized_class_name}.rb"
295
+ FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
296
+ FileUtils.rm "./spec/models/#{singularized_class_name}_spec.rb"
297
+ FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
298
+ FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
299
+ puts "deleted #{class_name.camelize} CRUD!"
300
+ rescue StandardError => error
301
+ puts error
302
+ end
283
303
  end
284
304
  end
285
305
  end
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.16.0"
2
+ VERSION = "0.16.5"
3
3
  end
data/souls.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = "SOULS is a Web Application Framework for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems."
11
11
  spec.homepage = "https://github.com/elsoul/souls"
12
12
  spec.license = "Apache-2.0"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = "https://github.com/elsoul/souls"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-02-15 00:00:00.000000000 Z
13
+ date: 2021-03-02 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: SOULS is a Web Application Framework for Microservices on Multi Cloud
16
16
  Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 2.7.0
66
+ version: 3.0.0
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="