Readme.md in usps-imis-api-0.2.1 vs Readme.md in usps-imis-api-0.3.0
- old
+ new
@@ -11,34 +11,36 @@
```
or add this line to your Gemfile:
```ruby
-gem 'usps-imis-api', '>= 0.2.0'
+gem 'usps-imis-api', '>= 0.3.0'
```
## Setup
Include the library, and set the configuration:
```ruby
require 'dotenv/load' # Optionally load environment variables from `.env` file
-require 'usps-imis-api'
+require 'usps/imis'
-Imis.configure do |config|
+Usps::Imis.configure do |config|
config.environment = :development # Rails.env
config.imis_id_query_name = ENV['IMIS_ID_QUERY_NAME']
config.username = ENV['IMIS_USERNAME']
config.password = ENV['IMIS_PASSWORD']
end
```
+When using `bin/console`, this configuration will be run by default.
+
Instantiate the API object:
```ruby
-api = Imis::Api.new
+api = Usps::Imis::Api.new
```
### Authentication
If a token is not available, this will automatically fetch one when needed. As long as that token
@@ -146,11 +148,11 @@
For supported panels (usually, business objects with composite identity keys), you can interact
with them in the same general way:
```ruby
-vsc = Imis::Panel::Vsc.new
+vsc = Usps::Imis::Panel::Vsc.new
vsc.api.imis_id = 6374
vsc.get(1417)
@@ -160,10 +162,16 @@
vsc.update(certificate: 'E136924', year: 2024, count: 43, ordinal: ordinal)
vsc.destroy(ordinal)
```
+Panels are also accessible directly from the API object:
+
+```ruby
+api.panels.vsc.get(1417)
+```
+
### DSL Mode
Instead of manually setting the current iMIS ID, then running individual queries, you can instead
run queries in DSL mode. This specifies the iMIS ID for the scope of the block, then reverts to the
previous value.
@@ -201,9 +209,15 @@
```
### GitHub Actions
Testing and linting are automatically run on every push.
+
+## Development
+
+After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
+
+To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## PHP
This same API is
[available for PHP](https://github.com/unitedstatespowersquadrons/imis-api).