Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 82 lines (68 sloc) 2.609 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
require 'rubygems'
require 'rake'

begin
  require 'jeweler'
  Jeweler::Tasks.new do |gem|
    gem.name = "whereuat"
    gem.summary = %Q{Direct your clients to test delivered features}
    gem.description = %Q{Adds a toolbar to your rails app that directs your clients to test stories that have been marked as 'delivered' in Pivotal Tracker }
    gem.email = "ben.askins@plus2.com.au"
    gem.homepage = "http://github.com/plus2/whereuat"
    gem.authors = ["Ben Askins", "Lachie Cox", "Ben Webster"]
    # gem is a Gem::Specificatiohttp://www.rubygems.org/read/chapter/20 n... see http://www.rubygems.org/read/chapter/20 for additional settings
    gem.add_dependency("pivotal-tracker", ">= 0.1.3")
    gem.add_dependency("haml", ">= 2.2.0")
    gem.add_dependency("rack", ">= 1.0.0")
  end
  Jeweler::GemcutterTasks.new
rescue LoadError
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end


rake_app = Rake::Application.new
rake_app.collect_tasks
if rake_app.top_level_tasks.include?('dev')
  require 'pathname'

  sh "bundle check || bundle install"

  task :dev => %w{dev:run}

  namespace :dev do
    task :run => :setup do
      sh 'bundle exec shotgun --server thin dev/dev.rb'
    end

    task :setup do
      gem_root = Pathname('..').expand_path(__FILE__)
      pivotal_config = gem_root+'pivotal_config.dont_commit.rb'
      unless pivotal_config.exist?
        puts "What's your pivotal tracker token? (find your down the bottom of https://www.pivotaltracker.com/profile)."
        token = $stdin.gets.chomp

        puts "What pivotal tracker project do you want to test against? (e.g. The digits at the end of http://www.pivotaltracker.com/projects/12345)."
        project_id = $stdin.gets.chomp

        puts "Creating config using your details."

        pivotal_config.open('w') {|f|
          f << %{Whereuat.configure do |config|
config.pivotal_tracker_token = "#{token}"
config.pivotal_tracker_project = #{project_id}
end
}.gsub(/^\s{3,16}/,'')
        }
      end
    end
  end

else
  desc "set up and run app in a convenient dev-only way. rake dev *must* be called as the only top level task (i.e. as 'rake dev')"
  task :dev do
    abort "Please run rake dev as 'rake dev'"
  end
end

task :bundled_env do
  require 'rubygems'
  require 'bundler'
  Bundler.setup

  $LOAD_PATH << File.expand_path('../lib',__FILE__)
  require 'whereuat'
end

namespace :assets do
  desc "Rebuild assets for distribution"
  task :rebuild => :bundled_env do
    Whereuat::Assets.rebuild!
  end
end
Something went wrong with that request. Please try again.