learn_create 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/README.md +9 -3
- data/lib/learn_create.rb +10 -3
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ddd5051568d3b75d8e35190e08e2edf2489b68a25f6f65c29bda39bcf806b6
|
4
|
+
data.tar.gz: e60cbe8a82c80d8df71d287a5181b0b40e07dab2a16ddc282490c8ba4c2029e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1660d3fdc0947302ce50880b14c8387a74c09b0358c1505436b0abeab197059621b1462997bde6f656be83ee09b22082bce924f602a434f3a98d6bfe4e26ef7
|
7
|
+
data.tar.gz: 4e9c629adcb4759409e560850dd1fa2279dba6a04a4a6480cc9151a588b8bd742774c59b00f0d8b49349fc4246b254ae3edea6621c916c2e23dde660f974bb0b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -14,11 +14,17 @@ Once `hub` is installed, you'll need to get it configured before running
|
|
14
14
|
`learn_create`. The best way to do this is to use `hub` once to create a
|
15
15
|
repository on learn-co-curriculum. In the shell:
|
16
16
|
|
17
|
-
- Create a new, empty folder and
|
17
|
+
- Create a new, empty folder and `cd` into it
|
18
|
+
- `git init` to create an initial git repo
|
18
19
|
- Run `hub create learn-co-curriculum/<whatever name you've chosen>`
|
19
20
|
- You should be prompted to sign into GitHub
|
20
|
-
- If
|
21
|
-
|
21
|
+
- **Note:** If you have set up two-factor identification on GitHub, when
|
22
|
+
prompted for your password, you have two options:
|
23
|
+
- If Github SMS' you a one-time password, use it!
|
24
|
+
- Otherwise, instead of using your normal password, you
|
25
|
+
need to enter a personal access token. You can create a token in your
|
26
|
+
GitHub settings page.
|
27
|
+
- If everything works as expected you should now have an empty `learn-co-curriculum` repo.
|
22
28
|
- Delete the repo. Everything should be set up now.
|
23
29
|
|
24
30
|
Install the `learn_create` gem:
|
data/lib/learn_create.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'require_all'
|
2
1
|
require 'faraday'
|
3
2
|
require 'uri'
|
3
|
+
require 'open3'
|
4
4
|
|
5
5
|
class LearnCreate
|
6
6
|
def initialize
|
@@ -8,6 +8,7 @@ class LearnCreate
|
|
8
8
|
|
9
9
|
# Checks to see if chosen name already exists as a repository
|
10
10
|
@repo_name = ''
|
11
|
+
@ssh_configured = check_ssh_config
|
11
12
|
|
12
13
|
loop do
|
13
14
|
puts 'What is the name of the repository you would like to create?'
|
@@ -15,7 +16,7 @@ class LearnCreate
|
|
15
16
|
url = 'https://api.github.com/repos/learn-co-curriculum/' + @repo_name
|
16
17
|
encoded_url = URI.encode(url).slice(0, url.length)
|
17
18
|
|
18
|
-
# Will hit rate
|
19
|
+
# Will hit rate limit on github is used too much
|
19
20
|
check_existing = Faraday.get URI.parse(encoded_url)
|
20
21
|
|
21
22
|
break if check_existing.body.include? '"Not Found"'
|
@@ -161,7 +162,8 @@ jspm_packages
|
|
161
162
|
end
|
162
163
|
|
163
164
|
def git_set_remote
|
164
|
-
|
165
|
+
remote = @ssh_configured ? "git@github.com:learn-co-curriculum/#{@repo_name}.git" : "https://github.com/learn-co-curriculum/#{@repo_name}"
|
166
|
+
cmd = cd_into_and("git remote set-url origin ")
|
165
167
|
`#{cmd}`
|
166
168
|
end
|
167
169
|
|
@@ -191,4 +193,9 @@ jspm_packages
|
|
191
193
|
puts 'Pushing to remote'
|
192
194
|
git_push
|
193
195
|
end
|
196
|
+
|
197
|
+
def check_ssh_config
|
198
|
+
result = Open3.capture2e('ssh -T git@github.com').first
|
199
|
+
result.include?("You've successfully authenticated")
|
200
|
+
end
|
194
201
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn_create
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- flatironschool
|
@@ -9,7 +9,21 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-11-20 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.15'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.15'
|
13
27
|
description:
|
14
28
|
email: maxwell@flatironschool.com
|
15
29
|
executables:
|
@@ -77,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
91
|
version: '0'
|
78
92
|
requirements: []
|
79
93
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.7.
|
94
|
+
rubygems_version: 2.7.6
|
81
95
|
signing_key:
|
82
96
|
specification_version: 4
|
83
97
|
summary: learn_create is a tool for creating learn.co lessons on github
|