rf-stylez 0.5.1 → 0.7.2.pre

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: 751b7ae7cc21d09573f52bce835548439f93d2fabbd8203f5c4c771a2de01751
4
- data.tar.gz: e286ad8370c51bad6be5250a82ffc8a297ec13877a476452188beb0854653d51
3
+ metadata.gz: fd9547159d6d79a99473832c2b48ded86d113c51ce489e0ec15257f4adb33e6d
4
+ data.tar.gz: 43f177de7916e845a174c799f53839f11f7e677b3ba259da36bb15d54cdad756
5
5
  SHA512:
6
- metadata.gz: de22f3351e96f398f715640bab0392e2f98685cee66edae64a6472a0709604bc83a01b760a3612705030195c47de9a171059744ab54fe1865836e00667543c19
7
- data.tar.gz: 86a87e0d8dd195888b112cabbf52189d087d61c15fadf5e7c40f6045bc23e3d79ea589d3d87b79360beba65742fef8087ee82cac10b35494fd8e2528e2e401b3
6
+ metadata.gz: 2786840e8ddf2c394ac783f3e691fe5114200d741c2b0300aeb3adfe58dd2c52b3ddd6c2cd4320cf61440aebe8107a14021a68dba7defbe6e7c2ac1910e8648e
7
+ data.tar.gz: 74b31e7b61a5705ca76d0f86284b912e8d061aa6aa61f518724a244135b3b324561f540947e5c914503b9a667393cadb49d887ccbfe971b416608a2d6aefdd77
@@ -3,7 +3,7 @@ version: 2
3
3
  jobs:
4
4
  style_check:
5
5
  docker:
6
- - image: rainforestapp/circlemator:latest
6
+ - image: gcr.io/rf-public-images/circlemator:latest
7
7
  steps:
8
8
  - checkout
9
9
  - run:
data/README.md CHANGED
@@ -33,3 +33,8 @@ To use it you'll need to install rf-stylez locally:
33
33
  ```bash
34
34
  gem install rf-stylez
35
35
  ```
36
+
37
+ To check if you version is the latest on (for example in a git hook)
38
+ ```bash
39
+ rf-stylez check-latest
40
+ ```
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rf/stylez"
5
+
6
+ command = ARGV.first
7
+ unless command == 'check-latest'
8
+ STDERR.puts('Usage: rf-stylez check-latest')
9
+ return
10
+ end
11
+
12
+ Rf::Stylez::UpdateCheck.check
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rf/stylez/version'
4
+ require 'rf/stylez/update_check'
5
+ require 'rubocop'
4
6
  require 'rubocop/cop/lint/no_env'
5
7
  require 'rubocop/cop/lint/no_json'
6
8
  require 'rubocop/cop/lint/no_http_party'
@@ -11,6 +13,5 @@ require 'rubocop/cop/lint/no_untyped_raise'
11
13
 
12
14
  module Rf
13
15
  module Stylez
14
- # Your code goes here...
15
16
  end
16
17
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+ require 'net/http'
5
+ require 'logger'
6
+
7
+ require 'semantic_versioning'
8
+
9
+ module Rf
10
+ module Stylez
11
+ module UpdateCheck
12
+ RUBYGEMS_URL = URI('https://rubygems.org/api/v1/gems/rf-stylez.json').freeze
13
+
14
+ def self.check
15
+ logger = Logger.new(STDOUT)
16
+ current_version = SemanticVersioning::Version.new(VERSION)
17
+
18
+ remote_version = SemanticVersioning::Version.new(
19
+ JSON.parse(Net::HTTP.get(RUBYGEMS_URL))['version']
20
+ )
21
+ if current_version >= remote_version
22
+ logger.info('You are running latest rf-stylez ')
23
+ logger.info('(•_•) ( •_•)>⌐■-■ (⌐■_■)')
24
+ else
25
+ logger.warn('RF Stylez is out of date!')
26
+ logger.warn("Newest version is: #{remote_version}")
27
+ logger.warn("You are running: #{current_version}")
28
+ logger.warn('Please update: `gem update rf-stylez`')
29
+ end
30
+ rescue SocketError
31
+ logger.info('Offline, cannot check for rf-stylez updates')
32
+ end
33
+ end
34
+ end
35
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rf
4
4
  module Stylez
5
- VERSION = '0.5.1'
5
+ VERSION = '0.7.2.pre'
6
6
  end
7
7
  end
@@ -15,12 +15,15 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/rainforestapp/rf-stylez'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = 'exe'
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.bindir = 'bin'
19
+ spec.executables = ['rf-stylez']
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_runtime_dependency 'rubocop', '>= 0.59', '< 0.81'
23
23
  spec.add_runtime_dependency 'rubocop-rails', '~> 2.5.0'
24
+ spec.add_runtime_dependency 'rubocop-rspec', '~> 1.39.0'
25
+ spec.add_runtime_dependency 'get_env', '0.2.0.pre'
26
+ spec.add_runtime_dependency 'semantic_versioning', '~> 0.2'
24
27
 
25
28
  spec.add_development_dependency 'bundler', '~> 1.10'
26
29
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -18,6 +18,7 @@ inherit_from:
18
18
 
19
19
  require:
20
20
  - rf/stylez
21
+ - rubocop-rspec
21
22
 
22
23
  # Custom cops
23
24
  Lint/NoENV:
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.5.1
4
+ version: 0.7.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Evans
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-11 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -44,6 +44,48 @@ dependencies:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.5.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: rubocop-rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 1.39.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 1.39.0
61
+ - !ruby/object:Gem::Dependency
62
+ name: get_env
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '='
66
+ - !ruby/object:Gem::Version
67
+ version: 0.2.0.pre
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '='
73
+ - !ruby/object:Gem::Version
74
+ version: 0.2.0.pre
75
+ - !ruby/object:Gem::Dependency
76
+ name: semantic_versioning
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.2'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.2'
47
89
  - !ruby/object:Gem::Dependency
48
90
  name: bundler
49
91
  requirement: !ruby/object:Gem::Requirement
@@ -117,7 +159,8 @@ dependencies:
117
159
  description: Configurations for Rubocop and other style enforcers/linters
118
160
  email:
119
161
  - emanuel@rainforestqa.com
120
- executables: []
162
+ executables:
163
+ - rf-stylez
121
164
  extensions: []
122
165
  extra_rdoc_files: []
123
166
  files:
@@ -130,12 +173,12 @@ files:
130
173
  - LICENSE
131
174
  - README.md
132
175
  - Rakefile
133
- - bin/console
176
+ - bin/rf-stylez
134
177
  - bin/setup
135
178
  - lib/rf/stylez.rb
179
+ - lib/rf/stylez/update_check.rb
136
180
  - lib/rf/stylez/version.rb
137
181
  - lib/rubocop/cop/lint/no_bang_state_machine_events.rb
138
- - lib/rubocop/cop/lint/no_env.rb
139
182
  - lib/rubocop/cop/lint/no_grape_api.rb
140
183
  - lib/rubocop/cop/lint/no_http_party.rb
141
184
  - lib/rubocop/cop/lint/no_json.rb
@@ -161,9 +204,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
204
  version: '0'
162
205
  required_rubygems_version: !ruby/object:Gem::Requirement
163
206
  requirements:
164
- - - ">="
207
+ - - ">"
165
208
  - !ruby/object:Gem::Version
166
- version: '0'
209
+ version: 1.3.1
167
210
  requirements: []
168
211
  rubyforge_project:
169
212
  rubygems_version: 2.7.7
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "rf/stylez"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
@@ -1,30 +0,0 @@
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