sugarjar 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sj +6 -0
- data/lib/sugarjar/commands.rb +19 -4
- data/lib/sugarjar/config.rb +1 -1
- data/lib/sugarjar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22bcfbf2376fe2665d068e42a3a2263c13602ac0a534fc958efbedd959e89862
|
4
|
+
data.tar.gz: c817adecadb1c3886cc8b8cfb105a1f844e5cfb90f32f351c17647d28ab21e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e2d3c3cc050f9da5432333559e8338fcb9312fd42be1b254f31a9e553440f0c2f4b86da8d93ccc6c58f6647bed931808ba714a893a8e868e6d439b2e29e74b0
|
7
|
+
data.tar.gz: d74d2118706f4c3386b27a6a23bd594301c3c5621e2da72fd08c6dcd3e6c59917f0cef11cb9fad2c93f99e942ff175c512766510c8c510d7158240bd4d6ea3bc
|
data/bin/sj
CHANGED
@@ -144,6 +144,9 @@ end
|
|
144
144
|
# we parse later. We also need a pristine copy in case we want to
|
145
145
|
# run git as we were called.
|
146
146
|
argv_copy = ARGV.dup
|
147
|
+
|
148
|
+
# We don't have options yet, but we need an instance of SJ in order
|
149
|
+
# to list public methods. We will recreate it
|
147
150
|
sj = SugarJar::Commands.new(options)
|
148
151
|
extra_opts = []
|
149
152
|
|
@@ -204,6 +207,9 @@ if ARGV.empty?
|
|
204
207
|
end
|
205
208
|
|
206
209
|
options = config.merge(options)
|
210
|
+
|
211
|
+
# Recreate SJ with all of our options
|
212
|
+
sj = SugarJar::Commands.new(options)
|
207
213
|
SugarJar::Log.level = options['log_level'].to_sym if options['log_level']
|
208
214
|
|
209
215
|
subcommand = argv_copy.reject { |x| x.start_with?('-') }.first
|
data/lib/sugarjar/commands.rb
CHANGED
@@ -11,6 +11,7 @@ class SugarJar
|
|
11
11
|
include SugarJar::Util
|
12
12
|
|
13
13
|
def initialize(options)
|
14
|
+
SugarJar::Log.debug("Commands.initialize options: #{options}")
|
14
15
|
@ghuser = options['github_user']
|
15
16
|
@ghhost = options['github_host']
|
16
17
|
@repo_config = SugarJar::RepoConfig.config
|
@@ -231,10 +232,14 @@ class SugarJar
|
|
231
232
|
return false
|
232
233
|
end
|
233
234
|
s = Mixlib::ShellOut.new(check).run_command
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
next unless s.error?
|
236
|
+
|
237
|
+
SugarJar::Log.info(
|
238
|
+
"#{type} #{check} failed, output follows (use debug for more)\n" +
|
239
|
+
s.stdout.to_s,
|
240
|
+
)
|
241
|
+
SugarJar::Log.debug(s.format_for_exception)
|
242
|
+
return false
|
238
243
|
end
|
239
244
|
end
|
240
245
|
end
|
@@ -353,8 +358,18 @@ class SugarJar
|
|
353
358
|
def gitup
|
354
359
|
SugarJar::Log.debug('Fetching upstream')
|
355
360
|
fetch_upstream
|
361
|
+
curr = current_branch
|
356
362
|
SugarJar::Log.debug('Rebasing')
|
357
363
|
base = tracked_branch
|
364
|
+
if curr != 'master' && base == "origin/#{curr}"
|
365
|
+
SugarJar::Log.warn(
|
366
|
+
"This branch is tracking origin/#{curr}, which is probably your " +
|
367
|
+
'downstream (where you push _to_) as opposed to your upstream ' +
|
368
|
+
'(where you pull _from_). This means that "sj up" is probably ' +
|
369
|
+
'rebasing on the wrong thing and doing nothing. You probably want ' +
|
370
|
+
'to do a "git branch -u upstream".',
|
371
|
+
)
|
372
|
+
end
|
358
373
|
s = hub_nofail('rebase', base)
|
359
374
|
s.error? ? nil : base
|
360
375
|
end
|
data/lib/sugarjar/config.rb
CHANGED
data/lib/sugarjar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarjar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Dibowitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|