Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Oct 21, 2021
1 parent 18bd3e0 commit 4e1b6f2
Show file tree
Hide file tree
Showing 26 changed files with 148 additions and 108 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
.env
.irb_history
/app/
/db/
/vendor/rbs/gem_rbs_collection/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor/rbs/gem_rbs_collection"]
path = vendor/rbs/gem_rbs_collection
url = https://github.com/ruby/gem_rbs_collection.git
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
backport (1.2.0)
benchmark (0.1.1)
benchmark (0.2.0)
concurrent-ruby (1.1.9)
diff-lcs (1.4.4)
e2mmap (0.1.0)
Expand Down Expand Up @@ -74,12 +74,12 @@ GEM
gapic-common (>= 0.7, < 2.a)
google-cloud-errors (~> 1.0)
grpc-google-iam-v1 (>= 0.6.10, < 2.a)
google-protobuf (3.18.1-x86_64-linux)
google-protobuf (3.19.0-x86_64-linux)
googleapis-common-protos (1.3.12)
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
googleapis-common-protos-types (1.2.0)
googleapis-common-protos-types (1.3.0)
google-protobuf (~> 3.14)
googleauth (1.0.0)
faraday (>= 0.17.3, < 2.0)
Expand Down Expand Up @@ -124,7 +124,7 @@ GEM
tty-color (~> 0.5)
pg (1.2.3)
public_suffix (4.0.6)
racc (1.5.2)
racc (1.6.0)
rack (2.2.3)
rack-protection (2.1.0)
rack
Expand Down Expand Up @@ -222,7 +222,7 @@ GEM
unicode-display_width (>= 1.1)
wisper (2.0.1)
yard (0.9.26)
zeitwerk (2.4.2)
zeitwerk (2.5.1)

PLATFORMS
x86_64-linux
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ Check your GraphQL PlayGround

After checking out the repo, run `bin/setup` to install dependencies. Then, run `souls t` to run the tests. You can also run `souls c` for an interactive prompt that will allow you to experiment.

You need to add submodule

```bash
git submodule add -f https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection
```

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/souls).

## Contributing
Expand Down
28 changes: 28 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,32 @@ target :app do

# check 'app'
# check "lib/souls/api/generate/edge.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
check "apps/scraper/app"
check "apps/scraper/db/seeds.rb"
check "apps/scraper/constants"
check "apps/scraper/app.rb"
end
30 changes: 30 additions & 0 deletions db/migrate/20210921194730_create_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class CreateUsers < ActiveRecord::Migration[6.1]
def change
create_table :users do |t|
t.string :uid, null: false, unique: true
t.string :username, null: false, default: ""
t.string :screen_name, null: false, default: ""
t.string :last_name, null: false, default: ""
t.string :first_name, null: false, default: ""
t.string :last_name_kanji, null: false, default: ""
t.string :first_name_kanji, null: false, default: ""
t.string :last_name_kana, null: false, default: ""
t.string :first_name_kana, null: false, default: ""
t.string :email, null: false, unique: true
t.string :tel, null: false, default: ""
t.string :icon_url, null: false, default: ""
t.string :birthday, null: false, default: ""
t.string :gender, null: false, default: ""
t.string :lang, null: false, default: "ja"
t.string :category, null: false, default: "user"
t.integer :roles_mask, null: false, default: 1
t.boolean :is_deleted, null: false, default: false
t.timestamps
end
add_index :users, :uid
add_index :users, :screen_name
add_index :users, :email, unique: true
add_index :users, :username
add_index :users, :is_deleted
end
end
46 changes: 46 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_08_23_090158) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "users", force: :cascade do |t|
t.string "uid", null: false
t.string "username", default: "", null: false
t.string "screen_name", default: "", null: false
t.string "last_name", default: "", null: false
t.string "first_name", default: "", null: false
t.string "last_name_kanji", default: "", null: false
t.string "first_name_kanji", default: "", null: false
t.string "last_name_kana", default: "", null: false
t.string "first_name_kana", default: "", null: false
t.string "email", null: false
t.string "tel", default: "", null: false
t.string "icon_url", default: "", null: false
t.string "birthday", default: "", null: false
t.string "gender", default: "", null: false
t.string "lang", default: "ja", null: false
t.string "category", default: "user", null: false
t.integer "roles_mask", default: 1, null: false
t.boolean "is_deleted", default: false, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["is_deleted"], name: "index_users_on_is_deleted"
t.index ["screen_name"], name: "index_users_on_screen_name"
t.index ["uid"], name: "index_users_on_uid"
t.index ["username"], name: "index_users_on_username"
end

end
27 changes: 0 additions & 27 deletions spec/api/generate/application_spec.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/api/generate/manager_spec.rb

This file was deleted.

20 changes: 0 additions & 20 deletions spec/api/generate/model_spec.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/api/generate/rspec_model_spec.rb

This file was deleted.

1 change: 1 addition & 0 deletions spec/cli/create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
FileUtils.mv "tmp/souls-api.rb", "apps/api/#{mother_conf}"
FileUtils.mv "tmp/Procfile.dev", "Procfile.dev"
FileUtils.rm_rf "apps/scraper"
FileUtils.rm_rf "sig/scraper"
FileUtils.rm_rf ".github/workflows/scraper.yml"
end
end
Expand Down
8 changes: 0 additions & 8 deletions spec/cli/db_spec.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
a1 = Souls::Generate.new.connection(class_name)
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
a1 = Souls::Generate.new.edge(class_name)
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RSpec.describe(Souls::Generate) do
describe "Generate Create Mutation" do
describe "Generate Mutation" do
let(:class_name) { "user" }

before do
Expand All @@ -9,12 +9,15 @@
FileUtils.rm(file_path) if File.exist?(file_path)
end

it "create_mutation" do
it "destroy delete mutation" do
file_dir = "./app/graphql/mutations/base/#{class_name}/"
file_path = "#{file_dir}create_#{class_name.singularize}.rb"
file_path = "#{file_dir}destroy_delete_#{class_name.singularize}.rb"
a1 = Souls::Generate.new.mutation(class_name)
expect(a1).to(eq(file_path))
FileUtils.rm_rf("./app/graphql/mutations")
rm_path = "./apps/api/app/graphql/mutations/base/#{class_name}/"
FileUtils.rm_rf(rm_path)
rescue StandardError => error
FileUtils.rm_rf(rm_path) if Dir.exist?(rm_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:policy, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:query, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:resolver, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:rspec_factory, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm_rf(file_dir) if Dir.exist?(file_dir)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:rspec_mutation, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf("./spec/mutations")
rescue StandardError => error
FileUtils.rm_rf(file_path) if File.exist?(file_path)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
a1 = Souls::Generate.new.invoke(:rspec_policy, ["user"], {})
expect(a1).to(eq(file_path))
FileUtils.rm_rf(file_dir)
rescue StandardError => error
FileUtils.rm_rf(file_dir) if Dir.exist?(file_dir)
end
end
end
Loading

0 comments on commit 4e1b6f2

Please sign in to comment.