producer-core 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/cli_verbose.feature +14 -4
- data/lib/producer/core/action.rb +10 -1
- data/lib/producer/core/version.rb +1 -1
- data/lib/producer/core/worker.rb +1 -1
- data/producer-core.gemspec +1 -1
- data/spec/producer/core/remote_spec.rb +2 -1
- data/spec/spec_helper.rb +0 -2
- data/spec/support/shared_action.rb +14 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 993830c5ed30225fe7333275a8eb33f39b000448
|
4
|
+
data.tar.gz: 74554e80ba1c4bfd0d1b7f23421e8fec68197693
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 133378dc481c5f5bbdd899d37aa4519a2e5f4dfcb3b771b44254bed19bbb8275940d192bef19705e2187b30d9dfe9a5ee9fabd1d0ce91c516c3fd27dd1346c1d
|
7
|
+
data.tar.gz: 41ee1449668ed09cad36e08274ee81ddd318f29d2b3e0dfc884ce5b7f7cf54c955525200afdc09a4945fcf812ba1fc3ed5c62c3dc108bec09f8f8f34c4715111
|
@@ -16,8 +16,8 @@ Feature: CLI verbose option
|
|
16
16
|
|
17
17
|
Scenario: prints tasks name
|
18
18
|
When I successfully execute the recipe with option -v
|
19
|
-
Then the output must match
|
20
|
-
And the output must match
|
19
|
+
Then the output must match /Task:.+`task_ok'/
|
20
|
+
And the output must match /Task:.+`task_ko'/
|
21
21
|
|
22
22
|
Scenario: appends `applying' or `skipped' after tasks name
|
23
23
|
When I successfully execute the recipe with option -v
|
@@ -28,6 +28,16 @@ Feature: CLI verbose option
|
|
28
28
|
When I successfully execute the recipe with option -v
|
29
29
|
Then the output must match /^ action: echo/
|
30
30
|
|
31
|
-
Scenario:
|
31
|
+
Scenario: prints actions arguments
|
32
32
|
When I successfully execute the recipe with option -v
|
33
|
-
Then the output must match
|
33
|
+
Then the output must match /echo \["some message"\]/
|
34
|
+
|
35
|
+
Scenario: summarizes printed actions arguments
|
36
|
+
Given a recipe with:
|
37
|
+
"""
|
38
|
+
task :some_task do
|
39
|
+
echo 'long message ' * 32
|
40
|
+
end
|
41
|
+
"""
|
42
|
+
When I successfully execute the recipe with option -v
|
43
|
+
Then the output must match /action: .{,70}$/
|
data/lib/producer/core/action.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Producer
|
2
2
|
module Core
|
3
3
|
class Action
|
4
|
+
INSPECT_ARGUMENTS_SUM_LEN = 68.freeze
|
5
|
+
|
4
6
|
extend Forwardable
|
5
7
|
def_delegators :@env, :input, :output, :error_output, :remote
|
6
8
|
def_delegators :remote, :fs
|
@@ -17,7 +19,14 @@ module Producer
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def to_s
|
20
|
-
name
|
22
|
+
[name, inspect_arguments].join ' '
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def inspect_arguments
|
29
|
+
@arguments.inspect[0, INSPECT_ARGUMENTS_SUM_LEN - name.length]
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
data/lib/producer/core/worker.rb
CHANGED
data/producer-core.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency 'net-ssh', '~> 2.7'
|
21
21
|
s.add_dependency 'net-sftp', '~> 2.1'
|
22
22
|
|
23
|
-
s.add_development_dependency 'rspec', '~>
|
23
|
+
s.add_development_dependency 'rspec', '~> 3.1'
|
24
24
|
s.add_development_dependency 'cucumber', '~> 1.3'
|
25
25
|
s.add_development_dependency 'aruba', '~> 0.5'
|
26
26
|
s.add_development_dependency 'cucumber-sshd', '~> 0.1'
|
@@ -71,7 +71,8 @@ module Producer::Core
|
|
71
71
|
let(:sftp_session) { double 'sftp session' }
|
72
72
|
|
73
73
|
it 'returns an FS instance built with a new sftp session' do
|
74
|
-
remote
|
74
|
+
allow(remote)
|
75
|
+
.to receive_message_chain(:session, :sftp, :connect) { sftp_session }
|
75
76
|
expect(remote.fs.sftp).to be sftp_session
|
76
77
|
end
|
77
78
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -54,8 +54,20 @@ module Producer::Core
|
|
54
54
|
end
|
55
55
|
|
56
56
|
describe '#to_s' do
|
57
|
-
it '
|
58
|
-
expect(action.to_s).to
|
57
|
+
it 'includes action name' do
|
58
|
+
expect(action.to_s).to match /\A#{action.name}/
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'includes arguments inspection' do
|
62
|
+
expect(action.to_s).to match /#{Regexp.quote(arguments.inspect)}\z/
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'when arguments inspection is very long' do
|
66
|
+
let(:arguments) { [:some, :arguments] * 32 }
|
67
|
+
|
68
|
+
it 'summarizes arguments inspection' do
|
69
|
+
expect(action.to_s.length).to be < 70
|
70
|
+
end
|
59
71
|
end
|
60
72
|
end
|
61
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: cucumber
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|