rake_shared_context 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 540d4bb67b90a4e0a99f57fb9e54e8f26e7367ac
4
- data.tar.gz: 6750961980f922a5638c7d972d3fd9258fc1e363
3
+ metadata.gz: 8c72ff2a079b8640c1bdc3288817611acc076322
4
+ data.tar.gz: cb4f19d675841486ee369623599882d430f38d0b
5
5
  SHA512:
6
- metadata.gz: e15b1ee057434a31ba2a3f41e8610049e1f11193e9a28a4f0b026db27b4845d3d840c187e6ded2dda4df1c7dad1ee0a40cc8a64e359db8a041837ade9a526320
7
- data.tar.gz: 57248665d7922aae8f6086a983dfbf76ed1b4d60bfb5937693612aa2cd726e8479ffdaeb44cf5b777b002eb28e8e975927ce4113010a38630d65914d146a1a7d
6
+ metadata.gz: 79f310beb62ae11c216c950963405e40556cca3e4bdabef68fbd7fb88ffed2675ac4ad77cfcbd4aee5eee4c077dd72e2916886a556da818a576ca2d95502dc7c
7
+ data.tar.gz: 54fac40dc96293717b68b27703a5f56f94e6fc9442d41a57f2eb70cdc1fbaa53e31829e0b94c345106ae297bda194f0a1d8b8d305d5ab368cf93e06a1b815bdb
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .ruby-style.yml
@@ -0,0 +1,243 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "vendor/**/*"
4
+ - "db/schema.rb"
5
+ UseCache: false
6
+ Style/CollectionMethods:
7
+ Description: Preferred collection methods.
8
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
9
+ Enabled: true
10
+ PreferredMethods:
11
+ collect: map
12
+ collect!: map!
13
+ find: detect
14
+ find_all: select
15
+ reduce: inject
16
+ Style/DotPosition:
17
+ Description: Checks the position of the dot in multi-line method calls.
18
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
19
+ Enabled: true
20
+ EnforcedStyle: trailing
21
+ SupportedStyles:
22
+ - leading
23
+ - trailing
24
+ Style/FileName:
25
+ Description: Use snake_case for source file names.
26
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
27
+ Enabled: false
28
+ Exclude: []
29
+ Style/GuardClause:
30
+ Description: Check for conditionals that can be replaced with guard clauses
31
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
32
+ Enabled: false
33
+ MinBodyLength: 1
34
+ Style/IfUnlessModifier:
35
+ Description: Favor modifier if/unless usage when you have a single-line body.
36
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
37
+ Enabled: false
38
+ MaxLineLength: 80
39
+ Style/OptionHash:
40
+ Description: Don't use option hashes when you can use keyword arguments.
41
+ Enabled: false
42
+ Style/PercentLiteralDelimiters:
43
+ Description: Use `%`-literal delimiters consistently
44
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
45
+ Enabled: false
46
+ PreferredDelimiters:
47
+ "%": "()"
48
+ "%i": "()"
49
+ "%q": "()"
50
+ "%Q": "()"
51
+ "%r": "{}"
52
+ "%s": "()"
53
+ "%w": "()"
54
+ "%W": "()"
55
+ "%x": "()"
56
+ Style/PredicateName:
57
+ Description: Check the names of predicate methods.
58
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
59
+ Enabled: true
60
+ NamePrefix:
61
+ - is_
62
+ - has_
63
+ - have_
64
+ NamePrefixBlacklist:
65
+ - is_
66
+ Exclude:
67
+ - spec/**/*
68
+ Style/RaiseArgs:
69
+ Description: Checks the arguments passed to raise/fail.
70
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
71
+ Enabled: false
72
+ EnforcedStyle: exploded
73
+ SupportedStyles:
74
+ - compact
75
+ - exploded
76
+ Style/SignalException:
77
+ Description: Checks for proper usage of fail and raise.
78
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
79
+ Enabled: false
80
+ EnforcedStyle: semantic
81
+ SupportedStyles:
82
+ - only_raise
83
+ - only_fail
84
+ - semantic
85
+ Style/SingleLineBlockParams:
86
+ Description: Enforces the names of some block params.
87
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
88
+ Enabled: false
89
+ Methods:
90
+ - reduce:
91
+ - a
92
+ - e
93
+ - inject:
94
+ - a
95
+ - e
96
+ Style/SingleLineMethods:
97
+ Description: Avoid single-line methods.
98
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
99
+ Enabled: false
100
+ AllowIfMethodIsEmpty: true
101
+ Style/StringLiterals:
102
+ Description: Checks if uses of quotes match the configured preference.
103
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
104
+ Enabled: true
105
+ EnforcedStyle: single_quotes
106
+ SupportedStyles:
107
+ - single_quotes
108
+ - double_quotes
109
+ Style/StringLiteralsInInterpolation:
110
+ Description: Checks if uses of quotes inside expressions in interpolated strings
111
+ match the configured preference.
112
+ Enabled: true
113
+ EnforcedStyle: single_quotes
114
+ SupportedStyles:
115
+ - single_quotes
116
+ - double_quotes
117
+ Style/TrailingCommaInArguments:
118
+ Description: 'Checks for trailing comma in argument lists.'
119
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
120
+ Enabled: false
121
+ EnforcedStyleForMultiline: no_comma
122
+ SupportedStyles:
123
+ - comma
124
+ - consistent_comma
125
+ - no_comma
126
+ Style/TrailingCommaInLiteral:
127
+ Description: 'Checks for trailing comma in array and hash literals.'
128
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
129
+ Enabled: false
130
+ EnforcedStyleForMultiline: no_comma
131
+ SupportedStyles:
132
+ - comma
133
+ - consistent_comma
134
+ - no_comma
135
+ Metrics/AbcSize:
136
+ Description: A calculated magnitude based on number of assignments, branches, and
137
+ conditions.
138
+ Enabled: false
139
+ Max: 15
140
+ Metrics/ClassLength:
141
+ Description: Avoid classes longer than 100 lines of code.
142
+ Enabled: false
143
+ CountComments: false
144
+ Max: 100
145
+ Metrics/ModuleLength:
146
+ CountComments: false
147
+ Max: 100
148
+ Description: Avoid modules longer than 100 lines of code.
149
+ Enabled: false
150
+ Metrics/CyclomaticComplexity:
151
+ Description: A complexity metric that is strongly correlated to the number of test
152
+ cases needed to validate a method.
153
+ Enabled: false
154
+ Max: 6
155
+ Metrics/MethodLength:
156
+ Description: Avoid methods longer than 10 lines of code.
157
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
158
+ Enabled: false
159
+ CountComments: false
160
+ Max: 10
161
+ Metrics/ParameterLists:
162
+ Description: Avoid parameter lists longer than three or four parameters.
163
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
164
+ Enabled: false
165
+ Max: 5
166
+ CountKeywordArgs: true
167
+ Metrics/PerceivedComplexity:
168
+ Description: A complexity metric geared towards measuring complexity for a human
169
+ reader.
170
+ Enabled: false
171
+ Max: 7
172
+ Lint/AssignmentInCondition:
173
+ Description: Don't use assignment in conditions.
174
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
175
+ Enabled: false
176
+ AllowSafeAssignment: true
177
+ Style/InlineComment:
178
+ Description: Avoid inline comments.
179
+ Enabled: false
180
+ Style/AccessorMethodName:
181
+ Description: Check the naming of accessor methods for get_/set_.
182
+ Enabled: false
183
+ Style/Alias:
184
+ Description: Use alias_method instead of alias.
185
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
186
+ Enabled: false
187
+ Style/Documentation:
188
+ Description: Document classes and non-namespace modules.
189
+ Enabled: false
190
+ Style/DoubleNegation:
191
+ Description: Checks for uses of double negation (!!).
192
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
193
+ Enabled: false
194
+ Style/EachWithObject:
195
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
196
+ Enabled: false
197
+ Style/EmptyLiteral:
198
+ Description: Prefer literals to Array.new/Hash.new/String.new.
199
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
200
+ Enabled: false
201
+ Style/ModuleFunction:
202
+ Description: Checks for usage of `extend self` in modules.
203
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
204
+ Enabled: false
205
+ Style/OneLineConditional:
206
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
207
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
208
+ Enabled: false
209
+ Style/PerlBackrefs:
210
+ Description: Avoid Perl-style regex back references.
211
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
212
+ Enabled: false
213
+ Style/Send:
214
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
215
+ may overlap with existing methods.
216
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
217
+ Enabled: false
218
+ Style/SpecialGlobalVars:
219
+ Description: Avoid Perl-style global variables.
220
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
221
+ Enabled: false
222
+ Style/VariableInterpolation:
223
+ Description: Don't interpolate global, instance and class variables directly in
224
+ strings.
225
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
226
+ Enabled: false
227
+ Style/WhenThen:
228
+ Description: Use when x then ... for one-line cases.
229
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
230
+ Enabled: false
231
+ Lint/EachWithObjectArgument:
232
+ Description: Check for immutable argument given to each_with_object.
233
+ Enabled: true
234
+ Lint/HandleExceptions:
235
+ Description: Don't suppress exception.
236
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
237
+ Enabled: false
238
+ Lint/LiteralInCondition:
239
+ Description: Checks of literals used in conditions.
240
+ Enabled: false
241
+ Lint/LiteralInInterpolation:
242
+ Description: Checks for literals used in interpolation.
243
+ Enabled: false
@@ -1,3 +1,7 @@
1
+ ## 0.3.0
2
+
3
+ * Load all rake tasks before suite
4
+
1
5
  ## 0.2.0
2
6
 
3
7
  * load rake files recursively
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rake_shared_context.gemspec
4
4
  gemspec
5
-
6
- gem 'coveralls', require: false
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/willnet/rake_shared_context.png)](https://travis-ci.org/willnet/rake_shared_context)
4
4
  [![Gem Version](https://badge.fury.io/rb/rake_shared_context.png)](http://badge.fury.io/rb/rake_shared_context)
5
- [![Coverage Status](https://coveralls.io/repos/willnet/rake_shared_context/badge.png)](https://coveralls.io/r/willnet/rake_shared_context)
6
5
  [![Stories in Ready](https://badge.waffle.io/willnet/rake_shared_context.png?label=ready&title=Ready)](https://waffle.io/willnet/rake_shared_context)
7
6
 
8
7
  shared_context for rake tasks.
@@ -2,7 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "coveralls", :require => false
6
5
  gem "rspec", "2.14.1"
7
6
 
8
7
  gemspec :path => "../"
@@ -2,7 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "coveralls", :require => false
6
5
  gem "rspec", "3.0.0"
7
6
 
8
7
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
- require "rake_shared_context/version"
3
- require "rake"
4
- require "pathname"
2
+ require 'rake_shared_context/version'
3
+ require 'rake'
4
+ require 'pathname'
5
5
 
6
6
  class RakeSharedContext
7
7
  class << self
@@ -34,17 +34,13 @@ class RakeSharedContext
34
34
  end
35
35
 
36
36
  begin
37
- require "rspec/core"
38
- RSpec.shared_context "rake" do
39
- let(:rake) { Rake::Application.new }
40
- let(:task_name) { self.class.top_level_description }
41
- subject { rake[task_name] }
42
-
43
- before do
37
+ require 'rspec/core'
38
+ RSpec.configure do |config|
39
+ config.before(:suite) do
40
+ Rake.application = Rake::Application.new
44
41
  loaded_files = []
45
- Rake.application = rake
46
42
  rake_dir = RakeSharedContext.rake_dir
47
- rake_files = File.join(rake_dir, "**", "*.rake")
43
+ rake_files = File.join(rake_dir, '**', '*.rake')
48
44
 
49
45
  Dir.glob(rake_files).sort.each do |task|
50
46
  filename_without_ext = File.basename(task.sub(/.rake$/, ''))
@@ -54,5 +50,11 @@ begin
54
50
  Rake::Task.define_task(:environment)
55
51
  end
56
52
  end
53
+
54
+ RSpec.shared_context 'rake' do
55
+ let(:task_name) { self.class.top_level_description }
56
+ before { Rake.application.tasks.each(&:reenable) }
57
+ subject { Rake.application[task_name] }
58
+ end
57
59
  rescue LoadError
58
60
  end
@@ -1,3 +1,3 @@
1
1
  class RakeSharedContext
2
- VERSION = "0.2.2"
2
+ VERSION = '0.3.0'
3
3
  end
@@ -16,5 +16,4 @@ Gem::Specification.new do |gem|
16
16
  gem.version = RakeSharedContext::VERSION
17
17
  gem.add_development_dependency "rake"
18
18
  gem.add_development_dependency "appraisal"
19
- gem.add_development_dependency "pry"
20
19
  end
@@ -1,19 +1,17 @@
1
1
  require 'spec_helper'
2
2
  require 'lib/report_generator'
3
3
 
4
- describe "reports:generate" do
5
- before do
6
- RakeSharedContext.root_dir = File.expand_path('..', __FILE__)
7
- end
4
+ RakeSharedContext.root_dir = File.expand_path('..', __FILE__)
8
5
 
9
- include_context "rake"
6
+ describe 'reports:generate' do
7
+ include_context 'rake'
10
8
 
11
9
  it 'prerequisites should include "environment"' do
12
10
  expect(subject.prerequisites).to include('environment')
13
11
  end
14
12
 
15
13
 
16
- it "generates the report" do
14
+ it 'generates the report' do
17
15
  expect(ReportGenerator).to receive(:generate)
18
16
  subject.invoke
19
17
  end
@@ -1,4 +1,2 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
1
  require 'rspec'
4
2
  require 'rake_shared_context'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_shared_context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - willnet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-18 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: pry
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  description: shared_context for rake task
56
42
  email:
57
43
  - netwillnet@gmail.com
@@ -60,6 +46,8 @@ extensions: []
60
46
  extra_rdoc_files: []
61
47
  files:
62
48
  - ".gitignore"
49
+ - ".hound.yml"
50
+ - ".ruby-style.yml"
63
51
  - ".travis.yml"
64
52
  - Appraisals
65
53
  - CHANGELOG.md