> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# sue445/ruby-orbs

CircleCI orb for ruby.
https://github.com/sue445/circleci-ruby-orbs


## Commands

### bundle-install

Run `bundle install` using cache.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `bundle_clean` | boolean | true | Whether pass `--clean` to `bundle install` or use `bundle config set --local clean 'true'` |
| `bundle_deployment` | boolean | false | Whether path to `--deployment` or run `bundle config set deployment 'true'` |
| `bundle_extra_args` | string |  | Arguments to pass to `bundle install` |
| `bundle_frozen` | boolean | false | Whether path to `--frozen` or  run `bundle config set frozen 'true'` |
| `bundle_gemfile` | string | Gemfile | Passed to `bundle install --gemfile` |
| `bundle_jobs` | integer | 4 | Passed to `bundle install --jobs` |
| `bundle_no_cache` | boolean | false | Whether path to `--no-cache` or  run `bundle config set no-cache 'true'` |
| `bundle_no_prune` | boolean | false | Whether path to `--no-prune` or  run `bundle config set no-prune 'true'` |
| `bundle_path` | string | vendor/bundle | Passed to `bundle install --path` or use `bundle config set path` |
| `bundle_retry` | integer | 3 | Passed to `bundle install --retry` |
| `bundle_shebang` | boolean | false | Whether path to `--shebang` or  run `bundle config set shebang 'true'` |
| `bundle_system` | boolean | false | Whether path to `--system` or  run `bundle config set system 'true'` |
| `bundle_with` | string |  | Passed to `bundle install --with` or `bundle config set with` |
| `bundle_without` | string |  | Passed to `bundle install --without` or `bundle config set without` |
| `cache_key_prefix` | string | v1-bundle | Key prefix of cache |
| `gemspec_name` | string |  | gemspec name (required if `with_gemfile_lock` is false) |
| `restore_bundled_with` | boolean | true | Whether resolve bundler version difference between `Gemfile.lock` and pre-installed in CI |
| `update_always` | boolean | false | Whether run always `bundle update` when `with_gemfile_lock` is disabled |
| `with_gemfile_lock` | boolean | true | Whether using `Gemfile.lock` for cache key |

### install-circleci-bundle-update-pr

Install circleci-bundle-update-pr.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `version` | string |  | circleci-bundle-update-pr vesion. default is latest |

### run-circleci-bundle-update-pr

Run `circleci-bundle-update-pr`.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `assignees` | string |  | Assign the PR to them. (e.g. alice,bob,carol) |
| `branch` | string | $CIRCLE_BRANCH | Space separated branches. (e.g. 'master develop topic') |
| `duplicate` | boolean | false | Make PR even if it has already existed |
| `enterprise_octokit_access_token` | env_var_name | ENTERPRISE_OCTOKIT_ACCESS_TOKEN | Your GitHub Enterprise personal access token as an env var on CircleCI |
| `enterprise_octokit_api_endpoint` | string | $ENTERPRISE_OCTOKIT_API_ENDPOINT | Your GitHub Enterprise api endpoint (e.g. https://www.example.com/api/v3) |
| `git_user_email` | string | $GIT_USER_EMAIL | E-mail for commit |
| `git_user_name` | string | $GIT_USER_NAME | Username for commit |
| `github_access_token` | env_var_name | GITHUB_ACCESS_TOKEN | Your GitHub personal access token as an env var on CircleCI.
Go to your account's settings page (https://github.com/settings/tokens/new?description=circleci-bundle-update-pr%20token) and generate a personal access token with "repo" scope
 |
| `labels` | string |  | Add labels to the PR (e.g. In Review, Update) |
| `no_output_timeout` | string | 10m | Elapsed time the command can run without output. (e.g. 20m, 1.25h, 5s) |
| `reviewers` | string |  | Request PR review to them. (e.g. alice,bob,carol) |

## Jobs

### bundle-update-pr

Run `bundle update` and send PullRequest.
Uses https://github.com/masutaka/circleci-bundle-update-pr


| Parameter | Type | Default | Description |
|---|---|---|---|
| `assignees` | string |  | Assign the PR to them. (e.g. alice,bob,carol) |
| `branch` | string | $CIRCLE_BRANCH | Space separated branches. (e.g. `master develop topic`) |
| `duplicate` | boolean | false | Make PR even if it has already existed |
| `enterprise_octokit_access_token` | env_var_name | ENTERPRISE_OCTOKIT_ACCESS_TOKEN | Your GitHub Enterprise personal access token as an env var on CircleCI |
| `enterprise_octokit_api_endpoint` | string | $ENTERPRISE_OCTOKIT_API_ENDPOINT | Your GitHub Enterprise api endpoint (e.g. https://www.example.com/api/v3) |
| `git_user_email` | string | $GIT_USER_EMAIL | E-mail for commit |
| `git_user_name` | string | $GIT_USER_NAME | Username for commit |
| `github_access_token` | env_var_name | GITHUB_ACCESS_TOKEN | Your GitHub personal access token as an env var on CircleCI.
Go to your account's settings page (https://github.com/settings/tokens/new?description=circleci-bundle-update-pr%20token) and generate a personal access token with "repo" scope
 |
| `image` | string | circleci/ruby | Image for `bundle update` |
| `labels` | string |  | Add labels to the PR (e.g. In Review, Update) |
| `no_output_timeout` | string | 10m | Elapsed time the command can run without output. (e.g. 20m, 1.25h, 5s) |
| `post-bundle-update-pr` | steps |  | Run steps after `circleci-bundle-update-pr` |
| `pre-bundle-update-pr` | steps |  | Run steps before `circleci-bundle-update-pr` |
| `reviewers` | string |  | Request PR review to them. (e.g. alice,bob,carol) |
| `version` | string |  | circleci-bundle-update-pr vesion. default is latest |

## Examples

### bundle-install-with-gemfile-lock

Run `bundle install` using cache for app repo. (`Gemfile.lock` is committed)


```yaml
jobs:
  rspec:
    docker:
      - image: circleci/ruby
    steps:
      - checkout
      - ruby-orbs/bundle-install:
          bundle_clean: true
          bundle_extra_args: ''
          bundle_gemfile: Gemfile
          bundle_jobs: 4
          bundle_path: vendor/bundle
          bundle_retry: 3
          bundle_without: development test
          cache_key_prefix: v1-bundle
          restore_bundled_with: true
      - run: bundle exec rspec
orbs:
  ruby-orbs: sue445/ruby-orbs@volatile
version: 2.1
```

### bundle-install-without-gemfile-lock

Run `bundle install` using cache for gem repo. (`Gemfile.lock` is not committed)


```yaml
jobs:
  rspec:
    docker:
      - image: circleci/ruby
    steps:
      - checkout
      - ruby-orbs/bundle-install:
          bundle_clean: true
          bundle_extra_args: ''
          bundle_jobs: 4
          bundle_path: vendor/bundle
          bundle_retry: 3
          bundle_without: development test
          cache_key_prefix: v1-bundle
          gemspec_name: yourgem
          with_gemfile_lock: false
      - run: bundle exec rspec
orbs:
  ruby-orbs: sue445/ruby-orbs@volatile
version: 2.1
```

### bundle-update-pr

Run `bundle update` and send PullRequest.
Uses https://github.com/masutaka/circleci-bundle-update-pr


```yaml
orbs:
  ruby-orbs: sue445/ruby-orbs@volatile
version: 2.1
workflows:
  nightly:
    jobs:
      - ruby-orbs/bundle-update-pr:
          git_user_email: you@example.com
          git_user_name: CircleCI
          github_access_token: GITHUB_ACCESS_TOKEN
          image: circleci/ruby:2.5.3
          pre-bundle-update-pr:
            - run:
                command: sudo cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
                name: Set timezone to Asia/Tokyo
            - ruby-orbs/bundle-install
    triggers:
      - schedule:
          cron: 00 10 * * 5
          filters:
            branches:
              only: master
  version: 2
```