ruby_raider 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/templates/common/partials/automation_gems.tt +1 -1
- data/lib/plugin/plugin.rb +12 -0
- data/lib/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4b79cdbe23fe8d98b28291b0efa3a5e7fc48c45c93eea5cf4cf2bf292a95510
|
4
|
+
data.tar.gz: cf8b06ae6e67de9613fa4be51b3eb0bb28b71739a503cbfabfc6a32c79ebb2a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a79ed5939da9fd789e6c3e67c2873c45b1222019640ba65283655d68286e9a96c8dbc8391aa1c18ad6a444870c894e57c769fc0ec74ff1106542a7d28d93875
|
7
|
+
data.tar.gz: 7c9c7ca6b505e3b3bb0b5717d9618bf635ce0bf25eab9d21e577046f19ca1bfdf538f5500d5dcd669acdd4efcf3c0bb73081c82c3b7c110422409ff18a8b4b64
|
data/lib/plugin/plugin.rb
CHANGED
@@ -28,6 +28,8 @@ module RubyRaider
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def installed_plugins
|
31
|
+
return gemfile_guard unless File.exist?('Gemfile')
|
32
|
+
|
31
33
|
parsed_gemfile = File.readlines('Gemfile').map { |line| line.sub('gem ', '').strip.delete("'") }
|
32
34
|
parsed_gemfile.select { |line| plugins.include?(line) }
|
33
35
|
end
|
@@ -51,6 +53,8 @@ module RubyRaider
|
|
51
53
|
private
|
52
54
|
|
53
55
|
def add_plugin_to_gemfile(plugin_name)
|
56
|
+
return gemfile_guard unless File.exist?('Gemfile')
|
57
|
+
|
54
58
|
File.open('Gemfile', 'a') do |file|
|
55
59
|
file.puts "\n# Ruby Raider Plugins\n" unless comment_present?
|
56
60
|
file.puts "gem '#{plugin_name}'" unless plugin_present?(plugin_name)
|
@@ -67,6 +71,8 @@ module RubyRaider
|
|
67
71
|
end
|
68
72
|
|
69
73
|
def read_gemfile
|
74
|
+
return gemfile_guard unless File.exist?('Gemfile')
|
75
|
+
|
70
76
|
File.readlines('Gemfile')
|
71
77
|
end
|
72
78
|
|
@@ -86,10 +92,16 @@ module RubyRaider
|
|
86
92
|
|
87
93
|
# :reek:NestedIterators { enabled: false }
|
88
94
|
def update_gemfile(output_lines)
|
95
|
+
return gemfile_guard unless File.exist?('Gemfile')
|
96
|
+
|
89
97
|
File.open('Gemfile', 'w') do |file|
|
90
98
|
output_lines.each { |line| file.puts line }
|
91
99
|
end
|
92
100
|
end
|
101
|
+
|
102
|
+
def gemfile_guard
|
103
|
+
pp 'There is no Gemfile, please create one to install plugins'
|
104
|
+
end
|
93
105
|
end
|
94
106
|
end
|
95
107
|
end
|
data/lib/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|