haveapi 0.29.4 → 0.29.5
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/haveapi.gemspec +1 -1
- data/lib/haveapi/version.rb +1 -1
- data/spec/validators/inclusion_spec.rb +26 -24
- data/test_support/client_test_api.rb +47 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91faacf7a526f1d4a85e3ac834af09b31870084892a4fe423c89f788b785831f
|
|
4
|
+
data.tar.gz: 81ece8ab753c147e13401933bd8086e11c6a20f8e1991cb86ac80df6afbfccac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d2c6c8cc96b841f645193d248023ea939f36a55af8e7dc2ed710ed770a15de89c34897cd9f3db969c4e1867b4e70ebcbcdf0c15f702d8acf917cee3cbc543a2
|
|
7
|
+
data.tar.gz: c7ff9c297474a183ba391e8567088494c0b98456f1cbb37b6a36599a955a4b6aca30ec2d5f631fc8d9fdc2c18319059eb5fda188fe75d2574d3875a52dda4544
|
data/haveapi.gemspec
CHANGED
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
|
15
15
|
s.required_ruby_version = ">= #{File.read('../../.ruby-version').strip}"
|
|
16
16
|
|
|
17
17
|
s.add_dependency 'activesupport', '>= 7.1'
|
|
18
|
-
s.add_dependency 'haveapi-client', '~> 0.29.
|
|
18
|
+
s.add_dependency 'haveapi-client', '~> 0.29.5'
|
|
19
19
|
s.add_dependency 'i18n', '>= 1.6', '< 2'
|
|
20
20
|
s.add_dependency 'json'
|
|
21
21
|
s.add_dependency 'mail'
|
data/lib/haveapi/version.rb
CHANGED
|
@@ -12,30 +12,32 @@ describe HaveAPI::Validators::Inclusion do
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
%w[one two three]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
context 'with full form' do
|
|
31
|
-
let(:validator) do
|
|
32
|
-
described_class.new(:include, {
|
|
33
|
-
values: %w[one two three]
|
|
34
|
-
})
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it_behaves_like 'all'
|
|
38
|
-
end
|
|
15
|
+
context 'with include as an Array' do
|
|
16
|
+
let(:values) { %w[one two three] }
|
|
17
|
+
|
|
18
|
+
context 'with short form' do
|
|
19
|
+
let(:validator) { described_class.new(:include, values) }
|
|
20
|
+
|
|
21
|
+
it_behaves_like 'all'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context 'with full form' do
|
|
25
|
+
let(:validator) { described_class.new(:include, { values: }) }
|
|
26
|
+
|
|
27
|
+
it_behaves_like 'all'
|
|
39
28
|
end
|
|
40
29
|
end
|
|
30
|
+
|
|
31
|
+
context 'with include as a Hash' do
|
|
32
|
+
let(:values) do
|
|
33
|
+
{
|
|
34
|
+
one: 'Fancy one',
|
|
35
|
+
two: 'Fancy two',
|
|
36
|
+
three: 'Fancy three'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
let(:validator) { described_class.new(:include, { values: }) }
|
|
40
|
+
|
|
41
|
+
it_behaves_like 'all'
|
|
42
|
+
end
|
|
41
43
|
end
|
|
@@ -519,6 +519,31 @@ module HaveAPI
|
|
|
519
519
|
end
|
|
520
520
|
end
|
|
521
521
|
|
|
522
|
+
define_action(:EchoChoice) do
|
|
523
|
+
extend DocFilter
|
|
524
|
+
|
|
525
|
+
route 'echo_choice'
|
|
526
|
+
http_method :post
|
|
527
|
+
input(:hash) do
|
|
528
|
+
string :format,
|
|
529
|
+
required: true,
|
|
530
|
+
choices: {
|
|
531
|
+
values: {
|
|
532
|
+
archive: 'Archive',
|
|
533
|
+
stream: 'Stream'
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
end
|
|
537
|
+
output(:hash) do
|
|
538
|
+
string :format
|
|
539
|
+
end
|
|
540
|
+
authorize { allow }
|
|
541
|
+
|
|
542
|
+
def exec
|
|
543
|
+
input
|
|
544
|
+
end
|
|
545
|
+
end
|
|
546
|
+
|
|
522
547
|
define_action(:EchoOptional) do
|
|
523
548
|
extend DocFilter
|
|
524
549
|
|
|
@@ -692,10 +717,32 @@ module HaveAPI
|
|
|
692
717
|
HaveAPI.implicit_version = '1.0'
|
|
693
718
|
|
|
694
719
|
reset!
|
|
720
|
+
::I18n.backend.store_translations(
|
|
721
|
+
:cs,
|
|
722
|
+
client_test: {
|
|
723
|
+
resources: {
|
|
724
|
+
test: {
|
|
725
|
+
actions: {
|
|
726
|
+
echo_choice: {
|
|
727
|
+
input: {
|
|
728
|
+
format: {
|
|
729
|
+
choices: {
|
|
730
|
+
archive: { label: 'Archiv' },
|
|
731
|
+
stream: { label: 'Proud' }
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
)
|
|
695
741
|
|
|
696
742
|
api = HaveAPI::Server.new(Resources)
|
|
697
743
|
api.use_version(:all)
|
|
698
744
|
api.default_version = '1.0'
|
|
745
|
+
api.parameter_i18n_scope = 'client_test'
|
|
699
746
|
api.auth_chain << BasicProvider
|
|
700
747
|
api.auth_chain << TokenProvider
|
|
701
748
|
api.action_state = ActionStateBackend
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: haveapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.29.
|
|
4
|
+
version: 0.29.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jakub Skokan
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.29.
|
|
32
|
+
version: 0.29.5
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.29.
|
|
39
|
+
version: 0.29.5
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: i18n
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|