Skip to content

Commit

Permalink
First push to RubyGems.org, updated to 0.1.3 for this.
Browse files Browse the repository at this point in the history
  • Loading branch information
coezbek committed Jun 10, 2020
1 parent fb2dab4 commit 939e220
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ This gem is an assorted collection of common helpers that I use in a lot of proj

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'cem'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install cem

## Usage
Expand All @@ -26,19 +14,19 @@ Key things includes:

### crequire

crequire is a replacement for require for situations where bundler would be overkill. It solves the frustration of having to manually install gems to run a particular ruby script which requires other gems.
`crequire` is a replacement for `require` for situations where bundler would be overkill. It solves the frustration of having to manually install gems to run a particular ruby script which requires other gems.

For example when you want to require 'qml' from the 'ruby-qml' gem, use the following line:
For example when you want to require `qml` from the `ruby-qml` gem, use the following line:

```
crequire 'qml', 'ruby-qml'
```

This will attempt to require qml and if it can't be found in the local RubyGems, then it will try to `gem install ruby-qml`
This will attempt to require `qml` and if it can't be found in the local RubyGems, then it will try to `gem install ruby-qml`

### Array::with_progress

Monkey patches array to return an enumeration which prints progress while lazy evaluating the enumeration.
Monkey patches `Array` to return an enumeration which prints progress while lazy evaluating the enumeration.

```
require 'cem'
Expand All @@ -59,7 +47,7 @@ Defines integer based `Point2D`, `Seg2D` (line segment), `Dir2D` (relative direc

## 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.
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests.

To install this gem onto your local machine, run `bundle exec rake install`.

Expand All @@ -71,7 +59,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/coezbe

## License

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

## What's with the name?

Expand Down
4 changes: 2 additions & 2 deletions cem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Gem::Specification.new do |spec|
spec.email = ["[email protected]"]

spec.summary = %q{Cem = Christopher's Common Helper Gem for Ruby.}
spec.description = %q{This gem contains my personal little helpers which I use in many projects.}
spec.description = %q{Christopher's Gem = My little helpers which I use in many projects.}
spec.homepage = "https://github.com/coezbek/cem"
spec.license = "MIT"

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
if spec.respond_to?(:metadata)
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/coezbek/cem"
spec.metadata["changelog_uri"] = "https://github.com/coezbek/cem/README.md"
Expand Down
2 changes: 2 additions & 0 deletions lib/cem/cruzzles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def +(other)
end
end

# Scalar multiplication
def *(other)
Point2D.new(x * other, y * other)
end
Expand All @@ -45,6 +46,7 @@ def manhattan(other)
return (x - other.x).abs + (y - other.y).abs
end

# returns the euclidean distance to the given Point2D
def dist(other)
return ((x - other.x) ** 2 + (y - other.y) ** 2).sqrt
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cem/version.rb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Cem
VERSION = "0.1.0"
VERSION = "0.1.3"
end

0 comments on commit 939e220

Please sign in to comment.