Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d4e4012
Merge branch 'develop' into unstable
jodosha Nov 29, 2017
b1a5483
Depend on hanami-utils 2.0.0.alpha1
jodosha Nov 29, 2017
36c9a68
Enforce rubocop rules for 2.0
jodosha Nov 29, 2017
b78c1d4
Depend on hanami-utils 2.0.0.alpha1
jodosha Nov 29, 2017
e3f8266
Fix build for 2.3 and JRuby
jodosha Nov 30, 2017
6462a88
Merge branch 'develop' into unstable
jodosha Feb 9, 2018
a7df309
Merge branch 'develop' into unstable
jodosha Apr 12, 2018
18bfa10
rubocop 0.54.0
jodosha Apr 12, 2018
7ed11de
Use dry-inflector (#482)
artofhuman Jun 4, 2018
57b6587
Merge branch 'develop' into unstable
jodosha Jun 5, 2018
e67c0e7
Merge branch 'develop' into unstable
jodosha Jun 8, 2018
d252281
Fix rubocop violations from 57b6587e9efb21bba7ff2e9c8a4fc4f21c8e9ae9
jodosha Jun 8, 2018
d3e2933
ROM 4.2 (#490)
jodosha Jun 25, 2018
35b9062
Use Types::Strict::Array.of instead of .member
jodosha Jun 28, 2018
5048e4f
Enable again warnings for test suite. Ref #490
jodosha Jun 28, 2018
3f24e7b
Removes the patchlevel fixation on dry-types so that hanami@usntable …
mereghost Jul 14, 2018
21930c5
Merge branch 'develop' into unstable
jodosha Jul 24, 2018
c87a499
Merge branch 'develop' into unstable
jodosha Jul 28, 2018
dae47fe
Merge branch 'develop' into unstable
jodosha Aug 3, 2018
b8386b2
Merge branch 'develop' into unstable
jodosha Oct 15, 2018
58f66c4
Fix usage of class attribute. Ref https://github.com/hanami/utils/pul…
jodosha Oct 15, 2018
e762086
Merge branch 'master' into develop
jodosha Dec 11, 2018
a8dfbf2
Depend on hanami gems at develop branch
jodosha Dec 11, 2018
e0b049c
Merge branch 'develop' into unstable
jodosha Dec 11, 2018
e459e6b
Merge branch 'master' into develop
jodosha Jan 7, 2019
a570f7e
Merge branch 'develop' into unstable
jodosha Jan 7, 2019
e7a6638
Merge branch 'master' into develop
jodosha Jan 26, 2019
f7271f6
Merge branch 'develop' into unstable
jodosha Jan 26, 2019
936049b
Support MRI 2.5+ (#513)
jodosha Jan 26, 2019
6d8fc84
Disambiguate `::Hash`. Ref hanami/utils#320
jodosha Jan 27, 2019
92e684c
Make the build to pass again locally
jodosha May 13, 2019
067d26a
Remove global state (#532)
mereghost May 15, 2019
ae42039
ROM 5 (#534)
jodosha Jun 12, 2019
6000684
Merge branch 'master' into develop
jodosha Jun 26, 2019
a8b8b83
Merge branch 'develop' into unstable
jodosha Jun 26, 2019
d9c94d4
Test only against 2.5+
jodosha Jun 26, 2019
83e51ee
Merge branch 'master' into develop
jodosha Jul 27, 2019
8f247d8
Merge branch 'develop' into unstable
jodosha Jul 27, 2019
babe442
Upgrade to ROM 5.1.0 (#543)
depfu[bot] Aug 2, 2019
5fedede
Update dry-types (#563)
mereghost Feb 27, 2020
db6b3eb
Update dry-types & ROM (#575)
mereghost Mar 13, 2020
b2aa2fc
Create Hanami::Relation object and setup some test relations.
mereghost Mar 27, 2020
764c5eb
Uses ROM::Structs as a base for Hanami::Entity
mereghost Apr 25, 2020
bd407b6
Makes more tests to pass
mereghost Apr 25, 2020
ec750aa
Moves the new Entity to lib. Renames the old one to OldEntity so we c…
mereghost Apr 27, 2020
e1618fd
Cleans up the Configuration code.
mereghost Apr 27, 2020
650ca4e
Skips tests about the schemas for now. Deletes custom association code
mereghost May 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
- run:
name: install MySQL client
command: |
sudo apt install -y mysql-client
sudo apt-get update
sudo apt install -y default-mysql-client
- run:
name: install dependencies
command: |
Expand Down Expand Up @@ -100,7 +101,7 @@ jobs:
name: install PostgreSQL client
command: |
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt install -y postgresql-contrib
- run:
Expand Down
182 changes: 1 addition & 181 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,186 +177,6 @@ services:
POSTGRES_USER: postgres
POSTGRES_DB: hanami_model

---
kind: pipeline
name: ruby-2-4
group: build

steps:
- name: install
image: hanami/ruby-2.4-db
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3

- name: unit-sqlite3
image: hanami/ruby-2.4-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: sqlite3
DRONE: true
commands:
- COVERAGE=true bundle exec rake

- name: unit-mysql
image: hanami/ruby-2.4-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: mysql
HANAMI_DATABASE_USERNAME: root
HANAMI_DATABASE_PASSWORD:
HANAMI_DATABASE_HOST: mysql-server # see below: services -> name
commands:
- mysql -u $HANAMI_DATABASE_USERNAME -h $HANAMI_DATABASE_HOST --execute="SELECT VERSION();" # assert can connect to database
- COVERAGE=true bundle exec rake

- name: unit-postgres
image: hanami/ruby-2.4-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: postgres
HANAMI_DATABASE: hanami_model
HANAMI_DATABASE_USERNAME: postgres
HANAMI_DATABASE_PASSWORD:
HANAMI_DATABASE_HOST: postgres-server # see below: services -> name
commands:
- psql -U $HANAMI_DATABASE_USERNAME -d $HANAMI_DATABASE -h $HANAMI_DATABASE_HOST # assert can connect to database
- COVERAGE=true bundle exec rake

- name: quality
image: hanami/ruby-2.4-db
environment:
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- bundle exec rubocop
- CI=true bundle exec rake codecov:upload

volumes:
- name: bundle
temp: {}

services:
- name: mysql-server
image: mysql
ports:
- 3306
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: hanami_model
command: ["--default-authentication-plugin=mysql_native_password"]

- name: postgres-server
image: postgres:11-alpine
ports:
- 5432
environment:
POSTGRES_USER: postgres
POSTGRES_DB: hanami_model

---
kind: pipeline
name: ruby-2-3
group: build

steps:
- name: install
image: hanami/ruby-2.3-db
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- ruby -v
- gem install bundler
- bundle install --jobs=3 --retry=3

- name: unit-sqlite3
image: hanami/ruby-2.3-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: sqlite3
DRONE: true
commands:
- COVERAGE=true bundle exec rake

- name: unit-mysql
image: hanami/ruby-2.3-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: mysql
HANAMI_DATABASE_USERNAME: root
HANAMI_DATABASE_PASSWORD:
HANAMI_DATABASE_HOST: mysql-server # see below: services -> name
commands:
- mysql -u $HANAMI_DATABASE_USERNAME -h $HANAMI_DATABASE_HOST --execute="SELECT VERSION();" # assert can connect to database
- COVERAGE=true bundle exec rake

- name: unit-postgres
image: hanami/ruby-2.3-db
volumes:
- name: bundle
path: /usr/local/bundle
environment:
DB: postgres
HANAMI_DATABASE: hanami_model
HANAMI_DATABASE_USERNAME: postgres
HANAMI_DATABASE_PASSWORD:
HANAMI_DATABASE_HOST: postgres-server # see below: services -> name
commands:
- psql -U $HANAMI_DATABASE_USERNAME -d $HANAMI_DATABASE -h $HANAMI_DATABASE_HOST # assert can connect to database
- COVERAGE=true bundle exec rake

- name: quality
image: hanami/ruby-2.3-db
environment:
CODECOV_TOKEN:
from_secret: codecov
volumes:
- name: bundle
path: /usr/local/bundle
commands:
- bundle exec rubocop
- CI=true bundle exec rake codecov:upload

volumes:
- name: bundle
temp: {}

services:
- name: mysql-server
image: mysql
ports:
- 3306
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: hanami_model
command: ["--default-authentication-plugin=mysql_native_password"]

- name: postgres-server
image: postgres:11-alpine
ports:
- 5432
environment:
POSTGRES_USER: postgres
POSTGRES_DB: hanami_model

---
kind: pipeline
name: slack
Expand All @@ -366,7 +186,7 @@ clone:
disable: true

depends_on:
- ruby-2-3
- ruby-2-5

steps:
- name: slack
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Please keep AllCops, Bundler, Style, Metrics groups and then order cops
# alphabetically
inherit_from:
- https://raw.githubusercontent.com/hanami/devtools/master/.rubocop.yml
- https://raw.githubusercontent.com/hanami/devtools/master/.rubocop-unstable.yml
Naming/RescuedExceptionsVariableName:
PreferredName: "exception"
Style/RescueStandardError:
Expand Down
11 changes: 3 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ cache: bundler
script: 'bundle exec rubocop && bundle exec rake spec:unit --trace'
after_script: 'echo `env`'
rvm:
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
- jruby-9.1.9.0
- 2.5
- 2.6
- ruby-head
- jruby-head
env:
- DB=sqlite
- DB=postgresql
Expand All @@ -22,8 +18,7 @@ addons:
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: jruby-9.1.9.0
- env: DB=mysql

notifications:
webhooks:
Expand Down
26 changes: 14 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
source 'https://rubygems.org'
# frozen_string_literal: true

source "https://rubygems.org"
gemspec

unless ENV['CI']
gem 'byebug', require: false, platforms: :mri
gem 'yard', require: false
unless ENV["CI"]
gem "byebug", require: false, platforms: :mri
gem "yard", require: false
end

gem 'hanami-utils', '~> 1.3', require: false, git: 'https://github.com/hanami/utils.git', branch: 'master'
gem "hanami-utils", "~> 2.0.alpha", require: false, git: "https://github.com/hanami/utils.git", branch: "unstable"

gem 'sqlite3', require: false, platforms: :mri, group: :sqlite
gem 'pg', require: false, platforms: :mri, group: :postgres
gem 'mysql2', require: false, platforms: :mri, group: :mysql
gem "sqlite3", require: false, platforms: :mri, group: :sqlite
gem "pg", require: false, platforms: :mri, group: :postgres
gem "mysql2", require: false, platforms: :mri, group: :mysql

gem 'jdbc-sqlite3', require: false, platforms: :jruby, group: :sqlite
gem 'jdbc-postgres', require: false, platforms: :jruby, group: :postgres
gem 'jdbc-mysql', require: false, platforms: :jruby, group: :mysql
gem "jdbc-sqlite3", require: false, platforms: :jruby, group: :sqlite
gem "jdbc-postgres", require: false, platforms: :jruby, group: :postgres
gem "jdbc-mysql", require: false, platforms: :jruby, group: :mysql

gem 'hanami-devtools', require: false, git: 'https://github.com/hanami/devtools.git'
gem "hanami-devtools", require: false, git: "https://github.com/hanami/devtools.git"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Like all the other Hanami components, it can be used as a standalone framework o

## Rubies

__Hanami::Model__ supports Ruby (MRI) 2.3+ and JRuby 9.1.5.0+
__Hanami::Model__ supports Ruby (MRI) 2.5+

## Installation

Expand Down Expand Up @@ -295,6 +295,6 @@ __Hanami::Model__ uses [Semantic Versioning 2.0.0](http://semver.org)

## Copyright

Copyright © 2014-2017 Luca Guidi – Released under MIT License
Copyright © 2014-2019 Luca Guidi – Released under MIT License

This project was formerly known as Lotus (`lotus-model`).
14 changes: 8 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require 'rake'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'hanami/devtools/rake_tasks'
# frozen_string_literal: true

require "rake"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "hanami/devtools/rake_tasks"

namespace :spec do
RSpec::Core::RakeTask.new(:unit) do |task|
task.pattern = FileList['spec/**/*_spec.rb']
task.pattern = FileList["spec/**/*_spec.rb"]
end
end

task default: 'spec:unit'
task default: "spec:unit"
44 changes: 23 additions & 21 deletions hanami-model.gemspec
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'hanami/model/version'
require "hanami/model/version"

Gem::Specification.new do |spec|
spec.name = 'hanami-model'
spec.name = "hanami-model"
spec.version = Hanami::Model::VERSION
spec.authors = ['Luca Guidi']
spec.email = ['me@lucaguidi.com']
spec.summary = 'A persistence layer for Hanami'
spec.description = 'A persistence framework with entities and repositories'
spec.homepage = 'http://hanamirb.org'
spec.license = 'MIT'
spec.authors = ["Luca Guidi"]
spec.email = ["me@lucaguidi.com"]
spec.summary = "A persistence layer for Hanami"
spec.description = "A persistence framework with entities and repositories"
spec.homepage = "http://hanamirb.org"
spec.license = "MIT"

spec.files = `git ls-files -z -- lib/* CHANGELOG.md EXAMPLE.md LICENSE.md README.md hanami-model.gemspec`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.3.0'
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.5.0"

spec.add_runtime_dependency 'hanami-utils', '~> 1.3'
spec.add_runtime_dependency 'rom', '~> 3.3', '>= 3.3.3'
spec.add_runtime_dependency 'rom-sql', '~> 1.3', '>= 1.3.5'
spec.add_runtime_dependency 'rom-repository', '~> 1.4'
spec.add_runtime_dependency 'dry-types', '~> 0.11.0'
spec.add_runtime_dependency 'dry-logic', '~> 0.4.2', '< 0.5'
spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
spec.add_runtime_dependency "hanami-utils", "~> 2.0.alpha"
spec.add_runtime_dependency "rom", "~> 5.2"
spec.add_runtime_dependency "rom-repository", "~> 5.2"
spec.add_runtime_dependency "rom-sql", "~> 3.2"
spec.add_runtime_dependency "dry-types", "~> 1.3"
spec.add_runtime_dependency "dry-inflector", "~> 0.1"
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"

spec.add_development_dependency 'bundler', '>= 1.6', '< 3'
spec.add_development_dependency 'rake', '~> 12'
spec.add_development_dependency 'rspec', '~> 3.7'
spec.add_development_dependency "bundler", ">= 1.6", "< 3"
spec.add_development_dependency "rake", "~> 12"
spec.add_development_dependency "rspec", "~> 3.8"
end
1 change: 0 additions & 1 deletion lib/hanami-model.rb

This file was deleted.

Loading