Sha256: a4d4af2d30680f9f6d32fb2810113888ecfed9ffbc3d733f0c82a02d72bd4a14

Contents?: true

Size: 1.75 KB

Versions: 4

Compression:

Stored size: 1.75 KB

Contents

require 'rspec/core/rake_task'
require 'jshintrb/jshinttask'
require 'jasmine-headless-webkit'
require 'sequel'
require 'ballonizer'

Jasmine::Headless::Task.new('jasmine') do |t|
  t.colors = true
  t.keep_on_error = true
  t.jasmine_config = 'spec/javascripts/support/jasmine.yml'
end

RSpec::Core::RakeTask.new :spec

Jshintrb::JshintTask.new :jshint do |t|
  t.pattern = '{lib/assets/javascripts/*.js,spec/javascripts/*.js}'
  t.options = {
    bitwise: true,
    camelcase: true,
    es3: true,
    immed: true,
    indent: 4,
    latedef: true,
    strict: true,
    curly: true,
    eqeqeq: true,
    eqnull: true,
    immed: true,
    noarg: true,
    trailing: true,
    unused: true,
    jquery: true,
    white: true
  }
end

namespace :db do
  desc 'Create/Reset the tables used by ballonizer in a database, the default' +
       'database is the example (examples/ballonizer_app/test.db), but you' +
       'can specify one with "rake db:reset[\'sqlite:///absolute/path/to/' +
       'database_name.db\']" (check sequel support to another databases).'
  task :reset, :database_path do | t, args |
    database_path = args[:database_path] || 'sqlite://examples/ballonizer_app/test.db'
    Sequel.connect(database_path) do | db |
      # The order is important, can throw Foreign Key Constraint Violation otherwise
      tables = [:ballonized_image_ballons,
                :ballonized_image_versions,
                :images,
                :ballons]
      db.drop_table?(*tables)
      Ballonizer.create_tables(db)
    end
  end
end

desc 'Run an example of the lib use in http://localhost:9292'
task :example do
  sh 'rackup examples/ballonizer_app/config.ru'
end

desc 'Run the ruby and the javascript module specs and the jshint'
task :default => [:spec, :jasmine, :jshint]

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ballonizer-0.7.4 Rakefile
ballonizer-0.7.3 Rakefile
ballonizer-0.7.2 Rakefile
ballonizer-0.7.1 Rakefile