github_fastforward 2.1.0 → 2.1.1
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 +4 -4
- data/bin/github_fastforward +29 -29
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2806b0fbf58698021f000fbe99a41a8845b222ee
|
|
4
|
+
data.tar.gz: 562b156730cbc39fab0314903e4aebe5f4c28c82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 374f6dde51a195c6c68b86afb4455f71ebd1f15df4b0ee23d654c05556da5e0c17075bc18d5823a8279cba7f8ff14e3ce6219ef85193a09b3c0d352d34dbfe9c
|
|
7
|
+
data.tar.gz: a1d19fe821d5db2a08a01d4ebad6675bea8d369389ab3e38352240ae9db9356f3ea006000ff21acb45e6dae45086e86fc28588abe1c383b8dfcb11dea50679fb
|
data/bin/github_fastforward
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require 'octokit'
|
|
4
4
|
|
|
5
|
-
parent =
|
|
5
|
+
parent = 'upstream'
|
|
6
6
|
|
|
7
|
-
if ARGV[0] ==
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
if ARGV[0] == '-a'
|
|
8
|
+
print 'Username: '
|
|
9
|
+
uname = STDIN.gets.chomp
|
|
10
|
+
print 'Password: '
|
|
11
|
+
pword = STDIN.gets.chomp
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
if ARGV[0] ==
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if ARGV[0] == '-u' && ARGV[2] == '-p'
|
|
15
|
+
uname = ARGV[1]
|
|
16
|
+
pword = ARGV[3]
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
unless uname.nil? || pword.nil?
|
|
20
|
+
Octokit.configure do |conf|
|
|
21
|
+
conf.login = uname
|
|
22
|
+
conf.password = pword
|
|
23
|
+
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
unless system
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
unless system 'git rev-parse --git-dir > /dev/null 2>&1'
|
|
27
|
+
puts 'Not in a git repo!'
|
|
28
|
+
exit
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
repo = `git config --get remote.origin.url`.sub('https://github.com/', '').chomp
|
|
32
32
|
|
|
33
33
|
unless `git remote`.include? parent
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
puts "Adding remote #{parent}..."
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
begin
|
|
38
|
+
url = Octokit.repo(repo)[:parent][:html_url]
|
|
39
|
+
rescue NoMethodError
|
|
40
|
+
puts 'Not a fork!'
|
|
41
|
+
exit
|
|
42
|
+
rescue StandardError
|
|
43
|
+
puts 'Could not find repo!'
|
|
44
|
+
exit
|
|
45
|
+
end
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
`git remote add #{parent} #{url}`
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
branch = `git rev-parse --abbrev-ref HEAD`.chomp
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: github_fastforward
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Caleb Smith
|
|
@@ -38,6 +38,20 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '1.14'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rubocop
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0.49'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0.49'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: bundler
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|