mdt-dummy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -0
- data/lib/mdt/command_modifiers/dummy.rb +15 -0
- data/lib/mdt/commands/dummy.rb +15 -0
- data/lib/mdt/directory_choosers/dummy.rb +26 -0
- data/lib/mdt/fetchers/dummy.rb +14 -0
- data/lib/mdt/version.rb +4 -1
- metadata +28 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c78432341e262c31fc4cab857453024828bbb405b2a5bd715e91e7ccc4743ba
|
4
|
+
data.tar.gz: cd6827ae665fd25a140d473daac57f6fbc92e0f3adfd9c3427fe62a9bbcba7af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da9d95d8787bed68499f17382bc6ebe7cda15f423eb68d399d2a577cd02a66b7f323d5848db22955948dab036448d1957836cb8f086231a4703cd5bf7b2173e6
|
7
|
+
data.tar.gz: 2da3246cf90af8a9488fb03c5a9caacf57b820de2c844f8ccba4f9d303ce2178f7c4ba12ec94387f45546e2c1e111ee276a45f1fd09d0ca484ff1d7b6ac0ee48
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# MDT - Dummy module
|
2
|
+
|
3
|
+
A dummy module for [MDT](https://github.com/Phitherek/mdt-core "MDT").
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
* [mdt-core](https://github.com/Phitherek/mdt-core "mdt-core") >= 0.0.1
|
8
|
+
* Ruby (tested with 2.5.0, earlier versions down to 2.0 may also work)
|
9
|
+
* RubyGems
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
`gem install mdt-dummy`
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
The module is automatically loaded by `mdt`. All you need to do is to use appropriate keys in your `mdt-deploy.yml`.
|
18
|
+
|
19
|
+
## Objects defined by module
|
20
|
+
|
21
|
+
### Command modifiers
|
22
|
+
|
23
|
+
* `dummy.dummy` - prints the diagnostic message and returns exactly the command or expression that it is given with no changes
|
24
|
+
|
25
|
+
### Commands
|
26
|
+
|
27
|
+
* `dummy.dummy` - prints the diagnostic message, executes all of the given command modifiers in order with command being empty string and returns 0 (success)
|
28
|
+
|
29
|
+
### Directory choosers
|
30
|
+
|
31
|
+
* `dummy.dummy` - `mkdir` prints the diagnostic message and returns 0 (success), `cd` prints the diagnostic message and returns 0 (success), `rm` prints the diagnostic message and returns 0 (success)
|
32
|
+
|
33
|
+
### Fetchers
|
34
|
+
|
35
|
+
* `dummy.dummy` - prints the diagnostic message and returns 0 (success)
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
You can contribute to the development of this MDT module by submitting an issue or pull request.
|
40
|
+
|
41
|
+
## Documentation
|
42
|
+
|
43
|
+
Generated RDoc documentation can be found [here](http://www.rubydoc.info/github/Phitherek/mdt-dummy "here").
|
@@ -1,15 +1,30 @@
|
|
1
1
|
require 'mdt-core'
|
2
2
|
module MDT
|
3
|
+
# A module containing all command modifiers
|
3
4
|
module CommandModifiers
|
5
|
+
# A class that implements dummy command modifiers
|
4
6
|
class Dummy < MDT::CommandModifiers::Base
|
7
|
+
# A method that defines a key for command modifiers class.
|
8
|
+
# Returns:
|
9
|
+
# * "dummy"
|
5
10
|
def self.key
|
6
11
|
'dummy'
|
7
12
|
end
|
8
13
|
|
14
|
+
# A method that defines keys for available command modifiers.
|
15
|
+
# Returns:
|
16
|
+
# * +["dummy"]+
|
9
17
|
def self.subkeys
|
10
18
|
['dummy']
|
11
19
|
end
|
12
20
|
|
21
|
+
# A method that defines how to prepend command modifiers to commands.
|
22
|
+
# Arguments:
|
23
|
+
# * +key+ - a key identifier of a particular command modifier
|
24
|
+
# * +command+ - a command to apply command modifier on
|
25
|
+
# * +options+ - options for modifier as a Hash
|
26
|
+
# Returns:
|
27
|
+
# * Unmodified value of +command+
|
13
28
|
def prepend(key, cmd, options = {})
|
14
29
|
case key
|
15
30
|
when 'dummy'
|
data/lib/mdt/commands/dummy.rb
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
require 'mdt-core'
|
2
2
|
module MDT
|
3
|
+
# A module containing all commands
|
3
4
|
module Commands
|
5
|
+
# A class that implements dummy commands
|
4
6
|
class Dummy < MDT::Commands::Base
|
7
|
+
# A method that defines a key for commands class.
|
8
|
+
# Returns:
|
9
|
+
# * "dummy"
|
5
10
|
def self.key
|
6
11
|
'dummy'
|
7
12
|
end
|
8
13
|
|
14
|
+
# A method that defines keys for available commands.
|
15
|
+
# Returns:
|
16
|
+
# * +["dummy"]+
|
9
17
|
def self.subkeys
|
10
18
|
['dummy']
|
11
19
|
end
|
12
20
|
|
21
|
+
# A method that defines how to execute a command and how to apply command modifiers.
|
22
|
+
# Arguments:
|
23
|
+
# * +key+ - a key identifier of a particular command
|
24
|
+
# * +modifiers+ - an array of command modifier configurations - each configuration is a Hash that includes modifier type and modifier options
|
25
|
+
# * +options+ - options for command as a Hash
|
26
|
+
# Returns:
|
27
|
+
# * 0
|
13
28
|
def execute(key, modifiers = [], options = {})
|
14
29
|
case key
|
15
30
|
when 'dummy'
|
@@ -1,15 +1,29 @@
|
|
1
1
|
require 'mdt-core'
|
2
2
|
module MDT
|
3
|
+
# A module containing all directory choosers
|
3
4
|
module DirectoryChoosers
|
5
|
+
# A class that implements dummy directory choosers
|
4
6
|
class Dummy < MDT::DirectoryChoosers::Base
|
7
|
+
# A method that defines a key for directory choosers class.
|
8
|
+
# Returns:
|
9
|
+
# * "dummy"
|
5
10
|
def self.key
|
6
11
|
'dummy'
|
7
12
|
end
|
8
13
|
|
14
|
+
# A method that defines keys for available directory choosers.
|
15
|
+
# Returns:
|
16
|
+
# * +["dummy"]+
|
9
17
|
def self.subkeys
|
10
18
|
['dummy']
|
11
19
|
end
|
12
20
|
|
21
|
+
# A method that defines how to create a deploy directory with directory choosers.
|
22
|
+
# Arguments:
|
23
|
+
# * +key+ - a key identifier of a particular directory chooser
|
24
|
+
# * +options+ - options for directory chooser as a Hash
|
25
|
+
# Returns:
|
26
|
+
# * 0
|
13
27
|
def mkdir(key, options = {})
|
14
28
|
case key
|
15
29
|
when 'dummy'
|
@@ -18,6 +32,12 @@ module MDT
|
|
18
32
|
end
|
19
33
|
end
|
20
34
|
|
35
|
+
# A method that defines how to change working directory to a deploy directory with directory choosers.
|
36
|
+
# Arguments:
|
37
|
+
# * +key+ - a key identifier of a particular directory chooser
|
38
|
+
# * +options+ - options for directory chooser as a Hash
|
39
|
+
# Returns:
|
40
|
+
# * 0
|
21
41
|
def cd(key, options = {})
|
22
42
|
case key
|
23
43
|
when 'dummy'
|
@@ -26,6 +46,12 @@ module MDT
|
|
26
46
|
end
|
27
47
|
end
|
28
48
|
|
49
|
+
# A method that defines how to remove a deploy directory with directory choosers.
|
50
|
+
# Arguments:
|
51
|
+
# * +key+ - a key identifier of a particular directory chooser
|
52
|
+
# * +options+ - options for directory chooser as a Hash
|
53
|
+
# Returns:
|
54
|
+
# * 0
|
29
55
|
def rm(key, options = {})
|
30
56
|
case key
|
31
57
|
when 'dummy'
|
data/lib/mdt/fetchers/dummy.rb
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
require 'mdt-core'
|
2
2
|
module MDT
|
3
|
+
# A module containing all fetchers
|
3
4
|
module Fetchers
|
5
|
+
# A class that implements dummy fetchers
|
4
6
|
class Dummy < MDT::Fetchers::Base
|
7
|
+
# A method that defines a key for fetchers class.
|
8
|
+
# Returns:
|
9
|
+
# * "dummy"
|
5
10
|
def self.key
|
6
11
|
'dummy'
|
7
12
|
end
|
8
13
|
|
14
|
+
# A method that defines keys for available fetchers.
|
15
|
+
# Returns:
|
16
|
+
# * +["dummy"]+
|
9
17
|
def self.subkeys
|
10
18
|
['dummy']
|
11
19
|
end
|
12
20
|
|
21
|
+
# A method that defines how to fetch project contents to a deploy directory with fetchers.
|
22
|
+
# Arguments:
|
23
|
+
# * +key+ - a key identifier of a particular fetcher
|
24
|
+
# * +options+ - options for fetchers as a Hash
|
25
|
+
# Returns:
|
26
|
+
# * 0
|
13
27
|
def fetch(key, options = {})
|
14
28
|
case key
|
15
29
|
when 'dummy'
|
data/lib/mdt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdt-dummy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phitherek_
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mdt-core
|
@@ -24,13 +24,29 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.7'
|
27
41
|
description: Dummy module for MDT
|
28
42
|
email:
|
29
43
|
- phitherek@gmail.com
|
30
44
|
executables: []
|
31
45
|
extensions: []
|
32
|
-
extra_rdoc_files:
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
33
48
|
files:
|
49
|
+
- README.md
|
34
50
|
- lib/mdt-dummy.rb
|
35
51
|
- lib/mdt/command_modifiers.rb
|
36
52
|
- lib/mdt/command_modifiers/dummy.rb
|
@@ -44,9 +60,16 @@ files:
|
|
44
60
|
homepage: https://github.com/Phitherek/mdt-dummy
|
45
61
|
licenses:
|
46
62
|
- MIT
|
47
|
-
metadata:
|
63
|
+
metadata:
|
64
|
+
documentation_uri: http://www.rubydoc.info/github/Phitherek/mdt-dummy
|
65
|
+
source_code_uri: https://github.com/Phitherek/mdt-dummy
|
48
66
|
post_install_message:
|
49
|
-
rdoc_options:
|
67
|
+
rdoc_options:
|
68
|
+
- "--title"
|
69
|
+
- MDT Dummy module
|
70
|
+
- "--main"
|
71
|
+
- README.md
|
72
|
+
- "--line-numbers"
|
50
73
|
require_paths:
|
51
74
|
- lib
|
52
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|