diff --git a/.gitignore b/.gitignore index 673611c..9106b2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ -pkg/* -*.gem -.bundle -tmp/*.sqlite3 +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/.rspec b/.rspec index 16f9cdb..8c18f1a 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,2 @@ ---color --format documentation +--color diff --git a/Gemfile b/Gemfile index 3be9c3c..5ceccb9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,4 @@ -source "https://rubygems.org" +source 'https://rubygems.org' + +# Specify your gem's dependencies in crono.gemspec gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 470d221..75ee1a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,12 +27,9 @@ GEM tzinfo (~> 1.1) arel (6.0.0) builder (3.2.2) - byebug (3.5.1) - columnize (~> 0.8) - debugger-linecache (~> 1.2) - slop (~> 3.6) + byebug (4.0.5) + columnize (= 0.9.0) columnize (0.9.0) - debugger-linecache (1.2.0) diff-lcs (1.2.5) globalid (0.3.3) activesupport (>= 4.1.0) @@ -51,7 +48,7 @@ GEM rspec-core (~> 3.2.0) rspec-expectations (~> 3.2.0) rspec-mocks (~> 3.2.0) - rspec-core (3.2.1) + rspec-core (3.2.2) rspec-support (~> 3.2.0) rspec-expectations (3.2.0) diff-lcs (>= 1.2.0, < 2.0) @@ -64,7 +61,6 @@ GEM rack (~> 1.4) rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) - slop (3.6.0) sqlite3 (1.3.10) thread_safe (0.3.5) tilt (1.4.1) diff --git a/Rakefile b/Rakefile index 6365b91..557acc6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,4 @@ -require 'bundler' -Bundler::GemHelper.install_tasks +require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new('spec') diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..db0b023 --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "crono" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start diff --git a/bin/setup b/bin/setup new file mode 100644 index 0000000..b65ed50 --- /dev/null +++ b/bin/setup @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +bundle install + +# Do any other automated setup that you need to do here diff --git a/crono.gemspec b/crono.gemspec index 43a5672..00abee7 100644 --- a/crono.gemspec +++ b/crono.gemspec @@ -1,32 +1,34 @@ -# -*- encoding: utf-8 -*- -require File.expand_path('../lib/crono/version', __FILE__) +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'crono/version' -Gem::Specification.new do |s| - s.name = 'crono' - s.version = Crono::VERSION - s.authors = ['Dzmitry Plashchynski'] - s.email = ['plashchynski@gmail.com'] - s.homepage = 'https://github.com/plashchynski/crono' - s.description = s.summary = 'Job scheduler for Rails' - s.license = 'Apache-2.0' +Gem::Specification.new do |spec| + spec.name = 'crono' + spec.version = Crono::VERSION + spec.authors = ['Dzmitry Plashchynski'] + spec.email = ['plashchynski@gmail.com'] - s.required_rubygems_version = '>= 1.3.6' - s.rubyforge_project = 'crono' + spec.summary = 'Job scheduler for Rails' + spec.description = 'A time-based background job scheduler daemon (just like Cron) for Rails' + spec.homepage = 'https://github.com/plashchynski/crono' + spec.license = 'Apache-2.0' - s.add_runtime_dependency 'activejob', '~> 4.0' - s.add_runtime_dependency 'activesupport', '~> 4.0' - s.add_runtime_dependency 'activerecord', '~> 4.0' - s.add_development_dependency 'rake', '~> 10.0' - s.add_development_dependency 'bundler', '>= 1.0.0' - s.add_development_dependency 'rspec', '~> 3.0' - s.add_development_dependency 'timecop', '~> 0.7' - s.add_development_dependency 'sqlite3' - s.add_development_dependency 'byebug' - s.add_development_dependency 'sinatra' - s.add_development_dependency 'haml' - s.add_development_dependency 'rack-test' + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = 'exe' # http://bundler.io/blog/2015/03/20/moving-bins-to-exe.html + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] - s.files = `git ls-files`.split("\n") - s.executables = ['crono'] - s.require_path = 'lib' + spec.add_runtime_dependency 'activejob', '~> 4.0' + spec.add_runtime_dependency 'activesupport', '~> 4.0' + spec.add_runtime_dependency 'activerecord', '~> 4.0' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'bundler', '>= 1.0.0' + spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'timecop', '~> 0.7' + spec.add_development_dependency 'sqlite3' + spec.add_development_dependency 'byebug' + spec.add_development_dependency 'sinatra' + spec.add_development_dependency 'haml' + spec.add_development_dependency 'rack-test' end diff --git a/bin/crono b/exe/crono similarity index 100% rename from bin/crono rename to exe/crono diff --git a/spec/crono_spec.rb b/spec/crono_spec.rb new file mode 100644 index 0000000..8ae5011 --- /dev/null +++ b/spec/crono_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe Crono do + it 'has a version number' do + expect(Crono::VERSION).not_to be nil + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 885319d..c528a41 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,8 @@ require 'bundler/setup' Bundler.setup +$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) + require 'timecop' require 'byebug' require 'crono'