rfix 1.0.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: f947e10503734c2c0d1b6e238936421ecc26e2cfe3c76d4ab8e8f1251decbfc6
4
+ data.tar.gz: 721fba6f63f05be239fbe6ebf4a9d9fe382b9bcfe0e9d4984b9cc1e94e154e7f
5
+ SHA512:
6
+ metadata.gz: 7e5383f193787321a62df2484e1668181b32904b89bc857b8ef6105918fdc740dcc9872477846eab1fcc6e1eecf1753e32c5abdf5900c4475c4b5c6de682fb9b
7
+ data.tar.gz: 012ae19245893ef39ce3563a9aec0a84fad9c34fade0c57704fc4d9822a941dd556b7e37528b0f55578aef8814817d0de69fd485d064944f8c8ee1727ebd3995
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ build
3
+ .vagrant
4
+ .DS_Store
5
+ .bundle
6
+
7
+ .starscope.db
8
+ cscope.out
9
+ tags
10
+
11
+ .byebug_history
12
+
13
+ .rubocop-*
14
+ doc
15
+ vendor/*
16
+ tmp/*
17
+ .rspec_status
18
+ pkg/*.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require spec_helper
3
+ --format doc
@@ -0,0 +1,68 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'Rakefile'
4
+ - 'Gemfile'
5
+ - 'bin/*'
6
+ - 'vendor/bundle/**/*'
7
+ - 'db/**/*'
8
+ - 'node_modules/**/*'
9
+ - 'spec/rails_helper.rb'
10
+ - 'lib/tasks/*'
11
+
12
+ Layout/LineLength:
13
+ Max: 120
14
+ Exclude:
15
+ - 'config/**/*'
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'config/**/*'
20
+ - 'spec/**/*'
21
+ - 'lib/tasks/*'
22
+ - 'lib/capistrano/**/*'
23
+
24
+ Metrics/ClassLength:
25
+ Max: 150
26
+ Exclude:
27
+ - 'config/**/*'
28
+
29
+ Metrics/MethodLength:
30
+ Enabled: false
31
+
32
+ Metrics/AbcSize:
33
+ Enabled: false
34
+
35
+ Style/Documentation:
36
+ Enabled: false
37
+
38
+ Style/FrozenStringLiteralComment:
39
+ Enabled: false
40
+
41
+ Style/HashEachMethods:
42
+ Enabled: true
43
+
44
+ Style/HashTransformKeys:
45
+ Enabled: true
46
+
47
+ Style/HashTransformValues:
48
+ Enabled: true
49
+
50
+ Style/NumericLiterals:
51
+ Enabled: false
52
+
53
+ Style/ClassAndModuleChildren:
54
+ Enabled: false
55
+ Lint/AssignmentInCondition:
56
+ Enabled: false
57
+ Style/MultilineBlockChain:
58
+ Enabled: false
59
+ Style/StringLiterals:
60
+ EnforcedStyle: double_quotes
61
+ Layout/MultilineAssignmentLayout:
62
+ EnforcedStyle: new_line
63
+ Style/GuardClause:
64
+ Enabled: false
65
+ Style/AsciiComments:
66
+ Enabled: false
67
+ Style/ConditionalAssignment:
68
+ EnforcedStyle: assign_inside_condition
@@ -0,0 +1,30 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.5.0
4
+ - 2.6.2
5
+ - 2.7.1
6
+ os:
7
+ - osx
8
+ - linux
9
+ gemfile:
10
+ - Gemfile
11
+ - ci/Gemfile.rubocop-0.80
12
+ - ci/Gemfile.rubocop-0.81
13
+ - ci/Gemfile.rubocop-0.82
14
+ - ci/Gemfile.rubocop-0.83
15
+ - ci/Gemfile.rubocop-0.84
16
+ - ci/Gemfile.rubocop-0.85
17
+ - ci/Gemfile.rubocop-0.85.1
18
+ before_install:
19
+ - yes | gem update --system --force
20
+ - gem uninstall bundler
21
+ - gem install bundler -v 2.1.4
22
+ - bundle config git.allow_insecure true
23
+ install:
24
+ - bundle install
25
+ - bundle exec rake setup
26
+ - bundle exec rake git:config
27
+ script:
28
+ - bundle exec rake spec
29
+ - bundle exec rake install
30
+ - rfix --help
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ ruby '>= 2.5.0'
5
+
6
+ gemspec
7
+
8
+ gem 'aruba'
9
+ gem 'pry'
10
+ gem 'rake', '~> 12.0'
11
+ gem 'rspec', '~> 3.0'
12
+ gem 'guard', require: false
13
+ gem 'guard-rspec', require: false
14
+
15
+ gem 'cli-ui', github: 'Shopify/cli-ui', ref: 'ef976df676f4', require: false
16
+ gem 'git_fame', github: 'oleander/git-fame-rb', ref: 'a9b9c25bbab1', require: false
@@ -0,0 +1,188 @@
1
+ GIT
2
+ remote: https://github.com/Shopify/cli-ui.git
3
+ revision: ef976df676f43a80b47249ac2390d5f12b2293d1
4
+ ref: ef976df676f4
5
+ specs:
6
+ cli-ui (1.3.0)
7
+
8
+ GIT
9
+ remote: https://github.com/oleander/git-fame-rb.git
10
+ revision: a9b9c25bbab197feaee00f9a5c970998e76f636c
11
+ ref: a9b9c25bbab1
12
+ specs:
13
+ git_fame (2.5.3)
14
+ hirb (~> 0.7.3)
15
+ memoist (~> 0.14.0)
16
+ method_profiler (~> 2.0.1)
17
+ progressbar (~> 0.21.0)
18
+ scrub_rb (~> 1.0.1)
19
+ trollop (~> 2.1.2)
20
+
21
+ PATH
22
+ remote: .
23
+ specs:
24
+ rfix (1.0.0)
25
+ rainbow (~> 3.0)
26
+ rouge (~> 3.20)
27
+ rubocop (~> 0.80)
28
+
29
+ GEM
30
+ remote: https://rubygems.org/
31
+ specs:
32
+ activesupport (6.0.3.1)
33
+ concurrent-ruby (~> 1.0, >= 1.0.2)
34
+ i18n (>= 0.7, < 2)
35
+ minitest (~> 5.1)
36
+ tzinfo (~> 1.1)
37
+ zeitwerk (~> 2.2, >= 2.2.2)
38
+ aruba (1.0.1)
39
+ childprocess (~> 3.0)
40
+ contracts (~> 0.16.0)
41
+ cucumber (>= 2.4, < 5.0)
42
+ ffi (~> 1.9)
43
+ rspec-expectations (~> 3.4)
44
+ thor (~> 1.0)
45
+ ast (2.4.1)
46
+ builder (3.2.4)
47
+ childprocess (3.0.0)
48
+ coderay (1.1.3)
49
+ concurrent-ruby (1.1.6)
50
+ contracts (0.16.0)
51
+ cucumber (4.0.0)
52
+ builder (~> 3.2, >= 3.2.3)
53
+ cucumber-core (~> 7.0, >= 7.0.0)
54
+ cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
55
+ cucumber-gherkin (~> 13.0, >= 13.0.0)
56
+ cucumber-html-formatter (~> 6.0, >= 6.0.1)
57
+ cucumber-messages (~> 12.1, >= 12.1.1)
58
+ cucumber-wire (~> 3.0, >= 3.0.0)
59
+ diff-lcs (~> 1.3, >= 1.3)
60
+ multi_test (~> 0.1, >= 0.1.2)
61
+ sys-uname (~> 1.0, >= 1.0.2)
62
+ cucumber-core (7.0.0)
63
+ cucumber-gherkin (~> 13.0, >= 13.0.0)
64
+ cucumber-messages (~> 12.1, >= 12.1.1)
65
+ cucumber-tag-expressions (~> 2.0, >= 2.0.4)
66
+ cucumber-cucumber-expressions (10.2.0)
67
+ cucumber-gherkin (13.0.0)
68
+ cucumber-messages (~> 12.0, >= 12.0.0)
69
+ cucumber-html-formatter (6.0.3)
70
+ cucumber-messages (~> 12.1, >= 12.1.1)
71
+ cucumber-messages (12.1.1)
72
+ protobuf-cucumber (~> 3.10, >= 3.10.8)
73
+ cucumber-tag-expressions (2.0.4)
74
+ cucumber-wire (3.0.0)
75
+ cucumber-core (~> 7.0, >= 7.0.0)
76
+ cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
77
+ cucumber-messages (~> 12.1, >= 12.1.1)
78
+ diff-lcs (1.3)
79
+ ffi (1.13.1)
80
+ formatador (0.2.5)
81
+ guard (2.16.2)
82
+ formatador (>= 0.2.4)
83
+ listen (>= 2.7, < 4.0)
84
+ lumberjack (>= 1.0.12, < 2.0)
85
+ nenv (~> 0.1)
86
+ notiffany (~> 0.0)
87
+ pry (>= 0.9.12)
88
+ shellany (~> 0.0)
89
+ thor (>= 0.18.1)
90
+ guard-compat (1.2.1)
91
+ guard-rspec (4.7.3)
92
+ guard (~> 2.1)
93
+ guard-compat (~> 1.1)
94
+ rspec (>= 2.99.0, < 4.0)
95
+ hirb (0.7.3)
96
+ i18n (1.8.3)
97
+ concurrent-ruby (~> 1.0)
98
+ listen (3.2.1)
99
+ rb-fsevent (~> 0.10, >= 0.10.3)
100
+ rb-inotify (~> 0.9, >= 0.9.10)
101
+ lumberjack (1.2.5)
102
+ memoist (0.14.0)
103
+ method_profiler (2.0.1)
104
+ hirb (>= 0.6.0)
105
+ method_source (1.0.0)
106
+ middleware (0.1.0)
107
+ minitest (5.14.1)
108
+ multi_test (0.1.2)
109
+ nenv (0.3.0)
110
+ notiffany (0.1.3)
111
+ nenv (~> 0.1)
112
+ shellany (~> 0.0)
113
+ parallel (1.19.1)
114
+ parser (2.7.1.3)
115
+ ast (~> 2.4.0)
116
+ progressbar (0.21.0)
117
+ protobuf-cucumber (3.10.8)
118
+ activesupport (>= 3.2)
119
+ middleware
120
+ thor
121
+ thread_safe
122
+ pry (0.13.1)
123
+ coderay (~> 1.1)
124
+ method_source (~> 1.0)
125
+ rainbow (3.0.0)
126
+ rake (12.3.3)
127
+ rb-fsevent (0.10.4)
128
+ rb-inotify (0.10.1)
129
+ ffi (~> 1.0)
130
+ regexp_parser (1.7.1)
131
+ rexml (3.2.4)
132
+ rouge (3.20.0)
133
+ rspec (3.9.0)
134
+ rspec-core (~> 3.9.0)
135
+ rspec-expectations (~> 3.9.0)
136
+ rspec-mocks (~> 3.9.0)
137
+ rspec-core (3.9.2)
138
+ rspec-support (~> 3.9.3)
139
+ rspec-expectations (3.9.2)
140
+ diff-lcs (>= 1.2.0, < 2.0)
141
+ rspec-support (~> 3.9.0)
142
+ rspec-mocks (3.9.1)
143
+ diff-lcs (>= 1.2.0, < 2.0)
144
+ rspec-support (~> 3.9.0)
145
+ rspec-support (3.9.3)
146
+ rubocop (0.85.1)
147
+ parallel (~> 1.10)
148
+ parser (>= 2.7.0.1)
149
+ rainbow (>= 2.2.2, < 4.0)
150
+ regexp_parser (>= 1.7)
151
+ rexml
152
+ rubocop-ast (>= 0.0.3)
153
+ ruby-progressbar (~> 1.7)
154
+ unicode-display_width (>= 1.4.0, < 2.0)
155
+ rubocop-ast (0.0.3)
156
+ parser (>= 2.7.0.1)
157
+ ruby-progressbar (1.10.1)
158
+ scrub_rb (1.0.1)
159
+ shellany (0.0.1)
160
+ sys-uname (1.2.1)
161
+ ffi (>= 1.0.0)
162
+ thor (1.0.1)
163
+ thread_safe (0.3.6)
164
+ trollop (2.1.3)
165
+ tzinfo (1.2.7)
166
+ thread_safe (~> 0.1)
167
+ unicode-display_width (1.7.0)
168
+ zeitwerk (2.3.0)
169
+
170
+ PLATFORMS
171
+ ruby
172
+
173
+ DEPENDENCIES
174
+ aruba
175
+ cli-ui!
176
+ git_fame!
177
+ guard
178
+ guard-rspec
179
+ pry
180
+ rake (~> 12.0)
181
+ rfix!
182
+ rspec (~> 3.0)
183
+
184
+ RUBY VERSION
185
+ ruby 2.5.0p0
186
+
187
+ BUNDLED WITH
188
+ 2.1.4
@@ -0,0 +1,16 @@
1
+ # --only-failures --next-failure
2
+ guard :rspec, cmd: "bundle exec rspec --fail-fast", all_on_start: true, all_after_pass: true do
3
+ require "guard/rspec/dsl"
4
+ dsl = Guard::RSpec::Dsl.new(self)
5
+
6
+ # RSpec files
7
+ rspec = dsl.rspec
8
+ watch(rspec.spec_helper) { rspec.spec_dir }
9
+ watch(rspec.spec_support) { rspec.spec_dir }
10
+ watch(rspec.spec_files)
11
+ watch("spec/**/*.{rb,yml}")
12
+
13
+ # Ruby files
14
+ ruby = dsl.ruby
15
+ dsl.watch_spec_files_for(ruby.lib_files)
16
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Linus Oleander
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,26 @@
1
+ # Rfix [![Build Status](https://travis-ci.org/oleander/rfix-rb.svg?branch=master)](https://travis-ci.org/oleander/rfix-rb)
2
+
3
+ ## Installation
4
+
5
+ ``` shell
6
+ gem install rfix
7
+ rfix <local|branch 'any branch'|origin> [--dry] [--help]
8
+ ```
9
+
10
+ ## Development
11
+
12
+ - `git clone https://github.com/oleander/rfix-rb`
13
+ - `cd rfix-rb`
14
+ - `bundle install`
15
+ - `bundle exec rake setup`
16
+ - `bundle exec rake local`
17
+ - `bundle exec rake spec`
18
+
19
+ ## Contributing
20
+
21
+ Bug reports and pull requests are welcome on GitHub at https://github.com/oleander/rfix.
22
+
23
+
24
+ ## License
25
+
26
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ require 'fileutils'
6
+ require 'rfix'
7
+
8
+ include Rfix::Log
9
+ include Rfix::Cmd
10
+
11
+ RSpec::Core::RakeTask.new(:spec)
12
+
13
+ def source_for(name:)
14
+ bundle_root = Bundler.bundle_path.join('bundler/gems')
15
+ path = Dir.glob(bundle_root.join("#{name}-*").to_s).first
16
+ path or raise "Could not find source for #{name}, run bundle install first"
17
+ end
18
+
19
+ def dest_for(name:)
20
+ File.join(__dir__, 'vendor', name)
21
+ end
22
+
23
+ def setup(gem:)
24
+ say "Setup gem {{yellow:#{gem}}}"
25
+ Bundler.setup(gem)
26
+
27
+ source = source_for(name: gem)
28
+ say "Load source {{yellow:#{source}}}"
29
+
30
+ dest = dest_for(name: gem)
31
+ say "Load dest {{yellow:#{dest}}}"
32
+
33
+ FileUtils.mkdir_p(dest)
34
+ say "Copy files"
35
+ FileUtils.copy_entry source, dest, true, true, true
36
+ end
37
+
38
+ task default: :spec
39
+
40
+ task :bundle_install do
41
+ say "Running bundle install"
42
+ cmd "bundle install"
43
+ end
44
+
45
+ task setup: [:bundle_install] do
46
+ setup(gem: "cli-ui")
47
+ setup(gem: "git-fame-rb")
48
+ end
49
+
50
+ def osx?
51
+ ENV.fetch("TRAVIS_OS_NAME") == "osx"
52
+ end
53
+
54
+ def brew_url(ref:)
55
+ "https://raw.githubusercontent.com/Homebrew/homebrew-core/#{ref}/Formula/git.rb"
56
+ end
57
+
58
+ namespace :git do
59
+ task :config do
60
+ cmd("git config --global user.email hello@world.com")
61
+ cmd("git config --global user.name John Doe")
62
+ result = cmd("git config --global -l").first
63
+ say "Git config set to {{yellow:#{result}}}"
64
+ end
65
+
66
+ namespace :install do
67
+ task :osx do
68
+ say "Installing git on OS X"
69
+ cmd("brew install #{brew_url(ref: "140da7e09919887e1040f726db22dafd0cffe4d9")}")
70
+ end
71
+
72
+ task :linux do
73
+ say("Skip linux for now")
74
+ end
75
+
76
+ task :guess do
77
+ osx? ? Rake::Task["git:install:osx"].invoke : Rake::Task["git:install:linux"].invoke
78
+ end
79
+ end
80
+ end
81
+
82
+ namespace :update do
83
+ task :gemfiles do
84
+ Dir.glob("ci/Gemfile*").unshift("Gemfile").reject do |path|
85
+ File.extname(path) == ".lock"
86
+ end.each do |gemfile|
87
+ say "Update #{gemfile}"
88
+ cmd("bundle", "update", "--gemfile", gemfile)
89
+ end
90
+ end
91
+ end
92
+
93
+ task local: [:setup, :install]