Skip to content

Commit

Permalink
Merge 85c59d4 into db1916b
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Apr 15, 2020
2 parents db1916b + 85c59d4 commit 3c185b4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Rankine).

- Allows comparing temperatures between each other.
- Supports basic math operations like addition and subtraction.
- Queries like `boil_water?`, `freeze_water?`.
- Tested against Ruby 2.3, 2.4, 2.5, 2.6 & 2.7. See
[.travis-ci.yml](https://github.com/marian13/basic_temperature/blob/9b13cb9909b57c51bb5dc05a8989d07a314e67d6/.travis.yml)
for the exact versions.
Expand All @@ -32,27 +33,33 @@ for the exact versions.

## Installation

Add this line to your application's Gemfile:
Gemfile:

```ruby
gem 'basic_temperature'
gem 'basic_temperature', '~> 0.2.2'
```

#### Warning
And then run:

Since this gem is under active development and there are often backward-incompatible changes between minor releases, you might want to use a conservative version lock in your Gemfile:
$ bundle install

And that's it.

You can access all the features of `basic_temperature` by creating instances of `BasicTemperature::Temperature`.

But there is a shorter form.

If `Temperature` constant was not used before in your app, you can add this line to your Gemfile:

```ruby
gem 'basic_temperature', '~> 0.2.1'
gem 'basic_temperature', '~> 0.2.2', require: ['basic_temperature/alias']
```

And then execute:

$ bundle install
This way `BasicTemperature::Temperature` class will be accesible simply by `Temperature`.

Or install it yourself as:
The following guide assumes you have chosen the shorter form.

$ gem install basic_temperature
If not, just replace all `Temperature` to `BasicTemperature::Temperature`.

## Usage

Expand Down
8 changes: 8 additions & 0 deletions lib/basic_temperature/temperature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ module BasicTemperature
# -Temperature[20, :celsius]
# # => -20 °C
#
# == Queries
#
# Temperature[0, :celsius].boil_water?
# # => false
#
# Temperature[0, :celsius].freeze_water?
# # => true
#
class Temperature
include Comparable

Expand Down

0 comments on commit 3c185b4

Please sign in to comment.