newline_hw 1.1.8 → 1.2.0
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/exe/newline_hw_stream +8 -1
- data/exe/newline_hw_stream_shim +1 -1
- data/lib/newline_hw/shell/setup.rb +15 -2
- data/lib/newline_hw/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f57670257d14b08ce22422c0e0d9d7abbed9fb4
|
4
|
+
data.tar.gz: 89614b4a1c0b89695867526759519ce55375b74f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97e395b23dc733330ddf7f2165768128ead455b5f1230e1808d0972cb68a0819f5833bc5e48b5d7178bd983c6eb14586b6b2f47a93282e58a5b4ec3e2b691040
|
7
|
+
data.tar.gz: 7ab360621efbdd342fa56b0694b97ef7865a2cdcb43899eac49aa1aa225fa959b1a308e716de59ab1ab31ce5603f9445072cb03d9ab830ea0c2e475ddc08f8db
|
data/exe/newline_hw_stream
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# coding: utf-8
|
3
|
+
|
4
|
+
require "rubygems"
|
5
|
+
|
6
|
+
begin
|
7
|
+
require "bundler/setup"
|
8
|
+
rescue
|
9
|
+
end
|
10
|
+
|
3
11
|
require "logger"
|
4
12
|
require "json"
|
5
13
|
require_relative "../lib/newline_hw"
|
@@ -17,7 +25,6 @@ begin
|
|
17
25
|
rescue StandardError => e
|
18
26
|
logger.error e
|
19
27
|
exit 1
|
20
|
-
|
21
28
|
rescue SystemExit
|
22
29
|
exit 0
|
23
30
|
end
|
data/exe/newline_hw_stream_shim
CHANGED
@@ -24,7 +24,7 @@ module NewlineHw
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def cloneable?
|
27
|
-
pr? || gist? || github_project_link? || git? || false
|
27
|
+
pr? || gist? || branch? || github_project_link? || git? || false
|
28
28
|
end
|
29
29
|
|
30
30
|
def sha
|
@@ -55,6 +55,10 @@ module NewlineHw
|
|
55
55
|
%r{\/\/github.com}.match(url) && %r{\/pull\/\d+}.match(url)
|
56
56
|
end
|
57
57
|
|
58
|
+
def branch?
|
59
|
+
%r{\/\/github.com}.match(url) && %r{\/tree\/([^\\]+)}.match(url)
|
60
|
+
end
|
61
|
+
|
58
62
|
def dir_name
|
59
63
|
git_url.split(%r{[\/\.]})[-3..-2].join("-")
|
60
64
|
end
|
@@ -79,7 +83,8 @@ module NewlineHw
|
|
79
83
|
cmds << "git clone #{git_url} #{dir_name}"
|
80
84
|
cmds << "cd #{dir_name}"
|
81
85
|
cmds << fetch_and_checkout_pr if pr?
|
82
|
-
cmds <<
|
86
|
+
cmds << fetch_and_checkout_branch if branch?
|
87
|
+
cmds << "git checkout -b #{BRANCH_NAME} #{sha}" if sha
|
83
88
|
cmds << "echo #{Shellwords.escape JSON.pretty_generate submission_info} > .newline_submission_meta.json" if newline_submission_id
|
84
89
|
cmds.join(" && ")
|
85
90
|
end
|
@@ -88,6 +93,14 @@ module NewlineHw
|
|
88
93
|
"git fetch origin pull/#{pr_id}/head:#{BRANCH_NAME} && git checkout #{BRANCH_NAME}"
|
89
94
|
end
|
90
95
|
|
96
|
+
def submitted_branch_name
|
97
|
+
branch?[1]
|
98
|
+
end
|
99
|
+
|
100
|
+
private def fetch_and_checkout_branch
|
101
|
+
"git fetch origin #{submitted_branch_name}:#{BRANCH_NAME} && git checkout #{BRANCH_NAME}"
|
102
|
+
end
|
103
|
+
|
91
104
|
private def infer_git_url_from_pr
|
92
105
|
url.split("/pull/").first + ".git"
|
93
106
|
end
|
data/lib/newline_hw/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newline_hw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Osborne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
184
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
185
|
+
rubygems_version: 2.6.11
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Quickly Clone and setup basic ruby and JS projects.
|