mdt-core 0.0.2 → 0.1.0

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
  SHA256:
3
- metadata.gz: 5f5302dd44719fbcd4484a84a8438421edd7b85532663df5ce94ac00ba4a3c93
4
- data.tar.gz: 60de727f66d701fb2db324f943a07f80eb4e5d069277804c8565fbb4ff7c0834
3
+ metadata.gz: aac4f6d4cf30d705b05f676a19c0362d58652f5ec7279da28d43f586366b0dbf
4
+ data.tar.gz: ebd0b6a0664389ca483229c16f64de53ac8ad1e18605f3fcb3f31fde909e3ae2
5
5
  SHA512:
6
- metadata.gz: aa6c396dcb98ab54208fdbec4791aa0c82a633b0ea1d8ce954d1438196f7bf199c5a94425cebc72b115d5a47dbc8a80bbad4451b3e1eb5e8063bf244eca300eb
7
- data.tar.gz: c65921bdc2bf5dd9ef37b244aaaa505ecf3e72ce3c0b6600f4154210458541253843223cb7fc815b81f964acd385e121aceec3edbdea1b2f06d818f56b354811
6
+ metadata.gz: f3fe371ccb821f5b81981b8d320423336a556df58d7cf2c1d9a3b22ce6e6bdef37bd149dd670e7d0d196122a2f07db0a201adeda6116d8823cb4bdd810802b56
7
+ data.tar.gz: b58dbd1f8080d9fcc08cf685f6cc9b892b9b041fabd2e5caa1cc1aa07f64eccfc930d22dff57fb152e61279886f6e2bd235195cd816961b3b7b3d6a45d050819
data/README.md CHANGED
@@ -13,6 +13,8 @@ MDT is a deployment automation tool that is designed to be simple and easily ext
13
13
 
14
14
  Be sure to also install any modules that you need.
15
15
 
16
+ Alternatively, please see [mdt](https://github.com/Phitherek/mdt "mdt") for the convenience gem providing the basic modules.
17
+
16
18
  ## Usage
17
19
 
18
20
  The gem installs an executable called `mdt` that is used in a way described below:
@@ -38,7 +40,12 @@ MDT defines 5 modular objects that can be used to build a simple deploy flow. Th
38
40
  ## Known modules
39
41
 
40
42
  * [mdt-dummy](https://github.com/Phitherek/mdt-dummy "mdt-dummy") - a module containing dummy implementations of each extensible MDT class. They can be used to skip a particular deployment step.
43
+ * [mdt-simple](https://github.com/Phitherek/mdt-simple "mdt-simple") - a module that contains simple implementations for MDT.
41
44
 
42
45
  ## Contributing
43
46
 
44
- You can contribute to the development of MDT by submitting an issue or pull request. You can also extend MDT's capabilities by creating your own module in accordance with guidelines in MODULE_GUIDELINES.md and submitting it to RubyGems.
47
+ You can contribute to the development of MDT by submitting an issue or pull request. You can also extend MDT's capabilities by creating your own module in accordance with guidelines in MODULE_GUIDELINES.md and submitting it to RubyGems.
48
+
49
+ ## Documentation
50
+
51
+ Generated RDoc documentation can be found [here](http://www.rubydoc.info/github/Phitherek/mdt-core "here").
@@ -10,9 +10,9 @@ module MDT
10
10
 
11
11
  # A method that defines how to execute a command and how to apply command modifiers. Raises MDT::Errors::OverrideNeeded.
12
12
  # Arguments:
13
- # +key+ - a key identifier of a particular command
14
- # +modifiers+ - an array of command modifier configurations - each configuration is a Hash that includes modifier type and modifier options
15
- # +options+ - options for command as a Hash
13
+ # * +key+ - a key identifier of a particular command
14
+ # * +modifiers+ - an array of command modifier configurations - each configuration is a Hash that includes modifier type and modifier options
15
+ # * +options+ - options for command as a Hash
16
16
  def execute(key, modifiers = [], options = {})
17
17
  raise MDT::Errors::OverrideNeeded.new('execute')
18
18
  end
@@ -0,0 +1,27 @@
1
+ require 'singleton'
2
+
3
+ module MDT
4
+ # Implements a singleton key-value data storage to be used across MDT. Uses a bit of metaprogramming for ease of use.
5
+ class DataStorage
6
+ include Singleton
7
+
8
+ # Initializes the storage with empty Hash.
9
+ def initialize
10
+ @storage = {}
11
+ end
12
+
13
+ # Override method_missing to delegate to the storage hash.
14
+ def method_missing(m, *args, &block)
15
+ if /^(\w+)=$/ =~ m
16
+ @storage[$1.to_sym] = args[0]
17
+ else
18
+ @storage[m.to_sym]
19
+ end
20
+ end
21
+
22
+ # Override respond_to? to always return true as it always delegates to the hash.
23
+ def respond_to?(method_name, include_private = false)
24
+ true
25
+ end
26
+ end
27
+ end
@@ -5,8 +5,8 @@ module MDT
5
5
  class Runner
6
6
  # A method that processes an array of contents that includes configurations for commands and command groups.
7
7
  # Arguments:
8
- # +contents+ - an array of configurations for commands and command groups. Refer to example configuration file in the code repository for structure description
9
- # +modifiers+ - an array of configurations for command modifiers that have to be applied to every command defined in +contents+
8
+ # * +contents+ - an array of configurations for commands and command groups. Refer to example configuration file in the code repository for structure description
9
+ # * +modifiers+ - an array of configurations for command modifiers that have to be applied to every command defined in +contents+
10
10
  # Returns:
11
11
  # * 1 on failure, otherwise 0
12
12
  def self.process_contents(contents, modifiers = [])
data/lib/mdt/version.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  module MDT
3
3
  # A module referring specifically to mdt-core
4
4
  module Core
5
- # Version of the core gem
6
- VERSION = '0.0.2'
5
+ # mdt-core gem version
6
+ VERSION = '0.1.0'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdt-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phitherek_
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -42,6 +42,7 @@ files:
42
42
  - lib/mdt/command_modifiers/base.rb
43
43
  - lib/mdt/commands.rb
44
44
  - lib/mdt/commands/base.rb
45
+ - lib/mdt/data_storage.rb
45
46
  - lib/mdt/directory_choosers.rb
46
47
  - lib/mdt/directory_choosers/base.rb
47
48
  - lib/mdt/errors.rb