-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4174ee7
commit dc842ad
Showing
15 changed files
with
140 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
require: rubocop-rspec | ||
|
||
inherit_mode: | ||
merge: | ||
- Exclude | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.2 | ||
TargetRubyVersion: 2.4.0 | ||
NewCops: enable | ||
Exclude: | ||
- 'lib/generators/rails/templates/**/*' | ||
|
||
Style/FrozenStringLiteralComment: | ||
Exclude: | ||
- 'bin/**/*' | ||
- 'Gemfile' | ||
|
||
RSpec/NamedSubject: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
sudo: false | ||
|
||
cache: bundler | ||
|
||
language: ruby | ||
|
||
rvm: | ||
- 2.2 | ||
|
||
env: | ||
global: | ||
- CC_TEST_REPORTER_ID=26bc71f0fff96d8eafdc0e8dbe867ab6fa5c281bde2df2a10b025ca9f9e066ea | ||
|
||
before_script: | ||
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
- chmod +x ./cc-test-reporter | ||
- ./cc-test-reporter before-build | ||
- 2.4.0 | ||
|
||
script: | ||
- bundle exec rspec | ||
- bundle exec rubocop | ||
|
||
after_script: | ||
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,63 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
service_it (1.2.0) | ||
service_it (2.0.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.0) | ||
diff-lcs (1.3) | ||
docile (1.3.1) | ||
jaro_winkler (1.5.2) | ||
json (2.2.0) | ||
parallel (1.17.0) | ||
parser (2.6.3.0) | ||
ast (~> 2.4.0) | ||
ast (2.4.1) | ||
coderay (1.1.3) | ||
diff-lcs (1.4.4) | ||
method_source (1.0.0) | ||
parallel (1.20.1) | ||
parser (2.7.2.0) | ||
ast (~> 2.4.1) | ||
pry (0.13.1) | ||
coderay (~> 1.1) | ||
method_source (~> 1.0) | ||
rainbow (3.0.0) | ||
rspec (3.8.0) | ||
rspec-core (~> 3.8.0) | ||
rspec-expectations (~> 3.8.0) | ||
rspec-mocks (~> 3.8.0) | ||
rspec-core (3.8.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-expectations (3.8.3) | ||
regexp_parser (2.0.0) | ||
rexml (3.2.4) | ||
rspec (3.10.0) | ||
rspec-core (~> 3.10.0) | ||
rspec-expectations (~> 3.10.0) | ||
rspec-mocks (~> 3.10.0) | ||
rspec-core (3.10.0) | ||
rspec-support (~> 3.10.0) | ||
rspec-expectations (3.10.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-mocks (3.8.0) | ||
rspec-support (~> 3.10.0) | ||
rspec-mocks (3.10.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-support (3.8.0) | ||
rubocop (0.68.1) | ||
jaro_winkler (~> 1.5.1) | ||
rspec-support (~> 3.10.0) | ||
rspec-support (3.10.0) | ||
rubocop (1.5.1) | ||
parallel (~> 1.10) | ||
parser (>= 2.5, != 2.5.1.1) | ||
parser (>= 2.7.1.5) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 2.0) | ||
rexml | ||
rubocop-ast (>= 1.2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 1.4.0, < 1.6) | ||
ruby-progressbar (1.10.0) | ||
simplecov (0.16.1) | ||
docile (~> 1.1) | ||
json (>= 1.8, < 3) | ||
simplecov-html (~> 0.10.0) | ||
simplecov-html (0.10.2) | ||
unicode-display_width (1.5.0) | ||
unicode-display_width (>= 1.4.0, < 2.0) | ||
rubocop-ast (1.3.0) | ||
parser (>= 2.7.1.5) | ||
rubocop-rspec (2.0.1) | ||
rubocop (~> 1.0) | ||
rubocop-ast (>= 1.1.0) | ||
ruby-progressbar (1.10.1) | ||
unicode-display_width (1.7.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
rspec | ||
rubocop | ||
pry (= 0.13.1) | ||
rspec (= 3.10.0) | ||
rubocop (= 1.5.1) | ||
rubocop-rspec (= 2.0.1) | ||
service_it! | ||
simplecov | ||
|
||
BUNDLED WITH | ||
1.16.6 | ||
2.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'bundler/setup' | ||
require 'service_it' | ||
|
||
# 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(__FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ServiceIt | ||
VERSION = '1.2.0'.freeze | ||
VERSION = '2.0.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,18 +7,24 @@ Gem::Specification.new do |s| | |
s.version = ServiceIt::VERSION | ||
s.date = '2018-07-27' | ||
s.authors = ['Iago Silva'] | ||
s.email = 'iago.[email protected]' | ||
s.email = ['iago.[email protected]'] | ||
s.homepage = 'https://github.com/iago-silva/service_it' | ||
s.license = 'MIT' | ||
s.summary = 'Simple gem to keep your controllers and models slim and | ||
readable' | ||
s.description = 'Service objects are a holy grail to keep your controllers and | ||
models slim and readable' | ||
|
||
s.files = Dir['lib/**/*', '*.md'] | ||
s.test_files = Dir['spec/**/*'] | ||
s.required_ruby_version = Gem::Requirement.new('>= 2.4.0') | ||
|
||
s.add_development_dependency 'rspec' | ||
s.add_development_dependency 'rubocop' | ||
s.add_development_dependency 'simplecov' | ||
s.metadata['homepage_uri'] = s.homepage | ||
s.metadata['source_code_uri'] = s.homepage | ||
|
||
s.files = Dir['lib/**/*', '*.md'] | ||
s.test_files = Dir['spec/**/*'] | ||
|
||
s.add_development_dependency 'pry', '0.13.1' | ||
s.add_development_dependency 'rspec', '3.10.0' | ||
s.add_development_dependency 'rubocop', '1.5.1' | ||
s.add_development_dependency 'rubocop-rspec', '2.0.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
describe ServiceIt::Base do | ||
context 'when calls new method' do | ||
subject { described_class.new } | ||
|
||
it 'raises NoMethodError exception' do | ||
expect { subject }.to raise_error(NoMethodError) | ||
end | ||
end | ||
|
||
describe SayMyName do | ||
context 'when I ask what is my name' do | ||
subject { described_class.call(name: name) } | ||
|
||
let(:name) { 'Heisenberg' } | ||
|
||
it 'says Heisenberg' do | ||
expect(subject).to eq(name) | ||
end | ||
end | ||
end | ||
|
||
describe MissedPerformService do | ||
context 'when perform method is not defined' do | ||
subject { described_class.call } | ||
|
||
it 'raises NotImplementedError exception' do | ||
expect { subject }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe ServiceIt do | ||
describe SayMyName do | ||
let(:name) { 'Heisenberg' } | ||
|
||
it 'says Heisenberg' do | ||
result = SayMyName.call(name: name) | ||
expect(result).to eq(name) | ||
end | ||
end | ||
|
||
context 'when perform method is not defined' do | ||
it 'raises an NotImplementedError exception' do | ||
expect do | ||
MissedPerformService.call | ||
end.to raise_error(NotImplementedError) | ||
end | ||
it 'has a version number' do | ||
expect(ServiceIt::VERSION).not_to be nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters