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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec3d78de4076610f94bba11e508e6433765abab9
4
- data.tar.gz: 51b481cd509f2cc46615312322dd49f85d96a0df
3
+ metadata.gz: 6b52de86f48daa16411749a2be248e6b504600d4
4
+ data.tar.gz: 96011cd71f55630b44760cf938335b94204bb54a
5
5
  SHA512:
6
- metadata.gz: 9df2e33f15e579c76451170fb7009f8dd9d4598c35521830fa049d29a833d938ef26b9c31fa72ba92ae76c17a43ea019e412c14a6175e730f8ea952cb0878dda
7
- data.tar.gz: ca698d06bceaccdbcab81eaf6b33bba0f14d7cb074fc35b43d9803b701ff21ba198c5125a9488a286902b7a6b92b63a346f94ea21366502a38a631b46d979d90
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
- submit!
23
+
24
+ if !save
25
+ submit!
26
+ end
23
27
  end
24
28
 
25
29
  def setup_tmp_file
@@ -1,3 +1,3 @@
1
1
  module LearnSubmit
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
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.0
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-08-26 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler