organ 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: bd33328998e87df6ab61e1dc2bd376300c697117
4
- data.tar.gz: f5f0a2ae5eb51e58f51272916e3d6fb40e9dbbca
3
+ metadata.gz: f58028758f74b7ad8fdb144b5be194a4b3f3eba6
4
+ data.tar.gz: 7391d92ec6d6165e58edb13b61b8290607577aba
5
5
  SHA512:
6
- metadata.gz: 8d44b2013528d2fb53af496ab000cbb14cc3d418c30b66a39a9dfb944bcf65c12cb1632b5e5fd8e1fce56d6666b44ff400fe162f9709ccea5424c9f71f6d698a
7
- data.tar.gz: c4ae75c498f063defb2cd5baa94a112f23e4f64c04dcaa374f6b65ac25e2730dec0e6c9b6184ac7a1caf15abe240902d534314c952472fe84bcaf7cf0e574000
6
+ metadata.gz: 657be4d73f04bd1c6a5aded0f539b2c37c39466b7f5c9879333680734137a7e7448e439c4bc9e93706b8216aab14cbc2997aca5ce50e1b219b6471f52ae7d3f6
7
+ data.tar.gz: e87cd083c328bf9b62cc7ad65304ef35b2a4bbb3b5c183092fbe7b78cf60822e1cf05951648f8e059317d44c0128fdb46fd54b2f3552c1ba51f6cc2a715627fa
@@ -2,6 +2,6 @@ require_relative "organ/form"
2
2
 
3
3
  module Organ
4
4
 
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
 
7
7
  end
@@ -119,12 +119,14 @@ module Organ
119
119
  #
120
120
  # @api public
121
121
  def perform!
122
- if valid?
122
+ return_value = if valid?
123
123
  perform
124
124
  end
125
125
  if errors.any?
126
126
  raise Organ::ValidationError.new(errors)
127
127
  end
128
+
129
+ return_value
128
130
  end
129
131
 
130
132
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "organ"
3
- s.version = "0.0.2"
3
+ s.version = "0.0.3"
4
4
  s.summary = "Forms with integrated validations and attribute coercing."
5
5
  s.description = "A small library for manipulating form-based data with validations and attributes coercion."
6
6
  s.authors = ["Sebastian Borrazas"]
@@ -77,15 +77,26 @@ describe Organ::Form do
77
77
  attribute(:username)
78
78
  attribute(:password)
79
79
 
80
+ def initialize(return_value)
81
+ @return_value = return_value
82
+ end
83
+
80
84
  def validate
81
85
  end
82
86
 
83
87
  def perform
88
+ @return_value
84
89
  end
90
+
85
91
  end
86
92
  end
87
93
 
88
- let(:form) { form_klass.new }
94
+ let(:return_value) { 188 }
95
+ let(:form) { form_klass.new(return_value) }
96
+
97
+ it "returns what #perform returns" do
98
+ assert_equal(return_value, form.perform!)
99
+ end
89
100
 
90
101
  describe "if no errors during validate or perform" do
91
102
  it "doesn't raise any exceptions" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: organ
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Borrazas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-28 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A small library for manipulating form-based data with validations and
14
14
  attributes coercion.