Sha256: 841179a3f6fc38cb07435df3c4f82abf8365520e490e22ab05cb8d444d791ff4

Contents?: true

Size: 1.86 KB

Versions: 25

Compression:

Stored size: 1.86 KB

Contents

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

require 'rake'
require 'terminal-table'

require 'ruby_app'

namespace :ruby_app do

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

  desc 'Display commit difference between current branch and staging'
  task :changes do |task|
    system("git checkout development; git pull origin development; git log --pretty=format:'%H %s' production..HEAD")
  end

  desc 'Push to development'
  task :push do |task|
      system('git checkout development; git pull origin development; git push origin development')
  end

  desc 'Push to production, release, and increment version'
  task :release do |task|
      system('git checkout production; git pull origin production; git merge origin/development; git push origin production; rake release; git checkout development')
      version_file = File.join(RubyApp::ROOT, %w[version.rb])
      RubyApp::VERSION =~ /(\d+)\.(\d+)\.(\d+)/
      system("sed 's|[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*|#{$1}.#{$2}.#{$3.to_i + 1}|g' < '#{version_file}' > '#{version_file}.out'; rm '#{version_file}'; mv '#{version_file}.out' '#{version_file}'")
      system("git commit --all --message=\'Version #{$1}.#{$2}.#{$3.to_i + 1}\'")
  end

  namespace :process do

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

    desc 'Run'
    task :run => ['ruby_app:cache:destroy'] do |task|
      system('cd ./lib/ruby_app && clear && bundle exec ../../bin/ruby_app run')
    end

  end

  namespace :cache do

    desc 'List all cached files'
    task :list do
      system('find . | grep \'\\.cache\'')
    end

    desc 'Remove all cached files'
    task :destroy do
      puts 'Removing cached files ...'
      system('find . -name \'.cache\' | xargs rm -rv')
    end

  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
RubyApp-0.6.48 Rakefile
RubyApp-0.6.47 Rakefile
RubyApp-0.6.46 Rakefile
RubyApp-0.6.45 Rakefile
RubyApp-0.6.44 Rakefile
RubyApp-0.6.43 Rakefile
RubyApp-0.6.42 Rakefile
RubyApp-0.6.41 Rakefile
RubyApp-0.6.40 Rakefile
RubyApp-0.6.39 Rakefile
RubyApp-0.6.38 Rakefile
RubyApp-0.6.36 Rakefile
RubyApp-0.6.35 Rakefile
RubyApp-0.6.34 Rakefile
RubyApp-0.6.33 Rakefile
RubyApp-0.6.32 Rakefile
RubyApp-0.6.31 Rakefile
RubyApp-0.6.29 Rakefile
RubyApp-0.6.28 Rakefile
RubyApp-0.6.27 Rakefile