Sha256: 6a1821cb9fb55e6f616d40fbb0e0880b714c3297f665e70266ee6fac7bdd91a6

Contents?: true

Size: 1.9 KB

Versions: 5

Compression:

Stored size: 1.9 KB

Contents

require 'rubygems'
require "bundler/gem_tasks"
require 'bundler/setup'

require 'rake'

namespace :ruby_app do

  desc 'Monitor log'
  task :monitor do |task|
    system("cd ./lib/ruby_app && > ./log/application.log && clear && tail -f ./log/application.log")
  end

  desc 'Create console'
  task :console do |task|
    system("cd ./lib/ruby_app && clear && bundle exec ../../bin/ruby_app console")
  end

  desc 'Run'
  task :run do |task|
    system("cd ./lib/ruby_app && clear && bundle exec ../../bin/ruby_app run")
  end

  desc 'Get version'
  task :version do |task|
    puts RubyApp::VERSION
  end

  desc 'Update version, commit, push to master, release'
  task :release, :version do |task, arguments|
    version_file = File.join(RubyApp::ROOT, %w[version.rb])
    system "sed 's|[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*|#{arguments.version}|g' < '#{version_file}' > '#{version_file}.out' && rm '#{version_file}' && mv '#{version_file}.out' '#{version_file}' && git commit --all --message='Incrementing version' && git push origin master; rake release"
  end

  namespace :test do

    desc 'Run feature tests for the given feature file or all features files if no argument is provided'
    task :features, :file do |task, arguments|
      system("bundle exec cucumber --format pretty --tags ~@broken --require features #{arguments.file}")
    end

    desc 'Run RSpec tests'
    task :specs, :file, :line do |task, arguments|
      if arguments.file
        if arguments.line
          system("bundle exec rspec #{arguments.file} --line_number=#{arguments.line} --format=documentation --colour")
        else
          system("bundle exec rspec #{arguments.file} --format=documentation --colour")
        end
      else
        system("bundle exec rspec spec/ --format=documentation --colour")
      end
    end

    desc 'Run all tests'
    task :all => ['ruby_app:test:specs',
                  'ruby_app:test:features']

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
RubyApp-0.0.41 rakefile
RubyApp-0.0.30 rakefile
RubyApp-0.0.29 rakefile
RubyApp-0.0.28 rakefile
RubyApp-0.0.27 rakefile