diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dca9870..5cb613b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,21 +56,21 @@ jobs: echo "" >> temp_changelog.md # Prepend to existing CHANGELOG (skip the header) - if [ -f CHANGELOG.md ]; then - tail -n +3 CHANGELOG.md >> temp_changelog.md + if [ -f structured_params/CHANGELOG.md ]; then + tail -n +3 structured_params/CHANGELOG.md >> temp_changelog.md fi # Add header back - echo "# Changelog" > CHANGELOG.md - echo "" >> CHANGELOG.md - cat temp_changelog.md >> CHANGELOG.md + echo "# Changelog" > structured_params/CHANGELOG.md + echo "" >> structured_params/CHANGELOG.md + cat temp_changelog.md >> structured_params/CHANGELOG.md # Clean up temporary file rm -f temp_changelog.md - name: Commit CHANGELOG update run: | - git add CHANGELOG.md + git add structured_params/CHANGELOG.md if git diff --staged --quiet; then echo "No CHANGELOG changes to commit" else @@ -85,8 +85,11 @@ jobs: bundler-cache: true - name: Build gem + working-directory: structured_params run: | gem build structured_params.gemspec - name: Publish to RubyGems uses: rubygems/release-gem@v1 + with: + working-directory: structured_params diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml index 8fc1e11..45f9057 100644 --- a/.github/workflows/tagging.yml +++ b/.github/workflows/tagging.yml @@ -32,11 +32,11 @@ jobs: - name: Update version file run: | VERSION="${{ steps.extract_version.outputs.version }}" - sed -i "s/VERSION = '[^']*'/VERSION = '$VERSION'/" lib/structured_params/version.rb + sed -i "s/VERSION = '[^']*'/VERSION = '$VERSION'/" structured_params/lib/structured_params/version.rb - name: Commit version update run: | - git add lib/structured_params/version.rb + git add structured_params/lib/structured_params/version.rb if git diff --staged --quiet; then echo "No version changes to commit" else diff --git a/.gitignore b/.gitignore index 46688bd..6e5774c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ Gemfile.lock /.config /coverage/ /InstalledFiles -/pkg/ +pkg/ /spec/reports/ /spec/examples.txt /test/tmp/ diff --git a/.rubocop.yml b/.rubocop.yml index 03edc96..8d1cae2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,10 +5,18 @@ plugins: AllCops: NewCops: enable + # Both gemspecs require Ruby >= 3.2.0; RuboCop cannot infer it from a gemspec in a subdirectory. + TargetRubyVersion: 3.2 Style/OneClassPerFile: Exclude: - - spec/support/test_classes/**/* + - '**/spec/support/test_classes/**/*' + +# RuboCop's default excludes match spec/ at the repository root only. +Style/Documentation: + Exclude: + - '**/spec/**/*' + - '**/test/**/*' Layout/LeadingCommentSpace: Enabled: false diff --git a/.rubocop_rbs.yml b/.rubocop_rbs.yml index 704a13a..3171f62 100644 --- a/.rubocop_rbs.yml +++ b/.rubocop_rbs.yml @@ -11,8 +11,8 @@ Style/RbsInline/MissingTypeAnnotation: - '**/spec/**/*' Style/RbsInline/UntypedInstanceVariable: Exclude: - - 'lib/structured_params/params.rb' - - 'lib/structured_params.rb' + - 'structured_params/lib/structured_params/params.rb' + - 'structured_params/lib/structured_params.rb' - 'structured_params-openapi/lib/structured_params/openapi/configuration.rb' - 'structured_params-openapi/lib/structured_params/openapi/registry.rb' diff --git a/AGENTS.md b/AGENTS.md index a66deac..1f96a9e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,22 +5,23 @@ ## プロジェクト概要 - `structured_params` は Rails 向けの型付きパラメータ/フォームオブジェクト用 gem です。 -- コア実装は `lib/structured_params/` 配下にあります。 +- このリポジトリには 2 つの gem があり、それぞれ独自のフォルダを持ちます。コア gem は `structured_params/`、OpenAPI drift check は `structured_params-openapi/` です。 +- コア実装は `structured_params/lib/structured_params/` 配下にあります。 - テストは RSpec、Lint は RuboCop、型検査は Steep を使います。 - RBS シグネチャは `rbs-inline` から生成されます。 ## 主要ディレクトリ -- `structured_params-openapi/`: OpenAPI drift check の別 gem(`structured_params-openapi`)。 - 独自の `lib/`・`sig/`・`spec/`・`docs/` と gemspec を持ちます。コアとは同じリポジトリで管理し、 - テストは `cd structured_params-openapi && bundle exec rspec` で実行します。 +- `structured_params/`: コア gem。`lib/`・`sig/`・`spec/`・`docs/`・`structured_params.gemspec`・`CHANGELOG.md` を持ちます。 +- `structured_params-openapi/`: OpenAPI drift check の別 gem。同じ構成の独自の `lib/`・`sig/`・`spec/`・`docs/` と gemspec を持ちます。 +- リポジトリ直下: `README.md`、`Gemfile`、`Rakefile`、`Steepfile`、`lefthook.yml`、RuboCop 設定など、両方の gem に共通のもの。 -- `lib/structured_params.rb`: エントリーポイント -- `lib/structured_params/params.rb`: コアの `Params` 実装 -- `lib/structured_params/type/`: `array` / `object` 型ハンドラ -- `spec/`: RSpec テスト -- `docs/`: 利用者向けドキュメント -- `sig/`: `rbs-inline` により生成された RBS +- `structured_params/lib/structured_params.rb`: エントリーポイント +- `structured_params/lib/structured_params/params.rb`: コアの `Params` 実装 +- `structured_params/lib/structured_params/type/`: `array` / `object` 型ハンドラ +- `structured_params/spec/`: RSpec テスト +- `structured_params/docs/`: 利用者向けドキュメント +- `structured_params/sig/`: `rbs-inline` により生成された RBS ## セットアップと実行 @@ -33,7 +34,7 @@ bin/setup 通常の確認: ```bash -bundle exec rspec +bundle exec rake spec # 両方の gem の spec(各 gem のフォルダで bundle exec rspec でも可) bundle exec rubocop bundle exec steep check ``` @@ -43,13 +44,13 @@ Ruby 3.2 系では `steep` や `.rubocop_rbs.yml` 前提のチェックが使え 個別実行例: ```bash -bundle exec rspec spec/params_spec.rb -bundle exec rubocop lib/structured_params/params.rb +(cd structured_params && bundle exec rspec spec/params_spec.rb) +bundle exec rubocop structured_params/lib/structured_params/params.rb ``` ## 変更時のルール -- `sig/**/*.rbs` は手編集しないでください。必要なら `bundle exec rbs-inline --output=sig lib/**/*.rb` で再生成します。 +- `sig/**/*.rbs` は手編集しないでください。必要なら各 gem のフォルダ(`structured_params/` など)で `bundle exec rbs-inline --output=sig lib` を実行して再生成します。 - Ruby メソッドの型注釈は `rbs-inline` の `method_type_signature` スタイルを使ってください。 - インスタンス変数の型注釈は `# @rbs` コメントを使ってください。 - 既存の公開 API を変える場合は、README と `docs/` の整合も確認してください。 @@ -58,16 +59,16 @@ bundle exec rubocop lib/structured_params/params.rb ## テスト方針 - 振る舞い変更には RSpec を追加または更新してください。 -- 既存 spec のスタイルに合わせ、必要に応じて `spec/factories/` と `spec/support/` を再利用してください。 +- 既存 spec のスタイルに合わせ、必要に応じて `structured_params/spec/factories/` と `structured_params/spec/support/` を再利用してください。 - 修正が型やシリアライズ、permit 生成に関わる場合は、関連 spec を広めに実行してください。 ## コミット前チェック `lefthook.yml` によりコミット前に以下が走ります。 -- `bundle exec rbs-inline --output=sig lib/**/*.rb`(`structured_params-openapi/` でも同様) +- 各 gem のフォルダでの `bundle exec rbs-inline --output=sig lib`(`structured_params/` と `structured_params-openapi/`) - `bundle exec rubocop` -- `bundle exec rspec`(`structured_params-openapi/` でも実行) +- 各 gem のフォルダでの `bundle exec rspec`(`structured_params/` と `structured_params-openapi/`) - `bundle exec steep check` フックで失敗しない状態まで揃えてから完了扱いにしてください。 @@ -81,4 +82,4 @@ bundle exec rubocop lib/structured_params/params.rb - エラーフォーマットやバリデーション挙動の変更 - Rails / Ruby サポート範囲の変更 -利用者向け概要は `README.md`、詳細仕様は `docs/*.md`、日本語 README が必要なら `README_ja.md` も更新します。 +利用者向け概要は `README.md`、詳細仕様は `structured_params/docs/*.md`、日本語 README が必要なら `README_ja.md` も更新します。 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c589d0..1850818 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,15 @@ bin/setup ### Running Tests ```bash -# Run all tests +# Run the specs of every gem (from the repository root) +bundle exec rake spec + +# The repository holds two gems, each in its own folder: +# structured_params/ the core gem +# structured_params-openapi/ the OpenAPI drift check gem +cd structured_params + +# Run all tests of the gem bundle exec rspec # Run specific test file @@ -62,15 +70,15 @@ Automatically regenerate signatures on file changes: ./bin/dev ``` -This command uses `fswatch` to monitor the `lib/` directory and automatically runs `rbs-inline` when files change. +This command uses `fswatch` to monitor the `lib/` directory of each gem and automatically runs `rbs-inline` when files change. ### Manual Generation Generate all signatures manually: ```bash -# Generate for all lib files -bundle exec rbs-inline --output=sig lib/**/*.rb +# Generate for all lib files (run inside each gem folder, e.g. structured_params/) +cd structured_params && bundle exec rbs-inline --output=sig lib ``` ### Automatic Generation (Git Hooks) @@ -88,7 +96,7 @@ The git hook configuration is in `lefthook.yml`: prepare-commit-msg: commands: rbs-inline: - run: bundle exec rbs-inline --output=sig lib/**/*.rb + run: (cd structured_params && bundle exec rbs-inline --output=sig lib) && ... ``` ## Coding Style @@ -167,32 +175,35 @@ You can test against different Rails versions using the `RAILS_VERSION` environm ```bash # Test with Rails 7.2 -RAILS_VERSION="~> 7.2.0" bundle update && bundle exec rspec +RAILS_VERSION="~> 7.2.0" bundle update && bundle exec rake spec # Test with Rails 8.0 -RAILS_VERSION="~> 8.0.0" bundle update && bundle exec rspec +RAILS_VERSION="~> 8.0.0" bundle update && bundle exec rake spec ``` ## Project Structure ``` -structured_params/ -├── lib/ -│ ├── structured_params.rb # Main entry point -│ ├── structured_params/ -│ │ ├── params.rb # Core Params class -│ │ ├── errors.rb # Enhanced error handling -│ │ ├── version.rb # Version constant -│ │ └── type/ -│ │ ├── array.rb # Array type handler -│ │ └── object.rb # Object type handler -├── sig/ # Auto-generated RBS files -│ └── generated/ # DO NOT EDIT -├── spec/ # RSpec tests -│ ├── factories/ # Test parameter classes -│ ├── support/ # Test helpers -│ └── *_spec.rb # Test files -└── docs/ # Documentation +. # repository root: README, Gemfile, Rakefile, Steepfile, lefthook.yml, RuboCop config +├── structured_params/ # core gem +│ ├── structured_params.gemspec +│ ├── CHANGELOG.md +│ ├── lib/ +│ │ ├── structured_params.rb # Main entry point +│ │ └── structured_params/ +│ │ ├── params.rb # Core Params class +│ │ ├── errors.rb # Enhanced error handling +│ │ ├── version.rb # Version constant +│ │ └── type/ +│ │ ├── array.rb # Array type handler +│ │ └── object.rb # Object type handler +│ ├── sig/ # Auto-generated RBS files (DO NOT EDIT) +│ ├── spec/ # RSpec tests +│ │ ├── factories/ # Test parameter classes +│ │ ├── support/ # Test helpers +│ │ └── *_spec.rb # Test files +│ └── docs/ # Documentation +└── structured_params-openapi/ # OpenAPI drift check gem (same layout) ``` ## Submitting Changes @@ -202,7 +213,7 @@ structured_params/ 1. **Fork the repository** and create your branch from `main` 2. **Write tests** for your changes 3. **Update documentation** if needed (README, docs/, inline comments) -4. **Ensure all tests pass**: `bundle exec rspec` +4. **Ensure all tests pass**: `bundle exec rake spec` 5. **Ensure code quality**: `bundle exec rubocop` 6. **Ensure type safety** (Ruby 3.3+): `bundle exec steep check` 7. **RBS signatures will be auto-generated** by git hooks diff --git a/Gemfile b/Gemfile index d70f085..46caa11 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' -gemspec +gemspec path: 'structured_params' gemspec path: 'structured_params-openapi' # Allow testing different Rails versions via environment variable diff --git a/Procfile.dev b/Procfile.dev index f1902a5..f0c8dc2 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1 +1,2 @@ -rbs-inline: fswatch -0 lib | xargs -0 -n1 bundle exec rbs-inline --output=sig +rbs-inline: sh -c 'cd structured_params && fswatch -0 lib | xargs -0 -n1 bundle exec rbs-inline --output=sig' +rbs-inline-openapi: sh -c 'cd structured_params-openapi && fswatch -0 lib | xargs -0 -n1 bundle exec rbs-inline --output=sig' diff --git a/README.md b/README.md index 51f4aa9..234c04d 100644 --- a/README.md +++ b/README.md @@ -123,14 +123,14 @@ bundle exec rake structured_params:openapi:drift_check ## Documentation -- **[Installation and Setup](docs/installation.md)** - Getting started with StructuredParams -- **[Basic Usage](docs/basic-usage.md)** - Parameter classes, nested objects, and arrays -- **[Validation](docs/validation.md)** - Using ActiveModel validations with nested structures +- **[Installation and Setup](structured_params/docs/installation.md)** - Getting started with StructuredParams +- **[Basic Usage](structured_params/docs/basic-usage.md)** - Parameter classes, nested objects, and arrays +- **[Validation](structured_params/docs/validation.md)** - Using ActiveModel validations with nested structures - **[OpenAPI Drift Check](structured_params-openapi/docs/drift-check.md)** - Detect differences between request schemas and Params classes (`structured_params-openapi` gem) -- **[Strong Parameters](docs/strong-parameters.md)** - Automatic permit list generation -- **[Error Handling](docs/error-handling.md)** - Flat and structured error formats -- **[Serialization](docs/serialization.md)** - Converting parameters to hashes and JSON -- **[Form Objects](docs/form-objects.md)** - Form object pattern with Rails views +- **[Strong Parameters](structured_params/docs/strong-parameters.md)** - Automatic permit list generation +- **[Error Handling](structured_params/docs/error-handling.md)** - Flat and structured error formats +- **[Serialization](structured_params/docs/serialization.md)** - Converting parameters to hashes and JSON +- **[Form Objects](structured_params/docs/form-objects.md)** - Form object pattern with Rails views ## Contributing diff --git a/README_ja.md b/README_ja.md index 8e85ef4..09b6508 100644 --- a/README_ja.md +++ b/README_ja.md @@ -123,14 +123,14 @@ bundle exec rake structured_params:openapi:drift_check ## ドキュメント -- **[インストールとセットアップ](docs/installation.md)** - StructuredParams の始め方 -- **[基本的な使い方](docs/basic-usage.md)** - パラメータクラス、ネストオブジェクト、配列 -- **[バリデーション](docs/validation.md)** - ネスト構造での ActiveModel バリデーション +- **[インストールとセットアップ](structured_params/docs/installation.md)** - StructuredParams の始め方 +- **[基本的な使い方](structured_params/docs/basic-usage.md)** - パラメータクラス、ネストオブジェクト、配列 +- **[バリデーション](structured_params/docs/validation.md)** - ネスト構造での ActiveModel バリデーション - **[OpenAPI Drift Check](structured_params-openapi/docs/drift-check_ja.md)** - OpenAPI schema と Params class の乖離検出(`structured_params-openapi` gem) -- **[Strong Parameters](docs/strong-parameters.md)** - permit リストの自動生成 -- **[エラーハンドリング](docs/error-handling.md)** - フラット形式と構造化形式のエラー -- **[シリアライゼーション](docs/serialization.md)** - パラメータのハッシュと JSON 変換 -- **[フォームオブジェクト](docs/form-objects.md)** - Rails ビューとのフォームオブジェクトパターン +- **[Strong Parameters](structured_params/docs/strong-parameters.md)** - permit リストの自動生成 +- **[エラーハンドリング](structured_params/docs/error-handling.md)** - フラット形式と構造化形式のエラー +- **[シリアライゼーション](structured_params/docs/serialization.md)** - パラメータのハッシュと JSON 変換 +- **[フォームオブジェクト](structured_params/docs/form-objects.md)** - Rails ビューとのフォームオブジェクトパターン ## コントリビューション diff --git a/Rakefile b/Rakefile index 0b01eab..441aa0a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,21 @@ # frozen_string_literal: true # rbs_inline: enabled -require 'bundler/gem_tasks' -require 'rspec/core/rake_task' +require 'rubocop/rake_task' -RSpec::Core::RakeTask.new(:spec) +# The repository holds two gems, each in its own directory with its own spec suite and its +# own Rakefile for `build`/`install`/`release` (run those from the gem's directory). +GEM_DIRS = %w[structured_params structured_params-openapi].freeze #: Array[String] -require 'rubocop/rake_task' +GEM_DIRS.each do |gem_dir| + desc "Run the #{gem_dir} specs" + task "spec:#{gem_dir}" do + Dir.chdir(gem_dir) { sh 'bundle exec rspec' } + end +end + +desc 'Run the specs of every gem' +task spec: GEM_DIRS.map { |gem_dir| "spec:#{gem_dir}" } # Use RBS Inline configuration for Ruby 3.3+ rubocop_config = if RUBY_VERSION >= '3.3.0' @@ -28,11 +37,4 @@ if RUBY_VERSION >= '3.3.0' default_tasks << :steep end -# The OpenAPI plugin lives in its own gem directory with its own spec suite. -desc 'Run the structured_params-openapi specs' -task :spec_openapi do - Dir.chdir('structured_params-openapi') { sh 'bundle exec rspec' } -end -default_tasks << :spec_openapi - task default: default_tasks diff --git a/Steepfile b/Steepfile index fb68fbe..016d827 100644 --- a/Steepfile +++ b/Steepfile @@ -3,9 +3,9 @@ # D = Steep::Diagnostic target :lib do - signature 'sig' + signature 'structured_params/sig' - check 'lib' + check 'structured_params/lib' # Suppress errors from broken library RBS files in gem_rbs_collection configure_code_diagnostics do |hash| @@ -14,7 +14,7 @@ target :lib do end target :openapi do - signature 'sig', 'structured_params-openapi/sig' + signature 'structured_params/sig', 'structured_params-openapi/sig' check 'structured_params-openapi/lib' diff --git a/bin/console b/bin/console index 4fdf31d..b8263b7 100755 --- a/bin/console +++ b/bin/console @@ -9,7 +9,7 @@ require 'structured_params' # with your gem easier. You can also use a different console, if you like. require 'factory_bot' StructuredParams.register_types -FactoryBot.definition_file_paths = [File.expand_path('../spec/factories', __dir__)] +FactoryBot.definition_file_paths = [File.expand_path('../structured_params/spec/factories', __dir__)] FactoryBot.find_definitions require 'irb' diff --git a/lefthook.yml b/lefthook.yml index 2ddee2e..8418c52 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,14 +1,14 @@ prepare-commit-msg: commands: rbs-inline: - run: bundle exec rbs-inline --output=sig lib/**/*.rb && (cd structured_params-openapi && bundle exec rbs-inline --output=sig lib/**/*.rb) && git add sig/ structured_params-openapi/sig/ + run: (cd structured_params && bundle exec rbs-inline --output=sig lib) && (cd structured_params-openapi && bundle exec rbs-inline --output=sig lib) && git add structured_params/sig/ structured_params-openapi/sig/ pre-commit: commands: rubocop: run: ./bin/rubocop rspec: - run: bundle exec rspec + run: cd structured_params && bundle exec rspec rspec-open-api: run: cd structured_params-openapi && bundle exec rspec steep: diff --git a/.rspec b/structured_params/.rspec similarity index 100% rename from .rspec rename to structured_params/.rspec diff --git a/CHANGELOG.md b/structured_params/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to structured_params/CHANGELOG.md diff --git a/structured_params/LICENSE.txt b/structured_params/LICENSE.txt new file mode 100644 index 0000000..0626645 --- /dev/null +++ b/structured_params/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Mizuki Yamamoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/structured_params/Rakefile b/structured_params/Rakefile new file mode 100644 index 0000000..fa8fbc4 --- /dev/null +++ b/structured_params/Rakefile @@ -0,0 +1,6 @@ +# frozen_string_literal: true +# rbs_inline: enabled + +# Release tasks (`rake build`, `rake release`) for this gem; run them from this directory. +# The repository-wide checks (specs, RuboCop, Steep) live in the root Rakefile. +require 'bundler/gem_tasks' diff --git a/docs/basic-usage.md b/structured_params/docs/basic-usage.md similarity index 100% rename from docs/basic-usage.md rename to structured_params/docs/basic-usage.md diff --git a/docs/error-handling.md b/structured_params/docs/error-handling.md similarity index 100% rename from docs/error-handling.md rename to structured_params/docs/error-handling.md diff --git a/docs/form-objects.md b/structured_params/docs/form-objects.md similarity index 100% rename from docs/form-objects.md rename to structured_params/docs/form-objects.md diff --git a/docs/installation.md b/structured_params/docs/installation.md similarity index 100% rename from docs/installation.md rename to structured_params/docs/installation.md diff --git a/docs/serialization.md b/structured_params/docs/serialization.md similarity index 100% rename from docs/serialization.md rename to structured_params/docs/serialization.md diff --git a/docs/strong-parameters.md b/structured_params/docs/strong-parameters.md similarity index 100% rename from docs/strong-parameters.md rename to structured_params/docs/strong-parameters.md diff --git a/docs/validation.md b/structured_params/docs/validation.md similarity index 100% rename from docs/validation.md rename to structured_params/docs/validation.md diff --git a/lib/structured_params.rb b/structured_params/lib/structured_params.rb similarity index 100% rename from lib/structured_params.rb rename to structured_params/lib/structured_params.rb diff --git a/lib/structured_params/attribute_methods.rb b/structured_params/lib/structured_params/attribute_methods.rb similarity index 100% rename from lib/structured_params/attribute_methods.rb rename to structured_params/lib/structured_params/attribute_methods.rb diff --git a/lib/structured_params/errors.rb b/structured_params/lib/structured_params/errors.rb similarity index 100% rename from lib/structured_params/errors.rb rename to structured_params/lib/structured_params/errors.rb diff --git a/lib/structured_params/i18n.rb b/structured_params/lib/structured_params/i18n.rb similarity index 100% rename from lib/structured_params/i18n.rb rename to structured_params/lib/structured_params/i18n.rb diff --git a/lib/structured_params/params.rb b/structured_params/lib/structured_params/params.rb similarity index 100% rename from lib/structured_params/params.rb rename to structured_params/lib/structured_params/params.rb diff --git a/lib/structured_params/type/array.rb b/structured_params/lib/structured_params/type/array.rb similarity index 100% rename from lib/structured_params/type/array.rb rename to structured_params/lib/structured_params/type/array.rb diff --git a/lib/structured_params/type/object.rb b/structured_params/lib/structured_params/type/object.rb similarity index 100% rename from lib/structured_params/type/object.rb rename to structured_params/lib/structured_params/type/object.rb diff --git a/lib/structured_params/validations.rb b/structured_params/lib/structured_params/validations.rb similarity index 100% rename from lib/structured_params/validations.rb rename to structured_params/lib/structured_params/validations.rb diff --git a/lib/structured_params/version.rb b/structured_params/lib/structured_params/version.rb similarity index 100% rename from lib/structured_params/version.rb rename to structured_params/lib/structured_params/version.rb diff --git a/sig/structured_params.rbs b/structured_params/sig/structured_params.rbs similarity index 100% rename from sig/structured_params.rbs rename to structured_params/sig/structured_params.rbs diff --git a/sig/structured_params/attribute_methods.rbs b/structured_params/sig/structured_params/attribute_methods.rbs similarity index 100% rename from sig/structured_params/attribute_methods.rbs rename to structured_params/sig/structured_params/attribute_methods.rbs diff --git a/sig/structured_params/errors.rbs b/structured_params/sig/structured_params/errors.rbs similarity index 100% rename from sig/structured_params/errors.rbs rename to structured_params/sig/structured_params/errors.rbs diff --git a/sig/structured_params/i18n.rbs b/structured_params/sig/structured_params/i18n.rbs similarity index 100% rename from sig/structured_params/i18n.rbs rename to structured_params/sig/structured_params/i18n.rbs diff --git a/sig/structured_params/params.rbs b/structured_params/sig/structured_params/params.rbs similarity index 100% rename from sig/structured_params/params.rbs rename to structured_params/sig/structured_params/params.rbs diff --git a/sig/structured_params/type/array.rbs b/structured_params/sig/structured_params/type/array.rbs similarity index 100% rename from sig/structured_params/type/array.rbs rename to structured_params/sig/structured_params/type/array.rbs diff --git a/sig/structured_params/type/object.rbs b/structured_params/sig/structured_params/type/object.rbs similarity index 100% rename from sig/structured_params/type/object.rbs rename to structured_params/sig/structured_params/type/object.rbs diff --git a/sig/structured_params/validations.rbs b/structured_params/sig/structured_params/validations.rbs similarity index 100% rename from sig/structured_params/validations.rbs rename to structured_params/sig/structured_params/validations.rbs diff --git a/sig/structured_params/version.rbs b/structured_params/sig/structured_params/version.rbs similarity index 100% rename from sig/structured_params/version.rbs rename to structured_params/sig/structured_params/version.rbs diff --git a/spec/attribute_methods_spec.rb b/structured_params/spec/attribute_methods_spec.rb similarity index 100% rename from spec/attribute_methods_spec.rb rename to structured_params/spec/attribute_methods_spec.rb diff --git a/spec/errors_spec.rb b/structured_params/spec/errors_spec.rb similarity index 100% rename from spec/errors_spec.rb rename to structured_params/spec/errors_spec.rb diff --git a/spec/factories/address_parameters.rb b/structured_params/spec/factories/address_parameters.rb similarity index 100% rename from spec/factories/address_parameters.rb rename to structured_params/spec/factories/address_parameters.rb diff --git a/spec/factories/hobby_parameters.rb b/structured_params/spec/factories/hobby_parameters.rb similarity index 100% rename from spec/factories/hobby_parameters.rb rename to structured_params/spec/factories/hobby_parameters.rb diff --git a/spec/factories/user_parameters.rb b/structured_params/spec/factories/user_parameters.rb similarity index 100% rename from spec/factories/user_parameters.rb rename to structured_params/spec/factories/user_parameters.rb diff --git a/spec/form_object_spec.rb b/structured_params/spec/form_object_spec.rb similarity index 100% rename from spec/form_object_spec.rb rename to structured_params/spec/form_object_spec.rb diff --git a/spec/i18n_spec.rb b/structured_params/spec/i18n_spec.rb similarity index 100% rename from spec/i18n_spec.rb rename to structured_params/spec/i18n_spec.rb diff --git a/spec/params_spec.rb b/structured_params/spec/params_spec.rb similarity index 100% rename from spec/params_spec.rb rename to structured_params/spec/params_spec.rb diff --git a/spec/permit_spec.rb b/structured_params/spec/permit_spec.rb similarity index 100% rename from spec/permit_spec.rb rename to structured_params/spec/permit_spec.rb diff --git a/spec/spec_helper.rb b/structured_params/spec/spec_helper.rb similarity index 100% rename from spec/spec_helper.rb rename to structured_params/spec/spec_helper.rb diff --git a/spec/support/locales/ja.yml b/structured_params/spec/support/locales/ja.yml similarity index 100% rename from spec/support/locales/ja.yml rename to structured_params/spec/support/locales/ja.yml diff --git a/spec/support/shared_contexts/ja_locale.rb b/structured_params/spec/support/shared_contexts/ja_locale.rb similarity index 100% rename from spec/support/shared_contexts/ja_locale.rb rename to structured_params/spec/support/shared_contexts/ja_locale.rb diff --git a/spec/support/test_classes/form_object_classes.rb b/structured_params/spec/support/test_classes/form_object_classes.rb similarity index 100% rename from spec/support/test_classes/form_object_classes.rb rename to structured_params/spec/support/test_classes/form_object_classes.rb diff --git a/spec/support/test_classes/params_classes.rb b/structured_params/spec/support/test_classes/params_classes.rb similarity index 100% rename from spec/support/test_classes/params_classes.rb rename to structured_params/spec/support/test_classes/params_classes.rb diff --git a/spec/type/array_spec.rb b/structured_params/spec/type/array_spec.rb similarity index 100% rename from spec/type/array_spec.rb rename to structured_params/spec/type/array_spec.rb diff --git a/spec/type/object_spec.rb b/structured_params/spec/type/object_spec.rb similarity index 100% rename from spec/type/object_spec.rb rename to structured_params/spec/type/object_spec.rb diff --git a/spec/validations_spec.rb b/structured_params/spec/validations_spec.rb similarity index 100% rename from spec/validations_spec.rb rename to structured_params/spec/validations_spec.rb diff --git a/structured_params.gemspec b/structured_params/structured_params.gemspec similarity index 96% rename from structured_params.gemspec rename to structured_params/structured_params.gemspec index 0489492..b1404f2 100644 --- a/structured_params.gemspec +++ b/structured_params/structured_params.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.metadata = { 'homepage_uri' => 'https://github.com/Syati/structured_params#readme', - 'changelog_uri' => 'https://github.com/Syati/structured_params/blob/main/CHANGELOG.md', + 'changelog_uri' => 'https://github.com/Syati/structured_params/blob/main/structured_params/CHANGELOG.md', 'bug_tracker_uri' => 'https://github.com/Syati/structured_params/issues', 'source_code_uri' => 'https://github.com/Syati/structured_params', 'rubygems_mfa_required' => 'true'