submit_hw 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fffeb2fcb121522e78a8656bd64175bfa644ba87
4
- data.tar.gz: 350c6e550b9ebac5578546a0f0173cfd70c3cc12
3
+ metadata.gz: bc8d5f061f0255fd0fdbee8509e17ac02ed577b0
4
+ data.tar.gz: edd47509de38150bb42a63bb4373ac5115685ef1
5
5
  SHA512:
6
- metadata.gz: 015b54c965e52d85df1f24af43b347900589c7d7b36dce43410d69e1710a60e673aca5152d4583e304178e6e126833fc02656471d7210fdb9f9be099d5f18b98
7
- data.tar.gz: 6f1e07f156213a1fbaa0e01b9a8e7a8a5a353cf5af074b2c047dacadc771fb690fc07f281fea2079aac08bdd7cb2056ff4d08ce72fef61d388d44888fb90baaa
6
+ metadata.gz: 282dc8ae0dae8400e6285af1b19e9fe7cd1b59a27e3420eaf91cbc1529fdab435e214c0b3b9508f70dce812980ce0ed6476e851e3769c17336fe170bad745387
7
+ data.tar.gz: 11afeaad757ed3ed542b2478374fb7795cedcf13d555a15b9b03ae6fe848f02525f84f6ca55dec7cc340e9741e1351542077bd032397fee6756bc1407a897186
data/bin/submit_hw CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  # TODO (phlco) remove Hub dependency and use github gem/api directly...
4
4
 
5
+ # require lib/*/**
6
+ require 'submit_hw/version'
7
+
5
8
  # require dependencies
6
9
  require "octokit"
7
10
  require "colorize"
@@ -27,6 +30,10 @@ if ["-h","--help"].include? ARGV[0]
27
30
  puts "$ submit_hw --debug"
28
31
  exit(true)
29
32
  end
33
+ if ["-v","--version"].include? ARGV[0]
34
+ puts SubmitHw::VERSION
35
+ exit(true)
36
+ end
30
37
  ARGV.clear # clean out arguments from $stdin so they don't get `gets`-ed below
31
38
 
32
39
  # NOTE: Removed in order to clean up the bash profile (this shouldn't touch it)
@@ -67,13 +74,13 @@ end
67
74
 
68
75
  # Ensure their gitconfig has a "name" entry with their GH username, and if not,
69
76
  # add it.
70
- output = `git config --get user.name`
71
- debug "user.name: #{output}"
77
+ output = `git config --get user.githubname`
78
+ debug "user.githubname: #{output}"
72
79
  if output.empty?
73
80
  puts "Please enter your Github username (it is case sensitive)."
74
81
  github_username = gets.chomp
75
- output = `git config --add user.name '#{github_username}'`
76
- debug "new user.name: #{output}"
82
+ output = `git config --add user.githubname '#{github_username}'`
83
+ debug "new user.githubname: #{output}"
77
84
  end
78
85
 
79
86
  # Check to see if they have a hub config file, which stores an auth token that
@@ -171,23 +178,24 @@ end
171
178
 
172
179
  # Get the necessary data to form a commit message.
173
180
  human_name = `git config --get user.humanname`.chomp
174
- github_name = `git config --get user.github`.chomp.downcase
181
+ github_name = `git config --get user.githubname`.chomp.downcase
175
182
  branch = "#{upstream}:#{github_name}"
176
183
  submitted_at = Time.now.strftime("%H:%m")
177
184
  submitted_on = Time.now.strftime('%Y-%m-%d')
178
185
  message = "HW for #{human_name}: #{submitted_on} at #{submitted_at}" + \
179
186
  "\n\n#{data.to_json}"
180
- debug "message: #{message.split("\n").first}"
181
187
 
182
188
  # Push to their fork.
183
189
  puts "Pushing your work to your fork...\n"
184
190
  push_msg = `git push origin master 2>&1`
185
- debug "push_message: #{push_msg}" #|| puts # spacin' it out bru
191
+ debug "push output: #{push_msg}" #|| puts # spacin' it out bru
186
192
 
187
193
  # Submit PR to class repo in their GH named branch
188
194
  puts "Submitting a pull request...\n"
195
+ debug "pr branch: #{branch}"
196
+ debug "pr message: #{message.split("\n").first}"
189
197
  submission_msg = `hub pull-request -m '#{message}' -b '#{branch}' 2>&1`
190
- debug "pr_message: #{submission_msg}"
198
+ debug "pr output: #{submission_msg}"
191
199
 
192
200
  # Check the submission message to ensure there were no errors
193
201
  if submission_msg.include? "pull request already exists"
@@ -0,0 +1,3 @@
1
+ module SubmitHw
2
+ VERSION = "0.1.5"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: submit_hw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Konowitch
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-04-28 00:00:00.000000000 Z
16
+ date: 2015-04-30 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: hub
@@ -66,8 +66,8 @@ executables:
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - "./bin/submit_hw"
70
69
  - bin/submit_hw
70
+ - lib/submit_hw/version.rb
71
71
  homepage: https://github.com/ga-instructors/submit_hw
72
72
  licenses:
73
73
  - MIT