exercism 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cli.rb CHANGED
@@ -48,6 +48,7 @@ class Exercism
48
48
 
49
49
  desc "submit FILE", "Submit code to exercism.io on your current assignment"
50
50
  method_option :host, :aliases => '-h', :default => 'http://exercism.io', :desc => 'the url of the exercism application'
51
+ method_option :ask, :aliases => '-a', :default => false, :type => :boolean, :desc => 'ask before submitting assignment'
51
52
  def submit(file)
52
53
  require 'exercism'
53
54
 
@@ -60,6 +61,12 @@ class Exercism
60
61
  end
61
62
  end
62
63
 
64
+ if options[:ask]
65
+ if no?("Are you sure you want to submit this assignment? [y/n]")
66
+ return
67
+ end
68
+ end
69
+
63
70
  begin
64
71
  response = Exercism::Api.new(options[:host], Exercism.user).submit(submission.file)
65
72
  say "Your assignment has been submitted."
data/lib/exercism/api.rb CHANGED
@@ -11,7 +11,7 @@ class Exercism
11
11
  end
12
12
 
13
13
  def conn
14
- conn = Faraday.new(:url => url) do |c|
14
+ Faraday.new(:url => url) do |c|
15
15
  c.use Faraday::Adapter::NetHttp
16
16
  c.headers['User-Agent'] = user_agent
17
17
  end
@@ -1,3 +1,3 @@
1
1
  class Exercism
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exercism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
12
+ date: 2013-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json