rench 0.1.0 → 0.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: 2dd25c974c390ff8610e73dc999eb168cc98c26c
4
- data.tar.gz: 9095292dd7794fc6d7ecdd62632d5396728e67f2
3
+ metadata.gz: 5382360de90b8e68c456ff634ba8a18f9517fec9
4
+ data.tar.gz: 769bca09791d7cbc6d970683c54b3dbb62a152fd
5
5
  SHA512:
6
- metadata.gz: 194b16b55f404e3d83aa035a2dbc97a896a8675d1ee0eec6444d6056211d465b6d85632924db3a8701f976c6257cb32ac448e704dcff7d3fbd4976d8b060c622
7
- data.tar.gz: 17948901ac40b6e6d1396440f619ec465ecb6cda7168855e4a5175c258e68128fc899d5a3d42b1d50784fe06b5fc28a7e5fba981b4c1978856534f5efd0d1b4b
6
+ metadata.gz: 14d89cde83dc8467b9d661281f10a53ce9c0362742a4a63aed07a42dd36ad3ffa71ca23f656af546ca2948e7fa2bf83cfce06c426ec84f5c192d5b63f3d3a423
7
+ data.tar.gz: d8a1355f110e0b9b3eeea23ebd245d49ea147177d81c6f177aa3a856e0d6e3bb9fb9a61e1f1e741664fa19760dbb4cb90c98e84e1168925d466196966839a0a4
data/lib/rench.rb CHANGED
@@ -21,7 +21,7 @@ class Rench::CLI
21
21
  end
22
22
 
23
23
  def filename
24
- @filename ||= highline.choose(tool_menu)
24
+ @filename ||= highline.choose(*tool_menu)
25
25
  end
26
26
 
27
27
  def tool_menu
@@ -33,9 +33,10 @@ class Rench::CLI
33
33
  end
34
34
 
35
35
  def choose_file_location
36
- highline.ask("Where do you want to download the file?", file_options) do |question|
36
+ highline.ask("Where do you want to put '#{filename.to_s}'?", file_options) do |question|
37
37
  question.readline = true
38
38
  question.answer_type = String
39
+ question.default = filename
39
40
  end
40
41
  end
41
42
 
data/lib/rench/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rench
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -40,7 +40,7 @@ describe Rench::CLI do
40
40
  let(:rench) { Rench::CLI.new "mrmicahcooper" }
41
41
  it "asks to choose a file from the tool menu" do
42
42
  tools = []
43
- highline.should_receive(:choose).with(tools)
43
+ highline.should_receive(:choose).with(*tools)
44
44
  rench.should_receive(:tool_menu).and_return(tools)
45
45
  rench.filename
46
46
  end
@@ -86,18 +86,20 @@ describe Rench::CLI do
86
86
  rench.file_location.should == "/location"
87
87
  end
88
88
  end
89
- context "when NOT initialize with a file location" do
89
+ context "when NOT initialized with a file location" do
90
90
  let(:rench) { Rench::CLI.new('mrmichacooper', "" ) }
91
91
  it "asks for a location" do
92
92
  rench.should_receive(:choose_file_location)
93
93
  rench.file_location
94
94
  end
95
95
  end
96
+
96
97
  end
97
98
 
98
99
  describe "#choose_file_location" do
99
- it "asks where to put the file" do
100
- rench.highline.should_receive(:ask)
100
+ it "asks where to put he file" do
101
+ rench.stub(file_options: ['foo'])
102
+ rench.highline.should_receive(:ask).with("Where do you want to put 'file.txt'?", ['foo'])
101
103
  rench.choose_file_location
102
104
  end
103
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Cooper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-07 00:00:00.000000000 Z
11
+ date: 2013-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday