Apply bundler gem template recommendations

This commit is contained in:
Dzmitry Plashchynski
2015-04-11 18:44:51 +03:00
parent a11a8985c3
commit aaa8bc40e5
11 changed files with 75 additions and 42 deletions

12
.gitignore vendored
View File

@@ -1,4 +1,8 @@
pkg/* /.bundle/
*.gem /.yardoc
.bundle /_yardoc/
tmp/*.sqlite3 /coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

2
.rspec
View File

@@ -1,2 +1,2 @@
--color
--format documentation --format documentation
--color

View File

@@ -1,2 +1,4 @@
source "https://rubygems.org" source 'https://rubygems.org'
# Specify your gem's dependencies in crono.gemspec
gemspec gemspec

View File

@@ -27,12 +27,9 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
arel (6.0.0) arel (6.0.0)
builder (3.2.2) builder (3.2.2)
byebug (3.5.1) byebug (4.0.5)
columnize (~> 0.8) columnize (= 0.9.0)
debugger-linecache (~> 1.2)
slop (~> 3.6)
columnize (0.9.0) columnize (0.9.0)
debugger-linecache (1.2.0)
diff-lcs (1.2.5) diff-lcs (1.2.5)
globalid (0.3.3) globalid (0.3.3)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
@@ -51,7 +48,7 @@ GEM
rspec-core (~> 3.2.0) rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0) rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0) rspec-mocks (~> 3.2.0)
rspec-core (3.2.1) rspec-core (3.2.2)
rspec-support (~> 3.2.0) rspec-support (~> 3.2.0)
rspec-expectations (3.2.0) rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
@@ -64,7 +61,6 @@ GEM
rack (~> 1.4) rack (~> 1.4)
rack-protection (~> 1.4) rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4) tilt (~> 1.3, >= 1.3.4)
slop (3.6.0)
sqlite3 (1.3.10) sqlite3 (1.3.10)
thread_safe (0.3.5) thread_safe (0.3.5)
tilt (1.4.1) tilt (1.4.1)

View File

@@ -1,5 +1,4 @@
require 'bundler' require 'bundler/gem_tasks'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec') RSpec::Core::RakeTask.new('spec')

14
bin/console Executable file
View File

@@ -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

7
bin/setup Normal file
View File

@@ -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

View File

@@ -1,32 +1,34 @@
# -*- encoding: utf-8 -*- # coding: utf-8
require File.expand_path('../lib/crono/version', __FILE__) lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'crono/version'
Gem::Specification.new do |s| Gem::Specification.new do |spec|
s.name = 'crono' spec.name = 'crono'
s.version = Crono::VERSION spec.version = Crono::VERSION
s.authors = ['Dzmitry Plashchynski'] spec.authors = ['Dzmitry Plashchynski']
s.email = ['plashchynski@gmail.com'] spec.email = ['plashchynski@gmail.com']
s.homepage = 'https://github.com/plashchynski/crono'
s.description = s.summary = 'Job scheduler for Rails'
s.license = 'Apache-2.0'
s.required_rubygems_version = '>= 1.3.6' spec.summary = 'Job scheduler for Rails'
s.rubyforge_project = 'crono' 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' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
s.add_runtime_dependency 'activesupport', '~> 4.0' spec.bindir = 'exe' # http://bundler.io/blog/2015/03/20/moving-bins-to-exe.html
s.add_runtime_dependency 'activerecord', '~> 4.0' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
s.add_development_dependency 'rake', '~> 10.0' spec.require_paths = ['lib']
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'
s.files = `git ls-files`.split("\n") spec.add_runtime_dependency 'activejob', '~> 4.0'
s.executables = ['crono'] spec.add_runtime_dependency 'activesupport', '~> 4.0'
s.require_path = 'lib' 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 end

7
spec/crono_spec.rb Normal file
View File

@@ -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

View File

@@ -1,6 +1,8 @@
require 'bundler/setup' require 'bundler/setup'
Bundler.setup Bundler.setup
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'timecop' require 'timecop'
require 'byebug' require 'byebug'
require 'crono' require 'crono'