Skip to content

Commit

Permalink
T-18 Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Mar 4, 2020
1 parent 9d083cd commit 3674484
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 10 deletions.
64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
[![Build Status](https://travis-ci.com/marian13/basic_temperature.svg?branch=master)](https://travis-ci.com/marian13/basic_temperature) [![Maintainability](https://api.codeclimate.com/v1/badges/a9acbc8db712f308d5f8/maintainability)](https://codeclimate.com/github/marian13/basic_temperature/maintainability) [![Coverage Status](https://coveralls.io/repos/github/marian13/basic_temperature/badge.svg)](https://coveralls.io/github/marian13/basic_temperature)
## Basic Temperature ##

# BasicTemperature
[![Gem Version](https://badge.fury.io/rb/basic_temperature.svg)](https://rubygems.org/gems/basic_temperature) [![Build Status](https://travis-ci.com/marian13/basic_temperature.svg?branch=master)](https://travis-ci.com/marian13/basic_temperature) [![Maintainability](https://api.codeclimate.com/v1/badges/21dc5d50cf5de8346a3c/maintainability)](https://codeclimate.com/github/marian13/basic_temperature/maintainability) [![Coverage Status](https://coveralls.io/repos/github/marian13/basic_temperature/badge.svg)](https://coveralls.io/github/marian13/basic_temperature)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/basic_temperature`. To experiment with that code, run `bin/console` for an interactive prompt.
![alt text](https://raw.githubusercontent.com/marian13/basic_temperature/master/logo.png)

TODO: Delete this and the text above, and describe your gem
Basic Temperature is a Ruby library which provides a simple value object to work with temperatures and allows to perform basic operations like conversion from Celcius to Kelvin, from Kelvin to Fahrenheit etc.

### Features
- Provides a `BasicTemperature` class which encapsulates all information about a certain
temperature, such as its amount of degrees and its scale.
- Provides APIs for exchanging temperatures from one scale to another (currently Celsius, Kelvin and Fahrenheit).
- Allows comparing temperatures between each other.
- Supports basic math operations like addition and subtraction.
- 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.

## Installation

Expand All @@ -24,19 +33,54 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
```ruby
require 'basic_temperature'

## Development
temperature = BasicTemperature.new(degrees: 20, scale: :celcius)
# Scale can be one of celcius, kelvin or fahrenheit.

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.
temperature.to_celcius
# => 20 Celcius
temperature.to_kelvin
# => 293 Kelvin
temperature.to_fahrenheit
# => 68 Fahrenheit
```

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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
You can try to utilize `BasicTemperature#to_scale` if you need to convert temperatures dynamically, for example:

## Contributing
```ruby
temperature.to_scale(scale)
```

Temperatures can be compared between each other.

```ruby
temperature = BasicTemperature.new(degress: 0, scale: :celcius)
other = BasicTemperature.new(degress: 0, scale: :celcius)

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/basic_temperature.
temperature == other
# => true
```

When temperatures have different scales - conversion to common scale is handled under the hood.
```ruby
temperature = BasicTemperature.new(degress: 0, scale: :celcius)
other = BasicTemperature.new(degress: 273.15, scale: :kelvin)

temperature == other
# => true
```

## Versioning
Basic Temperature follows the [Semantic Versioning](https://semver.org/) standard.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/marian13/basic_temperature.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Copyright (c) 2020 [Marian Kostyk](http://mariankostyk.com).
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3674484

Please sign in to comment.