Skip to content

Commit

Permalink
Configure application.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdeoliveira committed Jan 25, 2015
1 parent 63bdc9b commit 802dea9
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 43 deletions.
2 changes: 0 additions & 2 deletions .rspec

This file was deleted.

10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Metrics/LineLength:
Max: 120
Style/AndOr:
EnforcedStyle: conditionals
Style/HashSyntax:
EnforcedStyle: ruby19
Style/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: false
Style/StringLiterals:
EnforcedStyle: double_quotes
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.0
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
language: ruby
rvm:
- 2.2.0
- ruby-head
- 2.2
- 2.1
- 2.0
- 1.9.3
- 1.9.2
- jruby-head
- jruby-1.7
- rbx
bundler_args: "--without development"
20 changes: 17 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in extensible.gemspec
source "https://rubygems.org"
gemspec

group :development do
gem "byebug"
gem "guard-rspec"
gem "guard-rubocop"
gem "libnotify"
gem "pry"
gem "rubocop"
end

group :development, :test do
gem "codeclimate-test-reporter"
gem "rake"
gem "rspec"
gem "simplecov"
end
12 changes: 12 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
guard :rubocop, all_on_start: false do
watch(/^.+\.rb$/)
watch(/^(?:.+\/)?\.rubocop\.yml$/) {|m| File.dirname(m[0]) }
watch(/^(?:.+\/)?.+\.gemspec$/)
watch(/^(?:.+\/)?(?:Gem|Rake)file$/)
end

guard :rspec, cmd: "bundle exec rspec -fd" do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }
watch("spec/spec_helper.rb") { "spec" }
end
7 changes: 5 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)
Dir[File.join(File.dirname(__FILE__), "tasks", "**", "*.rb")].each do |file|
require file
end

task :default => :spec
RSpec::Core::RakeTask.new(:spec)

task default: :coverage
31 changes: 13 additions & 18 deletions extensible.gemspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'extensible/version'
require "extensible/version"

Gem::Specification.new do |spec|
spec.name = "extensible"
spec.version = Extensible::VERSION
spec.authors = ["Gabriel de Oliveira"]
spec.email = ["[email protected]"]
spec.summary = %q{TODO: Write a short summary. Required.}
spec.description = %q{TODO: Write a longer description. Optional.}
spec.homepage = ""
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.name = "extensible"
spec.version = Extensible::VERSION
spec.authors = ["Gabriel de Oliveira"]
spec.email = ["[email protected]"]
spec.summary = "Create extensible extensions."
spec.description = "Create extensible extensions."
spec.homepage = "https://github.com/gdeoliveira/extensible"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(/^spec\//)
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec"
spec.rdoc_options << "--title=Extensible"
end
4 changes: 0 additions & 4 deletions lib/extensible.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
require "extensible/version"

module Extensible
# Your code goes here...
end
2 changes: 2 additions & 0 deletions lib/extensible/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
##
# TODO: Write documentation.
module Extensible
VERSION = "0.0.1"
end
4 changes: 4 additions & 0 deletions spec/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
inherit_from:
- ../.rubocop.yml
Metrics/LineLength:
Max: 140
11 changes: 0 additions & 11 deletions spec/extensible_spec.rb

This file was deleted.

5 changes: 5 additions & 0 deletions spec/lib/extensible/version_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "spec_helper"

describe Extensible::VERSION do
it { should_not be_nil }
end
23 changes: 21 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'extensible'
unless ENV["COVERAGE"].nil?
require "codeclimate-test-reporter"
SimpleCov.start do
formatter SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
CodeClimate::TestReporter::Formatter
]
add_filter "/spec/"
end
end

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "extensible"

RSpec.configure do |config|
config.color = true
config.order = :rand
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
25 changes: 25 additions & 0 deletions tasks/console.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
desc "Open a console with the #{Bundler::GemHelper.gemspec.name} gem loaded"
task :console do
require Bundler::GemHelper.gemspec.name

if RUBY_VERSION >= "2"
begin
require "byebug"
rescue LoadError # rubocop:disable Lint/HandleExceptions
end
else
begin
require "debugger"
rescue LoadError # rubocop:disable Lint/HandleExceptions
end
end

begin
require "pry"
Pry.start
rescue LoadError
require "irb"
ARGV.clear
IRB.start
end
end
5 changes: 5 additions & 0 deletions tasks/coverage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
desc "Run tests and generate coverage report"
task :coverage do
ENV["COVERAGE"] = "true"
Rake::Task[:spec].invoke
end

0 comments on commit 802dea9

Please sign in to comment.