producer-core 0.1.9 → 0.1.10

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: 890c789a5de327b39836f468441f8c75b890faeb
4
- data.tar.gz: c524443e3b5882f32346b144a237bebdc60a477f
3
+ metadata.gz: c778784a6586dca4a73ef7c76bbb345ed990d3d4
4
+ data.tar.gz: 05ae1a88da59938098403eb45a4e98457ef6c68b
5
5
  SHA512:
6
- metadata.gz: 3a21fe320fa3ac8c89c92c7def97284413ad31afd620784a255daeeb38fa8db1b005fc1f5db02cd55d801d4ba159985845a87e23addea989ce6a25aa42135629
7
- data.tar.gz: d4d1389cfe3de827c45d2d6c0982644827d5356352699e2d41d8424772c17abb3d602c04e6b3d8aeacfee599de391c9fc33ddc1c2d245b71f70a63e66bb155f7
6
+ metadata.gz: 22156c33ab610cebd1ee5f82c3f6cf60f50f3a3b2c5c7d0a6194d30fcb958635201e34b86af415b3d6885a1d0b3cbeb3c38e52a752f7457626164d37c463d379
7
+ data.tar.gz: 8669e86c30cb7a8be71420f85f4280c0a8b67ef61520e5c8c7f37c849a0eedaed3c1184d385ff039c3920aabef6c08f17981f199dfe22c19b133bb21545b0bda
data/Guardfile CHANGED
@@ -4,7 +4,7 @@ guard :cucumber, cli: '--format pretty --quiet' do
4
4
  watch(%r{\Afeatures/step_definitions/.+_steps\.rb\z}) { 'features' }
5
5
  end
6
6
 
7
- guard :rspec do
7
+ guard :rspec, cmd: 'rspec -f doc', all_after_pass: true do
8
8
  watch(%r{\Aspec/.+_spec\.rb\z})
9
9
  watch(%r{\Alib/(.+)\.rb\z}) { |m| "spec/#{m[1]}_spec.rb" }
10
10
  watch('spec/spec_helper.rb') { 'spec' }
@@ -1,6 +1,12 @@
1
1
  module Producer
2
2
  module Core
3
3
  class Action
4
+ require 'forwardable'
5
+
6
+ extend Forwardable
7
+ def_delegators :@env, :output, :remote
8
+ def_delegators :remote, :fs
9
+
4
10
  attr_accessor :env, :arguments
5
11
 
6
12
  def initialize(env, *args)
@@ -3,7 +3,7 @@ module Producer
3
3
  module Actions
4
4
  class Echo < Action
5
5
  def apply
6
- env.output.puts arguments.first
6
+ output.puts arguments.first
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ module Producer
3
3
  module Actions
4
4
  class FileWriter < Action
5
5
  def apply
6
- env.remote.fs.file_write path, content
6
+ fs.file_write path, content
7
7
  end
8
8
 
9
9
  def path
@@ -3,7 +3,7 @@ module Producer
3
3
  module Actions
4
4
  class ShellCommand < Action
5
5
  def apply
6
- env.output.puts env.remote.execute(arguments.first)
6
+ output.puts remote.execute(arguments.first)
7
7
  end
8
8
  end
9
9
  end
@@ -28,7 +28,7 @@ module Producer
28
28
  @stdout = stdout
29
29
  end
30
30
 
31
- def run(worker: Interpreter.new)
31
+ def run(worker: Worker.new)
32
32
  load_recipe
33
33
  worker.process recipe.tasks
34
34
  end
@@ -2,16 +2,16 @@ module Producer
2
2
  module Core
3
3
  class Recipe
4
4
  class DSL
5
- attr_reader :tasks
5
+ attr_reader :env, :tasks
6
6
 
7
- def initialize(code = nil, &block)
7
+ def initialize(env, code = nil, &block)
8
+ @env = env
8
9
  @code = code
9
10
  @block = block
10
11
  @tasks = []
11
12
  end
12
13
 
13
- def evaluate(env)
14
- @env = env
14
+ def evaluate
15
15
  if @code
16
16
  instance_eval @code
17
17
  else
@@ -22,10 +22,6 @@ module Producer
22
22
 
23
23
  private
24
24
 
25
- def env
26
- @env
27
- end
28
-
29
25
  def source(filepath)
30
26
  instance_eval File.read("./#{filepath}.rb"), "#{filepath}.rb"
31
27
  end
@@ -3,7 +3,7 @@ module Producer
3
3
  class Recipe
4
4
  class << self
5
5
  def evaluate_from_file(filepath, env)
6
- dsl = DSL.new(File.read(filepath)).evaluate(env)
6
+ dsl = DSL.new(env, File.read(filepath)).evaluate
7
7
  Recipe.new(dsl.tasks)
8
8
  end
9
9
  end
@@ -15,7 +15,7 @@ module Producer
15
15
  require 'forwardable'
16
16
 
17
17
  extend Forwardable
18
- def_delegator :@variables, :has_key?
18
+ def_delegator :@variables, :key?
19
19
 
20
20
  def initialize(variables)
21
21
  @variables = variables
@@ -12,7 +12,7 @@ module Producer
12
12
  @sftp ||= @remote.session.sftp.connect
13
13
  end
14
14
 
15
- def has_file?(path)
15
+ def file?(path)
16
16
  sftp.stat!(path).file?
17
17
  rescue Net::SFTP::StatusException
18
18
  false
@@ -15,16 +15,16 @@ module Producer
15
15
 
16
16
  define_action :file_write, Actions::FileWriter
17
17
 
18
- attr_accessor :actions
18
+ attr_accessor :env, :actions
19
19
 
20
- def initialize(&block)
20
+ def initialize(env, &block)
21
+ @env = env
21
22
  @block = block
22
23
  @actions = []
23
24
  @condition = true
24
25
  end
25
26
 
26
- def evaluate(env, *args)
27
- @env = env
27
+ def evaluate(*args)
28
28
  instance_exec *args, &@block
29
29
  end
30
30
 
@@ -3,8 +3,8 @@ module Producer
3
3
  class Task
4
4
  class << self
5
5
  def evaluate(name, env, *args, &block)
6
- dsl = DSL.new(&block)
7
- dsl.evaluate(env, *args)
6
+ dsl = DSL.new(env, &block)
7
+ dsl.evaluate(*args)
8
8
  Task.new(name, dsl.actions, dsl.condition)
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@ module Producer
3
3
  module Tests
4
4
  class HasEnv < Test
5
5
  def verify
6
- env.remote.environment.has_key? arguments.first.to_s.upcase
6
+ env.remote.environment.key? arguments.first.to_s.upcase
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ module Producer
3
3
  module Tests
4
4
  class HasFile < Test
5
5
  def verify
6
- env.remote.fs.has_file? arguments.first
6
+ env.remote.fs.file? arguments.first
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Core
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module Producer
2
2
  module Core
3
- class Interpreter
3
+ class Worker
4
4
  def process(tasks)
5
5
  tasks.each { |t| process_task t }
6
6
  end
data/lib/producer/core.rb CHANGED
@@ -14,7 +14,6 @@ require 'producer/core/condition'
14
14
  require 'producer/core/condition/dsl'
15
15
  require 'producer/core/env'
16
16
  require 'producer/core/errors'
17
- require 'producer/core/interpreter'
18
17
  require 'producer/core/recipe'
19
18
  require 'producer/core/recipe/dsl'
20
19
  require 'producer/core/remote'
@@ -23,3 +22,4 @@ require 'producer/core/remote/fs'
23
22
  require 'producer/core/task'
24
23
  require 'producer/core/task/dsl'
25
24
  require 'producer/core/version'
25
+ require 'producer/core/worker'
@@ -2,7 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  module Producer::Core
4
4
  describe Action do
5
- let(:env) { double 'env' }
5
+ let(:output) { StringIO.new }
6
+ let(:env) { Env.new(output: output) }
6
7
  let(:arguments) { [:some, :arguments] }
7
8
  subject(:action) { Action.new(env, *arguments) }
8
9
 
@@ -17,5 +18,24 @@ module Producer::Core
17
18
  expect(action.arguments).to eq arguments
18
19
  end
19
20
  end
21
+
22
+ describe '#output' do
23
+ it 'delegates to env output' do
24
+ action.output.puts 'some content'
25
+ expect(output.string).to eq "some content\n"
26
+ end
27
+ end
28
+
29
+ describe '#remote' do
30
+ it 'returns env remote' do
31
+ expect(action.remote).to be action.env.remote
32
+ end
33
+ end
34
+
35
+ describe '#fs' do
36
+ it 'returns env remote fs' do
37
+ expect(action.fs).to be action.env.remote.fs
38
+ end
39
+ end
20
40
  end
21
41
  end
@@ -7,7 +7,7 @@ module Producer::Core
7
7
  subject(:echo) { Actions::Echo.new(env, text) }
8
8
 
9
9
  describe '#apply' do
10
- it 'writes the given string to env.output with a record separator' do
10
+ it 'writes the given string to env output with a record separator' do
11
11
  echo.apply
12
12
  expect(env.output.string).to eq "hello\n"
13
13
  end
@@ -8,8 +8,8 @@ module Producer::Core
8
8
  subject(:writer) { Actions::FileWriter.new(env, path, content) }
9
9
 
10
10
  describe '#apply' do
11
- it 'delegates the call to env.remote.fs.file_write method' do
12
- expect(env.remote.fs).to receive(:file_write).with(path, content)
11
+ it 'writes content to file on remote filesystem' do
12
+ expect(writer.fs).to receive(:file_write).with(path, content)
13
13
  writer.apply
14
14
  end
15
15
  end
@@ -8,17 +8,15 @@ module Producer::Core
8
8
  subject(:sh) { Actions::ShellCommand.new(env, command) }
9
9
 
10
10
  describe '#apply' do
11
- before { env.output = StringIO.new }
12
-
13
- it 'delegates the call to env.remote.execute method' do
14
- expect(env.remote).to receive(:execute).with(command)
11
+ it 'executes the remote command' do
12
+ expect(sh.remote).to receive(:execute).with(command)
15
13
  sh.apply
16
14
  end
17
15
 
18
- it 'writes the returned output to env.output with a record separator' do
19
- allow(env.remote).to receive(:execute) { command_args }
16
+ it 'writes the returned output with a record separator' do
17
+ allow(sh.remote).to receive(:execute) { command_args }
20
18
  sh.apply
21
- expect(env.output.string).to eq "#{command_args}\n"
19
+ expect(sh.output.string).to eq "#{command_args}\n"
22
20
  end
23
21
  end
24
22
  end
@@ -6,16 +6,20 @@ module Producer::Core
6
6
 
7
7
  let(:code) { proc { :some_recipe_code } }
8
8
  let(:env) { double('env').as_null_object }
9
- subject(:dsl) { Recipe::DSL.new(&code) }
9
+ subject(:dsl) { Recipe::DSL.new(env, &code) }
10
10
 
11
11
  describe '#initialize' do
12
+ it 'assigns the given env' do
13
+ expect(dsl.env).to be env
14
+ end
15
+
12
16
  it 'assigns no task' do
13
- expect(dsl.instance_eval { @tasks }).to be_empty
17
+ expect(dsl.tasks).to be_empty
14
18
  end
15
19
 
16
20
  context 'when a string of code is given as argument' do
17
21
  let(:code) { 'some_code' }
18
- subject(:dsl) { Recipe::DSL.new(code) }
22
+ subject(:dsl) { Recipe::DSL.new(env, code) }
19
23
 
20
24
  it 'assigns the string of code' do
21
25
  expect(dsl.instance_eval { @code }).to eq code
@@ -30,44 +34,44 @@ module Producer::Core
30
34
  end
31
35
 
32
36
  describe '#tasks' do
33
- let(:code) { proc { task(:some_task) { } } }
37
+ let(:code) { proc { task(:some_task) {} } }
34
38
 
35
39
  it 'returns registered tasks' do
36
- dsl.evaluate env
40
+ dsl.evaluate
37
41
  expect(dsl.tasks[0].name).to eq :some_task
38
42
  end
39
43
  end
40
44
 
41
45
  describe '#evaluate' do
42
46
  it 'evaluates its code' do
43
- dsl = Recipe::DSL.new { throw :recipe_code }
44
- expect { dsl.evaluate env }.to throw_symbol :recipe_code
47
+ dsl = Recipe::DSL.new(env) { throw :recipe_code }
48
+ expect { dsl.evaluate }.to throw_symbol :recipe_code
45
49
  end
46
50
 
47
51
  it 'returns itself' do
48
- expect(dsl.evaluate env).to eq dsl
52
+ expect(dsl.evaluate).to eq dsl
49
53
  end
50
54
  end
51
55
 
52
56
  context 'DSL specific methods' do
53
- subject(:dsl) { Recipe::DSL.new(&code).evaluate(env) }
57
+ subject(:dsl) { Recipe::DSL.new(env, &code).evaluate }
54
58
 
55
59
  describe '#env' do
56
60
  let(:code) { proc { env.some_message } }
57
61
 
58
62
  it 'returns the current environment' do
59
63
  expect(env).to receive :some_message
60
- dsl.evaluate env
64
+ dsl.evaluate
61
65
  end
62
66
  end
63
67
 
64
68
  describe '#source' do
65
69
  let(:filepath) { fixture_path_for 'recipes/throw' }
66
70
  let(:code) { "source '#{filepath}'" }
67
- subject(:dsl) { Recipe::DSL.new(code) }
71
+ subject(:dsl) { Recipe::DSL.new(env, code) }
68
72
 
69
73
  it 'sources the recipe given as argument' do
70
- expect { dsl.evaluate env }.to throw_symbol :recipe_code
74
+ expect { dsl.evaluate }.to throw_symbol :recipe_code
71
75
  end
72
76
  end
73
77
 
@@ -7,35 +7,13 @@ module Producer::Core
7
7
  subject(:recipe) { Recipe.new }
8
8
 
9
9
  describe '.evaluate_from_file' do
10
- let(:env) { double 'env' }
11
- let(:filepath) { fixture_path_for 'recipes/empty.rb' }
12
- let(:code) { File.read(filepath) }
10
+ let(:env) { double 'env' }
11
+ let(:filepath) { fixture_path_for 'recipes/some_recipe.rb' }
12
+ subject(:recipe) { Recipe.evaluate_from_file(filepath, env) }
13
13
 
14
- it 'builds a new DSL sandbox with code read from given file path' do
15
- expect(Recipe::DSL).to receive(:new).with(code).and_call_original
16
- Recipe.evaluate_from_file(filepath, env)
14
+ it 'returns an evaluated recipe' do
15
+ expect(recipe.tasks.map(&:name)).to eq [:some_task, :another_task]
17
16
  end
18
-
19
- it 'evaluates the DSL sandbox code with given environment' do
20
- dsl = double('dsl').as_null_object
21
- allow(Recipe::DSL).to receive(:new) { dsl }
22
- expect(dsl).to receive(:evaluate).with(env)
23
- Recipe.evaluate_from_file(filepath, env)
24
- end
25
-
26
- it 'builds a recipe with evaluated tasks' do
27
- dsl = Recipe::DSL.new { task(:some_task) { } }
28
- allow(Recipe::DSL).to receive(:new) { dsl }
29
- expect(Recipe).to receive(:new).with(dsl.tasks)
30
- Recipe.evaluate_from_file(filepath, env)
31
- end
32
-
33
- it 'returns the recipe' do
34
- recipe = double('recipe').as_null_object
35
- allow(Recipe).to receive(:new) { recipe }
36
- expect(Recipe.evaluate_from_file(filepath, env)).to be recipe
37
- end
38
-
39
17
  end
40
18
 
41
19
  describe '#initialize' do
@@ -46,8 +24,8 @@ module Producer::Core
46
24
  end
47
25
 
48
26
  context 'when tasks are given as argument' do
49
- let(:tasks) { [Task.new(:some_task)] }
50
- let(:recipe) { Recipe.new(tasks) }
27
+ let(:tasks) { [double('task')] }
28
+ subject(:recipe) { Recipe.new(tasks) }
51
29
 
52
30
  it 'assigns the tasks' do
53
31
  expect(recipe.tasks).to eq tasks
@@ -33,13 +33,13 @@ module Producer::Core
33
33
  end
34
34
  end
35
35
 
36
- describe '#has_key?' do
36
+ describe '#key?' do
37
37
  let(:key) { 'SOME_KEY' }
38
38
 
39
39
  it 'forwards the message to @variables' do
40
40
  expect(environment.instance_eval { @variables })
41
- .to receive(:has_key?).with(key)
42
- environment.has_key? key
41
+ .to receive(:key?).with(key)
42
+ environment.key? key
43
43
  end
44
44
  end
45
45
  end
@@ -33,7 +33,7 @@ module Producer::Core
33
33
 
34
34
  # FIXME: We rely a lot on mocking net-sftp heavily, while we already use a
35
35
  # part of net-ssh story helpers, which are more close to integration tests.
36
- describe '#has_file?', :ssh do
36
+ describe '#file?', :ssh do
37
37
  let(:file_path) { 'some_file_path' }
38
38
  let(:stat) { double 'stat' }
39
39
 
@@ -47,7 +47,7 @@ module Producer::Core
47
47
  before { allow(stat).to receive(:file?) { true } }
48
48
 
49
49
  it 'returns true' do
50
- expect(fs.has_file? file_path).to be true
50
+ expect(fs.file? file_path).to be true
51
51
  end
52
52
  end
53
53
 
@@ -55,7 +55,7 @@ module Producer::Core
55
55
  before { allow(stat).to receive(:file?) { false } }
56
56
 
57
57
  it 'returns false' do
58
- expect(fs.has_file? file_path).to be false
58
+ expect(fs.file? file_path).to be false
59
59
  end
60
60
  end
61
61
  end
@@ -68,7 +68,7 @@ module Producer::Core
68
68
  end
69
69
 
70
70
  it 'returns false' do
71
- expect(fs.has_file? file_path).to be false
71
+ expect(fs.file? file_path).to be false
72
72
  end
73
73
  end
74
74
  end
@@ -2,9 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  module Producer::Core
4
4
  describe Task::DSL do
5
- let(:block) { proc { } }
5
+ let(:block) { proc {} }
6
6
  let(:env) { double 'env' }
7
- subject(:dsl) { Task::DSL.new(&block) }
7
+ subject(:dsl) { Task::DSL.new(env, &block) }
8
8
 
9
9
  %w[echo sh file_write].each do |action|
10
10
  it "has `#{action}' action defined" do
@@ -20,6 +20,10 @@ module Producer::Core
20
20
  end
21
21
 
22
22
  describe '#initialize' do
23
+ it 'assigns the given env' do
24
+ expect(dsl.env).to be env
25
+ end
26
+
23
27
  it 'assigns no action' do
24
28
  expect(dsl.actions).to be_empty
25
29
  end
@@ -49,7 +53,7 @@ module Producer::Core
49
53
  let(:block) { proc { throw :task_code } }
50
54
 
51
55
  it 'evaluates its code' do
52
- expect { dsl.evaluate env }
56
+ expect { dsl.evaluate }
53
57
  .to throw_symbol :task_code
54
58
  end
55
59
 
@@ -57,7 +61,7 @@ module Producer::Core
57
61
  let(:block) { proc { |e| throw e } }
58
62
 
59
63
  it 'passes arguments as block parameters' do
60
- expect { dsl.evaluate env, :some_argument }
64
+ expect { dsl.evaluate :some_argument }
61
65
  .to throw_symbol :some_argument
62
66
  end
63
67
  end
@@ -68,7 +72,7 @@ module Producer::Core
68
72
 
69
73
  before do
70
74
  Task::DSL.define_action(:some_action, some_action_class)
71
- dsl.evaluate env
75
+ dsl.evaluate
72
76
  end
73
77
 
74
78
  it 'registers the action' do
@@ -82,7 +86,7 @@ module Producer::Core
82
86
  end
83
87
 
84
88
  context 'DSL specific methods' do
85
- subject(:dsl) { Task::DSL.new(&block).evaluate(env) }
89
+ subject(:dsl) { Task::DSL.new(env, &block).evaluate }
86
90
 
87
91
  describe '#condition' do
88
92
  context 'when a block is given' do
@@ -90,7 +94,7 @@ module Producer::Core
90
94
 
91
95
  it 'builds a new evaluated condition' do
92
96
  expect(Condition)
93
- .to receive(:evaluate).with(env) do |&b|
97
+ .to receive :evaluate do |&b|
94
98
  expect(b.call).to eq :some_value
95
99
  end
96
100
  dsl
@@ -12,19 +12,19 @@ module Producer::Core
12
12
  let(:args) { [:some, :arguments] }
13
13
  let(:block) { proc { :some_task_code } }
14
14
 
15
- it 'builds a new DSL sandbox with given code' do
15
+ it 'builds a new DSL sandbox with given env and code' do
16
16
  dsl = double('dsl').as_null_object
17
- expect(Task::DSL).to receive(:new).with(no_args) do |&b|
17
+ expect(Task::DSL).to receive(:new).with(env) do |&b|
18
18
  expect(b).to be block
19
19
  dsl
20
20
  end
21
21
  Task.evaluate(name, env, *args, &block)
22
22
  end
23
23
 
24
- it 'evaluates the DSL sandbox code with given environment' do
24
+ it 'evaluates the DSL sandbox code with given arguments' do
25
25
  dsl = double('dsl').as_null_object
26
26
  allow(Task::DSL).to receive(:new) { dsl }
27
- expect(dsl).to receive(:evaluate).with(env, *args)
27
+ expect(dsl).to receive(:evaluate).with(*args)
28
28
  Task.evaluate(name, env, *args, &block)
29
29
  end
30
30
 
@@ -18,22 +18,22 @@ module Producer::Core
18
18
  end
19
19
 
20
20
  it 'stringifies the queried variable name' do
21
- expect(environment).to receive(:has_key?).with(kind_of(String))
21
+ expect(environment).to receive(:key?).with(kind_of(String))
22
22
  has_env.verify
23
23
  end
24
24
 
25
25
  it 'upcases the queried variable name' do
26
- expect(environment).to receive(:has_key?).with('SOME_VARIABLE_NAME')
26
+ expect(environment).to receive(:key?).with('SOME_VARIABLE_NAME')
27
27
  has_env.verify
28
28
  end
29
29
 
30
30
  it 'returns true when remote environment var is defined' do
31
- allow(environment).to receive(:has_key?) { true }
31
+ allow(environment).to receive(:key?) { true }
32
32
  expect(has_env.verify).to be true
33
33
  end
34
34
 
35
35
  it 'returns false when remote environment var is not defined' do
36
- allow(environment).to receive(:has_key?) { false }
36
+ allow(environment).to receive(:key?) { false }
37
37
  expect(has_env.verify).to be false
38
38
  end
39
39
  end
@@ -14,13 +14,13 @@ module Producer::Core
14
14
  before { sftp_story }
15
15
 
16
16
  it 'delegates the call on remote FS' do
17
- expect(env.remote.fs).to receive(:has_file?).with(filepath)
17
+ expect(env.remote.fs).to receive(:file?).with(filepath)
18
18
  has_file.verify
19
19
  end
20
20
 
21
21
  it 'returns the file existence' do
22
22
  existence = double 'existence'
23
- allow(env.remote.fs).to receive(:has_file?) { existence }
23
+ allow(env.remote.fs).to receive(:file?) { existence }
24
24
  expect(has_file.verify).to be existence
25
25
  end
26
26
  end
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Producer::Core
4
- describe Interpreter do
5
- subject(:interpreter) { Interpreter.new }
4
+ describe Worker do
5
+ subject(:worker) { described_class.new }
6
6
 
7
7
  describe '#process' do
8
8
  it 'processes each task' do
9
- expect(interpreter).to receive(:process_task).with(:some_task)
10
- interpreter.process [:some_task]
9
+ expect(worker).to receive(:process_task).with(:some_task)
10
+ worker.process [:some_task]
11
11
  end
12
12
  end
13
13
 
@@ -18,7 +18,7 @@ module Producer::Core
18
18
  context 'when task condition is met' do
19
19
  it 'applies the actions' do
20
20
  expect(action).to receive :apply
21
- interpreter.process_task task
21
+ worker.process_task task
22
22
  end
23
23
  end
24
24
 
@@ -27,7 +27,7 @@ module Producer::Core
27
27
 
28
28
  it 'does not apply the actions' do
29
29
  expect(action).not_to receive :apply
30
- interpreter.process_task task
30
+ worker.process_task task
31
31
  end
32
32
  end
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: producer-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
@@ -140,7 +140,6 @@ files:
140
140
  - lib/producer/core/condition/dsl.rb
141
141
  - lib/producer/core/env.rb
142
142
  - lib/producer/core/errors.rb
143
- - lib/producer/core/interpreter.rb
144
143
  - lib/producer/core/recipe.rb
145
144
  - lib/producer/core/recipe/dsl.rb
146
145
  - lib/producer/core/remote.rb
@@ -152,6 +151,7 @@ files:
152
151
  - lib/producer/core/tests/has_env.rb
153
152
  - lib/producer/core/tests/has_file.rb
154
153
  - lib/producer/core/version.rb
154
+ - lib/producer/core/worker.rb
155
155
  - producer-core.gemspec
156
156
  - spec/fixtures/recipes/empty.rb
157
157
  - spec/fixtures/recipes/some_recipe.rb
@@ -164,7 +164,6 @@ files:
164
164
  - spec/producer/core/condition/dsl_spec.rb
165
165
  - spec/producer/core/condition_spec.rb
166
166
  - spec/producer/core/env_spec.rb
167
- - spec/producer/core/interpreter_spec.rb
168
167
  - spec/producer/core/recipe/dsl_spec.rb
169
168
  - spec/producer/core/recipe_spec.rb
170
169
  - spec/producer/core/remote/environment_spec.rb
@@ -175,6 +174,7 @@ files:
175
174
  - spec/producer/core/test_spec.rb
176
175
  - spec/producer/core/tests/has_env_spec.rb
177
176
  - spec/producer/core/tests/has_file_spec.rb
177
+ - spec/producer/core/worker_spec.rb
178
178
  - spec/spec_helper.rb
179
179
  - spec/support/exit_helpers.rb
180
180
  - spec/support/fixtures_helpers.rb
@@ -237,7 +237,6 @@ test_files:
237
237
  - spec/producer/core/condition/dsl_spec.rb
238
238
  - spec/producer/core/condition_spec.rb
239
239
  - spec/producer/core/env_spec.rb
240
- - spec/producer/core/interpreter_spec.rb
241
240
  - spec/producer/core/recipe/dsl_spec.rb
242
241
  - spec/producer/core/recipe_spec.rb
243
242
  - spec/producer/core/remote/environment_spec.rb
@@ -248,6 +247,7 @@ test_files:
248
247
  - spec/producer/core/test_spec.rb
249
248
  - spec/producer/core/tests/has_env_spec.rb
250
249
  - spec/producer/core/tests/has_file_spec.rb
250
+ - spec/producer/core/worker_spec.rb
251
251
  - spec/spec_helper.rb
252
252
  - spec/support/exit_helpers.rb
253
253
  - spec/support/fixtures_helpers.rb