rf-stylez 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e35201960c4f61dccd6cfe5cca8946beeb58f7c2173fb8de02e33f66141cda2
4
- data.tar.gz: bf515f81449e75aa0f31a7bd2bbd44a12cc048cbe61815863a61ab49d97e3f2b
3
+ metadata.gz: 6b3df1c229c340e1c581b417f7f9fab4634d5606c5cd22f132e2c6b42dc6270b
4
+ data.tar.gz: 04cf9acef3339e937a9c4676ec4770c749bfdac49a870939a936b7e938c39a01
5
5
  SHA512:
6
- metadata.gz: db5c9b8a5564bf4ff7640754fa1d76a001537be02b265e9414a7b92f05a4e10251a2e2457d184a6fdbdd019f2717709529fc29c66ab33d4226c2c167073c2717
7
- data.tar.gz: 3de6ddf50e6d6bfc8e5de944f101344ea8f8aa71623bd884c47c6d387ab0f04a094eb06a7ad36381a1fa5f3843130ea4b8f2cc71b52f5079262256d246fbf841
6
+ metadata.gz: 78fae2b89d5701a8397af7da2a250ff5420fd4a30ff3210971b9174c497dc11600144724ccdce207264317fa3574bc0afb10d2dfeab83d5c7eea707c799bf46a
7
+ data.tar.gz: 852ca3254c2a26ce3e30dda5fd5203fd394eccd62214d23791f81eb1c1c7ac49b27ccd5789c523ab09d1e7dc22c6ffde1adba3742fce093d987931d176c71feb
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
@@ -1,4 +1,7 @@
1
1
  require "rf/stylez/version"
2
+ require 'rubocop/cop/lint/no_env'
3
+ require 'rubocop/cop/lint/no_http_party'
4
+
2
5
 
3
6
  module Rf
4
7
  module Stylez
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Rf
3
3
  module Stylez
4
- VERSION = '0.2.10'
4
+ VERSION = '0.2.11'
5
5
  end
6
6
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Lint
6
+ # @example
7
+ # # bad
8
+ # ENV[]
9
+ #
10
+ # # bad
11
+ # ENV.fetch(..)
12
+ #
13
+ # # good
14
+ # GetEnv[]
15
+ #
16
+ # # good
17
+ # GetEnv.fetch(...)
18
+ class NoENV < Cop
19
+ MSG = 'Use `GetEnv` instead of `ENV`.'.freeze
20
+
21
+ def_node_matcher :is_ENV?, '(const nil? :ENV)'
22
+
23
+ def on_const(node)
24
+ return unless is_ENV?(node)
25
+ add_offense(node)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Lint
6
+ # @example
7
+ # # bad
8
+ # ENV[]
9
+ #
10
+ # # bad
11
+ # ENV.fetch(..)
12
+ #
13
+ # # good
14
+ # GetEnv[]
15
+ #
16
+ # # good
17
+ # GetEnv.fetch(...)
18
+ class NoHTTParty < Cop
19
+ MSG = 'Prefer `TimedRequest` instead of raw `HTTParty` calls.'.freeze
20
+
21
+ def_node_matcher :is_HTTParty?, '(send (const nil? :HTTParty) ...)'
22
+
23
+ def on_send(node)
24
+ return unless is_HTTParty?(node)
25
+ add_offense(node)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.10'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '>= 3.4'
26
27
  end
@@ -16,6 +16,14 @@ AllCops:
16
16
  inherit_from:
17
17
  ./rubocop_lint.yml
18
18
 
19
+ require:
20
+ - rf/stylez
21
+
22
+ Lint/NoENV:
23
+ Enabled: true
24
+ Lint/NoHTTParty:
25
+ Enabled: true
26
+
19
27
  # Good style cops
20
28
  Layout/BlockAlignment:
21
29
  Enabled: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rf-stylez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Evans
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-14 00:00:00.000000000 Z
11
+ date: 2018-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '3.4'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '3.4'
55
69
  description: Configurations for Rubocop and other style enforcers/linters
56
70
  email:
57
71
  - emanuel@rainforestqa.com
@@ -61,6 +75,7 @@ extra_rdoc_files: []
61
75
  files:
62
76
  - ".circleci/config.yml"
63
77
  - ".gitignore"
78
+ - ".rspec"
64
79
  - ".travis.yml"
65
80
  - Gemfile
66
81
  - LICENSE
@@ -70,6 +85,8 @@ files:
70
85
  - bin/setup
71
86
  - lib/rf/stylez.rb
72
87
  - lib/rf/stylez/version.rb
88
+ - lib/rubocop/cop/lint/no_env.rb
89
+ - lib/rubocop/cop/lint/no_http_party.rb
73
90
  - rf-stylez.gemspec
74
91
  - ruby/rubocop.yml
75
92
  - ruby/rubocop_lint.yml