coral_plan 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,31 +1,31 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- coral_core (0.1.4)
4
+ coral_core (0.1.7)
5
5
  git (= 1.2.5)
6
6
  json (>= 1.4)
7
7
  log4r (~> 1.1)
8
- diff-lcs (1.1.3)
8
+ diff-lcs (1.2.1)
9
9
  git (1.2.5)
10
10
  jeweler (1.8.4)
11
11
  bundler (~> 1.0)
12
12
  git (>= 1.2.5)
13
13
  rake
14
14
  rdoc
15
- json (1.7.6)
15
+ json (1.7.7)
16
16
  log4r (1.1.10)
17
17
  rake (10.0.3)
18
- rdoc (3.12.1)
18
+ rdoc (3.12.2)
19
19
  json (~> 1.4)
20
- rspec (2.12.0)
21
- rspec-core (~> 2.12.0)
22
- rspec-expectations (~> 2.12.0)
23
- rspec-mocks (~> 2.12.0)
24
- rspec-core (2.12.2)
25
- rspec-expectations (2.12.1)
26
- diff-lcs (~> 1.1.3)
27
- rspec-mocks (2.12.2)
28
- yard (0.8.4.1)
20
+ rspec (2.13.0)
21
+ rspec-core (~> 2.13.0)
22
+ rspec-expectations (~> 2.13.0)
23
+ rspec-mocks (~> 2.13.0)
24
+ rspec-core (2.13.1)
25
+ rspec-expectations (2.13.0)
26
+ diff-lcs (>= 1.1.3, < 2.0)
27
+ rspec-mocks (2.13.0)
28
+ yard (0.8.5.2)
29
29
 
30
30
  PLATFORMS
31
31
  ruby
data/README.rdoc CHANGED
@@ -27,8 +27,8 @@ Note: This library is still very early in development!
27
27
 
28
28
  == Contributing to coral_plan
29
29
 
30
- * Check out the latest master to make sure the feature hasn't been implemented
31
- or the bug hasn't been fixed yet.
30
+ * Check out the latest {major}.{minor} branch to make sure the feature hasn't
31
+ been implemented or the bug hasn't been fixed yet.
32
32
  * Check out the issue tracker to make sure someone already hasn't requested
33
33
  it and/or contributed it.
34
34
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/coral_plan.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coral_plan"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adrian Webb"]
12
- s.date = "2013-02-08"
13
- s.description = "= coral_plan\n\nThis library provides the ability to create, load, execute, and save \nexecution plans.\n\nThe Coral Plan library contains a system that defines execution plans of \nCLI commands. The goal is to make it easy to create, edit, load, execute,\nand save these plans in a machine readable format (ie; JSON). The system \nis composed of Events, Commands, Actions, and of course Plans. There are a\nfew simple rules:\n \n1. All plans begin with a Command but may have more Commands defined\n that act in sequence unless there are errors with previous commands.\n \n2. Commands can trigger Events of various types, where Events are reading\n and checking (ie; Regular expressions) Command output line by line.\n \n3. Events have different criteria for measuring success and will have \n different fields. For example, a Regexp event contains a 'pattern'\n field.\n \n4. Actions listen for Events and run Commands, with the ability to override\n default Command parameters. Actions may also generate Events on either\n successful execution or failure which can trigger other Actions.\n \nNote: This library is still very early in development!\n\n== Contributing to coral_plan\n \n* Check out the latest master to make sure the feature hasn't been implemented \n or the bug hasn't been fixed yet.\n* Check out the issue tracker to make sure someone already hasn't requested \n it and/or contributed it.\n* Fork the project.\n* Start a feature/bugfix branch.\n* Commit and push until you are happy with your contribution.\n* Make sure to add tests for it. This is important so I don't break it in a \n future version unintentionally.\n* Please try not to mess with the Rakefile, version, or history. If you want \n to have your own version, or is otherwise necessary, that is fine, but \n please isolate to its own commit so I can cherry-pick around it.\n\n== Copyright\n\nLicensed under GPLv3. See LICENSE.txt for further details.\n\nCopyright (c) 2013 Adrian Webb <adrian.webb@coraltech.net>\nCoral Technology Group LLC"
12
+ s.date = "2013-03-14"
13
+ s.description = "= coral_plan\n\nThis library provides the ability to create, load, execute, and save \nexecution plans.\n\nThe Coral Plan library contains a system that defines execution plans of \nCLI commands. The goal is to make it easy to create, edit, load, execute,\nand save these plans in a machine readable format (ie; JSON). The system \nis composed of Events, Commands, Actions, and of course Plans. There are a\nfew simple rules:\n \n1. All plans begin with a Command but may have more Commands defined\n that act in sequence unless there are errors with previous commands.\n \n2. Commands can trigger Events of various types, where Events are reading\n and checking (ie; Regular expressions) Command output line by line.\n \n3. Events have different criteria for measuring success and will have \n different fields. For example, a Regexp event contains a 'pattern'\n field.\n \n4. Actions listen for Events and run Commands, with the ability to override\n default Command parameters. Actions may also generate Events on either\n successful execution or failure which can trigger other Actions.\n \nNote: This library is still very early in development!\n\n== Contributing to coral_plan\n \n* Check out the latest {major}.{minor} branch to make sure the feature hasn't \n been implemented or the bug hasn't been fixed yet.\n* Check out the issue tracker to make sure someone already hasn't requested \n it and/or contributed it.\n* Fork the project.\n* Start a feature/bugfix branch.\n* Commit and push until you are happy with your contribution.\n* Make sure to add tests for it. This is important so I don't break it in a \n future version unintentionally.\n* Please try not to mess with the Rakefile, version, or history. If you want \n to have your own version, or is otherwise necessary, that is fine, but \n please isolate to its own commit so I can cherry-pick around it.\n\n== Copyright\n\nLicensed under GPLv3. See LICENSE.txt for further details.\n\nCopyright (c) 2013 Adrian Webb <adrian.webb@coraltech.net>\nCoral Technology Group LLC"
14
14
  s.email = "adrian.webb@coraltech.net"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
@@ -47,14 +47,21 @@ class Base < Memory
47
47
  #-----------------------------------------------------------------------------
48
48
 
49
49
  def initialize(options = {})
50
+ autoload = ( options.has_key?(:autoload) ? options[:autoload] : true )
51
+
52
+ options[:autoload] = false
50
53
  super(options)
54
+ @autoload = autoload
51
55
 
52
- @home = ( options.has_key?(:home) && options[:home].is_a?(Coral::Repository) ? options[:home] : self )
53
-
56
+ self.home = ( options.has_key?(:home) && options[:home].is_a?(Coral::Repository) ? options[:home] : self )
57
+
54
58
  @start_commands = []
55
59
  @commands = {}
56
60
  @events = {}
57
61
  @actions = {}
62
+
63
+ set_absolute_config_file
64
+ load if @autoload
58
65
  end
59
66
 
60
67
  #-----------------------------------------------------------------------------
@@ -83,7 +90,7 @@ class Base < Memory
83
90
  if reset || @start_commands.empty?
84
91
  @start_commands = []
85
92
  get('start', [], :array).each do |name|
86
- @start_commands << commands[name]
93
+ @start_commands << @commands[name]
87
94
  end
88
95
  end
89
96
  return @start_commands
@@ -211,7 +218,18 @@ class Base < Memory
211
218
  def delete_action(name, key = nil)
212
219
  return delete_group('actions', name, key)
213
220
  end
214
-
221
+
222
+ #-----------------------------------------------------------------------------
223
+ # Configuration loading / saving
224
+
225
+ def load
226
+ super()
227
+ commands(true)
228
+ events(true)
229
+ actions(true)
230
+ return self
231
+ end
232
+
215
233
  #-----------------------------------------------------------------------------
216
234
  # Execution
217
235
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coral_plan
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adrian Webb
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-08 00:00:00 Z
18
+ date: 2013-03-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: coral_core
@@ -137,8 +137,8 @@ description: |-
137
137
 
138
138
  == Contributing to coral_plan
139
139
 
140
- * Check out the latest master to make sure the feature hasn't been implemented
141
- or the bug hasn't been fixed yet.
140
+ * Check out the latest {major}.{minor} branch to make sure the feature hasn't
141
+ been implemented or the bug hasn't been fixed yet.
142
142
  * Check out the issue tracker to make sure someone already hasn't requested
143
143
  it and/or contributed it.
144
144
  * Fork the project.