pr 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +13 -4
- data/Gemfile +4 -0
- data/README.md +2 -4
- data/features/step_definitions/active_model_steps.rb +18 -5
- data/features/support/aruba.rb +2 -1
- data/lib/pr/active_form.rb +1 -1
- data/lib/pr/version.rb +1 -1
- data/pr.gemspec +20 -3
- data/spec/unit/pr/active_form_spec.rb +15 -15
- data/spec/unit/pr/build_from_model_spec.rb +2 -2
- data/spec/unit/pr/build_model_spec.rb +3 -3
- data/spec/unit/pr/define_and_register_spec.rb +11 -11
- data/spec/unit/pr/fields/boolean_field_spec.rb +5 -5
- data/spec/unit/pr/fields/date_field_spec.rb +7 -9
- data/spec/unit/pr/fields/float_field_spec.rb +4 -5
- data/spec/unit/pr/fields/generic_field_spec.rb +6 -8
- data/spec/unit/pr/fields/string_field_spec.rb +7 -9
- data/spec/unit/pr/fields_spec.rb +5 -7
- data/spec/unit/pr/form_spec.rb +2 -2
- metadata +40 -48
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4d11f31b4db52a5c3695a4f10e7f09e96b681dbb451b58c2137e5ca60ae09bd0
|
4
|
+
data.tar.gz: aa81a182b560bcb6874588effc1d5be4896f54f1e7dc9500e04895fdaacbba8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 828a3cc3274be8f88bc2f2c3b4a1c2697fe180407566de476303df693bb15359e596d1aeefdd6845394c8c7e4947c09ea5f23fb5a88f85a39d563fb9e4b1b767
|
7
|
+
data.tar.gz: 3fa4586282547083d37e359dc23511599cf040c9e35d2bcee6eef7ce6bb6673b74998652aab635044c53a4905b59a33fc139bf2bc3adfde76cc8f58da6aab442
|
data/.travis.yml
CHANGED
@@ -1,10 +1,19 @@
|
|
1
|
+
# required for ruby below 2.3
|
2
|
+
dist: trusty
|
1
3
|
language: ruby
|
2
|
-
|
4
|
+
before_install: gem update bundler
|
3
5
|
rvm:
|
6
|
+
- 2.7.1
|
7
|
+
- 2.6.6
|
8
|
+
- 2.5.8
|
9
|
+
- 2.4.10
|
10
|
+
- 2.3.8
|
11
|
+
- 2.2
|
12
|
+
- 2.1
|
13
|
+
- 2.0
|
14
|
+
- 1.9.3
|
15
|
+
- 1.9.2
|
4
16
|
- 2.0.0
|
5
17
|
- 1.9.3
|
6
18
|
- 1.9.2
|
7
|
-
|
8
|
-
- rbx-19mode
|
9
19
|
- jruby-19mode
|
10
|
-
- ruby-head
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
[![Build Status](https://secure.travis-ci.org/JonRowe/pr.png)](http://travis-ci.org/JonRowe/pr)
|
3
|
-
|
4
|
-
PR :: PublicRelations
|
1
|
+
PR :: PublicRelations
|
5
2
|
======================
|
3
|
+
[![Code Climate](https://codeclimate.com/github/JonRowe/pr.png)](https://codeclimate.com/github/JonRowe/pr) [![Build Status](https://secure.travis-ci.org/JonRowe/pr.png)](http://travis-ci.org/JonRowe/pr)
|
6
4
|
|
7
5
|
`PR` is a gem for handling user input with forms. The idea is to decouple
|
8
6
|
the logic of handling user input, the process of parsing what is
|
@@ -7,10 +7,23 @@ When "I run the active model lint tests for" do |instance|
|
|
7
7
|
module Rails
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
begin
|
11
|
+
# new hotness
|
12
|
+
require 'minitest/autorun'
|
13
|
+
rescue LoadError
|
14
|
+
# old and busted then
|
15
|
+
require 'test/unit'
|
16
|
+
end
|
17
|
+
require '#{ expand_path './my_form' }'
|
18
|
+
|
19
|
+
base_class =
|
20
|
+
if defined?(::Test)
|
21
|
+
Test::Unit::TestCase
|
22
|
+
else
|
23
|
+
MiniTest::Unit::TestCase
|
24
|
+
end
|
12
25
|
|
13
|
-
class TestActiveModelCompliance <
|
26
|
+
class TestActiveModelCompliance < base_class
|
14
27
|
include ActiveModel::Lint::Tests
|
15
28
|
|
16
29
|
def model
|
@@ -19,9 +32,9 @@ class TestActiveModelCompliance < Test::Unit::TestCase
|
|
19
32
|
|
20
33
|
end
|
21
34
|
TEST
|
22
|
-
|
35
|
+
run_command 'ruby -Itest test_active_model_compliance.rb'
|
23
36
|
end
|
24
37
|
|
25
38
|
Then "it should pass" do
|
26
|
-
|
39
|
+
expect(all_stdout).to match a_string_including '0 failures'
|
27
40
|
end
|
data/features/support/aruba.rb
CHANGED
data/lib/pr/active_form.rb
CHANGED
data/lib/pr/version.rb
CHANGED
data/pr.gemspec
CHANGED
@@ -16,10 +16,27 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
|
19
|
+
if RUBY_VERSION < '1.9.3'
|
20
|
+
s.add_development_dependency 'rake', '< 11'
|
21
|
+
s.add_development_dependency 'i18n', '< 0.7.0'
|
22
|
+
s.add_development_dependency 'gherkin', '< 3.2'
|
23
|
+
s.add_development_dependency 'cucumber', '< 2'
|
24
|
+
elsif RUBY_VERSION.to_f < 2.3
|
25
|
+
s.add_development_dependency 'cucumber', '< 2'
|
26
|
+
s.add_development_dependency 'rake', '< 12'
|
27
|
+
else
|
28
|
+
s.add_development_dependency 'cucumber'
|
29
|
+
s.add_development_dependency 'rake', '> 13'
|
30
|
+
end
|
31
|
+
|
20
32
|
s.add_development_dependency 'rspec'
|
21
|
-
s.add_development_dependency 'cucumber'
|
22
33
|
s.add_development_dependency 'aruba'
|
23
|
-
s.add_development_dependency 'activemodel'
|
24
34
|
|
35
|
+
if RUBY_VERSION < '2.2.2'
|
36
|
+
s.add_development_dependency 'activemodel', '< 5'
|
37
|
+
else
|
38
|
+
s.add_development_dependency 'activemodel', '> 5'
|
39
|
+
# Only because Github flags dependency security warnings
|
40
|
+
s.add_development_dependency 'activesupport', '> 5'
|
41
|
+
end
|
25
42
|
end
|
@@ -15,11 +15,11 @@ describe 'the PR Form' do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'sets up field to define fields' do
|
18
|
-
PR::DefineAndRegister.
|
18
|
+
expect(PR::DefineAndRegister).to receive(:[]).with form_klass, name, type, {}
|
19
19
|
form_klass.field name, type
|
20
20
|
end
|
21
21
|
it 'sets up field to define fields and passes in options' do
|
22
|
-
PR::DefineAndRegister.
|
22
|
+
expect(PR::DefineAndRegister).to receive(:[]).with form_klass, name, type, my: :option
|
23
23
|
form_klass.field name, type, my: :option
|
24
24
|
end
|
25
25
|
|
@@ -33,23 +33,23 @@ describe 'the PR Form' do
|
|
33
33
|
let(:form) { form_klass.new }
|
34
34
|
subject { form }
|
35
35
|
|
36
|
-
it {
|
37
|
-
it {
|
38
|
-
it {
|
36
|
+
it { is_expected.to respond_to :id }
|
37
|
+
it { is_expected.to respond_to :valid? }
|
38
|
+
it { is_expected.to respond_to :errors }
|
39
39
|
|
40
40
|
it 'has a model name' do
|
41
41
|
expect(form_klass.model_name).to eq "TestForm"
|
42
42
|
expect(form_klass.model_name).to be_a ActiveModel::Name
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
|
-
|
45
|
+
specify { expect(subject.to_model).to eq form }
|
46
|
+
specify { expect(subject.to_partial_path).to eq 'testforms/testform' }
|
47
47
|
|
48
48
|
describe 'when not persisted' do
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
specify { expect(subject.persisted?).to be false }
|
51
|
+
specify { expect(subject.to_key).to be nil }
|
52
|
+
specify { expect(subject.to_param).to be nil }
|
53
53
|
end
|
54
54
|
|
55
55
|
describe 'when persisted' do
|
@@ -57,21 +57,21 @@ describe 'the PR Form' do
|
|
57
57
|
form.id = 100
|
58
58
|
end
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
specify { expect(subject.persisted?).to be true }
|
61
|
+
specify { expect(subject.to_key).to eq [:id] }
|
62
|
+
specify { expect(subject.to_param).to eq "100" }
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
66
|
describe 'and responds to ActiveModel errors' do
|
67
67
|
let(:errors) { double }
|
68
68
|
let(:form) { form_klass.new }
|
69
|
-
before { ActiveModel::Errors.
|
69
|
+
before { allow(ActiveModel::Errors).to receive(:new).and_return(errors) }
|
70
70
|
|
71
71
|
subject { form.errors }
|
72
72
|
|
73
73
|
it 'creates active model errors with itself' do
|
74
|
-
ActiveModel::Errors.
|
74
|
+
expect(ActiveModel::Errors).to receive(:new).with form
|
75
75
|
form.errors
|
76
76
|
end
|
77
77
|
it 'returns the errors object' do
|
@@ -11,12 +11,12 @@ describe 'building forms from models' do
|
|
11
11
|
let(:builder) { PR::BuildFromModel.new(registry, form) }
|
12
12
|
|
13
13
|
it 'gets fields from the registry' do
|
14
|
-
registry.
|
14
|
+
expect(registry).to receive(:fields)
|
15
15
|
builder.build_from model
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'populates the form values from the model when it has them' do
|
19
|
-
field_a.
|
19
|
+
expect(field_a).to receive(:populate).with('a')
|
20
20
|
builder.build_from model
|
21
21
|
end
|
22
22
|
|
@@ -11,12 +11,12 @@ describe 'building a model from a form' do
|
|
11
11
|
let(:builder) { PR::BuildModel.new registry }
|
12
12
|
|
13
13
|
it 'gets the fields' do
|
14
|
-
registry.
|
14
|
+
expect(registry).to receive(:fields)
|
15
15
|
builder.for form, model
|
16
16
|
end
|
17
17
|
it 'converts fields to values' do
|
18
|
-
field_a.
|
19
|
-
field_b.
|
18
|
+
expect(field_a).to receive(:convert)
|
19
|
+
expect(field_b).to receive(:convert)
|
20
20
|
builder.for form, model
|
21
21
|
end
|
22
22
|
it 'iterated over the fields and sets values' do
|
@@ -24,28 +24,28 @@ describe 'defining and registering fields' do
|
|
24
24
|
|
25
25
|
describe 'using the macro' do
|
26
26
|
it 'looks up the field registry for this form klass' do
|
27
|
-
PR::FieldRegistry.
|
27
|
+
expect(PR::FieldRegistry).to receive(:[]).with(form_klass).and_return(registry)
|
28
28
|
PR::DefineAndRegister[ form_klass, field_name, field_type ]
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'looks up the the field for this type' do
|
32
|
-
PR::Fields.
|
32
|
+
expect(PR::Fields).to receive(:[]).with(field_type)
|
33
33
|
PR::DefineAndRegister[ form_klass, field_name, field_type ]
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'defines a field on this form klass' do
|
37
|
-
PR::DefineField.
|
37
|
+
expect(PR::DefineField).to receive(:[]).with( form_klass, field_name, field_klass, {} )
|
38
38
|
PR::DefineAndRegister[ form_klass, field_name, field_type ]
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'registers this definition' do
|
42
|
-
registry.
|
42
|
+
expect(registry).to receive(:register).with(field_name,field)
|
43
43
|
PR::DefineAndRegister[ form_klass, field_name, field_type ]
|
44
44
|
end
|
45
45
|
|
46
46
|
context 'with options' do
|
47
47
|
it 'defines a field on this form klass' do
|
48
|
-
PR::DefineField.
|
48
|
+
expect(PR::DefineField).to receive(:[]).with( form_klass, field_name, field_klass, options )
|
49
49
|
PR::DefineAndRegister[ form_klass, field_name, field_type, options ]
|
50
50
|
end
|
51
51
|
end
|
@@ -55,12 +55,12 @@ describe 'defining and registering fields' do
|
|
55
55
|
let(:definition) { PR::DefineAndRegister.new form_klass }
|
56
56
|
|
57
57
|
it 'looks up the field registry for this form klass' do
|
58
|
-
PR::FieldRegistry.
|
58
|
+
expect(PR::FieldRegistry).to receive(:[]).with(form_klass).and_return(registry)
|
59
59
|
definition.register field_name, field
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'registers this definition' do
|
63
|
-
registry.
|
63
|
+
expect(registry).to receive(:register).with(field_name,field)
|
64
64
|
definition.register field_name, field
|
65
65
|
end
|
66
66
|
end
|
@@ -69,23 +69,23 @@ describe 'defining and registering fields' do
|
|
69
69
|
let(:definition) { PR::DefineAndRegister.new form_klass }
|
70
70
|
|
71
71
|
it 'looks up the field registry for this form klass' do
|
72
|
-
PR::FieldRegistry.
|
72
|
+
expect(PR::FieldRegistry).to receive(:[]).with(form_klass).and_return(registry)
|
73
73
|
definition.define field_name, field_type
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'looks up the the field for this type' do
|
77
|
-
PR::Fields.
|
77
|
+
expect(PR::Fields).to receive(:[]).with(field_type)
|
78
78
|
definition.define field_name, field_type
|
79
79
|
end
|
80
80
|
|
81
81
|
it 'defines a field on this form klass' do
|
82
|
-
PR::DefineField.
|
82
|
+
expect(PR::DefineField).to receive(:[]).with( form_klass, field_name, field_klass, {} )
|
83
83
|
definition.define field_name, field_type
|
84
84
|
end
|
85
85
|
|
86
86
|
context 'with options' do
|
87
87
|
it 'defines a field on this form klass' do
|
88
|
-
PR::DefineField.
|
88
|
+
expect(PR::DefineField).to receive(:[]).with( form_klass, field_name, field_klass, options )
|
89
89
|
definition.define field_name, field_type, options
|
90
90
|
end
|
91
91
|
end
|
@@ -9,9 +9,9 @@ describe 'a boolean field' do
|
|
9
9
|
describe "default value" do
|
10
10
|
subject { klass.new }
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
specify { expect(subject.raw).to equal(false) }
|
13
|
+
specify { expect(subject.convert).to equal(false) }
|
14
|
+
specify { expect(subject.options).to eq({}) }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#options' do
|
@@ -24,8 +24,8 @@ describe 'a boolean field' do
|
|
24
24
|
let(:converted_value) { double "converted_value" }
|
25
25
|
|
26
26
|
it "should return the converted value" do
|
27
|
-
field.
|
28
|
-
field.raw.
|
27
|
+
expect(field).to receive(:convert).and_return(converted_value)
|
28
|
+
expect(field.raw).to eq(converted_value)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -8,11 +8,9 @@ describe 'a date field' do
|
|
8
8
|
let(:field) { klass.new value, options }
|
9
9
|
|
10
10
|
describe "default value" do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
specify { expect { subject.convert }.to raise_error PR::Fields::InvalidValue }
|
15
|
-
its(:options) { should == {} }
|
11
|
+
specify { expect(klass.new.raw).to eq '' }
|
12
|
+
specify { expect { klass.new.convert }.to raise_error PR::Fields::InvalidValue }
|
13
|
+
specify { expect(klass.new.options).to eq({}) }
|
16
14
|
end
|
17
15
|
|
18
16
|
describe '#options' do
|
@@ -23,7 +21,7 @@ describe 'a date field' do
|
|
23
21
|
|
24
22
|
describe "raw" do
|
25
23
|
it "returns the value the field was initialized with" do
|
26
|
-
field.raw.
|
24
|
+
expect(field.raw).to eq(value)
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
@@ -31,19 +29,19 @@ describe 'a date field' do
|
|
31
29
|
let(:value) { Date.civil 2011, 6, 1 }
|
32
30
|
|
33
31
|
subject { field.populate value }
|
34
|
-
specify { subject; field.raw.
|
32
|
+
specify { subject; expect(field.raw).to eq('01/06/2011') }
|
35
33
|
end
|
36
34
|
|
37
35
|
describe "convert" do
|
38
36
|
|
39
37
|
it "should attempt to parse the value as a uk formatted date" do
|
40
|
-
Date.
|
38
|
+
expect(Date).to receive(:strptime).with(value,'%d/%m/%Y')
|
41
39
|
field.convert
|
42
40
|
end
|
43
41
|
|
44
42
|
context "where value is not a valid date" do
|
45
43
|
it "should raise an InvalidFieldValueError" do
|
46
|
-
Date.
|
44
|
+
expect(Date).to receive(:strptime).and_raise(ArgumentError)
|
47
45
|
expect { field.convert }.to raise_error PR::Fields::InvalidValue
|
48
46
|
end
|
49
47
|
end
|
@@ -8,9 +8,8 @@ describe 'a float field' do
|
|
8
8
|
let(:field) { klass.new value, options }
|
9
9
|
|
10
10
|
describe "default value" do
|
11
|
-
|
12
|
-
|
13
|
-
its(:options) { should == {} }
|
11
|
+
specify { expect(klass.new.raw).to eq '' }
|
12
|
+
specify { expect(klass.new.options).to eq({}) }
|
14
13
|
end
|
15
14
|
|
16
15
|
describe '#options' do
|
@@ -31,7 +30,7 @@ describe 'a float field' do
|
|
31
30
|
|
32
31
|
subject { field.populate value }
|
33
32
|
|
34
|
-
specify { subject; field.raw.
|
33
|
+
specify { subject; expect(field.raw).to eq("3.141") }
|
35
34
|
end
|
36
35
|
|
37
36
|
describe "#convert" do
|
@@ -40,7 +39,7 @@ describe 'a float field' do
|
|
40
39
|
let(:value) { "3.4" }
|
41
40
|
|
42
41
|
it "should return the float intepretation" do
|
43
|
-
field.convert.
|
42
|
+
expect(field.convert).to eq(3.4)
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
@@ -7,11 +7,9 @@ describe 'a generic field' do
|
|
7
7
|
let(:field) { klass.new value, options }
|
8
8
|
|
9
9
|
describe "default value" do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
its(:convert) { should == nil }
|
14
|
-
its(:options) { should == {} }
|
10
|
+
specify { expect(klass.new.raw).to eq nil }
|
11
|
+
specify { expect(klass.new.convert).to eq nil }
|
12
|
+
specify { expect(klass.new.options).to eq({}) }
|
15
13
|
end
|
16
14
|
|
17
15
|
describe '#options' do
|
@@ -22,18 +20,18 @@ describe 'a generic field' do
|
|
22
20
|
|
23
21
|
describe :raw do
|
24
22
|
it "should return the value the field was initialized with" do
|
25
|
-
field.raw.
|
23
|
+
expect(field.raw).to eq(value)
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
29
27
|
describe "#populate" do
|
30
28
|
subject { field.populate value }
|
31
|
-
specify { field.raw.
|
29
|
+
specify { expect(field.raw).to eq(value) }
|
32
30
|
end
|
33
31
|
|
34
32
|
describe :convert do
|
35
33
|
it "should return the raw value" do
|
36
|
-
field.convert.
|
34
|
+
expect(field.convert).to eq(value)
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
@@ -7,11 +7,9 @@ describe 'a string field' do
|
|
7
7
|
let(:field) { klass.new value, options }
|
8
8
|
|
9
9
|
describe "default value" do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
its(:convert) { should == '' }
|
14
|
-
its(:options) { should == {} }
|
10
|
+
specify { expect(klass.new.raw).to eq '' }
|
11
|
+
specify { expect(klass.new.convert).to eq '' }
|
12
|
+
specify { expect(klass.new.options).to eq({}) }
|
15
13
|
end
|
16
14
|
|
17
15
|
describe '#options' do
|
@@ -22,19 +20,19 @@ describe 'a string field' do
|
|
22
20
|
|
23
21
|
describe "#populate" do
|
24
22
|
subject { field.populate value }
|
25
|
-
specify { field.raw.
|
23
|
+
specify { expect(field.raw).to eq(value) }
|
26
24
|
end
|
27
25
|
|
28
26
|
describe :raw do
|
29
27
|
it "should return the value the field was initialized with" do
|
30
|
-
field.raw.
|
28
|
+
expect(field.raw).to eq(value)
|
31
29
|
end
|
32
30
|
end
|
33
31
|
|
34
32
|
describe :convert do
|
35
33
|
it "should return the string version of value" do
|
36
|
-
value.
|
37
|
-
field.convert.
|
34
|
+
expect(value).to receive(:to_s).and_return "string value"
|
35
|
+
expect(field.convert).to eq("string value")
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
data/spec/unit/pr/fields_spec.rb
CHANGED
@@ -5,13 +5,11 @@ describe 'accessing fields' do
|
|
5
5
|
let(:lookup) { PR::Fields }
|
6
6
|
|
7
7
|
describe 'finding fields via constant' do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
its([:date]) { should eq PR::Fields::DateField }
|
14
|
-
its([:float]) { should eq PR::Fields::FloatField }
|
8
|
+
specify { expect(lookup[:generic]).to eq PR::Fields::GenericField }
|
9
|
+
specify { expect(lookup[:string]).to eq PR::Fields::StringField }
|
10
|
+
specify { expect(lookup[:boolean]).to eq PR::Fields::BooleanField }
|
11
|
+
specify { expect(lookup[:date]).to eq PR::Fields::DateField }
|
12
|
+
specify { expect(lookup[:float]).to eq PR::Fields::FloatField }
|
15
13
|
end
|
16
14
|
|
17
15
|
describe 'extending with custom fields' do
|
data/spec/unit/pr/form_spec.rb
CHANGED
@@ -16,11 +16,11 @@ describe 'the PR Form' do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'sets up field to define fields' do
|
19
|
-
PR::DefineAndRegister.
|
19
|
+
expect(PR::DefineAndRegister).to receive(:[]).with form_klass, name, type, {}
|
20
20
|
form_klass.field name, type
|
21
21
|
end
|
22
22
|
it 'sets up field to define fields and passes in options' do
|
23
|
-
PR::DefineAndRegister.
|
23
|
+
expect(PR::DefineAndRegister).to receive(:[]).with form_klass, name, type, my: :option
|
24
24
|
form_klass.field name, type, my: :option
|
25
25
|
end
|
26
26
|
end
|
metadata
CHANGED
@@ -1,106 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Rowe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDVjCCAj6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBRMQ4wDAYDVQQDDAVoZWxs
|
14
|
-
bzEXMBUGCgmSJomT8ixkARkWB2pvbnJvd2UxEjAQBgoJkiaJk/IsZAEZFgJjbzES
|
15
|
-
MBAGCgmSJomT8ixkARkWAnVrMB4XDTEzMDIwMzA4MTgwNloXDTE0MDIwMzA4MTgw
|
16
|
-
NlowUTEOMAwGA1UEAwwFaGVsbG8xFzAVBgoJkiaJk/IsZAEZFgdqb25yb3dlMRIw
|
17
|
-
EAYKCZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJ1azCCASIwDQYJKoZI
|
18
|
-
hvcNAQEBBQADggEPADCCAQoCggEBAMhs6ng/SRrYfG7RtQx8liJTZs8tpz7PBnlH
|
19
|
-
qyOwuU0weJc7nh6C9C8LGyJzpkbjJJo1rfTMg7huDyL14Py82dfMDomApif8jNNI
|
20
|
-
8KtviAgB1DrWq0fCDLtu/M77+yuVV3OhDdrAFaBkT/euvdJ8cAKrLxbJ+klgvrcB
|
21
|
-
FK+c4PUV3/zBKghe0l7FuDhyQCsuLNDbWyFvDS97tPjeN6yWuszwg22vZMDdsuzN
|
22
|
-
Cj3M4LLSkbrt+AOUcysEJxI4t6uv2U1bRzHsDfAF0RI/Q7OMtUr+Dtz/2YJ47KKs
|
23
|
-
51ZRjLLGHd10XrIfFSfGyJj1dMbDgLsEBj1sFH4e6dy7gau8TaUCAwEAAaM5MDcw
|
24
|
-
CQYDVR0TBAIwADAdBgNVHQ4EFgQULu5JH2g7RAjoXaZt+fbrfNDI9IkwCwYDVR0P
|
25
|
-
BAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQAf5A4kB769DPKGjPZ++v42FwVi7X7v
|
26
|
-
RpufPs6R4YHyzHXaJmAqnhleZhVJijBgsdb2SigNRbg+IK8XYHg7jkonMgO8OS3D
|
27
|
-
C6w8VB5bI0PqyDOwCGcQkYHYlZZWCghAyBTSBowHAekMb9V3QjJtJ8XkizjshETO
|
28
|
-
ZCVI2AObjlJi8I10aK2tSo9sv2riCKZ92BVSM13zYWn+C/eCP/m9BDiw37UQtuQq
|
29
|
-
2feWfO4gCNmvfFjULOAYHq9JHEjN5SLSXvj5HdSnDcCyIfJKn5Ya3JahWQaWIsXf
|
30
|
-
/NPE/mB57TOwj+d7XUa2NC4HUadF8R51IYEcIB0PpIEzJlKtfXFcOZxO
|
31
|
-
-----END CERTIFICATE-----
|
32
|
-
date: 2013-04-15 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
33
12
|
dependencies:
|
34
13
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
14
|
+
name: cucumber
|
36
15
|
requirement: !ruby/object:Gem::Requirement
|
37
16
|
requirements:
|
38
|
-
- -
|
17
|
+
- - ">="
|
39
18
|
- !ruby/object:Gem::Version
|
40
19
|
version: '0'
|
41
20
|
type: :development
|
42
21
|
prerelease: false
|
43
22
|
version_requirements: !ruby/object:Gem::Requirement
|
44
23
|
requirements:
|
45
|
-
- -
|
24
|
+
- - ">="
|
46
25
|
- !ruby/object:Gem::Version
|
47
26
|
version: '0'
|
48
27
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
28
|
+
name: rake
|
50
29
|
requirement: !ruby/object:Gem::Requirement
|
51
30
|
requirements:
|
52
|
-
- -
|
31
|
+
- - ">"
|
53
32
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
33
|
+
version: '13'
|
55
34
|
type: :development
|
56
35
|
prerelease: false
|
57
36
|
version_requirements: !ruby/object:Gem::Requirement
|
58
37
|
requirements:
|
59
|
-
- -
|
38
|
+
- - ">"
|
60
39
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
40
|
+
version: '13'
|
62
41
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
42
|
+
name: rspec
|
64
43
|
requirement: !ruby/object:Gem::Requirement
|
65
44
|
requirements:
|
66
|
-
- -
|
45
|
+
- - ">="
|
67
46
|
- !ruby/object:Gem::Version
|
68
47
|
version: '0'
|
69
48
|
type: :development
|
70
49
|
prerelease: false
|
71
50
|
version_requirements: !ruby/object:Gem::Requirement
|
72
51
|
requirements:
|
73
|
-
- -
|
52
|
+
- - ">="
|
74
53
|
- !ruby/object:Gem::Version
|
75
54
|
version: '0'
|
76
55
|
- !ruby/object:Gem::Dependency
|
77
56
|
name: aruba
|
78
57
|
requirement: !ruby/object:Gem::Requirement
|
79
58
|
requirements:
|
80
|
-
- -
|
59
|
+
- - ">="
|
81
60
|
- !ruby/object:Gem::Version
|
82
61
|
version: '0'
|
83
62
|
type: :development
|
84
63
|
prerelease: false
|
85
64
|
version_requirements: !ruby/object:Gem::Requirement
|
86
65
|
requirements:
|
87
|
-
- -
|
66
|
+
- - ">="
|
88
67
|
- !ruby/object:Gem::Version
|
89
68
|
version: '0'
|
90
69
|
- !ruby/object:Gem::Dependency
|
91
70
|
name: activemodel
|
92
71
|
requirement: !ruby/object:Gem::Requirement
|
93
72
|
requirements:
|
94
|
-
- -
|
73
|
+
- - ">"
|
95
74
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
75
|
+
version: '5'
|
97
76
|
type: :development
|
98
77
|
prerelease: false
|
99
78
|
version_requirements: !ruby/object:Gem::Requirement
|
100
79
|
requirements:
|
101
|
-
- -
|
80
|
+
- - ">"
|
102
81
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
82
|
+
version: '5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activesupport
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5'
|
104
97
|
description: Form and Presenter libraries for interfacing the public with Rails
|
105
98
|
email:
|
106
99
|
- hello@jonrowe.co.uk
|
@@ -108,9 +101,9 @@ executables: []
|
|
108
101
|
extensions: []
|
109
102
|
extra_rdoc_files: []
|
110
103
|
files:
|
111
|
-
- .gitignore
|
112
|
-
- .rspec
|
113
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
114
107
|
- Gemfile
|
115
108
|
- README.md
|
116
109
|
- Rakefile
|
@@ -169,17 +162,16 @@ require_paths:
|
|
169
162
|
- lib
|
170
163
|
required_ruby_version: !ruby/object:Gem::Requirement
|
171
164
|
requirements:
|
172
|
-
- -
|
165
|
+
- - ">="
|
173
166
|
- !ruby/object:Gem::Version
|
174
167
|
version: '0'
|
175
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
169
|
requirements:
|
177
|
-
- -
|
170
|
+
- - ">="
|
178
171
|
- !ruby/object:Gem::Version
|
179
172
|
version: '0'
|
180
173
|
requirements: []
|
181
|
-
|
182
|
-
rubygems_version: 2.0.3
|
174
|
+
rubygems_version: 3.1.2
|
183
175
|
signing_key:
|
184
176
|
specification_version: 4
|
185
177
|
summary: Public Relations tools for Rails
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
�*V���)�&m6�!�����կ��}kgL8��;%�bmN\�*�#K�$�>�2@[�������b4�pM��2?�&����#��~��Lc�m�'L��M���#��,o���\���2-�ѷ;�"j1�/:�K@�,e�WoN�[��[���C�mL�W'��@�UF?��+����3�1C>a�����A�
|
metadata.gz.sig
DELETED
Binary file
|