Remove unused rake tasks, make cumber rake file the vanilla one

This commit is contained in:
Jonne Haß 2012-09-25 12:41:13 +02:00
parent 5bea630910
commit a0d60e7333
9 changed files with 39 additions and 252 deletions

View file

@ -1,51 +0,0 @@
writer:
name: "Kevin Koolman"
posts:
- text: '“Marshall McLuhan said that, we look at the present through a rear-view mirror, and we march backwards into the future. Invention becomes our lens to imagine what is possible, and design is the road we follow to reach it. But, there is a snag in McLuhans view, because marching is no way to go into the future. It is too methodical and restricted. The world often subverts our best laid plans, so our road calls for a way to move that is messier, bolder, more responsive. The lightness and joy afforded by creating suggests that we instead dance" - Frank Chimero'
- text: '"Everyone has a photographic memory, some just dont have film."'
- text: "Today lasted forever. But really. Ive been up since 7am walking around and Im too exhausted to do anything but sit in my bed and feast on treasures from today (cheese, blueberries, salami and bread with a bottle of wine this alcohol under 21 thing is pretty great). Amsterdam is a city of canals. I concluded that its also a morning city meaning that everything has a different feel to it in the early hours of the morning. There are swans in the water, birds chirping, ….. people just starting to clean up the trash and mess from last night. Im glad I came here myself. One, because one can really reevaluate all the shadiness and sadness thats around. Red light districts people are buying affection, 50 euros for 20 minutes from girls from Eastern Europe who need cash to support their families and living. They tap on the glass, smile, and wave at you with their barbie-sized proportions and men stand on the opposite end of the streets, eyes flickering from window to window. Coffeeshops are open for business selling pungent goods to keep you entertained for a good five hours and a bit more. The business transactions are so normal on the streets. Thirty minutes, or five hour trips and all every day, every night, but so alluring. This morning I stood in the middle of the main square looking up at the Royal Palace gold and gilded monument symbolizing nothing more than a box with forlorn looking statues gazing from its facade. Commuters were on their way to work. No one looked happy. Trash everywhere. Square was empty except for smoking teenage passerbys in leather jackets walking home from a seedy weekend adventure.Graffiti was the backdrop to their journey. "
- text: 'Time to invent a new future'
photographer:
name: "Polly Photographer"
posts:
- text: 'i was definitely some sort of bird in my past life.'
- text: 'This is not a deer'
photo: 'http://25.media.tumblr.com/tumblr_m2mmzybwEs1qevmz4o1_500.jpg'
- text: 'Sleepless in #Amsterdam'
photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash3/539915_3737052667985_1326174311_33541557_1023742200_n.jpg'
- photo: 'http://24.media.tumblr.com/tumblr_m2w7ynCHct1r2ysm3o1_500.png'
- photo: 'http://28.media.tumblr.com/tumblr_m28j5osnBy1qj69kjo1_1280.jpg'
- photo: 'http://29.media.tumblr.com/tumblr_m2yd1hP3SS1r1m6ayo1_500.jpg'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc6/33608_1638866977335_1406591038_1724566_8022154_n.jpg'
text: 'hello friend'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/215323_10150153470293170_604243169_6767922_1154482_n.jpg'
text: 'hello, paris'
- photo: 'https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/216184_10150153469618170_604243169_6767914_442611_n.jpg'
- photo: 'http://scienceblogs.com/startswithabang/upload/2011/07/is_this_where_the_matter_in_th/Virgo-Cluster.jpeg'
- photo: 'http://www.nasa.gov/centers/goddard/images/content/433226main_Misti_ComaCluster.jpg'
- photo: http://apod.nasa.gov/apod/image/0801/M31_hallas.jpg
- photo: http://thearchitectofadventure.files.wordpress.com/2011/11/colourful-universe-desktop3c.jpg
- photo: http://www.mostlyjunkfood.com/treats/2012/04/coachella-2012-stream.jpg
- photo: http://26.media.tumblr.com/tumblr_m28j5a5TAU1r8qarro1_500.jpg
collector:
name: "Charlie Collector"
posts:
- photo: http://25.media.tumblr.com/tumblr_m0qo48UJwI1qh2jkmo1_500.jpg
- video: 'http://www.youtube.com/watch?feature=player_embedded&v=vuxKb5mxM8g'
- photo: http://27.media.tumblr.com/tumblr_m19n02mk1x1qavkb2o1_1280.jpg
- text: @cainsarcade
photo: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/305393_183499138391926_181029958638844_372989_662353677_n.jpg
- photo: http://cuterthanpie.files.wordpress.com/2010/04/100_1386.jpg
- photo: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-prn1/555729_412524702098653_120085081342618_1554312_577289292_n.jpg
- photo: http://picturepoetry.files.wordpress.com/2007/10/achewood-beef-hee-hee.jpg?w=500
- photo: http://www.everydaywithedward.com/img/links/scarygoround.PNG
- photo: http://payload.cargocollective.com/1/0/4707/904187/tumblr_ktw9iioNtU1qa2i2xo1_400_1.gif
- video: http://vimeo.com/34750078
- text: '#karlmartens'
photo: http://www.harmenliemburg.nl/wp-content/uploads/Karel-Martens-5.jpg
- photo: http://catalogtree.net/pictures/001236image.jpg
- photo: http://catalogtree.net/pictures/000967image.jpg

View file

@ -1,7 +1,7 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> -r features
wip: -r features --tags @wip:3 --wip features

View file

@ -1,35 +0,0 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require Rails.root.join('lib', 'rake_helpers')
include RakeHelpers
namespace :invites do
desc 'send a bunch of invites from a csv with rows of name, email'
task :send, :number, :test do |t, args|
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')
filename = Rails.root.join('config', 'mailing_list.csv')
offset_filename = Rails.root.join('config', 'email_offset')
number_of_backers = args[:number] ? args[:number].to_i : 1000
offset = if File.exists?(offset_filename)
File.read(offset_filename).to_i
else
1
end
test = !(args[:test] == 'false')
puts "emailing #{number_of_backers} people listed in #{filename} starting at #{offset}"
finish_num = process_emails(filename, number_of_backers, offset, test)
new_offset = offset + finish_num + 1
File.open(Rails.root.join('config', 'email_offset'), 'w') do |f|
f.write(new_offset)
end
puts "you ended on #{new_offset}"
puts "all done"
end
end

View file

@ -1,12 +0,0 @@
namespace :ci do
namespace :travis do
desc "Run everyhting except cucumber"
task :other => [ :prepare_db, :generate_fixtures, :spec, "jasmine:ci" ]
desc "Run cucumber"
task :cucumber => [ :prepare_db, "rake:cucumber" ]
desc "Prepare db"
task :prepare_db => [ "db:create", "db:test:load"]
end
end

View file

@ -1,52 +0,0 @@
desc 'Seeds cool users'
task :cool => :environment do
require 'factory_girl_rails'
cool_people_yml = YAML.load(File.open(Rails.root.join('config', 'cool_people.yml')))
cool_people_yml.each do |name, attributes|
puts "making #{name}"
user = make_user_with_name(attributes['name'])
attributes['posts'].shuffle.each do |post|
new_post = Factory.build(:status_message, :public => true, :text => '', :author => user.person)
new_post.text = post.fetch('text', '')
if post['photo'].present?
new_photo = Factory.build(:photo)
new_photo.remote_processed_image_url = post['photo']
new_photo.remote_unprocessed_image_url = post['photo']
new_photo.save
new_photo.update_remote_path
new_post.photos << new_photo
new_photo.save
end
#wut to do with videos :(
new_post.save
puts "made: #{post}"
end
end
end
def make_user_with_name(name)
first, last = name.split
puts first, last
user = User.find_by_username(first)
return user if user.present?
puts Person.all.inspect
person = Factory.build(:person, :diaspora_handle => "#{first}@diaspora.dev")
person.save!
profile = Factory(:profile, :first_name => first, :last_name => last, :person => person)
user = Factory.build(:user, :username => first)
user.person = person
person.save!
person.profile.destroy
person.profile = profile
profile.person_id = person.id
profile.save!
user.save(:validate => false)
user
end

View file

@ -1,35 +1,32 @@
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
vendored_cucumber_bin = Dir[Rails.root.join('vendor', '{gems,plugins}', 'cucumber*', 'bin', 'cucumber')].first
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
begin
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t|
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
cucumber_opts = ""
cucumber_opts << " -f pretty"
t.cucumber_opts = cucumber_opts
end
Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip'
end
Cucumber::Rake::Task.new(:rerun, 'Record failing features and run only them if any exist') do |t|
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun'
@ -37,15 +34,27 @@ begin
desc 'Run all features'
task :all => [:ok, :wip]
task :statsetup do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
end
end
desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok'
Rake.application.instance_variable_get('@tasks').delete('default')
task :default => :cucumber
task :features => :cucumber do
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
end
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
task 'db:test:prepare' do
end
task :stats => 'cucumber:statsetup'
rescue LoadError
desc 'cucumber rake task not available (cucumber not installed)'
task :cucumber do

View file

@ -1,3 +1 @@
task :default => [:spec, :cucumber, :'jasmine:ci']
task :'no-jasmine' => [:cucumber, :spec]

View file

@ -1,89 +0,0 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
begin
require 'rspec/core'
require 'rspec/core/rake_task'
spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop
task :noop do
end
task :stats => "spec:statsetup"
#heroku barfs here :/
begin
Rake::Task[:spec].clear
rescue
nil
end
desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:spec => spec_prereq) do |t|
t.rspec_opts = ['-b', '--order random']
end
desc "Run all specs that generate fixtures for rspec or jasmine"
RSpec::Core::RakeTask.new(:generate_fixtures => spec_prereq) do |t|
t.rspec_opts = ['--tag fixture']
end
desc "Run the specs with rcov"
RSpec::Core::RakeTask.new(:rcov => spec_prereq) do |t|
t.rcov = true
t.rcov_opts = ['-Ispec', '--exclude', 'spec', '--exclude', 'gems']
end
namespace :"spec --color" do
[:requests, :models, :controllers, :views, :helpers, :mailers, :lib].each do |sub|
desc "Run the code examples in spec/#{sub}"
RSpec::Core::RakeTask.new(sub => spec_prereq) do |t|
t.pattern = "./spec/#{sub}/**/*_spec.rb "
end
end
task :statsetup do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
::STATS_DIRECTORIES << %w(Mailer\ specs spec/mailers) if File.exist?('spec/mailers')
::STATS_DIRECTORIES << %w(Routing\ specs spec/routing) if File.exist?('spec/routing')
::STATS_DIRECTORIES << %w(Request\ specs spec/requests) if File.exist?('spec/requests')
::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
::CodeStatistics::TEST_TYPES << "Mailer specs" if File.exist?('spec/mailer')
::CodeStatistics::TEST_TYPES << "Routing specs" if File.exist?('spec/routing')
::CodeStatistics::TEST_TYPES << "Request specs" if File.exist?('spec/requests')
end
end
rescue MissingSourceFile
module RSpec
module Core
class RakeTask
def initialize(name)
task name do
# if rspec-rails is a configured gem, this will output helpful material and exit ...
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
# ... otherwise, do this:
raise <<-MSG
#{"*" * 80}
* You are trying to run an rspec rake task defined in
* #{__FILE__},
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
#{"*" * 80}
MSG
end
end
end
end
end
end

19
lib/tasks/tests.rake Normal file
View file

@ -0,0 +1,19 @@
namespace :ci do
namespace :travis do
desc "Run everyhting except cucumber"
task :other => [ :prepare_db, "tests:generate_fixtures", :spec, "jasmine:ci" ]
desc "Run cucumber"
task :cucumber => [ :prepare_db, "rake:cucumber" ]
desc "Prepare db"
task :prepare_db => [ "db:create", "db:test:load"]
end
end
namespace :tests do
desc "Run all specs that generate fixtures for rspec or jasmine"
RSpec::Core::RakeTask.new(:generate_fixtures) do |t|
t.rspec_opts = ['--tag fixture']
end
end