learn-submit 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/learn-submit +2 -1
- data/lib/learn_submit/submission.rb +9 -5
- data/lib/learn_submit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b52de86f48daa16411749a2be248e6b504600d4
|
4
|
+
data.tar.gz: 96011cd71f55630b44760cf938335b94204bb54a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330de54b06cd9e6a47e4d3c78eeecd45698e4b992312b77d43e36fe5d493a38dfa70787e7097670b30daeb81686f7219e682dec1838c1deaab5f292ff8075126
|
7
|
+
data.tar.gz: e7a5d198fb2b79cfdb26c05b3a35d3ff57c7a9a4a161116d69d8ea7c7318a5e91120a8a2f593365c73519fe564b5e9b9d53336567206949fc43d052b1efc30f8
|
data/bin/learn-submit
CHANGED
@@ -5,10 +5,11 @@ require 'learn_submit'
|
|
5
5
|
# To prevent weird errors when random command line args are passed in
|
6
6
|
KNOWN_COMMANDS = []
|
7
7
|
|
8
|
+
save = !!ARGV.delete('--save-only')
|
8
9
|
message = ARGV[0] ? ARGV.join(' ') : nil
|
9
10
|
|
10
11
|
ARGV.map! do |arg|
|
11
12
|
KNOWN_COMMANDS.include?(arg) ? arg : nil
|
12
13
|
end.compact!
|
13
14
|
|
14
|
-
LearnSubmit::Submission.create(message: message)
|
15
|
+
LearnSubmit::Submission.create(message: message, save: save)
|
@@ -1,25 +1,29 @@
|
|
1
1
|
module LearnSubmit
|
2
2
|
class Submission
|
3
|
-
attr_reader :git, :client, :file_path, :message
|
3
|
+
attr_reader :git, :client, :file_path, :message, :save
|
4
4
|
|
5
|
-
def self.create(message: nil)
|
6
|
-
new(message: message).create
|
5
|
+
def self.create(message: nil, save: false)
|
6
|
+
new(message: message, save: save).create
|
7
7
|
end
|
8
8
|
|
9
|
-
def initialize(message:)
|
9
|
+
def initialize(message:, save:)
|
10
10
|
_login, token = Netrc.read['learn-config']
|
11
11
|
|
12
12
|
@client = LearnWeb::Client.new(token: token)
|
13
13
|
@git = LearnSubmit::Submission::GitInteractor.new(username: user.username, message: message)
|
14
14
|
@file_path = File.expand_path('~/.learn-submit-tmp')
|
15
15
|
@message = message
|
16
|
+
@save = save
|
16
17
|
end
|
17
18
|
|
18
19
|
def create
|
19
20
|
setup_tmp_file
|
20
21
|
|
21
22
|
commit_and_push!
|
22
|
-
|
23
|
+
|
24
|
+
if !save
|
25
|
+
submit!
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def setup_tmp_file
|
data/lib/learn_submit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn-submit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flatiron School
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|