operation 1.0.0.beta → 1.0.0

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: e609f4ffd6fbf2a50ff0667fbf4bfdedd3a2f874
4
- data.tar.gz: 28a06955ebe29eba6317917ae0be8dd3211a4711
3
+ metadata.gz: 6a2a82d643d105848ecdd6c4fbb893ac3feb90b6
4
+ data.tar.gz: 8e470090532b789ef6aa8df10abc46512d2bbfc4
5
5
  SHA512:
6
- metadata.gz: 8f8ee5b725295f6bd571e116775662374ae825f348752dd8284b244f45cb76cf160cbe50e16db8fbe1706bb3dd35e120caac1ad3da858492a0accae7473f835e
7
- data.tar.gz: 6eb1d71f1794e0eebccb48f260922a0675de4f16f9d49f92e8cd15977f6bacd4b72390155bb114d7947a96df020f726e6807f4d66682b14f15e9c16c55942efe
6
+ metadata.gz: 4a6743348ba2e004a9c8527af1bc7fa31ee6543821cd310794e4a4f865f2b811f2a57f2fb7da925d4166f9a03b86d943c4198924f3efa447e2557a7d61392d6e
7
+ data.tar.gz: ad6b9dc8f4f534f3f7cf689b847bf240e440221ffad38993be492d867b29d6f780d01e986127ed242ae1572172a57951f57a140ee9f2b6f3a08f5092d56e0509
@@ -3,7 +3,7 @@ class Operation
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
5
  TINY = 0
6
- PRE = 'beta'
6
+ PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join '.'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo
@@ -81,9 +81,6 @@ files:
81
81
  - lib/operation/progress.rb
82
82
  - lib/operation/version.rb
83
83
  - lib/operations.rb
84
- - spec/lib/operation/deferrable_spec.rb
85
- - spec/lib/operation_spec.rb
86
- - spec/spec_helper.rb
87
84
  homepage: https://github.com/halo/operation
88
85
  licenses:
89
86
  - MIT
@@ -99,9 +96,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
96
  version: 2.1.0
100
97
  required_rubygems_version: !ruby/object:Gem::Requirement
101
98
  requirements:
102
- - - ">"
99
+ - - ">="
103
100
  - !ruby/object:Gem::Version
104
- version: 1.3.1
101
+ version: '0'
105
102
  requirements: []
106
103
  rubyforge_project:
107
104
  rubygems_version: 2.4.5
@@ -1,69 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Operation do
4
- let(:operation) { Operation.new }
5
- let(:successables) { [] }
6
- let(:progressables) { [] }
7
- let(:failables) { [] }
8
-
9
- describe '#on_progress' do
10
- before do
11
- operation.on_progress { |result| progressables << result }
12
- operation.progress 42, :still_working
13
- operation.progress 99, :almost_done
14
- end
15
-
16
- it 'calls all the successables' do
17
- expect(progressables.size).to eq 2
18
- expect(progressables.first.percent).to eq 42
19
- expect(progressables.first.code).to eq :still_working
20
- expect(progressables.last.percent).to eq 99
21
- expect(progressables.last.code).to eq :almost_done
22
- end
23
-
24
- it 'does not call the successables' do
25
- expect(successables).to be_empty
26
- end
27
-
28
- it 'does not call the failables' do
29
- expect(failables).to be_empty
30
- end
31
-
32
- it 'does not alter the state' do
33
- expect(operation.status).to eq :unknown
34
- end
35
- end
36
-
37
- describe '#on_success' do
38
- before do
39
- operation.on_success { successables << 'called' }
40
- operation.on_success { |result| successables << result }
41
- operation.succeed :great
42
- end
43
-
44
- it 'calls all the successables' do
45
- expect(successables).to eq ['called', :great]
46
- end
47
-
48
- it 'does not call the failables' do
49
- expect(failables).to be_empty
50
- end
51
- end
52
-
53
- describe '#on_failure' do
54
- before do
55
- operation.on_failure { failables << 'called' }
56
- operation.on_failure { |result| failables << result }
57
- operation.fail :bummer
58
- end
59
-
60
- it 'calls all the successables' do
61
- expect(failables).to eq ['called', :bummer]
62
- end
63
-
64
- it 'does not call the failables' do
65
- expect(successables).to be_empty
66
- end
67
- end
68
-
69
- end
@@ -1,87 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Operation do
4
-
5
- describe '#success' do
6
- it 'handles different types of success' do
7
- expect( Operation.new(success: true) ).to be_success
8
- expect( Operation.new(success: 'true') ).to be_success
9
- expect( Operation.new(success: 1) ).to be_success
10
- expect( Operation.new(success: '1') ).to be_success
11
- end
12
- end
13
-
14
- describe '#failure' do
15
- it 'handles different types of failure' do
16
- expect( Operation.new(success: false) ).to be_failure
17
- expect( Operation.new(success: 'false') ).to be_failure
18
- expect( Operation.new(success: 0) ).to be_failure
19
- expect( Operation.new(success: '0') ).to be_failure
20
- expect( Operation.new ).to be_failure
21
- end
22
- end
23
-
24
- describe '#code' do
25
- it 'is a Symbol if possible' do
26
- expect( Operation.new(code: :normal).code ).to eq :normal
27
- expect( Operation.new(code: 'normal').code ).to eq :normal
28
- expect( Operation.new(code: 'it worked').code ).to eq :'it worked'
29
- expect( Operation.new(code: 0).code ).to eq :'0'
30
- expect( Operation.new(code: "\n").code ).to eq :"\n"
31
- end
32
-
33
- it 'may be nil' do
34
- expect( Operation.new.code ).to be_nil
35
- expect( Operation.new(code: nil).code ).to be_nil
36
- expect( Operation.new(code: '').code ).to be_nil
37
- end
38
- end
39
-
40
- describe '#metadata' do
41
- it 'is whatever was passed in' do
42
- expect( Operation.new(metadata: nil).metadata ).to be_nil
43
- expect( Operation.new(metadata: []).metadata ).to eq []
44
- expect( Operation.new(metadata: { one: :two }).metadata ).to eq one: :two
45
- end
46
- end
47
-
48
- describe 'test setup' do
49
- it 'has no Hashie' do
50
- expect { Hashie }.to raise_error NameError
51
- end
52
- end
53
-
54
- describe '#meta' do
55
- it 'is nil for nil' do
56
- expect( Operation.new.meta ).to be_nil
57
- expect( Operation.new(metadata: nil).meta ).to be_nil
58
- end
59
-
60
- it 'is whatever was passed in' do
61
- expect( Operation.new(metadata: {}).meta ).to be_instance_of Hash
62
- expect( Operation.new(metadata: { one: { two: :three } }).meta[:one][:two] ).to eq :three
63
- end
64
- end
65
-
66
- describe '#meta', :hashie do
67
- before :all do
68
- require 'hashie/mash'
69
- end
70
-
71
- it 'is a Mash for nil' do
72
- expect( Operation.new.meta ).to be_instance_of Hashie::Mash
73
- expect( Operation.new(metadata: nil).meta ).to be_instance_of Hashie::Mash
74
- end
75
-
76
- it 'is the Mash of what was passed in' do
77
- expect( Operation.new(metadata: {}).meta ).to be_instance_of Hashie::Mash
78
- expect( Operation.new(metadata: { one: { two: :three } }).meta.one.two ).to eq :three
79
- end
80
-
81
- it 'is the metadata if no Mash possible' do
82
- expect( Operation.new(metadata: []).meta ).to eq []
83
- expect( Operation.new(metadata: 'wow').meta ).to eq 'wow'
84
- end
85
- end
86
-
87
- end
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'operation'
2
-
3
- RSpec.configure do |config|
4
-
5
- config.raise_errors_for_deprecations!
6
- config.disable_monkey_patching!
7
- config.color = true
8
- config.fail_fast = true
9
-
10
- end