orc 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57771a0ccf6f041a6fa4b078d8e1afd949a45109
4
- data.tar.gz: d516bad7021c748534a91cba5a83e0128631fb48
3
+ metadata.gz: 127fd1871659187b605b3e5c18c6e2a1917b9de3
4
+ data.tar.gz: 6df9ee6fe949ade30692aaa555345e0c858d9201
5
5
  SHA512:
6
- metadata.gz: 6473d492c84c8c6a7f5cd620470199e19af61762043c9e9ab9cadfb135dc1b83c0f53e7c0752203d5c699f2f3c9f07565c1e6a3e90e1fa28a9d91578df46d26b
7
- data.tar.gz: a0433644c852466a2efaba48dbaf11e7d9a35ca6d2614cc24f98e3d9019d90c97a49cb98dc7d597e203aa8150a0cc7ef4df0ca07389c4568a7737cecd28c46cb
6
+ metadata.gz: 780610dc00606668c4f03c984ff20c8133ffe886da741106172ae037895607fcafcc976cf8de53c73ee2bb13d5a4beac25766a64e3165d8c84b857a709e542e5
7
+ data.tar.gz: c0b966a22bc7390c43e6b43f02299bdbd523893baf1ed972b23f78810eda6331b0d66a6217273a95873598e5a1ed6a7fd3ad913712ffbdd1877c86b3c99c79fe
data/.travis.yml CHANGED
@@ -6,8 +6,6 @@ rvm:
6
6
  - 1.9.3
7
7
  - 2.1.2
8
8
  - ruby-head
9
- - jruby-19mode
10
- - jruby-head
11
9
  - rbx-2
12
10
  matrix:
13
11
  include:
@@ -17,5 +15,6 @@ matrix:
17
15
  env: JRUBY_OPTS="$JRUBY_OPTS --debug"
18
16
  allow_failures:
19
17
  - rvm: ruby-head
18
+ - rvm: jruby-head
20
19
  notifications:
21
20
  email: false
data/README.md CHANGED
@@ -27,7 +27,7 @@ describe Orc::Result do
27
27
  expect(subject.success?).to be(true)
28
28
  end
29
29
 
30
- it 'returns :success state' do
30
+ it 'returns :success status' do
31
31
  expect(subject.status).to be(:success)
32
32
  end
33
33
 
@@ -37,21 +37,37 @@ describe Orc::Result do
37
37
  end
38
38
 
39
39
  describe '.failure' do
40
- subject { Orc::Result.failure(status, context) }
40
+ shared_context 'a failure result' do
41
+ let(:status) { :confused }
42
+ let(:object) { :context }
41
43
 
42
- let(:status) { :confused }
43
- let(:context) { :context }
44
+ it 'signals failure' do
45
+ expect(subject.success?).to be(false)
46
+ end
44
47
 
45
- it 'signals failure' do
46
- expect(subject.success?).to be(false)
48
+ it 'exposes the associated #object' do
49
+ expect(subject.object).to be(object)
50
+ end
47
51
  end
48
52
 
49
- it 'returns :success state' do
50
- expect(subject.status).to be(status)
53
+ context 'when no status is given' do
54
+ subject { Orc::Result.failure(object) }
55
+
56
+ include_context 'a failure result'
57
+
58
+ it 'exposes a :failure status' do
59
+ expect(subject.status).to be(:failure)
60
+ end
51
61
  end
52
62
 
53
- it 'exposes the associated context' do
54
- expect(subject.context).to be(context)
63
+ context 'when status is given' do
64
+ subject { Orc::Result.failure(object, status) }
65
+
66
+ include_context 'a failure result'
67
+
68
+ it 'exposes the given #status' do
69
+ expect(subject.status).to be(status)
70
+ end
55
71
  end
56
72
  end
57
73
  end
data/config/flog.yml CHANGED
@@ -1,2 +1,2 @@
1
1
  ---
2
- threshold: 1.1
2
+ threshold: 1.6
data/config/rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  AllCops:
2
- Includes:
2
+ Include:
3
3
  - '**/*.rake'
4
4
  - 'Gemfile'
5
5
  - 'Gemfile.devtools'
6
- Excludes:
6
+ Exclude:
7
7
  - '**/vendor/**'
8
8
  - '**/benchmarks/**'
9
9
 
data/lib/orc.rb CHANGED
@@ -21,15 +21,15 @@ module Orc
21
21
 
22
22
  # Create a result indicating failure
23
23
  #
24
- # @param [Object] status
25
- # an arbitrary status description (symbol)
26
- #
27
- # @param [Object] context
24
+ # @param [Object] object
28
25
  # context information associated with the failure
29
26
  #
27
+ # @param [Object] status
28
+ # an optional, arbitrary status description (symbol)
29
+ #
30
30
  # @return [Success]
31
- def self.failure(status, context)
32
- Failure.new(status, context)
31
+ def self.failure(object, status = :failure)
32
+ Failure.new(object, status)
33
33
  end
34
34
 
35
35
  include AbstractType
@@ -58,7 +58,7 @@ module Orc
58
58
 
59
59
  # Result object indicating failure along with status and context
60
60
  class Failure < self
61
- include Concord::Public.new(:status, :context)
61
+ include Concord::Public.new(:object, :status)
62
62
 
63
63
  # Indicate success
64
64
  #
data/lib/orc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Orc
4
- VERSION = '0.0.1'.freeze
4
+ VERSION = '0.0.2'.freeze
5
5
  end # Orc
@@ -12,7 +12,7 @@ describe Orc::Result do
12
12
  expect(subject.success?).to be(true)
13
13
  end
14
14
 
15
- it 'returns :success state' do
15
+ it 'returns :success status' do
16
16
  expect(subject.status).to be(:success)
17
17
  end
18
18
 
@@ -22,21 +22,37 @@ describe Orc::Result do
22
22
  end
23
23
 
24
24
  describe '.failure' do
25
- subject { Orc::Result.failure(status, context) }
25
+ shared_context 'a failure result' do
26
+ let(:status) { :confused }
27
+ let(:object) { :context }
26
28
 
27
- let(:status) { :confused }
28
- let(:context) { :context }
29
+ it 'signals failure' do
30
+ expect(subject.success?).to be(false)
31
+ end
29
32
 
30
- it 'signals failure' do
31
- expect(subject.success?).to be(false)
33
+ it 'exposes the associated #object' do
34
+ expect(subject.object).to be(object)
35
+ end
32
36
  end
33
37
 
34
- it 'returns :success state' do
35
- expect(subject.status).to be(status)
38
+ context 'when no status is given' do
39
+ subject { Orc::Result.failure(object) }
40
+
41
+ include_context 'a failure result'
42
+
43
+ it 'exposes a :failure status' do
44
+ expect(subject.status).to be(:failure)
45
+ end
36
46
  end
37
47
 
38
- it 'exposes the associated context' do
39
- expect(subject.context).to be(context)
48
+ context 'when status is given' do
49
+ subject { Orc::Result.failure(object, status) }
50
+
51
+ include_context 'a failure result'
52
+
53
+ it 'exposes the given #status' do
54
+ expect(subject.status).to be(status)
55
+ end
40
56
  end
41
57
  end
42
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Gamsjaeger (snusnu)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-01 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concord