### Install dependencies with bundle install Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Installs Ruby dependencies. Not necessary when using Docker Compose, which installs them automatically. ```bash bundle install ``` -------------------------------- ### Install gem with gem install Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Installs the lago-ruby-client gem when bundler is not used. ```bash gem install lago-ruby-client ``` -------------------------------- ### Start Docker Compose services Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Boots a Lago instance for integration tests and a container with the Lago Ruby Client code. ```bash docker compose up -d ``` -------------------------------- ### Add gem to Gemfile with bundle add Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Adds the lago-ruby-client gem to the application's Gemfile and installs it. ```bash bundle add lago-ruby-client ``` -------------------------------- ### Initialize client and list applied coupons Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Creates a Lago API client with an API key and retrieves applied coupons with pagination and coupon code filters. Prints the results. ```ruby require 'lago-ruby-client' client = Lago::Api::Client.new(api_key: "xyz") applied_coupons = client.applied_coupons.get_all( page: 1, per_page: 10, "coupon_code[]": ["BLACK_FRIDAY", "CHRISTMAS"], ) puts "Listing all applied coupons:" puts applied_coupons ``` -------------------------------- ### Run RuboCop linter Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Runs RuboCop to lint the code. ```bash bundle exec rubocop ``` -------------------------------- ### Run tests with Docker Compose Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Runs tests inside the client container using Docker Compose. ```bash docker compose exec client bundle exec rspec ``` -------------------------------- ### Run RuboCop with Docker Compose Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Runs RuboCop inside the client container using Docker Compose. ```bash docker compose exec client bundle exec rubocop ``` -------------------------------- ### Run tests with rspec Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Runs unit and integration tests. Integration tests require INTEGRATION_TESTS_ENABLED=true and TEST_LAGO_API_URL and TEST_LAGO_API_KEY environment variables. ```bash bundle exec rspec INTEGRATION_TESTS_ENABLED=true TEST_LAGO_API_URL=http://lago:3000 TEST_LAGO_API_KEY=123456 bundle exec rspec ``` -------------------------------- ### Auto-correct RuboCop with Docker Compose Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Formats code inside the client container using Docker Compose. ```bash docker compose exec client bundle exec rubocop -a # or -A ``` -------------------------------- ### Auto-correct RuboCop offenses Source: https://github.com/getlago/lago-ruby-client/blob/main/README.md Formats code by auto-correcting RuboCop offenses. Use -A for more aggressive corrections. ```bash bundle exec rubocop -a # or -A ```