unit-ruby 0.3.7 → 0.4.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -4
- data/lib/unit-ruby/util/api_resource.rb +10 -0
- data/lib/unit-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7417620acf3f69df5f634207b4bf0e97d5a7e45aca790ce22b57aa2d8fd84614
|
4
|
+
data.tar.gz: 11cbabcdb449614599cf252f7ea514b931a6ba7568efec791a11d053f32df866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce872f36d6ec31367d22ef794ca47d88748bcc051d92b8000715cf5c011193f8f9ea48e4c898dd46bb1a8710bdd50b330eee0a37cd7b12e2eb049023b67c89be
|
7
|
+
data.tar.gz: 48665a1223b85b440e4b4d0fdbb4af7008f9209f95d29b0c4cd9e9d15cd9a94b2248475b36d8b565ee616dfa387f29f3315223203a2a0e5659d808ebce40cc28
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -45,12 +45,11 @@ In order to publish this gem on [RubyGems.org](https://rubygems.org/), you will
|
|
45
45
|
|
46
46
|
Once your account is set up, the following operations will facilitate publishing the latest version of the gem:
|
47
47
|
|
48
|
-
1.
|
49
|
-
2.
|
48
|
+
1. After making your changes to the gem, update the version number in `version.rb` and open a PR for review using semantic versioning
|
49
|
+
2. Ensure that PR request is approved by appropriate member(s) of the engineering team before publishing the gem in the below steps
|
50
50
|
3. Run `gem build unit-ruby`. This will build a version of the gem called `unit-ruby-[gem version number].gem`
|
51
51
|
4. Push this latest version of the gem to RubyGems.org by calling `gem push unit-ruby-[gem version number].gem`
|
52
|
-
5.
|
53
|
-
6. Merge PR into `main` branch
|
52
|
+
5. Merge PR into `main` branch
|
54
53
|
|
55
54
|
## Contributing
|
56
55
|
|
@@ -124,6 +124,16 @@ module Unit
|
|
124
124
|
[send(singular_resource_name)].compact
|
125
125
|
end
|
126
126
|
end
|
127
|
+
|
128
|
+
define_method("#{resource_name}=") do |resources|
|
129
|
+
singular_resource_name = resource_name.to_s.singularize.to_sym
|
130
|
+
|
131
|
+
relationships[resource_name] = {
|
132
|
+
data: resources.map do |resource|
|
133
|
+
{ type: singular_resource_name, id: resource.id }
|
134
|
+
end
|
135
|
+
}
|
136
|
+
end
|
127
137
|
end
|
128
138
|
|
129
139
|
# Hyrdates an instance of the resource from data returned from the API
|
data/lib/unit-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chloe Isacke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-09-
|
12
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|