sanger-jsonapi-resources 0.1.3 → 0.1.4

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: 41ebb993c7cbfaceff000cffb66c33e03242eb93f32f898676b78cf633fa835c
4
- data.tar.gz: 334f92079b8036bcafcc12647965bc82181a609f3773bd54e88f1041e533f9de
3
+ metadata.gz: a55bda6cecda0ea196dec77943a8e2506af7bd15bd581cabcfbc996b3792aeb6
4
+ data.tar.gz: 84fe7e09db2944f6891037f838e751c7daf49ebd095bb08de43c1ab5a5010853
5
5
  SHA512:
6
- metadata.gz: 8f82eb2c975059c4f0745f08bcf6d9243a48440ae430d9b1f2855386e59d3404dbde639776c114a5e6449788c5be0af766d3d6b4569af2903b1d65fb95169e55
7
- data.tar.gz: a423295e281436746d3eecc5edd6ead5377d1ab1ec71ff6322500314eaa45761fc1d5a4b028e4ec18d6b989b33a5c6e240c14b210a1db8c690f61eb11b46cb0d
6
+ metadata.gz: '09651520c32728f3a6835aa77d83dc3b212426fc1154a7f49bc017f2f758aa8435c94954a6df5d3009fec99605fc8445ce4f636b6b2ce7f5b60d9758e061c1ed'
7
+ data.tar.gz: d7f53c0c0f23c6c1e6ec7e3f535e0e9481bf900682a93a5b1672ecfb5f53c642d74a4a754140b7daaf962a4cbe1c4eb2dc34e5b31763e0c631d0b7d0554c849c
data/README.md CHANGED
@@ -56,8 +56,10 @@ Check which versions we have published at https://rubygems.org/gems/sanger-jsona
56
56
  - Change version number in `lib/jsonapi/resources/version.rb` . This file is read by the gemspec during publication.
57
57
  - Test Sequencescape with the gem from the branch.
58
58
  - Merge the branch into develop.
59
+ - Create a release from the develop branch with the new version number as the tag. Set Release label to _None_.
59
60
  <!-- list separator -->
60
- - Checkout the develop branch.
61
+ - Checkout the newly-created tag on develop.
62
+ - Execute `bundle install` to ensure the gemspec is up to date.
61
63
  - Execute `gem build jsonapi-resources.gemspec` which builds sanger-jsonapi-resources-0.1.x.gem in this case.
62
64
  - Execute `gem push sanger-jsonapi-resources-0.1.x.gem` which publishes the gem.
63
65
 
@@ -67,8 +69,10 @@ Check which versions we have published at https://rubygems.org/gems/sanger-jsona
67
69
  - Change version number in `lib/jsonapi/resources/version.rb` . This file is read by the gemspec during publication.
68
70
  - Test Traction with the gem from the branch.
69
71
  - Merge the branch into master.
72
+ - Create a release from the master branch with the new version number as the tag. Set Release label to _Latest_.
70
73
  <!-- list separator -->
71
- - Checkout the master branch.
74
+ - Checkout the newly-created tag on master.
75
+ - Execute `bundle install` to ensure the gemspec is up to date.
72
76
  - Execute `gem build jsonapi-resources.gemspec` which builds sanger-jsonapi-resources-0.2.x.gem in this case.
73
77
  - Execute `gem push sanger-jsonapi-resources-0.2.x.gem` which publishes the gem.
74
78
 
@@ -76,15 +80,9 @@ Check which versions we have published at https://rubygems.org/gems/sanger-jsona
76
80
 
77
81
  You will be notified by email for each. You will also receive one email for API key setup. The first push will ask email and password for the account, which are in KeePass (search for "gem").
78
82
 
79
- > [!TIP]
80
- > The process above can be improved by creating new releases first and then publish gems from those releases (tags) rather than publications from master (0.2) and develop (0.1) branches. Still create the releases to make tags in this work though.
81
-
82
83
  > [!NOTE]
83
84
  > The email and password for gem publication is a recent addition to the credentials database. Pull latest changes in the credentials repo.
84
85
 
85
- > [!IMPORTANT]
86
- > Developers need to execute `bundle install`.
87
-
88
86
  ## Contributing
89
87
 
90
88
  See CONTRIBUTING.md for details.
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -38,28 +38,14 @@ module ActionDispatch
38
38
  options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
39
39
  end
40
40
 
41
- resource @resource_type, options do
42
- # :nocov:
43
- if @scope.respond_to? :[]=
44
- # Rails 4
45
- @scope[:jsonapi_resource] = @resource_type
46
-
41
+ resource @resource_type, **options do
42
+ jsonapi_resource_scope(SingletonResource.new(@resource_type, api_only?, @scope[:shallow], **options), @resource_type) do
47
43
  if block_given?
48
44
  yield
49
45
  else
50
46
  jsonapi_relationships
51
47
  end
52
- else
53
- # Rails 5
54
- jsonapi_resource_scope(SingletonResource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
55
- if block_given?
56
- yield
57
- else
58
- jsonapi_relationships
59
- end
60
- end
61
48
  end
62
- # :nocov:
63
49
  end
64
50
  end
65
51
 
@@ -107,27 +93,14 @@ module ActionDispatch
107
93
  options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
108
94
  end
109
95
 
110
- resources @resource_type, options do
111
- # :nocov:
112
- if @scope.respond_to? :[]=
113
- # Rails 4
114
- @scope[:jsonapi_resource] = @resource_type
96
+ resources @resource_type, **options do
97
+ jsonapi_resource_scope(Resource.new(@resource_type, api_only?, @scope[:shallow], **options), @resource_type) do
115
98
  if block_given?
116
99
  yield
117
100
  else
118
101
  jsonapi_relationships
119
102
  end
120
- else
121
- # Rails 5
122
- jsonapi_resource_scope(Resource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
123
- if block_given?
124
- yield
125
- else
126
- jsonapi_relationships
127
- end
128
- end
129
103
  end
130
- # :nocov:
131
104
  end
132
105
  end
133
106
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanger-jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - PSD Team - Wellcome Trust Sanger Institute
@@ -147,40 +147,40 @@ dependencies:
147
147
  requirements:
148
148
  - - ">="
149
149
  - !ruby/object:Gem::Version
150
- version: '7.1'
150
+ version: '7.2'
151
151
  - - "<"
152
152
  - !ruby/object:Gem::Version
153
- version: '8.1'
153
+ version: '9.0'
154
154
  type: :runtime
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: '7.1'
160
+ version: '7.2'
161
161
  - - "<"
162
162
  - !ruby/object:Gem::Version
163
- version: '8.1'
163
+ version: '9.0'
164
164
  - !ruby/object:Gem::Dependency
165
165
  name: railties
166
166
  requirement: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: '7.1'
170
+ version: '7.2'
171
171
  - - "<"
172
172
  - !ruby/object:Gem::Version
173
- version: '8.1'
173
+ version: '9.0'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
- version: '7.1'
180
+ version: '7.2'
181
181
  - - "<"
182
182
  - !ruby/object:Gem::Version
183
- version: '8.1'
183
+ version: '9.0'
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: rack
186
186
  requirement: !ruby/object:Gem::Requirement