ruby_raider 1.0.1 → 1.0.2

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: c4b79cdbe23fe8d98b28291b0efa3a5e7fc48c45c93eea5cf4cf2bf292a95510
4
+ data.tar.gz: cf8b06ae6e67de9613fa4be51b3eb0bb28b71739a503cbfabfc6a32c79ebb2a1
5
5
  SHA512:
6
- metadata.gz: 0611d5e7f9ce2303b3be175fdfdd9a3de947630ecff8827ac2129946556e97d4215555fb4b9a50be2d4949784045ea9f90a25738f71775e455287a362d2d1668
7
- data.tar.gz: 1bf0f23483cf6281c5f66b689914b8b26c48830ce5ca0936c83e8053ccc49571db385539d01abbc393536759f316c7edc4b4181df6f9d619f1ec1c3a4185585e
6
+ metadata.gz: 0a79ed5939da9fd789e6c3e67c2873c45b1222019640ba65283655d68286e9a96c8dbc8391aa1c18ad6a444870c894e57c769fc0ec74ff1106542a7d28d93875
7
+ data.tar.gz: 7c9c7ca6b505e3b3bb0b5717d9618bf635ce0bf25eab9d21e577046f19ca1bfdf538f5500d5dcd669acdd4efcf3c0bb73081c82c3b7c110422409ff18a8b4b64
@@ -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
@@ -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
+ 1.0.2
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno