Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

Thanks for your interest in improving the PostHog Ruby SDK.

## Developing locally

1. Install `asdf` to manage your Ruby version: `brew install asdf`
2. Install Ruby's plugin: `asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git`
3. Install the required Ruby version: `asdf install`
4. Install dependencies: `bundle install`

## Running the example file

1. Build the gem:

```bash
gem build posthog-ruby.gemspec
```

2. Install it locally:

```bash
gem install ./posthog-ruby-<version>.gem
```

3. Run the example:

```bash
ruby example.rb
```

## Testing

1. Run the full test suite:

```bash
bin/test
```

2. Run a specific test if needed:

```bash
bin/test spec/posthog/client_spec.rb:26
```

## Rails package

The `posthog-rails` package has its own package-specific guide in [posthog-rails/CONTRIBUTING.md](posthog-rails/CONTRIBUTING.md).
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,8 @@ Specifically, the [Ruby integration](https://posthog.com/docs/integrations/ruby-

**Using Rails?** Check out [posthog-rails](posthog-rails/README.md) for automatic exception tracking, ActiveJob instrumentation, and Rails-specific features.

## Developing Locally
## Contributing

1. Install `asdf` to manage your Ruby version: `brew install asdf`
1. Install Ruby's plugin via `asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git`
1. Make `asdf` install the required version by running `asdf install`
1. Run `bundle install` to install dependencies

## Running example file

1. Build the `posthog-ruby` gem by calling: `gem build posthog-ruby.gemspec`.
2. Install the gem locally: `gem install ./posthog-ruby-<version>.gem`
3. Run `ruby example.rb`

## Testing

1. Run `bin/test` (this ends up calling `bundle exec rspec`)
2. An example of running specific tests: `bin/test spec/posthog/client_spec.rb:26`
See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup, example, and test instructions.

For release instructions, see [RELEASING.md](RELEASING.md).
18 changes: 18 additions & 0 deletions posthog-rails/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

This guide covers package-specific development for `posthog-rails`.

For repository-level setup, see the root [CONTRIBUTING.md](../CONTRIBUTING.md).

## Development

Run the package tests from the repository root:

```bash
bundle install
bundle exec rspec
```

## Pull requests

Please keep changes focused, update tests when behavior changes, and follow the existing package conventions.
14 changes: 2 additions & 12 deletions posthog-rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,9 @@ RSpec.configure do |config|
end
```

## Development

To run tests:
## Contributing

```bash
cd posthog-rails
bundle install
bundle exec rspec
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for package-specific development instructions.

## Architecture

Expand Down Expand Up @@ -446,10 +440,6 @@ Ensure you've set `personal_api_key`:
config.personal_api_key = ENV['POSTHOG_PERSONAL_API_KEY']
```

## Contributing

See the main [PostHog Ruby](../README.md) repository for contribution guidelines.

## License

MIT License. See [LICENSE](../LICENSE) for details.
Loading