Skip to content

Commit

Permalink
Merge 4a42eac into f27d4f3
Browse files Browse the repository at this point in the history
  • Loading branch information
0exp committed May 25, 2019
2 parents f27d4f3 + 4a42eac commit 207bfe7
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit_gem:

AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6

Naming/MemoizedInstanceVariableName:
Enabled: false
23 changes: 8 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
language: ruby

sudo: false

rvm:
- 2.3
- 2.4
- 2.5
- ruby-head

before_install: gem install bundler

env: SUITE="rspec"

script: bundle exec $SUITE

matrix:
fast_finish: true
# Only run RuboCop on the latest Ruby
include:
- rvm: 2.5
env: SUITE="rubocop"
- rvm: 2.3
- rvm: 2.4
- rvm: 2.5
- rvm: 2.6
- rvm: 2.6 # Only run RuboCop on the latest Ruby
env: SUITE="rubocop"
- rvm: ruby-head
allow_failures:
- rvm: ruby-head
- rvm: ruby-head
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Yuri Smirnov
Copyright (c) 2017-2019 Yuri Smirnov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 14 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rubocop"
require "rubocop-rspec"
require "rubocop-performance"
require "rubocop/rake_task"

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new(:rubocop) do |t|
config_path = File.expand_path(File.join(".rubocop.yml"), __dir__)

task default: :spec
t.options = ["--config", config_path]
t.requires << "rubocop-rspec"
t.requires << "rubocop-performance"
end

RSpec::Core::RakeTask.new(:rspec)

task default: :rspec
8 changes: 8 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'polist'

require 'pry'
Pry.start
4 changes: 2 additions & 2 deletions lib/polist/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def call; end

def run(&block)
call(&block)
rescue self.class::Failure => error
@response = error.response
rescue self.class::Failure => e
@response = e.response
@failure = true
end

Expand Down
19 changes: 10 additions & 9 deletions polist.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "polist/version"

Gem::Specification.new do |spec|
spec.name = "polist"
spec.version = Polist::VERSION
spec.authors = ["Yuri Smirnov"]
spec.email = ["tycooon@yandex.ru"]
spec.name = "polist"
spec.version = Polist::VERSION
spec.authors = ["Yuri Smirnov"]
spec.email = ["tycooon@yandex.ru", "oss@umbrellio.biz"]

spec.summary = "A gem for creating simple service classes and more."
spec.description = "Polist is a gem for creating simple service classes and more."
spec.homepage = "https://github.com/umbrellio/polist"
spec.license = "MIT"
spec.summary = "A gem for creating simple service classes and more."
spec.description = "Polist is a gem for creating simple service classes and more."
spec.homepage = "https://github.com/umbrellio/polist"
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
spec.require_paths = ["lib"]

spec.add_runtime_dependency "activemodel", ">= 3.0"
Expand All @@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "pry"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rubocop-config-umbrellio"
spec.add_development_dependency "simplecov"
end
4 changes: 2 additions & 2 deletions spec/polist/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def call
class ServiceWichRescueBlock < BasicService
def call
yield
rescue StandardError => error
success!(error)
rescue StandardError => e
success!(e)
end
end

Expand Down

0 comments on commit 207bfe7

Please sign in to comment.