diff --git a/Gemfile b/Gemfile index 340c531..fa75df1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in rake_control.gemspec gemspec diff --git a/README.md b/README.md index b0052c7..a340a50 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# RakeControl +# Burden -RakeControl is a tool for managing Rake tasks. +Burden is a tool for managing Rake tasks. ## Installation Add this line to your application's Gemfile: ```ruby -gem 'rake_control' +gem 'burden' ``` And then execute: @@ -16,11 +16,10 @@ $ bundle ## Configuration - Add this lines to the top of your application's Rakefile: ```ruby -require 'rake_control' -RakeControl.configure do |c| +require 'burden' +Burden.configure do |c| c.storage = :active_record # or :mongoid, :mongo_mapper end ``` diff --git a/Rakefile b/Rakefile index 3b211c2..c702cfc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,16 +1 @@ require 'bundler/gem_tasks' -require 'rake_control' - -task :regular_task do - puts 'I am being invoked' -end - -task :failing_task do - raise 'wtf' -end - -task :sleepy_task do - puts 'Sleeping...' - sleep 2 - puts 'Woke up!' -end diff --git a/rake_control.gemspec b/burden.gemspec similarity index 82% rename from rake_control.gemspec rename to burden.gemspec index e5a838a..1c219ca 100644 --- a/rake_control.gemspec +++ b/burden.gemspec @@ -1,15 +1,15 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'rake_control/version' +require 'burden/version' Gem::Specification.new do |spec| - spec.name = 'rake_control' - spec.version = RakeControl::VERSION + spec.name = 'burden' + spec.version = Burden::VERSION spec.authors = ['Gregory Eremin'] spec.email = ['magnolia_fan@me.com'] spec.description = %q{} spec.summary = %q{Rake tasks manager and statistics collector} - spec.homepage = 'https://github.com/magnolia-fan/rake_control' + spec.homepage = 'https://github.com/magnolia-fan/burden' spec.license = 'MIT' spec.files = `git ls-files`.split($/) diff --git a/rake_control_web/.gitignore b/burden_web/.gitignore similarity index 100% rename from rake_control_web/.gitignore rename to burden_web/.gitignore diff --git a/rake_control_web/Gemfile b/burden_web/Gemfile similarity index 65% rename from rake_control_web/Gemfile rename to burden_web/Gemfile index f5d5eea..cff6b96 100644 --- a/rake_control_web/Gemfile +++ b/burden_web/Gemfile @@ -3,4 +3,4 @@ source 'http://rubygems.org' gemspec gem 'jquery-rails' -gem 'rake_control', path: '..' +gem 'burden', path: '..' diff --git a/rake_control_web/MIT-LICENSE b/burden_web/MIT-LICENSE similarity index 100% rename from rake_control_web/MIT-LICENSE rename to burden_web/MIT-LICENSE diff --git a/burden_web/README.md b/burden_web/README.md new file mode 100644 index 0000000..d922581 --- /dev/null +++ b/burden_web/README.md @@ -0,0 +1 @@ +# Burden Web Interface diff --git a/rake_control_web/Rakefile b/burden_web/Rakefile similarity index 94% rename from rake_control_web/Rakefile rename to burden_web/Rakefile index ce3334d..56eee80 100644 --- a/rake_control_web/Rakefile +++ b/burden_web/Rakefile @@ -14,7 +14,7 @@ end RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'RakeControlWeb' + rdoc.title = 'BurdenWeb' rdoc.options << '--line-numbers' rdoc.rdoc_files.include('README.rdoc') rdoc.rdoc_files.include('lib/**/*.rb') diff --git a/rake_control_web/app/assets/javascripts/rake_control_web/application.js b/burden_web/app/assets/javascripts/burden_web/application.js similarity index 100% rename from rake_control_web/app/assets/javascripts/rake_control_web/application.js rename to burden_web/app/assets/javascripts/burden_web/application.js diff --git a/burden_web/app/assets/stylesheets/burden_web/application.css b/burden_web/app/assets/stylesheets/burden_web/application.css new file mode 100644 index 0000000..0e4f5c0 --- /dev/null +++ b/burden_web/app/assets/stylesheets/burden_web/application.css @@ -0,0 +1,7 @@ +/* + *= require burden_web/normalize + *= require burden_web/foundation.min + *= require_self +*/ + +a.button { margin: 0; } diff --git a/rake_control_web/app/assets/stylesheets/rake_control_web/foundation.min.css b/burden_web/app/assets/stylesheets/burden_web/foundation.min.css similarity index 100% rename from rake_control_web/app/assets/stylesheets/rake_control_web/foundation.min.css rename to burden_web/app/assets/stylesheets/burden_web/foundation.min.css diff --git a/rake_control_web/app/assets/stylesheets/rake_control_web/normalize.css b/burden_web/app/assets/stylesheets/burden_web/normalize.css similarity index 100% rename from rake_control_web/app/assets/stylesheets/rake_control_web/normalize.css rename to burden_web/app/assets/stylesheets/burden_web/normalize.css diff --git a/rake_control_web/app/controllers/rake_control_web/application_controller.rb b/burden_web/app/controllers/burden_web/application_controller.rb similarity index 90% rename from rake_control_web/app/controllers/rake_control_web/application_controller.rb rename to burden_web/app/controllers/burden_web/application_controller.rb index 5ff73f9..063eab5 100644 --- a/rake_control_web/app/controllers/rake_control_web/application_controller.rb +++ b/burden_web/app/controllers/burden_web/application_controller.rb @@ -1,4 +1,4 @@ -module RakeControlWeb +module BurdenWeb class ApplicationController < ActionController::Base def tasks Rails.application.load_tasks diff --git a/rake_control_web/app/controllers/rake_control_web/tasks_controller.rb b/burden_web/app/controllers/burden_web/tasks_controller.rb similarity index 74% rename from rake_control_web/app/controllers/rake_control_web/tasks_controller.rb rename to burden_web/app/controllers/burden_web/tasks_controller.rb index b065bc3..9474144 100644 --- a/rake_control_web/app/controllers/rake_control_web/tasks_controller.rb +++ b/burden_web/app/controllers/burden_web/tasks_controller.rb @@ -1,9 +1,9 @@ -module RakeControlWeb +module BurdenWeb class TasksController < ApplicationController def index - @tasks = RakeControl::Storage.run.summary + @tasks = Burden::Storage.run.summary (tasks.map(&:name) - @tasks.map(&:name)).each do |nr_task| # Never runned tasks - @tasks << RakeControl::Storage.run.new( + @tasks << Burden::Storage.run.new( name: nr_task ) end diff --git a/rake_control_web/app/helpers/rake_control_web/application_helper.rb b/burden_web/app/helpers/burden_web/application_helper.rb similarity index 90% rename from rake_control_web/app/helpers/rake_control_web/application_helper.rb rename to burden_web/app/helpers/burden_web/application_helper.rb index 039c788..e0eb091 100644 --- a/rake_control_web/app/helpers/rake_control_web/application_helper.rb +++ b/burden_web/app/helpers/burden_web/application_helper.rb @@ -1,4 +1,4 @@ -module RakeControlWeb +module BurdenWeb module ApplicationHelper def task_label run case run.success diff --git a/rake_control_web/app/views/rake_control_web/tasks/index.html.erb b/burden_web/app/views/burden_web/tasks/index.html.erb similarity index 100% rename from rake_control_web/app/views/rake_control_web/tasks/index.html.erb rename to burden_web/app/views/burden_web/tasks/index.html.erb diff --git a/burden_web/app/views/layouts/burden_web/application.html.erb b/burden_web/app/views/layouts/burden_web/application.html.erb new file mode 100644 index 0000000..43590e9 --- /dev/null +++ b/burden_web/app/views/layouts/burden_web/application.html.erb @@ -0,0 +1,16 @@ + + + + Burden + <%= stylesheet_link_tag 'burden_web/application', media: 'all' %> + <%= csrf_meta_tags %> + + +
+
+

Burden Dashboard

+ <%= yield %> +
+
+ + diff --git a/rake_control_web/rake_control_web.gemspec b/burden_web/burden_web.gemspec similarity index 64% rename from rake_control_web/rake_control_web.gemspec rename to burden_web/burden_web.gemspec index 3b33663..fac74c9 100644 --- a/rake_control_web/rake_control_web.gemspec +++ b/burden_web/burden_web.gemspec @@ -1,22 +1,22 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: -require "rake_control_web/version" +require "burden_web/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "rake_control_web" - s.version = RakeControlWeb::VERSION + s.name = "burden_web" + s.version = BurdenWeb::VERSION s.authors = ["TODO: Your name"] s.email = ["TODO: Your email"] s.homepage = "TODO" - s.summary = "TODO: Summary of RakeControlWeb." - s.description = "TODO: Description of RakeControlWeb." + s.summary = "TODO: Summary of BurdenWeb." + s.description = "TODO: Description of BurdenWeb." s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.add_dependency 'rails', '>= 3.2' - s.add_development_dependency 'rake_control' + s.add_development_dependency 'burden' s.add_development_dependency 'sqlite3' s.add_development_dependency 'awesome_print' diff --git a/rake_control_web/config/routes.rb b/burden_web/config/routes.rb similarity index 80% rename from rake_control_web/config/routes.rb rename to burden_web/config/routes.rb index 5d9167c..688726c 100644 --- a/rake_control_web/config/routes.rb +++ b/burden_web/config/routes.rb @@ -1,4 +1,4 @@ -RakeControlWeb::Engine.routes.draw do +BurdenWeb::Engine.routes.draw do resources :tasks, path: '/', only: [:index], constraints: { id: /[a-z0-9_:]+/ } do member{ get :run } resources :runs, only: [:index, :show] diff --git a/burden_web/lib/burden_web.rb b/burden_web/lib/burden_web.rb new file mode 100644 index 0000000..0251636 --- /dev/null +++ b/burden_web/lib/burden_web.rb @@ -0,0 +1,4 @@ +require "burden_web/engine" + +module BurdenWeb +end diff --git a/burden_web/lib/burden_web/engine.rb b/burden_web/lib/burden_web/engine.rb new file mode 100644 index 0000000..f57bb48 --- /dev/null +++ b/burden_web/lib/burden_web/engine.rb @@ -0,0 +1,5 @@ +module BurdenWeb + class Engine < ::Rails::Engine + isolate_namespace BurdenWeb + end +end diff --git a/lib/rake_control/version.rb b/burden_web/lib/burden_web/version.rb similarity index 55% rename from lib/rake_control/version.rb rename to burden_web/lib/burden_web/version.rb index c3a9c0c..781b2d7 100644 --- a/lib/rake_control/version.rb +++ b/burden_web/lib/burden_web/version.rb @@ -1,3 +1,3 @@ -module RakeControl +module BurdenWeb VERSION = '0.1.0' end diff --git a/rake_control_web/script/rails b/burden_web/script/rails similarity index 76% rename from rake_control_web/script/rails rename to burden_web/script/rails index 9642b40..a997d24 100755 --- a/rake_control_web/script/rails +++ b/burden_web/script/rails @@ -2,7 +2,7 @@ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. ENGINE_ROOT = File.expand_path('../..', __FILE__) -ENGINE_PATH = File.expand_path('../../lib/rake_control_web/engine', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/burden_web/engine', __FILE__) require 'rails/all' require 'rails/engine/commands' diff --git a/rake_control_web/spec/dummy/Rakefile b/burden_web/spec/dummy/Rakefile similarity index 100% rename from rake_control_web/spec/dummy/Rakefile rename to burden_web/spec/dummy/Rakefile diff --git a/rake_control_web/spec/dummy/app/assets/javascripts/application.js b/burden_web/spec/dummy/app/assets/javascripts/application.js similarity index 100% rename from rake_control_web/spec/dummy/app/assets/javascripts/application.js rename to burden_web/spec/dummy/app/assets/javascripts/application.js diff --git a/rake_control_web/spec/dummy/app/assets/stylesheets/application.css b/burden_web/spec/dummy/app/assets/stylesheets/application.css similarity index 100% rename from rake_control_web/spec/dummy/app/assets/stylesheets/application.css rename to burden_web/spec/dummy/app/assets/stylesheets/application.css diff --git a/rake_control_web/spec/dummy/app/controllers/application_controller.rb b/burden_web/spec/dummy/app/controllers/application_controller.rb similarity index 100% rename from rake_control_web/spec/dummy/app/controllers/application_controller.rb rename to burden_web/spec/dummy/app/controllers/application_controller.rb diff --git a/rake_control_web/spec/dummy/app/helpers/application_helper.rb b/burden_web/spec/dummy/app/helpers/application_helper.rb similarity index 100% rename from rake_control_web/spec/dummy/app/helpers/application_helper.rb rename to burden_web/spec/dummy/app/helpers/application_helper.rb diff --git a/rake_control_web/app/assets/images/rake_control_web/.gitkeep b/burden_web/spec/dummy/app/mailers/.gitkeep similarity index 100% rename from rake_control_web/app/assets/images/rake_control_web/.gitkeep rename to burden_web/spec/dummy/app/mailers/.gitkeep diff --git a/rake_control_web/spec/dummy/app/mailers/.gitkeep b/burden_web/spec/dummy/app/models/.gitkeep similarity index 100% rename from rake_control_web/spec/dummy/app/mailers/.gitkeep rename to burden_web/spec/dummy/app/models/.gitkeep diff --git a/rake_control_web/spec/dummy/app/views/layouts/application.html.erb b/burden_web/spec/dummy/app/views/layouts/application.html.erb similarity index 100% rename from rake_control_web/spec/dummy/app/views/layouts/application.html.erb rename to burden_web/spec/dummy/app/views/layouts/application.html.erb diff --git a/rake_control_web/spec/dummy/config.ru b/burden_web/spec/dummy/config.ru similarity index 100% rename from rake_control_web/spec/dummy/config.ru rename to burden_web/spec/dummy/config.ru diff --git a/rake_control_web/spec/dummy/config/application.rb b/burden_web/spec/dummy/config/application.rb similarity index 99% rename from rake_control_web/spec/dummy/config/application.rb rename to burden_web/spec/dummy/config/application.rb index adddb1b..3edf51e 100644 --- a/rake_control_web/spec/dummy/config/application.rb +++ b/burden_web/spec/dummy/config/application.rb @@ -9,7 +9,7 @@ require "sprockets/railtie" # require "rails/test_unit/railtie" Bundler.require(*Rails.groups) -require "rake_control_web" +require "burden_web" module Dummy class Application < Rails::Application diff --git a/rake_control_web/spec/dummy/config/boot.rb b/burden_web/spec/dummy/config/boot.rb similarity index 100% rename from rake_control_web/spec/dummy/config/boot.rb rename to burden_web/spec/dummy/config/boot.rb diff --git a/rake_control_web/spec/dummy/config/database.yml b/burden_web/spec/dummy/config/database.yml similarity index 100% rename from rake_control_web/spec/dummy/config/database.yml rename to burden_web/spec/dummy/config/database.yml diff --git a/rake_control_web/spec/dummy/config/environment.rb b/burden_web/spec/dummy/config/environment.rb similarity index 100% rename from rake_control_web/spec/dummy/config/environment.rb rename to burden_web/spec/dummy/config/environment.rb diff --git a/rake_control_web/spec/dummy/config/environments/development.rb b/burden_web/spec/dummy/config/environments/development.rb similarity index 100% rename from rake_control_web/spec/dummy/config/environments/development.rb rename to burden_web/spec/dummy/config/environments/development.rb diff --git a/rake_control_web/spec/dummy/config/environments/production.rb b/burden_web/spec/dummy/config/environments/production.rb similarity index 100% rename from rake_control_web/spec/dummy/config/environments/production.rb rename to burden_web/spec/dummy/config/environments/production.rb diff --git a/rake_control_web/spec/dummy/config/environments/test.rb b/burden_web/spec/dummy/config/environments/test.rb similarity index 100% rename from rake_control_web/spec/dummy/config/environments/test.rb rename to burden_web/spec/dummy/config/environments/test.rb diff --git a/rake_control_web/spec/dummy/config/initializers/backtrace_silencers.rb b/burden_web/spec/dummy/config/initializers/backtrace_silencers.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/backtrace_silencers.rb rename to burden_web/spec/dummy/config/initializers/backtrace_silencers.rb diff --git a/rake_control_web/spec/dummy/config/initializers/rake_control.rb b/burden_web/spec/dummy/config/initializers/burden.rb similarity index 70% rename from rake_control_web/spec/dummy/config/initializers/rake_control.rb rename to burden_web/spec/dummy/config/initializers/burden.rb index 4246db3..ef5472f 100644 --- a/rake_control_web/spec/dummy/config/initializers/rake_control.rb +++ b/burden_web/spec/dummy/config/initializers/burden.rb @@ -1,4 +1,4 @@ -RakeControl.configure do |c| +Burden.configure do |c| c.storage = :active_record c.ignored_tasks = [:environment] end diff --git a/rake_control_web/spec/dummy/config/initializers/inflections.rb b/burden_web/spec/dummy/config/initializers/inflections.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/inflections.rb rename to burden_web/spec/dummy/config/initializers/inflections.rb diff --git a/rake_control_web/spec/dummy/config/initializers/mime_types.rb b/burden_web/spec/dummy/config/initializers/mime_types.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/mime_types.rb rename to burden_web/spec/dummy/config/initializers/mime_types.rb diff --git a/rake_control_web/spec/dummy/config/initializers/secret_token.rb b/burden_web/spec/dummy/config/initializers/secret_token.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/secret_token.rb rename to burden_web/spec/dummy/config/initializers/secret_token.rb diff --git a/rake_control_web/spec/dummy/config/initializers/session_store.rb b/burden_web/spec/dummy/config/initializers/session_store.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/session_store.rb rename to burden_web/spec/dummy/config/initializers/session_store.rb diff --git a/rake_control_web/spec/dummy/config/initializers/wrap_parameters.rb b/burden_web/spec/dummy/config/initializers/wrap_parameters.rb similarity index 100% rename from rake_control_web/spec/dummy/config/initializers/wrap_parameters.rb rename to burden_web/spec/dummy/config/initializers/wrap_parameters.rb diff --git a/rake_control_web/spec/dummy/config/locales/en.yml b/burden_web/spec/dummy/config/locales/en.yml similarity index 100% rename from rake_control_web/spec/dummy/config/locales/en.yml rename to burden_web/spec/dummy/config/locales/en.yml diff --git a/burden_web/spec/dummy/config/routes.rb b/burden_web/spec/dummy/config/routes.rb new file mode 100644 index 0000000..4f8935f --- /dev/null +++ b/burden_web/spec/dummy/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + mount BurdenWeb::Engine => "/burden" +end diff --git a/rake_control_web/spec/dummy/db/migrate/20130606131532_create_rake_control_runs.rb b/burden_web/spec/dummy/db/migrate/20130606131532_create_burden_runs.rb similarity index 51% rename from rake_control_web/spec/dummy/db/migrate/20130606131532_create_rake_control_runs.rb rename to burden_web/spec/dummy/db/migrate/20130606131532_create_burden_runs.rb index c87ebe2..e68a384 100644 --- a/rake_control_web/spec/dummy/db/migrate/20130606131532_create_rake_control_runs.rb +++ b/burden_web/spec/dummy/db/migrate/20130606131532_create_burden_runs.rb @@ -1,6 +1,6 @@ -class CreateRakeControlRuns < ActiveRecord::Migration +class CreateBurdenRuns < ActiveRecord::Migration def up - create_table :rake_control_runs do |t| + create_table :burden_runs do |t| t.string :name t.boolean :success t.float :execution_time @@ -9,6 +9,6 @@ class CreateRakeControlRuns < ActiveRecord::Migration end def down - drop_table :rake_control_runs + drop_table :burden_runs end end diff --git a/rake_control_web/spec/dummy/db/schema.rb b/burden_web/spec/dummy/db/schema.rb similarity index 94% rename from rake_control_web/spec/dummy/db/schema.rb rename to burden_web/spec/dummy/db/schema.rb index 1ae428c..199f5bb 100644 --- a/rake_control_web/spec/dummy/db/schema.rb +++ b/burden_web/spec/dummy/db/schema.rb @@ -13,7 +13,7 @@ ActiveRecord::Schema.define(:version => 20130606131532) do - create_table "rake_control_runs", :force => true do |t| + create_table "burden_runs", :force => true do |t| t.string "name" t.boolean "success" t.float "execution_time" diff --git a/rake_control_web/spec/dummy/app/models/.gitkeep b/burden_web/spec/dummy/lib/assets/.gitkeep similarity index 100% rename from rake_control_web/spec/dummy/app/models/.gitkeep rename to burden_web/spec/dummy/lib/assets/.gitkeep diff --git a/rake_control_web/spec/dummy/lib/tasks/bad_failure.rake b/burden_web/spec/dummy/lib/tasks/bad_failure.rake similarity index 100% rename from rake_control_web/spec/dummy/lib/tasks/bad_failure.rake rename to burden_web/spec/dummy/lib/tasks/bad_failure.rake diff --git a/rake_control_web/spec/dummy/lib/tasks/good_bar.rake b/burden_web/spec/dummy/lib/tasks/good_bar.rake similarity index 100% rename from rake_control_web/spec/dummy/lib/tasks/good_bar.rake rename to burden_web/spec/dummy/lib/tasks/good_bar.rake diff --git a/rake_control_web/spec/dummy/lib/tasks/good_foo.rake b/burden_web/spec/dummy/lib/tasks/good_foo.rake similarity index 100% rename from rake_control_web/spec/dummy/lib/tasks/good_foo.rake rename to burden_web/spec/dummy/lib/tasks/good_foo.rake diff --git a/rake_control_web/spec/dummy/lib/assets/.gitkeep b/burden_web/spec/dummy/log/.gitkeep similarity index 100% rename from rake_control_web/spec/dummy/lib/assets/.gitkeep rename to burden_web/spec/dummy/log/.gitkeep diff --git a/rake_control_web/spec/dummy/public/404.html b/burden_web/spec/dummy/public/404.html similarity index 100% rename from rake_control_web/spec/dummy/public/404.html rename to burden_web/spec/dummy/public/404.html diff --git a/rake_control_web/spec/dummy/public/422.html b/burden_web/spec/dummy/public/422.html similarity index 100% rename from rake_control_web/spec/dummy/public/422.html rename to burden_web/spec/dummy/public/422.html diff --git a/rake_control_web/spec/dummy/public/500.html b/burden_web/spec/dummy/public/500.html similarity index 100% rename from rake_control_web/spec/dummy/public/500.html rename to burden_web/spec/dummy/public/500.html diff --git a/rake_control_web/spec/dummy/public/favicon.ico b/burden_web/spec/dummy/public/favicon.ico similarity index 100% rename from rake_control_web/spec/dummy/public/favicon.ico rename to burden_web/spec/dummy/public/favicon.ico diff --git a/rake_control_web/spec/dummy/script/rails b/burden_web/spec/dummy/script/rails similarity index 100% rename from rake_control_web/spec/dummy/script/rails rename to burden_web/spec/dummy/script/rails diff --git a/lib/rake_control.rb b/lib/burden.rb similarity index 56% rename from lib/rake_control.rb rename to lib/burden.rb index 119e132..eb4c103 100644 --- a/lib/rake_control.rb +++ b/lib/burden.rb @@ -2,13 +2,13 @@ require 'bundler/setup' require 'rake' require File.expand_path('../rake/task', __FILE__) -require 'rake_control/config' -require 'rake_control/statistics' -require 'rake_control/storage' -require 'rake_control/version' -require 'rake_control/wrapper' +require 'burden/config' +require 'burden/statistics' +require 'burden/storage' +require 'burden/version' +require 'burden/wrapper' -module RakeControl +module Burden include Config::Helper def wrap(name, description, &block) diff --git a/lib/rake_control/config.rb b/lib/burden/config.rb similarity index 95% rename from lib/rake_control/config.rb rename to lib/burden/config.rb index 044c489..f6d9c39 100644 --- a/lib/rake_control/config.rb +++ b/lib/burden/config.rb @@ -1,4 +1,4 @@ -module RakeControl +module Burden class Config attr_accessor :storage, # Storage backend (ActiveRecord, Mongoid, MongoMapper) :ignored_tasks # Do not log this tasks (eg. environment task) diff --git a/lib/rake_control/statistics.rb b/lib/burden/statistics.rb similarity index 97% rename from lib/rake_control/statistics.rb rename to lib/burden/statistics.rb index 374cedf..a169dc5 100644 --- a/lib/rake_control/statistics.rb +++ b/lib/burden/statistics.rb @@ -1,4 +1,4 @@ -module RakeControl +module Burden class Statistics attr_reader :name, :success, :execution_time diff --git a/lib/burden/storage.rb b/lib/burden/storage.rb new file mode 100644 index 0000000..253f757 --- /dev/null +++ b/lib/burden/storage.rb @@ -0,0 +1,21 @@ +module Burden + module Storage + def run + case Burden.config.storage + when :active_record, :activerecord + require 'burden/storage/active_record/run' + Burden::Storage::ActiveRecord::Run + when :mongoid + require 'burden/storage/mongoid/run' + Burden::Storage::Mongoid::Run + when :mongo_mapper, :mongomapper + require 'burden/storage/mongo_mapper/run' + Burden::Storage::MongoMapper::Run + else + raise Exception.new("Unknown storage: #{storage}") + end + end + + extend self + end +end diff --git a/lib/rake_control/storage/active_record/run.rb b/lib/burden/storage/active_record/run.rb similarity index 78% rename from lib/rake_control/storage/active_record/run.rb rename to lib/burden/storage/active_record/run.rb index 088fa92..51e60c9 100644 --- a/lib/rake_control/storage/active_record/run.rb +++ b/lib/burden/storage/active_record/run.rb @@ -1,8 +1,8 @@ -module RakeControl +module Burden module Storage module ActiveRecord class Run < ::ActiveRecord::Base - self.table_name = 'rake_control_runs' + self.table_name = 'burden_runs' attr_accessible :name, :success, :execution_time scope :summary, ->{ group(:name).order('created_at desc') } diff --git a/lib/rake_control/storage/mongo_mapper/run.rb b/lib/burden/storage/mongo_mapper/run.rb similarity index 79% rename from lib/rake_control/storage/mongo_mapper/run.rb rename to lib/burden/storage/mongo_mapper/run.rb index 5243eb8..7db50e9 100644 --- a/lib/rake_control/storage/mongo_mapper/run.rb +++ b/lib/burden/storage/mongo_mapper/run.rb @@ -1,9 +1,10 @@ -module RakeControl +module Burden module Storage module MongoMapper class Run include ::MongoMapper::Document + set_collection_name 'burden_runs' key :name, String key :success, Boolean key :execution_time, Float diff --git a/lib/rake_control/storage/mongoid/run.rb b/lib/burden/storage/mongoid/run.rb similarity index 80% rename from lib/rake_control/storage/mongoid/run.rb rename to lib/burden/storage/mongoid/run.rb index e3ad944..2568860 100644 --- a/lib/rake_control/storage/mongoid/run.rb +++ b/lib/burden/storage/mongoid/run.rb @@ -1,9 +1,10 @@ -module RakeControl +module Burden module Storage module Mongoid class Run include ::Mongoid::Document + store_in collection: 'burden_runs' field :name, type: String field :success, type: Boolean field :execution_time, type: Float diff --git a/lib/burden/version.rb b/lib/burden/version.rb new file mode 100644 index 0000000..4bbc531 --- /dev/null +++ b/lib/burden/version.rb @@ -0,0 +1,3 @@ +module Burden + VERSION = '0.1.0' +end diff --git a/lib/rake_control/wrapper.rb b/lib/burden/wrapper.rb similarity index 92% rename from lib/rake_control/wrapper.rb rename to lib/burden/wrapper.rb index a03aea7..d83c592 100644 --- a/lib/rake_control/wrapper.rb +++ b/lib/burden/wrapper.rb @@ -1,4 +1,4 @@ -module RakeControl +module Burden class Wrapper attr_reader :name, :description, :block, :success, :exception, :execution_time @@ -42,7 +42,7 @@ module RakeControl end def ignored? - RakeControl.config.ignored_tasks.include?(name.to_sym) + Burden.config.ignored_tasks.include?(name.to_sym) end def save_statistics diff --git a/lib/generators/active_record/rake_control_generator.rb b/lib/generators/active_record/burden_generator.rb similarity index 74% rename from lib/generators/active_record/rake_control_generator.rb rename to lib/generators/active_record/burden_generator.rb index ca28c72..3f1973e 100644 --- a/lib/generators/active_record/rake_control_generator.rb +++ b/lib/generators/active_record/burden_generator.rb @@ -1,7 +1,7 @@ require 'rails/generators' require 'rails/generators/migration' -class RakeControlGenerator < Rails::Generators::Base +class BurdenGenerator < Rails::Generators::Base include Rails::Generators::Migration def self.source_root @@ -17,6 +17,6 @@ class RakeControlGenerator < Rails::Generators::Base end def create_migration_file - migration_template 'create_rake_control_runs.rb', 'db/migrate/create_rake_control_runs.rb' + migration_template 'create_burden_runs.rb', 'db/migrate/create_burden_runs.rb' end end diff --git a/lib/generators/active_record/create_rake_control_runs.rb b/lib/generators/active_record/create_burden_runs.rb similarity index 53% rename from lib/generators/active_record/create_rake_control_runs.rb rename to lib/generators/active_record/create_burden_runs.rb index 4e86c5a..9ed964d 100644 --- a/lib/generators/active_record/create_rake_control_runs.rb +++ b/lib/generators/active_record/create_burden_runs.rb @@ -1,6 +1,6 @@ -class CreateRakeControlRuns < ActiveRecord::Migration +class CreateBurdenRuns < ActiveRecord::Migration def self.up - create_table :rake_control_runs do |t| + create_table :burden_runs do |t| t.string :name t.boolean :success t.float :execution_time @@ -9,6 +9,6 @@ class CreateRakeControlRuns < ActiveRecord::Migration end def self.down - drop_table :rake_control_runs + drop_table :burden_runs end end diff --git a/lib/rake/task.rb b/lib/rake/task.rb index 12e1173..9d5d73b 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -3,7 +3,7 @@ module Rake alias_method :original_execute, :execute def execute(args) - RakeControl.wrap(name, comment) do + Burden.wrap(name, comment) do original_execute(args) end end diff --git a/lib/rake_control/storage.rb b/lib/rake_control/storage.rb deleted file mode 100644 index 3e08796..0000000 --- a/lib/rake_control/storage.rb +++ /dev/null @@ -1,21 +0,0 @@ -module RakeControl - module Storage - def run - case RakeControl.config.storage - when :active_record, :activerecord - require 'rake_control/storage/active_record/run' - RakeControl::Storage::ActiveRecord::Run - when :mongoid - require 'rake_control/storage/mongoid/run' - RakeControl::Storage::Mongoid::Run - when :mongo_mapper, :mongomapper - require 'rake_control/storage/mongo_mapper/run' - RakeControl::Storage::MongoMapper::Run - else - raise Exception.new("Unknown storage: #{storage}") - end - end - - extend self - end -end diff --git a/rake_control_web/README.rdoc b/rake_control_web/README.rdoc deleted file mode 100644 index 50b0a50..0000000 --- a/rake_control_web/README.rdoc +++ /dev/null @@ -1,3 +0,0 @@ -= RakeControlWeb - -This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/rake_control_web/app/assets/stylesheets/rake_control_web/application.css b/rake_control_web/app/assets/stylesheets/rake_control_web/application.css deleted file mode 100644 index 18276fd..0000000 --- a/rake_control_web/app/assets/stylesheets/rake_control_web/application.css +++ /dev/null @@ -1,7 +0,0 @@ -/* - *= require rake_control_web/normalize - *= require rake_control_web/foundation.min - *= require_self -*/ - -a.button { margin: 0; } diff --git a/rake_control_web/app/views/layouts/rake_control_web/application.html.erb b/rake_control_web/app/views/layouts/rake_control_web/application.html.erb deleted file mode 100644 index 1808800..0000000 --- a/rake_control_web/app/views/layouts/rake_control_web/application.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - RakeControlWeb - <%= stylesheet_link_tag 'rake_control_web/application', media: 'all' %> - <%= javascript_include_tag 'rake_control_web/application' %> - <%= csrf_meta_tags %> - - -
-
-

Rake Control Dashboard

- <%= yield %> -
-
- - diff --git a/rake_control_web/lib/rake_control_web.rb b/rake_control_web/lib/rake_control_web.rb deleted file mode 100644 index fe196f3..0000000 --- a/rake_control_web/lib/rake_control_web.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "rake_control_web/engine" - -module RakeControlWeb -end diff --git a/rake_control_web/lib/rake_control_web/engine.rb b/rake_control_web/lib/rake_control_web/engine.rb deleted file mode 100644 index 4f2310f..0000000 --- a/rake_control_web/lib/rake_control_web/engine.rb +++ /dev/null @@ -1,5 +0,0 @@ -module RakeControlWeb - class Engine < ::Rails::Engine - isolate_namespace RakeControlWeb - end -end diff --git a/rake_control_web/lib/rake_control_web/version.rb b/rake_control_web/lib/rake_control_web/version.rb deleted file mode 100644 index e60d3fa..0000000 --- a/rake_control_web/lib/rake_control_web/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module RakeControlWeb - VERSION = "0.0.1" -end diff --git a/rake_control_web/lib/tasks/rake_control_web_tasks.rake b/rake_control_web/lib/tasks/rake_control_web_tasks.rake deleted file mode 100644 index 1df556a..0000000 --- a/rake_control_web/lib/tasks/rake_control_web_tasks.rake +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :rake_control_web do -# # Task goes here -# end diff --git a/rake_control_web/spec/dummy/config/routes.rb b/rake_control_web/spec/dummy/config/routes.rb deleted file mode 100644 index 90a6589..0000000 --- a/rake_control_web/spec/dummy/config/routes.rb +++ /dev/null @@ -1,3 +0,0 @@ -Rails.application.routes.draw do - mount RakeControlWeb::Engine => "/rake_control" -end diff --git a/rake_control_web/spec/dummy/log/.gitkeep b/rake_control_web/spec/dummy/log/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/spec/rake_control/wrapper_spec.rb b/spec/burden/wrapper_spec.rb similarity index 83% rename from spec/rake_control/wrapper_spec.rb rename to spec/burden/wrapper_spec.rb index cd6dcf6..1f9a956 100644 --- a/spec/rake_control/wrapper_spec.rb +++ b/spec/burden/wrapper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RakeControl::Wrapper do +describe Burden::Wrapper do before :all do Rake::Task.define_task('dummy_task'){} Rake::Task['dummy_task'].invoke diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5629441..9b6bcf1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -require 'rake_control' +require 'burden' RSpec.configure do |config| config.formatter = :progress