https://github.com/posthog/posthog-ruby
Send usage data from your Ruby code to PostHog.
https://github.com/posthog/posthog-ruby
ruby
Last synced: 9 months ago
JSON representation
Send usage data from your Ruby code to PostHog.
- Host: GitHub
- URL: https://github.com/posthog/posthog-ruby
- Owner: PostHog
- License: mit
- Created: 2020-02-17T22:09:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T11:47:44.000Z (10 months ago)
- Last Synced: 2025-03-21T18:13:42.694Z (10 months ago)
- Topics: ruby
- Language: Ruby
- Homepage: https://posthog.com/docs/libraries/ruby
- Size: 135 KB
- Stars: 19
- Watchers: 3
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostHog Ruby
Please see the main [PostHog docs](https://posthog.com/docs).
Specifically, the [Ruby integration](https://posthog.com/docs/integrations/ruby-integration) details.
## Developing Locally
1. Install Ruby (and optionally `rbenv` to control ruby versions)
2. Install Bundler
3. 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-.gem`
3. Run `ruby example.rb`
## Testing
1. Run `bundle exec rspec`
2. An example of running specific tests: `bundle exec rspec spec/posthog/client_spec.rb:26`
## Questions?
### [Join our Slack community.](https://join.slack.com/t/posthogusers/shared_invite/enQtOTY0MzU5NjAwMDY3LTc2MWQ0OTZlNjhkODk3ZDI3NDVjMDE1YjgxY2I4ZjI4MzJhZmVmNjJkN2NmMGJmMzc2N2U3Yjc3ZjI5NGFlZDQ)
## How to release
1. Get access to RubyGems from @dmarticus, @daibhin or @mariusandra
2. Update `lib/posthog/version.rb` with the new version & add to `CHANGELOG.md`. Commit the changes:
```shell
git commit -am "Version 1.2.3"
git tag -a 1.2.3 -m "Version 1.2.3"
git push && git push --tags
```
3. Run
```shell
gem build posthog-ruby.gemspec
gem push posthog-ruby-1.2.3.gem
```
3. Authenticate with your RubyGems account and approve the publish!