surveymonkey-style 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4bc053ec165afeb7a7f2fbee0f31349466dc7b7f66de9bb1bf5062109718a568
4
+ data.tar.gz: e4ee65542286b7d9c5c7d4ea6de5e3786930669ed85a79098d93f9279c905fc0
5
+ SHA512:
6
+ metadata.gz: 9ae384eccca234898dfc3a41400fe711818459dbb877a01c7f417c38778908269851b4fd26afd4e46e718a1e791d2ded91806a6329f0267d8b43476d23e7ec96
7
+ data.tar.gz: edcbb052a0383a2f4a3852d277d000409f7c2462fa6ce8806b72da6fac0c775296b69f962279d22063b5f151610ad51fc0252d65b1ef4d60bc1cae6255eeae5a
@@ -0,0 +1,16 @@
1
+ version: 1
2
+ update_configs:
3
+ # Update your Gemfile (& lockfiles) as soon as
4
+ # new versions are published to the RubyGems registry
5
+ - package_manager: 'ruby:bundler'
6
+ directory: '/'
7
+ update_schedule: 'live'
8
+
9
+ default_reviewers:
10
+ # TODO: We need to create a getfeedback/ruby-libraries team
11
+ - 'mdeering'
12
+ default_labels:
13
+ - 'Dependencies'
14
+ - 'Dependabot'
15
+
16
+ # To learn more about this config file, visit: https://dependabot.com/docs/config-file/
@@ -0,0 +1,38 @@
1
+ name: Default rake tasks
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+ if: "!contains(github.event.head_commit.message, 'ci-skip')"
10
+
11
+ strategy:
12
+ matrix:
13
+ ruby: ['2.5', '2.6', '2.7']
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby ${{ matrix.ruby }}
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Install required packages
22
+ run: |
23
+ sudo apt-get update
24
+ - name: Cache gems
25
+ uses: actions/cache@v1
26
+ with:
27
+ path: vendor/bundle
28
+ key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
29
+ restore-keys: |
30
+ ${{ runner.os}}-gem-
31
+ - name: Install gems
32
+ run: |
33
+ gem install bundler
34
+ bundle config path vendor/bundle
35
+ bundle install --jobs 4 --retry 3
36
+ - name: Build, test, and lint with default Rake task
37
+ run: |
38
+ bundle exec rake
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,10 @@
1
+ inherit_gem:
2
+ surveymonkey-style:
3
+ - rubocop/performance.yml
4
+ - rubocop/rspec.yml
5
+ - rubocop/ruby.yml
6
+
7
+ RSpec/FilePath:
8
+ Exclude:
9
+ # Wants file names for SurveyMonkey to be survey_monkey
10
+ - spec/surveymonkey/**/*
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.5.3
6
+ before_install: gem install bundler -v 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ group :development do
6
+ gem 'guard-bundler', require: false
7
+ gem 'guard-rspec', require: false
8
+ gem 'guard-rubocop', require: false
9
+ gem 'guard-yardstick', require: false
10
+ end
11
+
12
+ group :test do
13
+ gem 'rspec', require: false
14
+ gem 'rubocop', require: false
15
+ gem 'rubocop-performance', require: false
16
+ gem 'rubocop-rspec', require: false
17
+ gem 'yardstick', require: false
18
+ end
19
+
20
+ gemspec
@@ -0,0 +1,109 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ surveymonkey-style (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ coderay (1.1.2)
11
+ diff-lcs (1.3)
12
+ ffi (1.12.2)
13
+ formatador (0.2.5)
14
+ guard (2.16.2)
15
+ formatador (>= 0.2.4)
16
+ listen (>= 2.7, < 4.0)
17
+ lumberjack (>= 1.0.12, < 2.0)
18
+ nenv (~> 0.1)
19
+ notiffany (~> 0.0)
20
+ pry (>= 0.9.12)
21
+ shellany (~> 0.0)
22
+ thor (>= 0.18.1)
23
+ guard-bundler (2.2.1)
24
+ bundler (>= 1.3.0, < 3)
25
+ guard (~> 2.2)
26
+ guard-compat (~> 1.1)
27
+ guard-compat (1.2.1)
28
+ guard-rspec (4.7.3)
29
+ guard (~> 2.1)
30
+ guard-compat (~> 1.1)
31
+ rspec (>= 2.99.0, < 4.0)
32
+ guard-rubocop (1.3.0)
33
+ guard (~> 2.0)
34
+ rubocop (~> 0.20)
35
+ guard-yardstick (1.0.0)
36
+ guard (>= 2.0)
37
+ guard-compat (>= 1.2)
38
+ yardstick (>= 0.9)
39
+ listen (3.2.1)
40
+ rb-fsevent (~> 0.10, >= 0.10.3)
41
+ rb-inotify (~> 0.9, >= 0.9.10)
42
+ lumberjack (1.2.4)
43
+ method_source (1.0.0)
44
+ nenv (0.3.0)
45
+ notiffany (0.1.3)
46
+ nenv (~> 0.1)
47
+ shellany (~> 0.0)
48
+ parallel (1.19.1)
49
+ parser (2.7.1.2)
50
+ ast (~> 2.4.0)
51
+ pry (0.13.1)
52
+ coderay (~> 1.1)
53
+ method_source (~> 1.0)
54
+ rainbow (3.0.0)
55
+ rake (13.0.1)
56
+ rb-fsevent (0.10.4)
57
+ rb-inotify (0.10.1)
58
+ ffi (~> 1.0)
59
+ rexml (3.2.4)
60
+ rspec (3.9.0)
61
+ rspec-core (~> 3.9.0)
62
+ rspec-expectations (~> 3.9.0)
63
+ rspec-mocks (~> 3.9.0)
64
+ rspec-core (3.9.2)
65
+ rspec-support (~> 3.9.3)
66
+ rspec-expectations (3.9.2)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.9.0)
69
+ rspec-mocks (3.9.1)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.9.0)
72
+ rspec-support (3.9.3)
73
+ rubocop (0.83.0)
74
+ parallel (~> 1.10)
75
+ parser (>= 2.7.0.1)
76
+ rainbow (>= 2.2.2, < 4.0)
77
+ rexml
78
+ ruby-progressbar (~> 1.7)
79
+ unicode-display_width (>= 1.4.0, < 2.0)
80
+ rubocop-performance (1.5.2)
81
+ rubocop (>= 0.71.0)
82
+ rubocop-rspec (1.39.0)
83
+ rubocop (>= 0.68.1)
84
+ ruby-progressbar (1.10.1)
85
+ shellany (0.0.1)
86
+ thor (1.0.1)
87
+ unicode-display_width (1.7.0)
88
+ yard (0.9.25)
89
+ yardstick (0.9.9)
90
+ yard (~> 0.8, >= 0.8.7.2)
91
+
92
+ PLATFORMS
93
+ ruby
94
+
95
+ DEPENDENCIES
96
+ guard-bundler
97
+ guard-rspec
98
+ guard-rubocop
99
+ guard-yardstick
100
+ rake
101
+ rspec
102
+ rubocop
103
+ rubocop-performance
104
+ rubocop-rspec
105
+ surveymonkey-style!
106
+ yardstick
107
+
108
+ BUNDLED WITH
109
+ 2.1.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Michael Deering
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # SurveyMonkey::Style
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ group :development, :test do
9
+ gem 'surveymonkey-style', require: false
10
+ end
11
+ ```
12
+ ## Usage
13
+
14
+ ### RuboCop
15
+
16
+ Add the following to your .rubocop.yml
17
+
18
+ ```yaml
19
+ inherit_gem:
20
+ surveymonkey-style:
21
+ - rubocop/all.yml # Includes Rails, Ruby && RSpec Cops
22
+ # - rubocop/ruby.yml # Includes Ruby && RSpec Cops
23
+ ```
24
+
25
+ ### Yardstick
26
+
27
+ Pull in the yardstick configuration options like so.
28
+
29
+ ```ruby
30
+ require 'yardstick/rake/verify'
31
+ require 'surveymonkey/style'
32
+ yardstick_options = YAML.load_file(SurveyMonkey::Style.yardstick)
33
+ Yardstick::Rake::Verify.new(:yardstick, yardstick_options)
34
+ ```
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+
5
+ require 'bundler/gem_tasks'
6
+ require 'rspec/core/rake_task'
7
+
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ require 'rubocop/rake_task'
11
+
12
+ RuboCop::RakeTask.new(:rubocop)
13
+
14
+ require 'yardstick/rake/verify'
15
+
16
+ require 'surveymonkey/style'
17
+
18
+ yardstick_options = YAML.load_file(SurveyMonkey::Style.yardstick)
19
+ Yardstick::Rake::Verify.new(:yardstick, yardstick_options)
20
+
21
+ task default: [:spec, :rubocop, :yardstick]
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'surveymonkey/style'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'surveymonkey/style/version'
4
+
5
+ module SurveyMonkey
6
+ # SurveyMonkey common code and linting settings and configurations
7
+ module Style
8
+ class Error < StandardError; end
9
+
10
+ # Path to yarstick.yml configuration
11
+ #
12
+ # @api public
13
+ #
14
+ # @example
15
+ # require 'yardstick/rake/verify'
16
+ # require 'surveymonkey/style'
17
+ # yardstick_options = YAML.load_file(SurveyMonkey::Style.yardstick)
18
+ # Yardstick::Rake::Verify.new(:yardstick, yardstick_options)
19
+ #
20
+ # @return [String]
21
+ def self.yardstick
22
+ File.expand_path('../../yardstick/.yardstick.yml', __dir__)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurveyMonkey
4
+ module Style
5
+ # Semantic versioning
6
+ module Version
7
+
8
+ MAJOR = 0
9
+ MINOR = 1
10
+ PATCH = 0
11
+ PRE_RELEASE = nil
12
+
13
+ # Current semantic version of the gem
14
+ #
15
+ # @api public
16
+ #
17
+ # @example
18
+ # "surveymonkey-style #{SurveyMonkey::Style::Version} has been loaded!"
19
+ #
20
+ # @return [string] Current semantic version of the gem
21
+ def self.to_s
22
+ [MAJOR, MINOR, PATCH, PRE_RELEASE].compact.join('.')
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ inherit_from:
2
+ - ./performance.yml
3
+ - ./rails.yml
4
+ - ./rspec.yml
5
+ - ./ruby.yml
@@ -0,0 +1 @@
1
+ require: rubocop-performance
@@ -0,0 +1,9 @@
1
+ require: rubocop-rails
2
+
3
+ Metrics/MethodLength:
4
+ Exclude:
5
+ - db/migrate/*.rb
6
+
7
+ Style/Documentation:
8
+ Exclude:
9
+ - db/migrate/*.rb
@@ -0,0 +1,10 @@
1
+ require: rubocop-rspec
2
+
3
+ Style/BlockComments:
4
+ Exclude:
5
+ - spec/spec_helper.rb
6
+
7
+ # RSpec files are basicly huge blocks of blocks
8
+ Metrics/BlockLength:
9
+ Exclude:
10
+ - spec/**/*_spec.rb
@@ -0,0 +1,41 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ NewCops: enable
4
+
5
+ Layout/CaseIndentation:
6
+ EnforcedStyle: end
7
+
8
+ # Whitespace is never a bad thing
9
+ Layout/EmptyLinesAroundBlockBody:
10
+ Enabled: false
11
+
12
+ # Whitespace is never a bad thing
13
+ Layout/EmptyLinesAroundClassBody:
14
+ Enabled: false
15
+
16
+ # Whitespace is never a bad thing
17
+ Layout/EmptyLinesAroundMethodBody:
18
+ Enabled: false
19
+
20
+ # Whitespace is never a bad thing
21
+ Layout/EmptyLinesAroundModuleBody:
22
+ Enabled: false
23
+
24
+ Layout/HashAlignment:
25
+ EnforcedColonStyle: table
26
+ EnforcedHashRocketStyle: table
27
+
28
+ Layout/LineLength:
29
+ # Chosen the value of 125 as that is the width GitHub/GitLab provide
30
+ # before you need to do any horizontal scrolling
31
+ Max: 125
32
+
33
+ # SymbolArrays are jarring to anyone coming from any other language. What are you gaining
34
+ # anyway with %i[foo bar baz] VS [:foo, :bar, :baz]? Street cred../
35
+ Style/SymbolArray:
36
+ EnforcedStyle: brackets
37
+
38
+ # WordArray are jarring to anyone coming from any other language. What are you gaining
39
+ # anyway with %w[foo bar baz] VS ['foo', 'bar', 'baz']? Street cred../
40
+ Style/WordArray:
41
+ EnforcedStyle: brackets
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/surveymonkey/style/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'surveymonkey-style'
7
+ spec.version = SurveyMonkey::Style::Version
8
+ spec.authors = ['Michael Deering']
9
+ spec.email = ['mdeering@mdeering.com']
10
+
11
+ spec.summary = 'SurveyMonkey coding standards'
12
+ spec.description = 'Set of common SurveyMonkey coding and linting settings and configurations'
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_development_dependency 'rake'
25
+ end
@@ -0,0 +1,10 @@
1
+ ---
2
+ rules:
3
+ APITag::Presence:
4
+ enabled: false
5
+ ApiTag::Inclusion:
6
+ enabled: false
7
+ ApiTag::ProtectedMethod:
8
+ enabled: false
9
+ ApiTag::PrivateMethod:
10
+ enabled: false
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: surveymonkey-style
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Michael Deering
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Set of common SurveyMonkey coding and linting settings and configurations
28
+ email:
29
+ - mdeering@mdeering.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".dependabot/config.yml"
35
+ - ".github/workflows/rake.yml"
36
+ - ".gitignore"
37
+ - ".rspec"
38
+ - ".rubocop.yml"
39
+ - ".travis.yml"
40
+ - Gemfile
41
+ - Gemfile.lock
42
+ - LICENSE.txt
43
+ - README.md
44
+ - Rakefile
45
+ - bin/console
46
+ - bin/setup
47
+ - lib/surveymonkey/style.rb
48
+ - lib/surveymonkey/style/version.rb
49
+ - rubocop/all.yml
50
+ - rubocop/performance.yml
51
+ - rubocop/rails.yml
52
+ - rubocop/rspec.yml
53
+ - rubocop/ruby.yml
54
+ - surveymonkey-style.gemspec
55
+ - yardstick/.yardstick.yml
56
+ homepage:
57
+ licenses: []
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 2.3.0
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 2.7.10
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: SurveyMonkey coding standards
79
+ test_files: []