Sha256: 332df98186f666f793574c8f755013f13847d6a1f9264cd2fa80445ef7c57148

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env rake

require 'json'
require File.expand_path('../lib/bootstrap-typeahead-rails/version', __FILE__)

desc "Update assets"
task :update do
  if Dir.exist?('bootstrap-typeahead-src')
    system("cd bootstrap-typeahead-src && git pull && cd ..")
  else
    system("git clone git@github.com:twitter/typeahead.js.git bootstrap-typeahead-src")
  end

  system("cp bootstrap-typeahead-src/dist/typeahead.bundle.js vendor/assets/javascripts/bootstrap-typeahead-rails/bootstrap-typeahead.js")

  system("git status")

  puts "\n"
  puts "bootstrap-typeahead version:       #{JSON.parse(File.read('./bootstrap-typeahead-src/bower.json'))['version']}"
  puts "bootstrap-typeahead-rails version: #{BootstrapTypeaheadRails::Rails::VERSION}"
end

desc "Build"
task "build" do
  system("gem build bootstrap-typeahead-rails.gemspec")
end

desc "Build and publish the gem"
task :publish => :build do
  tags = `git tag`.split
  current_version = BootstrapTypeaheadRails::Rails::VERSION
  system("git tag -a #{current_version} -m 'Release #{current_version}'") unless tags.include?(current_version)
  system("gem push bootstrap-typeahead-rails-#{current_version}.gem")
  system("git push --follow-tags")
end

task :release => :publish do
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap-typeahead-rails-0.10.5.1 Rakefile