safe_pusher 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.rubocop.yml +27 -0
- data/.travis.yml +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +67 -0
- data/Rakefile +11 -0
- data/exe/safepush +4 -0
- data/lib/safe_pusher.rb +23 -0
- data/lib/safe_pusher/cli.rb +56 -0
- data/lib/safe_pusher/configuration.rb +23 -0
- data/lib/safe_pusher/github_runner.rb +44 -0
- data/lib/safe_pusher/pronto_runner.rb +26 -0
- data/lib/safe_pusher/rspec_runner.rb +113 -0
- data/lib/safe_pusher/version.rb +3 -0
- data/safe_pusher.gemspec +50 -0
- metadata +206 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a393bfe7d3b0eac0338cd195e70ddeb03cde5258
|
4
|
+
data.tar.gz: beb885ef4baa56d3c67ea09892f1110b10af173d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 764bf9962de643da514ea84bd2feec8021a694edb5068816ab7549a913c9f8490693f6490587bf83bc88375308a2bc66de04f4f2e9e1f10414b3d83875428e50
|
7
|
+
data.tar.gz: 926e57c52dfc1564eaed87abc282ac5abf80412a6f0257562ab8ffb53ac01ed2e8a6a16e283588277686d2b9f22ebe26ebf79618f49cbcdd5cfcd453ae918608
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
inherit_gem:
|
2
|
+
fashion_police:
|
3
|
+
- .rubocop.yml
|
4
|
+
|
5
|
+
# Deactivate rule that makes `lambda` mandatory in defavor of `->`
|
6
|
+
# when having blocks.
|
7
|
+
Style/Lambda:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
# Do not verify empty lines around blocks in specs
|
11
|
+
Layout/EmptyLinesAroundBlockBody:
|
12
|
+
Exclude:
|
13
|
+
- spec/**/*
|
14
|
+
|
15
|
+
# Allow using normal test doubles, since they are useful for mocking.
|
16
|
+
# See https://github.com/KissKissBankBank/fashion_police/pull/34
|
17
|
+
RSpec/VerifiedDoubles:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
# Allow 5 nesting groups for context
|
21
|
+
RSpec/NestedGroups:
|
22
|
+
Max: 5
|
23
|
+
|
24
|
+
# Enable long blocs for Gemspec files
|
25
|
+
Metrics/BlockLength:
|
26
|
+
Exclude:
|
27
|
+
- safe_pusher.gemspec
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at william.pollet@kisskissbankbank.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 William Pollet
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# SafePusher
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.com/williampollet/safe_pusher.svg?branch=master)](https://travis-ci.com/williampollet/safe_pusher)
|
4
|
+
|
5
|
+
Run your favorite linters and specs on the files you touched, before pushing your branch
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'safe_pusher'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install safe_pusher
|
22
|
+
|
23
|
+
|
24
|
+
To use the gem fully, you should install [pronto](https://github.com/prontolabs/pronto) and [rspec](https://github.com/rspec/rspec) first.
|
25
|
+
|
26
|
+
## Configuration
|
27
|
+
|
28
|
+
Generate the `binstubs` for `pronto` and `rspec`:
|
29
|
+
|
30
|
+
$ bundler binstubs pronto
|
31
|
+
$ bundler binstubs rspec-core
|
32
|
+
|
33
|
+
create the `safe_pusher.yml` file at the root of your application
|
34
|
+
|
35
|
+
```yaml
|
36
|
+
files_to_skip:
|
37
|
+
- file/to/skip_1
|
38
|
+
- file/to/skip/2
|
39
|
+
app_base_directory: app
|
40
|
+
repo_url: https://github.com/williampollet/safe_pusher
|
41
|
+
```
|
42
|
+
|
43
|
+
## Usage
|
44
|
+
|
45
|
+
To see the commands available, type:
|
46
|
+
|
47
|
+
$ safepush
|
48
|
+
|
49
|
+
To run pronto checks before to push on github run:
|
50
|
+
|
51
|
+
$ safepush ppush
|
52
|
+
|
53
|
+
To run specs and pronto before to push on github run:
|
54
|
+
|
55
|
+
$ safepush ppushtest
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/safe_pusher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
64
|
+
|
65
|
+
## Code of Conduct
|
66
|
+
|
67
|
+
Everyone interacting in the SafePusher project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/safe_pusher/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/exe/safepush
ADDED
data/lib/safe_pusher.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'safe_pusher/configuration'
|
2
|
+
require 'thor'
|
3
|
+
require 'colorize'
|
4
|
+
require 'safe_pusher/cli'
|
5
|
+
require 'safe_pusher/version'
|
6
|
+
require 'safe_pusher/rspec_runner'
|
7
|
+
require 'safe_pusher/pronto_runner'
|
8
|
+
require 'safe_pusher/github_runner'
|
9
|
+
|
10
|
+
module SafePusher
|
11
|
+
# Configuration setup
|
12
|
+
class << self
|
13
|
+
attr_writer :configuration
|
14
|
+
|
15
|
+
def configuration
|
16
|
+
@configuration = Configuration.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def configure
|
20
|
+
yield(configuration)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module SafePusher
|
2
|
+
class CLI < Thor
|
3
|
+
desc 'prontorun', 'launch pronto with a return message'
|
4
|
+
def prontorun
|
5
|
+
puts '#######################'.yellow
|
6
|
+
puts '## Running pronto... ##'.yellow
|
7
|
+
puts '#######################'.yellow
|
8
|
+
|
9
|
+
results = SafePusher::ProntoRunner.new.call
|
10
|
+
|
11
|
+
exit results unless results == 0
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'test', 'launch the test suite with a return message'
|
15
|
+
def test
|
16
|
+
puts '##########################'.yellow
|
17
|
+
puts '## Testing new files... ##'.yellow
|
18
|
+
puts '##########################'.yellow
|
19
|
+
|
20
|
+
results = SafePusher::RspecRunner.new.call
|
21
|
+
|
22
|
+
exit results unless results == 0
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'pushandpr', 'push your code on github,'\
|
26
|
+
' and open a PR if it is the first time'
|
27
|
+
def pushandpr
|
28
|
+
puts '##########################'.yellow
|
29
|
+
puts '## Pushing to Github... ##'.yellow
|
30
|
+
puts '##########################'.yellow
|
31
|
+
|
32
|
+
results = SafePusher::GithubRunner.new.call
|
33
|
+
|
34
|
+
exit results unless results == 0
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'ptest', 'launch the test suite, then pronto if it is successful'
|
38
|
+
def ptest
|
39
|
+
invoke :test
|
40
|
+
invoke :prontorun
|
41
|
+
end
|
42
|
+
|
43
|
+
desc 'ppush', 'run your favorite linter, then push on github'
|
44
|
+
def ppush
|
45
|
+
invoke :prontorun
|
46
|
+
invoke :pushandpr
|
47
|
+
end
|
48
|
+
|
49
|
+
desc 'ppushtest', 'run your favorite linters and tests, then push on github'
|
50
|
+
def ppushtest
|
51
|
+
invoke :test
|
52
|
+
invoke :prontorun
|
53
|
+
invoke :pushandpr
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
# Configuration variables and defaults
|
3
|
+
module SafePusher
|
4
|
+
class Configuration
|
5
|
+
# The configuration singleton
|
6
|
+
attr_accessor :files_to_skip,
|
7
|
+
:app_base_directory,
|
8
|
+
:repo_url
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
application_config =
|
12
|
+
if File.exist?('safe_pusher.yml')
|
13
|
+
YAML.load_file('safe_pusher.yml')
|
14
|
+
else
|
15
|
+
{}
|
16
|
+
end
|
17
|
+
|
18
|
+
@files_to_skip = application_config['files_to_skip'] || []
|
19
|
+
@app_base_directory = application_config['app_base_directory']
|
20
|
+
@repo_url = application_config['repo_url']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'English'
|
3
|
+
|
4
|
+
module SafePusher
|
5
|
+
class GithubRunner
|
6
|
+
def call
|
7
|
+
push_on_github
|
8
|
+
|
9
|
+
exit_status = $CHILD_STATUS.exitstatus
|
10
|
+
|
11
|
+
if exit_status == 128
|
12
|
+
puts 'Syncing with github...'.green
|
13
|
+
|
14
|
+
push_and_set_upstream
|
15
|
+
|
16
|
+
exit_status = $CHILD_STATUS.exitstatus
|
17
|
+
|
18
|
+
open_pull_request_url if exit_status == 0
|
19
|
+
end
|
20
|
+
|
21
|
+
exit_status
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def push_on_github
|
27
|
+
system('git push origin')
|
28
|
+
end
|
29
|
+
|
30
|
+
def push_and_set_upstream
|
31
|
+
system("git push --set-upstream origin #{branch}")
|
32
|
+
end
|
33
|
+
|
34
|
+
def open_pull_request_url
|
35
|
+
system(
|
36
|
+
"open '#{SafePusher.configuration.repo_url}/pull/new/#{branch}'",
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def branch
|
41
|
+
`git rev-parse --symbolic-full-name --abbrev-ref HEAD`.delete("\n")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'English'
|
3
|
+
|
4
|
+
module SafePusher
|
5
|
+
class ProntoRunner
|
6
|
+
def call
|
7
|
+
run_pronto
|
8
|
+
exit_status = $CHILD_STATUS.exitstatus
|
9
|
+
|
10
|
+
if exit_status != 0
|
11
|
+
warn 'Pronto found somme errors... '\
|
12
|
+
'Fix them before pushing to master!'.red
|
13
|
+
else
|
14
|
+
puts 'No errors found by pronto, go for next step!'.green
|
15
|
+
end
|
16
|
+
|
17
|
+
exit_status
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def run_pronto
|
23
|
+
system('bin/pronto run --exit-code')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'colorize'
|
2
|
+
require 'English'
|
3
|
+
|
4
|
+
module SafePusher
|
5
|
+
class RspecRunner
|
6
|
+
def initialize
|
7
|
+
@specs_to_execute = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
return 1 if list_files_to_execute == 1
|
12
|
+
|
13
|
+
run_specs
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
attr_reader :specs_to_execute
|
19
|
+
|
20
|
+
def list_files_to_execute
|
21
|
+
modified_files.map do |f|
|
22
|
+
return 1 if analyze_file(f) == 1
|
23
|
+
end.compact
|
24
|
+
end
|
25
|
+
|
26
|
+
def modified_files
|
27
|
+
`git diff --name-only #{branch} $(git merge-base #{branch} master)`
|
28
|
+
.split("\n")
|
29
|
+
.uniq
|
30
|
+
end
|
31
|
+
|
32
|
+
def analyze_file(file)
|
33
|
+
if file.match(app_base_directory) &&
|
34
|
+
!file.match(files_to_skip)
|
35
|
+
search_or_create_spec(file)
|
36
|
+
elsif file.match(/spec/) &&
|
37
|
+
!specs_to_execute.include?(file) &&
|
38
|
+
!file.match(files_to_skip)
|
39
|
+
index_file(file)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def search_or_create_spec(file)
|
44
|
+
puts "#{file} has been modified, searching for specs..."
|
45
|
+
|
46
|
+
spec_path = file.gsub(
|
47
|
+
"#{SafePusher.configuration.app_base_directory}/",
|
48
|
+
'spec/',
|
49
|
+
).gsub('.rb', '_spec.rb')
|
50
|
+
|
51
|
+
return create_new_spec(spec_path, file) unless File.exist?(spec_path)
|
52
|
+
|
53
|
+
puts "Spec found for #{file}, putting #{spec_path}"\
|
54
|
+
' in the list of specs to run'
|
55
|
+
specs_to_execute << spec_path
|
56
|
+
end
|
57
|
+
|
58
|
+
def index_file(file)
|
59
|
+
puts "#{file} modified, putting it in the list of specs to run"
|
60
|
+
specs_to_execute << file
|
61
|
+
end
|
62
|
+
|
63
|
+
def files_to_skip
|
64
|
+
Regexp.new(
|
65
|
+
SafePusher.configuration.files_to_skip.join('|').gsub('/', '\/'),
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
def run_specs
|
70
|
+
if specs_to_execute.empty?
|
71
|
+
puts 'no spec analyzed, passing to the next step'.green
|
72
|
+
return 0
|
73
|
+
end
|
74
|
+
|
75
|
+
system("bin/rspec #{specs_to_execute.join(' ')}")
|
76
|
+
|
77
|
+
exit_status = $CHILD_STATUS.exitstatus
|
78
|
+
|
79
|
+
if exit_status != 0
|
80
|
+
puts 'Oops, a spec seems to be red or empty, '\
|
81
|
+
'be sure to complete it before you push'.red
|
82
|
+
else
|
83
|
+
puts 'Every spec operational, '\
|
84
|
+
'passing to the next step!'.green
|
85
|
+
end
|
86
|
+
|
87
|
+
exit_status
|
88
|
+
end
|
89
|
+
|
90
|
+
def create_new_spec(spec_path, file_matched)
|
91
|
+
puts "no spec found for file #{file_matched},"\
|
92
|
+
" would you like to add #{spec_path}? (Yn)"
|
93
|
+
result = STDIN.gets.chomp
|
94
|
+
|
95
|
+
if result.casecmp('n') == 0
|
96
|
+
puts 'Alright, skipping the test for now!'
|
97
|
+
return 0
|
98
|
+
else
|
99
|
+
File.open(spec_path, 'w') {}
|
100
|
+
warn 'spec to write!'.red
|
101
|
+
return 1
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def branch
|
106
|
+
`git rev-parse --abbrev-ref HEAD`.delete("\n")
|
107
|
+
end
|
108
|
+
|
109
|
+
def app_base_directory
|
110
|
+
%r{#{SafePusher.configuration.app_base_directory}\/.*\.rb$}
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
data/safe_pusher.gemspec
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'safe_pusher/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'safe_pusher'
|
7
|
+
spec.version = SafePusher::VERSION
|
8
|
+
spec.authors = ['William Pollet']
|
9
|
+
spec.email = ['william.pollet@kisskissbankbank.com']
|
10
|
+
|
11
|
+
spec.summary = 'a small CLI that lints your code and'\
|
12
|
+
' run your tests before you push'
|
13
|
+
spec.homepage = 'https://github.com/williampollet/safe_pusher'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org.
|
17
|
+
# To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section
|
19
|
+
# to allow pushing to any host.
|
20
|
+
if spec.respond_to?(:metadata)
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
|
22
|
+
else
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
24
|
+
'public gem pushes.'
|
25
|
+
end
|
26
|
+
|
27
|
+
# Specify which files should be added to the gem when it is released.
|
28
|
+
# The `git ls-files -z` loads the files in the RubyGem
|
29
|
+
# that have been added into git.
|
30
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
31
|
+
`git ls-files -z`
|
32
|
+
.split("\x0")
|
33
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
end
|
35
|
+
spec.bindir = 'exe'
|
36
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ['lib']
|
38
|
+
|
39
|
+
spec.add_dependency 'colorize', '~> 0.8.1'
|
40
|
+
spec.add_dependency 'thor', '~> 0.19.4'
|
41
|
+
|
42
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
43
|
+
spec.add_development_dependency 'fashion_police', '~> 1.2'
|
44
|
+
spec.add_development_dependency 'pronto', '~> 0.9'
|
45
|
+
spec.add_development_dependency 'pronto-rubocop', '~> 0.9'
|
46
|
+
spec.add_development_dependency 'pry', '~> 0.12'
|
47
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
48
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
49
|
+
spec.add_development_dependency 'rubocop', '~> 0.60'
|
50
|
+
end
|
metadata
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: safe_pusher
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- William Pollet
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.19.4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.19.4
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.16'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.16'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fashion_police
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pronto
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.9'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.9'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pronto-rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.12'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.12'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.60'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.60'
|
153
|
+
description:
|
154
|
+
email:
|
155
|
+
- william.pollet@kisskissbankbank.com
|
156
|
+
executables:
|
157
|
+
- safepush
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".gitignore"
|
162
|
+
- ".rspec"
|
163
|
+
- ".rubocop.yml"
|
164
|
+
- ".travis.yml"
|
165
|
+
- CODE_OF_CONDUCT.md
|
166
|
+
- Gemfile
|
167
|
+
- LICENSE.txt
|
168
|
+
- README.md
|
169
|
+
- Rakefile
|
170
|
+
- bin/console
|
171
|
+
- bin/setup
|
172
|
+
- exe/safepush
|
173
|
+
- lib/safe_pusher.rb
|
174
|
+
- lib/safe_pusher/cli.rb
|
175
|
+
- lib/safe_pusher/configuration.rb
|
176
|
+
- lib/safe_pusher/github_runner.rb
|
177
|
+
- lib/safe_pusher/pronto_runner.rb
|
178
|
+
- lib/safe_pusher/rspec_runner.rb
|
179
|
+
- lib/safe_pusher/version.rb
|
180
|
+
- safe_pusher.gemspec
|
181
|
+
homepage: https://github.com/williampollet/safe_pusher
|
182
|
+
licenses:
|
183
|
+
- MIT
|
184
|
+
metadata:
|
185
|
+
allowed_push_host: https://rubygems.org/
|
186
|
+
post_install_message:
|
187
|
+
rdoc_options: []
|
188
|
+
require_paths:
|
189
|
+
- lib
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
requirements: []
|
201
|
+
rubyforge_project:
|
202
|
+
rubygems_version: 2.5.2.3
|
203
|
+
signing_key:
|
204
|
+
specification_version: 4
|
205
|
+
summary: a small CLI that lints your code and run your tests before you push
|
206
|
+
test_files: []
|