order_already 0.3.0 → 0.3.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: 06d0792edcb48d855dd6d7fe7f7e7bd28ee198f6144a816e4b7594f49ea7fe32
4
- data.tar.gz: bc0bb4eafc7c7f01bdbb90e3a5ab20b59abc74f797509f0da4f592ba946ca628
3
+ metadata.gz: 53d7a220ae782eabbe029a0e45f909d1b605b07b881e612b09150819b5cafdc6
4
+ data.tar.gz: 364e044bd3e6b73201f87987cec8f98f09e49d9ef14152bbbdad7c9623bca900
5
5
  SHA512:
6
- metadata.gz: 57752a7bf98a638194b27db452a8028e30cfe94e2490972ee3b9164e72c3e20e6fbb3db4db9c1b6e3a1987259daf29e69b78657578a42342d68377d11e127a50
7
- data.tar.gz: 16d4471e24105b2641ff0640963e3de6a2eff56dc84e0ea104415b1b4cbbe77ab146fcb71df6938f60f4bf1158b5fcf0bdee2d7e2c22939a8209669c83455d29
6
+ metadata.gz: cb6868e1c646a11440e211b90afb49d4662a5312fdd49f75fec4f3cadef7508a72c6af8a99b9f8db46148de56b5be6741a37eddc52af5f39e7dbec8e51571cd7
7
+ data.tar.gz: 441506b2660ff35e8555e451401ed9ae73db8008a233755f77d6e7d4ec61b903d8244bf54f85e052b99571671c1408316a34c35d89ae2d74f396b787bedb2052
data/README.md CHANGED
@@ -47,6 +47,19 @@ class GenericWork < ActiveFedora::Base
47
47
  end
48
48
  ```
49
49
 
50
+ Included, as of v0.3.1, is the `order_already/spec_helper`. This provides the custom matcher: `have_already_ordered_attributes`.
51
+
52
+ ```ruby
53
+ require 'spec_helper'
54
+ require 'order_already/spec_helper'
55
+
56
+ RSpec.describe GenericWork do
57
+ subject { described_class.new }
58
+
59
+ it { is_expected.to have_already_ordered_attributes(:creator, :contributor) }
60
+ end
61
+ ```
62
+
50
63
  As of v0.2.0, the `OrderAlready.for` method takes a `:serializer` keyword. By default this is the preserve the order of the input serializers.
51
64
 
52
65
  ## Development
@@ -0,0 +1,14 @@
1
+ RSpec::Matchers.define :have_already_ordered_attributes do |*expected_attributes|
2
+ match do |actual|
3
+ actual.already_ordered_attributes.map(&:to_sym).sort == expected_attributes.map(&:to_sym).sort
4
+ end
5
+
6
+ failure_message do |actual|
7
+ actual_attrs = actual.already_ordered_attributes.map(&:to_sym).sort
8
+ expected_attrs = expected_attributes.map(&:to_sym).sort
9
+
10
+ "Expected that #{actual} would have the following ordered attributes:\n" \
11
+ "#{expected_attrs.inspect}.\n"
12
+ "Actual: #{actual_attrs.inspect}\n"
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OrderAlready
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
data/lib/order_already.rb CHANGED
@@ -62,6 +62,10 @@ module OrderAlready
62
62
  define_method(:attribute_is_ordered_already?) do |attribute|
63
63
  ordered_attributes.include?(attribute.to_sym)
64
64
  end
65
+
66
+ define_method(:already_ordered_attributes) do
67
+ ordered_attributes
68
+ end
65
69
  end
66
70
  end
67
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: order_already
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-03-01 00:00:00.000000000 Z
12
+ date: 2023-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails-html-sanitizer
@@ -71,11 +71,11 @@ files:
71
71
  - ".rubocop.yml"
72
72
  - CHANGELOG.md
73
73
  - Gemfile
74
- - Gemfile.lock
75
74
  - LICENSE
76
75
  - README.md
77
76
  - Rakefile
78
77
  - lib/order_already.rb
78
+ - lib/order_already/spec_helper.rb
79
79
  - lib/order_already/version.rb
80
80
  - order_already.gemspec
81
81
  homepage: https://github.com/scientist-softserv/order_already
data/Gemfile.lock DELETED
@@ -1,92 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- order_already (0.2.1)
5
- rails-html-sanitizer (~> 1.4)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- activesupport (7.0.4)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 1.6, < 2)
13
- minitest (>= 5.1)
14
- tzinfo (~> 2.0)
15
- ast (2.4.2)
16
- bixby (5.0.2)
17
- rubocop (= 1.28.2)
18
- rubocop-ast
19
- rubocop-performance
20
- rubocop-rails
21
- rubocop-rspec
22
- concurrent-ruby (1.1.10)
23
- crass (1.0.6)
24
- diff-lcs (1.5.0)
25
- i18n (1.12.0)
26
- concurrent-ruby (~> 1.0)
27
- loofah (2.19.0)
28
- crass (~> 1.0.2)
29
- nokogiri (>= 1.5.9)
30
- minitest (5.16.3)
31
- nokogiri (1.13.9-arm64-darwin)
32
- racc (~> 1.4)
33
- parallel (1.22.1)
34
- parser (3.1.2.1)
35
- ast (~> 2.4.1)
36
- racc (1.6.0)
37
- rack (3.0.0)
38
- rails-html-sanitizer (1.4.3)
39
- loofah (~> 2.3)
40
- rainbow (3.1.1)
41
- rake (13.0.6)
42
- regexp_parser (2.6.1)
43
- rexml (3.2.5)
44
- rspec (3.12.0)
45
- rspec-core (~> 3.12.0)
46
- rspec-expectations (~> 3.12.0)
47
- rspec-mocks (~> 3.12.0)
48
- rspec-core (3.12.0)
49
- rspec-support (~> 3.12.0)
50
- rspec-expectations (3.12.0)
51
- diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.12.0)
53
- rspec-mocks (3.12.0)
54
- diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.12.0)
56
- rspec-support (3.12.0)
57
- rubocop (1.28.2)
58
- parallel (~> 1.10)
59
- parser (>= 3.1.0.0)
60
- rainbow (>= 2.2.2, < 4.0)
61
- regexp_parser (>= 1.8, < 3.0)
62
- rexml
63
- rubocop-ast (>= 1.17.0, < 2.0)
64
- ruby-progressbar (~> 1.7)
65
- unicode-display_width (>= 1.4.0, < 3.0)
66
- rubocop-ast (1.23.0)
67
- parser (>= 3.1.1.0)
68
- rubocop-performance (1.15.1)
69
- rubocop (>= 1.7.0, < 2.0)
70
- rubocop-ast (>= 0.4.0)
71
- rubocop-rails (2.15.2)
72
- activesupport (>= 4.2.0)
73
- rack (>= 1.1)
74
- rubocop (>= 1.7.0, < 2.0)
75
- rubocop-rspec (2.11.1)
76
- rubocop (~> 1.19)
77
- ruby-progressbar (1.11.0)
78
- tzinfo (2.0.5)
79
- concurrent-ruby (~> 1.0)
80
- unicode-display_width (2.3.0)
81
-
82
- PLATFORMS
83
- arm64-darwin-21
84
-
85
- DEPENDENCIES
86
- bixby (~> 5.0, >= 5.0.2)
87
- order_already!
88
- rake (~> 13.0)
89
- rspec (~> 3.0)
90
-
91
- BUNDLED WITH
92
- 2.3.9