Skip to content

Commit 9bf3f32

Browse files
committed
devcontainer and update deps
1 parent 3cea70b commit 9bf3f32

File tree

12 files changed

+88
-15
lines changed

12 files changed

+88
-15
lines changed

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version or gemspec
2+
ARG RUBY_VERSION=3.4.2
3+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
4+
5+
USER root
6+
7+
# Install pkg-config and SQLite development libraries
8+
RUN apt-get update -qq && \
9+
apt-get install -y pkg-config libsqlite3-dev && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
USER vscode
14+
15+
# Ensure binding is always 0.0.0.0
16+
# Binds the server to all IP addresses of the container, so it can be accessed from outside the container.
17+
ENV BINDING="0.0.0.0"

.devcontainer/compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "typed_operation"
2+
3+
services:
4+
typed_operation-dev-env:
5+
container_name: typed_operation-dev-env
6+
build:
7+
context: ..
8+
dockerfile: .devcontainer/Dockerfile
9+
ports:
10+
- "3000"

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "typed_operation Gem Development",
3+
"dockerComposeFile": "compose.yml",
4+
"service": "typed_operation-dev-env",
5+
"containerEnv": {
6+
"RAILS_ENV": "development"
7+
},
8+
"forwardPorts": [3000],
9+
"postCreateCommand": "bundle install && bundle exec appraisal install",
10+
"postStartCommand": "bin/test",
11+
"remoteUser": "vscode"
12+
}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
ruby: [ "3.2", "3.3" ]
13-
rails: [ "7.0" ]
12+
ruby: [ "3.2", "3.3", "3.4" ]
13+
rails: [ "7.2", "8.0" ]
1414
steps:
1515
- uses: actions/checkout@v3
1616
- name: Set up Ruby

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Gemfile.lock
1313
*.gem
1414
/coverage/
1515
.tool-versions
16+
gemfiles/*.lock

Appraisals

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Test against different Rails versions
2+
# Run 'bundle exec appraisal install' to generate Gemfiles
3+
# Run 'bundle exec appraisal rake test' to run tests against all versions
4+
5+
appraise "rails-7.2" do
6+
gem "rails", "~> 7.2"
7+
end
8+
9+
appraise "rails-8.0" do
10+
gem "rails", "~> 8.0"
11+
end

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
# Specify your gem's dependencies in typed_operation.gemspec.
55
gemspec
66

7-
# TODO: move to gemspec when released
8-
gem "literal", ">= 0.1.0", github: "joeldrapper/literal", branch: "main"
7+
gem "literal", "~> 1.0"
98

109
gem "standard"
1110
gem "simplecov"
@@ -15,6 +14,8 @@ gem "sqlite3", "< 2.0"
1514
gem "dry-monads"
1615
gem "action_policy"
1716

17+
gem "appraisal", require: false
18+
1819
# gem "typed_operation"
1920
# gem "type_fusion"
2021

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ Inputs to the operation are specified as typed attributes (uses [`literal`](http
66

77
Type of result of the operation is up to you, eg you could use [`literal` monads](https://github.com/joeldrapper/literal) or [`Dry::Monads`](https://dry-rb.org/gems/dry-monads/1.3/).
88

9-
**Note the version described here (~ 1.0.0) is pre-release on Rubygems (v1.0.0 is waiting for a release of `literal`). To use it now you can simply require `literal` from github in your Gemfile:**
10-
11-
```ruby
12-
gem "literal", github: "joeldrapper/literal", branch: "main"
13-
gem "typed_operation", "~> 1.0.0.beta2"
14-
```
15-
169
## Features
1710

1811
- Operations can be **partially applied** or **curried**

gemfiles/rails_7.2.gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "literal", "~> 1.0"
6+
gem "standard"
7+
gem "simplecov"
8+
gem "rails", "~> 7.2"
9+
gem "sqlite3", "< 2.0"
10+
gem "dry-monads"
11+
gem "action_policy"
12+
gem "appraisal", require: false
13+
14+
gemspec path: "../"

gemfiles/rails_8.0.gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "literal", "~> 1.0"
6+
gem "standard"
7+
gem "simplecov"
8+
gem "rails", "~> 8.0"
9+
gem "sqlite3", "< 2.0"
10+
gem "dry-monads"
11+
gem "action_policy"
12+
gem "appraisal", require: false
13+
14+
gemspec path: "../"

0 commit comments

Comments
 (0)