diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 68adbf2..a28c665 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -13,45 +13,45 @@ jobs: test: name: ${{matrix.ruby}} on ${{matrix.os}} runs-on: ${{matrix.os}}-latest - + strategy: matrix: os: - ubuntu - macos - + ruby: - - "3.3" - + - '3.3' + steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby}} - bundler-cache: true - - - name: Run tests - timeout-minutes: 5 - run: bundle exec bake test - - - uses: actions/upload-artifact@v3 - with: - name: coverage-${{matrix.os}}-${{matrix.ruby}} - path: .covered.db - + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 5 + run: bundle exec bake test + + - uses: actions/upload-artifact@v3 + with: + name: coverage-${{matrix.os}}-${{matrix.ruby}} + path: .covered.db + validate: needs: test runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.3" - bundler-cache: true - - - uses: actions/download-artifact@v3 - - - name: Validate coverage - timeout-minutes: 5 - run: bundle exec bake covered:validate --paths */.covered.db \; + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - uses: actions/download-artifact@v3 + + - name: Validate coverage + timeout-minutes: 5 + run: bundle exec bake covered:validate --paths */.covered.db \; diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 4fa6552..b76f458 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -13,7 +13,7 @@ permissions: id-token: write concurrency: - group: "pages" + group: 'pages' cancel-in-progress: true env: @@ -23,34 +23,34 @@ env: jobs: generate: runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.3" - bundler-cache: true - - - name: Installing packages - run: sudo apt-get install wget - - - name: Generate documentation - timeout-minutes: 5 - run: bundle exec bake utopia:project:static --force no - - - name: Upload documentation artifact - uses: actions/upload-pages-artifact@v2 - with: - path: docs - + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Installing packages + run: sudo apt-get install wget + + - name: Generate documentation + timeout-minutes: 5 + run: bundle exec bake utopia:project:static --force no + + - name: Upload documentation artifact + uses: actions/upload-pages-artifact@v2 + with: + path: docs + deploy: runs-on: ubuntu-latest - + environment: name: github-pages url: ${{steps.deployment.outputs.page_url}} - + needs: generate steps: - name: Deploy to GitHub Pages diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9073bd0..adeb101 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,11 +17,11 @@ jobs: - '3.2.2' steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run the default task - run: bundle exec bake test + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run the default task + run: bundle exec bake test diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index c6649fa..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish Gem - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - bundler-cache: true - - - name: Install bundler - run: gem install bundler - - - name: Install dependencies - run: bundle install - - - name: Build gem - run: gem build lennarb.gemspec - - - name: Set up RubyGems credentials - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - run: | - mkdir -p ~/.gem - echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials - chmod 0600 ~/.gem/credentials - - - name: Push gem to RubyGems - env: - RUBYGEMS_HOST: "https://rubygems.org" - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - run: | - cat ~/.gem/credentials | head -c 50 - ls *.gem - gem push $(ls *.gem) - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0769a98..92b28e0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,20 +13,20 @@ jobs: name: ${{matrix.ruby}} on ${{matrix.os}} runs-on: ${{matrix.os}}-latest continue-on-error: ${{matrix.experimental}} - + strategy: matrix: os: - ubuntu - macos - + ruby: - - "3.1" - - "3.2" - - "3.3" - + - '3.1' + - '3.2' + - '3.3' + experimental: [false] - + include: - os: ubuntu ruby: truffleruby @@ -37,14 +37,14 @@ jobs: - os: ubuntu ruby: head experimental: true - + steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby}} - bundler-cache: true - - - name: Run tests - timeout-minutes: 10 - run: bundle exec bake test + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 10 + run: bundle exec bake test diff --git a/guides/getting-started/readme.md b/guides/getting-started/readme.md index 361d4ed..e938115 100644 --- a/guides/getting-started/readme.md +++ b/guides/getting-started/readme.md @@ -1,16 +1,19 @@ # Getting Started with Lennarb ## Overview + Lennarb is a lightweight, Rack-based web framework for Ruby that emphasizes simplicity and flexibility. It provides a clean DSL for routing, middleware support, and various ways to structure your web applications. ## Installation Add Lennarb to your project's Gemfile: + ```ruby gem 'lennarb' ``` Or install it directly via RubyGems: + ```bash $ gem install lennarb ``` @@ -18,6 +21,7 @@ $ gem install lennarb ## Quick Start ### Basic Application + Create a new file named `config.ru`: ```ruby @@ -34,6 +38,7 @@ run app ``` Start the server: + ```bash $ rackup ``` @@ -43,6 +48,7 @@ Your application will be available at `http://localhost:9292`. ## Application Structure ### Class-Based Applications + For larger applications, you can use a class-based structure: ```ruby @@ -52,7 +58,7 @@ class MyApp < Lennarb res.status = 200 res.html('