ezdrb 0.1.3 → 0.1.4
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 +4 -4
- data/lib/ezdrb/cli.rb +29 -24
- data/lib/ezdrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf888c438aea87e559ca5c0d7292ddea8398f3105d828b50945d85931ebebdb
|
4
|
+
data.tar.gz: d406af3f965e49e1ae6d1b36ba60635dbb8223e4cf882ca20c0d7dfd6c88ae78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46cda58cce71b6d0a46f94fdc9643c88a63551b33e1cbb999ebfe7e2544badb15dff155510cc405752365702cd1b2bf03e046800adb23163edefc04854f58f9e
|
7
|
+
data.tar.gz: 4c7aa20ab6bdba9fcf60f8c2bce2a4bebb1def9254d9bb71eae9fc52ba457240ffcd606c23105f96fc88f386f3c528be0b07ae6b30e9a46418c7576acb30d08d
|
data/lib/ezdrb/cli.rb
CHANGED
@@ -20,6 +20,27 @@ module Ezdrb
|
|
20
20
|
ERB.new(File.read("#{Bundler.rubygems.find_name('ezdrb').first.full_gem_path}/lib/ezdrb/templates/#{template}.erb"), 0, '%<>')
|
21
21
|
end
|
22
22
|
|
23
|
+
class YamlHandler
|
24
|
+
|
25
|
+
attr_reader :yamlfile, :path
|
26
|
+
|
27
|
+
def initialize(file)
|
28
|
+
@path = "#{file}.yml"
|
29
|
+
@yamlfile = YAML.load_file(path)
|
30
|
+
end
|
31
|
+
|
32
|
+
def append_to_list(list, value)
|
33
|
+
if !@yamlfile[list].include?(value) then
|
34
|
+
@yamlfile[list].push(value)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def write
|
39
|
+
File.write(@path, @yamlfile.to_yaml)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
23
44
|
end
|
24
45
|
end
|
25
46
|
|
@@ -51,19 +72,11 @@ module Ezdrb
|
|
51
72
|
end
|
52
73
|
|
53
74
|
File.open('config/commands.yml', 'w') do |file|
|
54
|
-
file.write(
|
55
|
-
<<~HEREDOC
|
56
|
-
commands:
|
57
|
-
HEREDOC
|
58
|
-
)
|
75
|
+
file.write('commands: []')
|
59
76
|
end
|
60
77
|
|
61
78
|
File.open('config/events.yml', 'w') do |file|
|
62
|
-
file.write(
|
63
|
-
<<~HEREDOC
|
64
|
-
events:
|
65
|
-
HEREDOC
|
66
|
-
)
|
79
|
+
file.write('events: []')
|
67
80
|
end
|
68
81
|
|
69
82
|
File.open('Attributes.rb', 'w') do |file|
|
@@ -110,13 +123,9 @@ module Ezdrb
|
|
110
123
|
end
|
111
124
|
|
112
125
|
begin
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
- #{command_name}
|
117
|
-
HEREDOC
|
118
|
-
)
|
119
|
-
end
|
126
|
+
commands_yaml = Helpers::YamlHandler.new('config/commands')
|
127
|
+
commands_yaml.append_to_list('commands', command_name)
|
128
|
+
commands_yaml.write
|
120
129
|
|
121
130
|
File.open("commands/#{command_name.capitalize}.rb", 'w') do |file|
|
122
131
|
template = Helpers::load_template('SingleCommand').result(binding)
|
@@ -149,13 +158,9 @@ module Ezdrb
|
|
149
158
|
end
|
150
159
|
|
151
160
|
begin
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
- #{event.downcase.capitalize}
|
156
|
-
HEREDOC
|
157
|
-
)
|
158
|
-
end
|
161
|
+
events_yaml = Helpers::YamlHandler.new('config/events')
|
162
|
+
events_yaml.append_to_list('events', event)
|
163
|
+
events_yaml.write
|
159
164
|
|
160
165
|
File.open("events/#{event.capitalize}.rb", 'w') do |file|
|
161
166
|
template = Helpers::load_template('SingleEvent').result(binding)
|
data/lib/ezdrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezdrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- monocrystal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|