ruby_raider 1.0.1 → 1.0.3

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: 057157ebe82e5e0926a7a24eff9a600f7f0fc998e2284a03ce562280cd6c8a0f
4
- data.tar.gz: 6f86a8e645279b836d7ab8cd5bc665d811f8934c31256f369ae9bf6622192a3b
3
+ metadata.gz: 52074e06fb0010ea9fdc1ffe0729598ced95349c4775b389b353ca80e234de1b
4
+ data.tar.gz: bc95a37d449f89cf0cdf3fa7d7a393aaeb66dc931cf5cdb924ed3b7245b885d4
5
5
  SHA512:
6
- metadata.gz: 0611d5e7f9ce2303b3be175fdfdd9a3de947630ecff8827ac2129946556e97d4215555fb4b9a50be2d4949784045ea9f90a25738f71775e455287a362d2d1668
7
- data.tar.gz: 1bf0f23483cf6281c5f66b689914b8b26c48830ce5ca0936c83e8053ccc49571db385539d01abbc393536759f316c7edc4b4181df6f9d619f1ec1c3a4185585e
6
+ metadata.gz: 3190c657ef13871b11658bd01a7744b8f95ba226c418bc913e1bba41d8a4a30a8c64468cee679342be641ac8d444ecb59c27d519f0f3c8d47b5241d9d3f5bb98
7
+ data.tar.gz: ab2b8c573a2c04a104c45c0e90c805389727fb368f8ec73325b2f2b45076cc460bd1536f630c45e25ae70086f964a68a6793e44910af96e830b0c8cfdcfed64e
@@ -29,5 +29,5 @@ gem 'rubocop'
29
29
  <%- if rspec? -%>
30
30
  gem 'rubocop-rspec'
31
31
  <%- end -%>
32
- gem 'ruby_raider', '~> 1.0.1'
32
+ gem 'ruby_raider', '~> 1.0.3'
33
33
  <%= ERB.new(File.read(File.expand_path('./partials/automation_gems.tt', __dir__))).result(binding).strip! %>
@@ -4,7 +4,7 @@ gem 'selenium-webdriver'
4
4
  gem 'watir'
5
5
  <% when selenium_based? %>
6
6
  gem 'selenium-webdriver'
7
- <% else %>
7
+ <% when mobile? %>
8
8
  gem 'appium_lib'
9
9
  gem 'appium_console'
10
10
  <% end %>
data/lib/plugin/plugin.rb CHANGED
@@ -7,6 +7,7 @@ module RubyRaider
7
7
  module Plugin
8
8
  class << self
9
9
  def add_plugin(plugin_name)
10
+ return gemfile_guard unless File.exist?('Gemfile')
10
11
  return pp 'The plugin was not found' unless available?(plugin_name)
11
12
  return pp 'The plugin is already installed' if installed?(plugin_name)
12
13
 
@@ -28,6 +29,8 @@ module RubyRaider
28
29
  end
29
30
 
30
31
  def installed_plugins
32
+ return gemfile_guard unless File.exist?('Gemfile')
33
+
31
34
  parsed_gemfile = File.readlines('Gemfile').map { |line| line.sub('gem ', '').strip.delete("'") }
32
35
  parsed_gemfile.select { |line| plugins.include?(line) }
33
36
  end
@@ -51,6 +54,8 @@ module RubyRaider
51
54
  private
52
55
 
53
56
  def add_plugin_to_gemfile(plugin_name)
57
+ return gemfile_guard unless File.exist?('Gemfile')
58
+
54
59
  File.open('Gemfile', 'a') do |file|
55
60
  file.puts "\n# Ruby Raider Plugins\n" unless comment_present?
56
61
  file.puts "gem '#{plugin_name}'" unless plugin_present?(plugin_name)
@@ -67,6 +72,8 @@ module RubyRaider
67
72
  end
68
73
 
69
74
  def read_gemfile
75
+ return gemfile_guard unless File.exist?('Gemfile')
76
+
70
77
  File.readlines('Gemfile')
71
78
  end
72
79
 
@@ -86,10 +93,16 @@ module RubyRaider
86
93
 
87
94
  # :reek:NestedIterators { enabled: false }
88
95
  def update_gemfile(output_lines)
96
+ return gemfile_guard unless File.exist?('Gemfile')
97
+
89
98
  File.open('Gemfile', 'w') do |file|
90
99
  output_lines.each { |line| file.puts line }
91
100
  end
92
101
  end
102
+
103
+ def gemfile_guard
104
+ pp 'There is no Gemfile, please create one to install plugins'
105
+ end
93
106
  end
94
107
  end
95
108
  end
data/lib/version CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_raider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno