rasti-model 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f9eccfccf07cf4cdd8918d8767ec7f350b50cb6455b684e1684b6726cd6b6c0
4
- data.tar.gz: 144268df7baa226b9cdfa622994ce32cb523aebf586c75bfa9c2c25c6e782613
3
+ metadata.gz: cd4831ac82eadc7515e4103a10fe010346ec8719d16db0d30103a713b5cd15ef
4
+ data.tar.gz: b363b3bb323dbb5d1eec404e6adb7c3eef6d6673b0a19474d467a40551f280f8
5
5
  SHA512:
6
- metadata.gz: 6a61d5e9030e0752b1080f91e7c65b7259100efba579219b9707e8efa8637ecba183ab574c0816daa7fb9caa3e5ba91a346156e40bec5000d919c35ee54f7ae0
7
- data.tar.gz: 5096b2f80d1e42ba42387be5ecfcae690c02944619f62ae6ca26632380d64511e4badbca3e2add39f5f9d7b9e19413cd60d1754a62b2727a72348394037f28a7
6
+ metadata.gz: 2e0659afca7e7f8a38731ea5901029f4f346895f357430970eba5f251745e2ceaa765ac9731e47c03a7504e2d66d9fccf57e08ea7f58230fabab8c86ca3e2962
7
+ data.tar.gz: aabf1480e4bd1b45c6cde754775714047beff31d89a571fb1b617f4aa4f174a65b922fecd8ddcd90ee3b2acaedf5e3aae70a63d33ddfdcbdde41bbe35fcb8fc9
@@ -0,0 +1,26 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ '**' ]
6
+ pull_request:
7
+ branches: [ '**' ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ name: Tests
13
+ runs-on: ubuntu-22.04
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', 'jruby-9.2.9.0']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Rasti::Model
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rasti-model.svg)](https://rubygems.org/gems/rasti-model)
4
- [![Build Status](https://travis-ci.org/gabynaiman/rasti-model.svg?branch=master)](https://travis-ci.org/gabynaiman/rasti-model)
4
+ [![CI](https://github.com/gabynaiman/rasti-model/actions/workflows/ci.yml/badge.svg)](https://github.com/gabynaiman/rasti-model/actions/workflows/ci.yml)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/gabynaiman/rasti-model/badge.svg?branch=master)](https://coveralls.io/github/gabynaiman/rasti-model?branch=master)
6
6
  [![Code Climate](https://codeclimate.com/github/gabynaiman/rasti-model.svg)](https://codeclimate.com/github/gabynaiman/rasti-model)
7
7
 
@@ -18,6 +18,10 @@ module Rasti
18
18
  options.fetch(:default)
19
19
  end
20
20
 
21
+ def option(name)
22
+ options[name]
23
+ end
24
+
21
25
  def to_s
22
26
  "#{self.class}[name: #{name.inspect}, type: #{type.inspect}, options: #{options.inspect}]"
23
27
  end
@@ -1,5 +1,5 @@
1
1
  module Rasti
2
2
  class Model
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
data/spec/model_spec.rb CHANGED
@@ -257,6 +257,16 @@ describe Rasti::Model do
257
257
  point_2.y.must_equal 2
258
258
  end
259
259
 
260
+ it 'Custom attribute options' do
261
+ model = Class.new(Rasti::Model) do
262
+ attribute :text, T::String, description: 'Test description'
263
+ end
264
+
265
+ attribute = model.attributes.first
266
+ attribute.option(:description).must_equal 'Test description'
267
+ attribute.option(:undefined).must_be_nil
268
+ end
269
+
260
270
  it 'to_s' do
261
271
  Position.to_s.must_equal 'Position[type, point]'
262
272
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasti-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-01 00:00:00.000000000 Z
11
+ date: 2025-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_require
@@ -150,10 +150,10 @@ extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
152
  - ".coveralls.yml"
153
+ - ".github/workflows/ci.yml"
153
154
  - ".gitignore"
154
155
  - ".ruby-gemset"
155
156
  - ".ruby-version"
156
- - ".travis.yml"
157
157
  - Gemfile
158
158
  - LICENSE.txt
159
159
  - README.md
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.0
5
- - 2.1
6
- - 2.2
7
- - 2.3
8
- - 2.4
9
- - 2.5
10
- - 2.6
11
- - 2.7
12
- - jruby-9.2.9.0
13
- - ruby-head
14
- - jruby-head
15
-
16
- matrix:
17
- fast_finish: true
18
- allow_failures:
19
- - rvm: ruby-head
20
- - rvm: jruby-head