Skip to content

Commit

Permalink
Rake task showing raider version (#93)
Browse files Browse the repository at this point in the history
* Rake task for generated projects

* Added txt file for gem version

Fixed raider version command and added rake task for generated projects

* Deleted irrelevant rake tasks

* Cleaned the syntax

* Cleaned syntax to match Rubocop requirements

* Fixed variables names and values
  • Loading branch information
natalia-ss authored Jan 31, 2024
1 parent 87606e6 commit 69054d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions lib/generators/templates/common/rakefile.tt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
require 'yaml'

desc 'Selects browser for automation run'
task :select_browser, [:browser] do |_t, args|
config = YAML.load_file('config/config.yml')
config['browser'] = args.browser
File.write('config/config.yml', config.to_yaml)
end
desc 'Print Ruby Raider version'
task :raider do
system 'raider version'
end
5 changes: 2 additions & 3 deletions lib/ruby_raider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def new(project_name)
desc 'version', 'It shows the version of Ruby Raider you are currently using'

def version
puts "The version is #{parsed_version}, happy testing!"
puts "The version is #{current_version}, happy testing!"
end

map 'v' => 'version'
Expand All @@ -37,8 +37,7 @@ def version
map 'u' => 'utility'

no_commands do
def gemspec = Gem::Specification.load('ruby_raider.gemspec')
def parsed_version = Gem::Version.new(gemspec.version)
def current_version = File.read(File.expand_path('version', __dir__)).strip
end
end
end
1 change: 1 addition & 0 deletions lib/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.8.6
2 changes: 1 addition & 1 deletion ruby_raider.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = 'ruby_raider'
s.version = '0.8.6'
s.version = File.read(File.expand_path('lib/version', __dir__)).strip
s.summary = 'A gem to make setup and start of UI automation projects easier'
s.description = 'This gem has everything you need to start working with test automation'
s.authors = ['Agustin Pequeno']
Expand Down

0 comments on commit 69054d0

Please sign in to comment.