summaryrefslogtreecommitdiffstats
path: root/CLI/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'CLI/ruby')
-rw-r--r--CLI/ruby/CHANGELOG.md4
-rw-r--r--CLI/ruby/Dockerfile14
-rw-r--r--CLI/ruby/Gemfile.lock4
-rw-r--r--CLI/ruby/README.md20
-rw-r--r--CLI/ruby/game_of_life.gemspec4
-rw-r--r--CLI/ruby/lib/game_of_life.rb1
-rw-r--r--CLI/ruby/lib/game_of_life/version.rb6
7 files changed, 34 insertions, 19 deletions
diff --git a/CLI/ruby/CHANGELOG.md b/CLI/ruby/CHANGELOG.md
index 44dcc70..01fe7cb 100644
--- a/CLI/ruby/CHANGELOG.md
+++ b/CLI/ruby/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+## 1.0.8
+- Update the gem to work the development via docker
+- Fix yard compatibility with ruby 3
+
## 1.0.7
- Fix compatibility issues with ruby 3
- Fix rubocop offenses (after update)
diff --git a/CLI/ruby/Dockerfile b/CLI/ruby/Dockerfile
new file mode 100644
index 0000000..42f98c0
--- /dev/null
+++ b/CLI/ruby/Dockerfile
@@ -0,0 +1,14 @@
+From alpine:3.18
+
+RUN apk add build-base ruby ruby-dev ruby-bundler
+
+WORKDIR /app
+COPY Gemfile Gemfile.lock game_of_life.gemspec .
+RUN bundle install
+
+COPY . .
+RUN bundle exec rake build
+RUN bundle exec rake install
+CMD game-of-life
+
+VOLUME /app
diff --git a/CLI/ruby/Gemfile.lock b/CLI/ruby/Gemfile.lock
index 0caff5a..138c7fa 100644
--- a/CLI/ruby/Gemfile.lock
+++ b/CLI/ruby/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- terminal_game_of_life (1.0.6)
+ terminal_game_of_life (1.0.8)
thor (~> 1.0)
GEM
@@ -69,7 +69,7 @@ GEM
simplecov_json_formatter (0.1.2)
thor (1.1.0)
unicode-display_width (2.4.2)
- yard (0.9.26)
+ yard (0.9.34)
PLATFORMS
ruby
diff --git a/CLI/ruby/README.md b/CLI/ruby/README.md
index 88dafcd..9ca42d3 100644
--- a/CLI/ruby/README.md
+++ b/CLI/ruby/README.md
@@ -41,25 +41,31 @@ Options:
## Development
+### Locally
- Clone the repo.
- Navigate to the ruby CLI implementation `cd game-of-life/CLI/ruby`.
- run `bundle install` to install dependencies.
-- you can run `bundle rake build` to build the gem/CLI into the `pkg` directory.
-- you can run `bundle rake install` to build and install gem/CLI into system gems.
+- you can run `bundle exec rake build` to build the gem/CLI into the `pkg` directory.
+- you can run `bundle exec rake install` to build and install gem/CLI into system gems.
- you can run `bundle exec ./bin/game-of-life` to run the code for development/testing purposes
+### Docker
+- Run `docker build . -t ruby-gol`
+- Run `docker run -it -v .:/app ruby-gol bundle exec rake install`
+- Run `docker run -it ruby-gol`
+
## Linting
-Run `bundle exec rubocop`
+Run `bundle exec rubocop` or `docker run -it -v .:/app ruby-gol bundle exec rubocop`
## Testing
-Run `bundle exec rspec`
+Run `bundle exec rspec` or `docker run -it ruby-gol bundle exec rspec`
## Documentation
-Run `bundle exec yard`
+Run `bundle exec yard` or `docker run -it -v .:/app ruby-gol bundle exec yard`
## Release
-- Update the [version](./lib/game_of_live/version.rb) number
-- Run `bundle install` and commit changes
+- Update the [version](./game_of_life.gemspec#L5) number
+- Run `bundle install` and commit changes (or `docker run -it -v .:/app ruby-gol bundle install`)
- Update the [CHANGELOG](./CHANGELOG.md)
- Create a git tag `ruby/v#{version_number}` ex: `ruby/v0.1.1-pre`
diff --git a/CLI/ruby/game_of_life.gemspec b/CLI/ruby/game_of_life.gemspec
index 3c7f86b..8f861f5 100644
--- a/CLI/ruby/game_of_life.gemspec
+++ b/CLI/ruby/game_of_life.gemspec
@@ -1,10 +1,8 @@
# frozen_string_literal: true
-require_relative "lib/game_of_life/version"
-
Gem::Specification.new do |spec|
spec.name = "terminal_game_of_life"
- spec.version = GameOfLife::VERSION
+ spec.version = "1.0.8"
spec.authors = ["a14m"]
spec.email = ["[email protected]"]
diff --git a/CLI/ruby/lib/game_of_life.rb b/CLI/ruby/lib/game_of_life.rb
index ca9ce5d..04974ab 100644
--- a/CLI/ruby/lib/game_of_life.rb
+++ b/CLI/ruby/lib/game_of_life.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require "io/console"
-require "game_of_life/version"
require "game_of_life/plane"
require "game_of_life/universe"
require "game_of_life/cell"
diff --git a/CLI/ruby/lib/game_of_life/version.rb b/CLI/ruby/lib/game_of_life/version.rb
deleted file mode 100644
index 58fd737..0000000
--- a/CLI/ruby/lib/game_of_life/version.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-# frozen_string_literal: true
-
-module GameOfLife
- # Game of life version number
- VERSION = "1.0.7"
-end