striuct 0.8.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d820670e757190ed2db502b8d6e0c53a7689f299262695f3ca18cec69dd5270b
4
- data.tar.gz: 8a27cca712c9a63c2a5207090a6a8d0d8dcecd24a13bf07fa16c243a3b24c366
3
+ metadata.gz: 209dd1ff84de379965762e6b1dfc8d730487125aac3c68601198212a45b73491
4
+ data.tar.gz: cd659be7ccc4e033c01805189ea00242ccb298c002d7ced0190dcfa69793639f
5
5
  SHA512:
6
- metadata.gz: c90d1e6cc1ac20015660134d88d863dc935d6db44128e0f49f7c807b6b357d4821055d989e9e9e3a8bb4c49382acbab04509bf0445389a454c72c3fb729cbd85
7
- data.tar.gz: a7154a914174099a8b5d32fe4b534811c14187f3fb9e8735cba701764b7d9aee640de1c276711dcedb85915f33efc9fecac87dde0ae8a09d704d0bbf84f3f11b
6
+ metadata.gz: 7c84b2a3fd370f35315b809b748a1b5fd45682e45ca7edff772806d40dc910535862c2f4464b81aacb87d0af8472c06e2ea9d0139dce76ce98acab2b209a1b97
7
+ data.tar.gz: abc84b95eac37052258aecaed387c9e8adb9e7c8ab8c8aa9463c7e910681f32690044fdf9bd8b9e70925b8a49c5b111bbe3ce1182eac03b705f5061715b027f0
@@ -1,5 +1,3 @@
1
- MIT License
2
-
3
1
  Copyright (c) 2011 Kenichi Kamiya
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
data/README.md CHANGED
@@ -1,18 +1,22 @@
1
1
  # striuct
2
2
 
3
3
  ![Build Status](https://github.com/kachick/striuct/actions/workflows/test_behaviors.yml/badge.svg?branch=main)
4
- [![Gem Version](https://badge.fury.io/rb/striuct.png)](http://badge.fury.io/rb/striuct)
4
+ [![Gem Version](https://badge.fury.io/rb/striuct.svg)](http://badge.fury.io/rb/striuct)
5
5
 
6
6
  Struct++
7
7
 
8
+ - _**This repository is archived**_
9
+ - _**No longer maintained**_
10
+ - _**I didn't remove old versions on https://rubygems.org/gems/striuct, but I no longer plan to update them.**_
11
+
8
12
  ## Usage
9
13
 
10
- Require Ruby 2.6 or later
14
+ Tested in Ruby 3.2 or 3.3
11
15
 
12
16
  Add this line to your `Gemfile`
13
17
 
14
18
  ```ruby
15
- gem 'striuct', '>= 0.8.0', '< 0.9.0'
19
+ gem 'striuct', '~> 0.10.1'
16
20
  ```
17
21
 
18
22
  Then add below code into your Ruby code
@@ -96,28 +100,23 @@ UseMustOption.new #=> InvalidOperationError "`foo` require a value under `must`
96
100
 
97
101
  ### Strict
98
102
 
99
- * Easy and Flexible Validations
100
- * Basically use `#===` for the validation
101
- * The pattern builder DSL is just using [eqq](https://github.com/kachick/eqq)
102
- * When passed the Proc, it will be evaluated in the instance context
103
- * Prevent to conflict member names
104
- * Lock setters for each member
103
+ - Easy and Flexible Validations
104
+ - Basically use `#===` for the validation
105
+ - The pattern builder DSL is just using [eqq](https://github.com/kachick/eqq)
106
+ - When passed the Proc, it will be evaluated in the instance context
107
+ - Prevent to conflict member names
108
+ - Lock setters for each member
105
109
 
106
110
  ### Useful
107
111
 
108
- * Hook just before setters
109
- * Default value
110
- * Member aliasing
111
- * Inheritable
112
- * Handling between nil <-> unassigned
113
- * Similar API for Hash
112
+ - Hook just before setters
113
+ - Default value
114
+ - Member aliasing
115
+ - Inheritable
116
+ - Handling between nil <-> unassigned
117
+ - Similar API for Hash
114
118
 
115
119
  ### Finally
116
120
 
117
- * Base API looks like Struct
118
- * Pure Ruby :)
119
-
120
- ## Link
121
-
122
- * [Repository](https://github.com/kachick/striuct)
123
- * [API documents](https://kachick.github.io/striuct/)
121
+ - Base API looks like Struct
122
+ - Pure Ruby :)
@@ -1,10 +1,8 @@
1
- Note
2
- =====
1
+ # Note
3
2
 
4
3
  This dir's tree is divided under roles/features.
5
4
  Not only divided by CONSTANT names.
6
5
 
7
- CONSTANT
8
- --------
6
+ ## CONSTANT
9
7
 
10
- * attributes - Attributes
8
+ - attributes - Attributes
@@ -10,7 +10,7 @@ class Striuct
10
10
  # @param adjuster [Proc, #to_proc]
11
11
  # @return [Proc]
12
12
  def WHEN(pattern, adjuster)
13
- unless Eqq.valid?(pattern)
13
+ unless Eqq.pattern?(pattern)
14
14
  raise ArgumentError, 'wrong object for pattern'
15
15
  end
16
16
 
@@ -32,7 +32,7 @@ class Striuct
32
32
  end
33
33
 
34
34
  def condition=(condition)
35
- unless Eqq.valid?(condition)
35
+ unless Eqq.pattern?(condition)
36
36
  raise TypeError, 'wrong object for condition'
37
37
  end
38
38
 
@@ -1,5 +1,4 @@
1
- Note
2
- =====
1
+ # Note
3
2
 
4
3
  This dir's tree is divided under roles/features.
5
4
  Not under CONSTANT names.
@@ -42,7 +42,8 @@ class Striuct
42
42
 
43
43
  @db[autonym] = value
44
44
  rescue InvalidValueError
45
- unless /in \[\]=/.match?(caller(2..2).first.slice(/([^:]+)\z/))
45
+ # @note Why caller with range instead of the index? See https://github.com/rubocop/rubocop/pull/4078
46
+ unless caller(2..2).first.slice(/([^:]+)\z/).include?('in []=')
46
47
  $!.backtrace.delete_if { |s| /#{Regexp.escape(File.dirname(__FILE__))}/ =~ s }
47
48
  $!.backtrace.first.sub!(/([^:]+)\z/) { "in `#{autonym}='" }
48
49
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: striuct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi Kamiya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eqq
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.5
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: 0.1.0
19
+ version: 0.1.1
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 0.0.5
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 0.1.0
26
+ version: 0.1.1
33
27
  description: " Struct + validation + inheritable + default_value + etc...\n"
34
28
  email:
35
29
  - kachick1+ruby@gmail.com
@@ -37,7 +31,7 @@ executables: []
37
31
  extensions: []
38
32
  extra_rdoc_files: []
39
33
  files:
40
- - MIT-LICENSE.txt
34
+ - LICENSE
41
35
  - README.md
42
36
  - lib/striuct.rb
43
37
  - lib/striuct/bootstrap.rb
@@ -82,10 +76,9 @@ homepage: https://github.com/kachick/striuct
82
76
  licenses:
83
77
  - MIT
84
78
  metadata:
85
- documentation_uri: https://kachick.github.io/striuct/
86
- homepage_uri: https://github.com/kachick/striuct
87
79
  source_code_uri: https://github.com/kachick/striuct
88
80
  bug_tracker_uri: https://github.com/kachick/striuct/issues
81
+ rubygems_mfa_required: 'true'
89
82
  post_install_message:
90
83
  rdoc_options: []
91
84
  require_paths:
@@ -94,14 +87,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
87
  requirements:
95
88
  - - ">="
96
89
  - !ruby/object:Gem::Version
97
- version: 2.6.0
90
+ version: '3.2'
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: '3.4'
98
94
  required_rubygems_version: !ruby/object:Gem::Requirement
99
95
  requirements:
100
96
  - - ">="
101
97
  - !ruby/object:Gem::Version
102
98
  version: '0'
103
99
  requirements: []
104
- rubygems_version: 3.2.15
100
+ rubygems_version: 3.5.7
105
101
  signing_key:
106
102
  specification_version: 4
107
103
  summary: Struct++