winnie 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +1 -0
- data/lib/winnie/command.rb +1 -1
- data/lib/winnie/commands/auth.rb +2 -2
- data/lib/winnie/version.rb +1 -1
- data/spec/command_spec.rb +1 -1
- data/spec/commands/auth_spec.rb +6 -17
- metadata +43 -7
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ree-1.8.7-2011.03@winnie-gem
|
data/lib/winnie/command.rb
CHANGED
@@ -8,7 +8,7 @@ module Winnie
|
|
8
8
|
command_name ||= 'run'
|
9
9
|
|
10
10
|
begin
|
11
|
-
command_class =
|
11
|
+
command_class = Winnie::Commands.const_get(class_name.capitalize.to_sym)
|
12
12
|
rescue NameError
|
13
13
|
command_class = Winnie::Commands::App
|
14
14
|
command_name = class_name
|
data/lib/winnie/commands/auth.rb
CHANGED
@@ -10,8 +10,8 @@ module Winnie
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
13
|
-
confirm('Do you want to change your API key?') if
|
14
|
-
ask_for_api_key
|
13
|
+
confirm('Do you want to change your API key?') if api_key_exists?
|
14
|
+
ask_for_api_key
|
15
15
|
save_api_key
|
16
16
|
validate_api_key
|
17
17
|
end
|
data/lib/winnie/version.rb
CHANGED
data/spec/command_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe Winnie::Command do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should create command class object" do
|
12
|
-
Winnie::
|
12
|
+
Winnie::Commands.should_receive(:const_get).with(:'Help').and_return(Winnie::Commands::Help)
|
13
13
|
Winnie::Command.run('help')
|
14
14
|
end
|
15
15
|
|
data/spec/commands/auth_spec.rb
CHANGED
@@ -58,28 +58,17 @@ describe Winnie::Commands::Auth do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
describe "when API key exists" do
|
61
|
-
it "should ask if overwrite API key" do
|
62
|
-
@auth.should_receive(:confirm).with('Do you want to change your API key?')
|
63
|
-
@auth.stub!(:api_key_exists?).and_return(true)
|
64
|
-
@auth.run
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe "when API key is passed as an option" do
|
69
61
|
before do
|
70
|
-
|
62
|
+
create_api_key_file("secret-bla-bla")
|
63
|
+
@auth = Winnie::Commands::Auth.new
|
64
|
+
@auth.stub(:display)
|
65
|
+
@auth.stub(:ask_for_api_key)
|
71
66
|
@auth.stub(:save_api_key)
|
72
67
|
@auth.stub(:validate_api_key)
|
73
68
|
end
|
74
69
|
|
75
|
-
it "should
|
76
|
-
@auth.
|
77
|
-
@auth.run
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should not prompt confirm" do
|
81
|
-
@auth.stub(:api_key_exists? => true)
|
82
|
-
@auth.should_not_receive(:confirm)
|
70
|
+
it "should ask if overwrite API key" do
|
71
|
+
@auth.should_receive(:confirm).with('Do you want to change your API key?')
|
83
72
|
@auth.run
|
84
73
|
end
|
85
74
|
end
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winnie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
hash: 13
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- winnie
|
@@ -10,7 +15,8 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-
|
18
|
+
date: 2011-06-10 00:00:00 +02:00
|
19
|
+
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: json
|
@@ -20,6 +26,9 @@ dependencies:
|
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
33
|
type: :runtime
|
25
34
|
version_requirements: *id001
|
@@ -31,6 +40,9 @@ dependencies:
|
|
31
40
|
requirements:
|
32
41
|
- - ">="
|
33
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
34
46
|
version: "0"
|
35
47
|
type: :runtime
|
36
48
|
version_requirements: *id002
|
@@ -42,6 +54,11 @@ dependencies:
|
|
42
54
|
requirements:
|
43
55
|
- - ~>
|
44
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 7
|
58
|
+
segments:
|
59
|
+
- 2
|
60
|
+
- 2
|
61
|
+
- 0
|
45
62
|
version: 2.2.0
|
46
63
|
type: :development
|
47
64
|
version_requirements: *id003
|
@@ -53,6 +70,9 @@ dependencies:
|
|
53
70
|
requirements:
|
54
71
|
- - ">="
|
55
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
56
76
|
version: "0"
|
57
77
|
type: :development
|
58
78
|
version_requirements: *id004
|
@@ -64,6 +84,9 @@ dependencies:
|
|
64
84
|
requirements:
|
65
85
|
- - ">="
|
66
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
67
90
|
version: "0"
|
68
91
|
type: :development
|
69
92
|
version_requirements: *id005
|
@@ -78,6 +101,7 @@ extra_rdoc_files: []
|
|
78
101
|
|
79
102
|
files:
|
80
103
|
- .gitignore
|
104
|
+
- .rvmrc
|
81
105
|
- CHANGELOG.rdoc
|
82
106
|
- Gemfile
|
83
107
|
- LICENSE
|
@@ -101,6 +125,7 @@ files:
|
|
101
125
|
- spec/spec_helper.rb
|
102
126
|
- spec/winnie_spec.rb
|
103
127
|
- winnie.gemspec
|
128
|
+
has_rdoc: true
|
104
129
|
homepage: http://winniecloud.com
|
105
130
|
licenses: []
|
106
131
|
|
@@ -114,20 +139,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
139
|
requirements:
|
115
140
|
- - ">="
|
116
141
|
- !ruby/object:Gem::Version
|
142
|
+
hash: 3
|
143
|
+
segments:
|
144
|
+
- 0
|
117
145
|
version: "0"
|
118
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
147
|
none: false
|
120
148
|
requirements:
|
121
149
|
- - ">="
|
122
150
|
- !ruby/object:Gem::Version
|
151
|
+
hash: 3
|
152
|
+
segments:
|
153
|
+
- 0
|
123
154
|
version: "0"
|
124
155
|
requirements: []
|
125
156
|
|
126
157
|
rubyforge_project: winnie
|
127
|
-
rubygems_version: 1.7
|
158
|
+
rubygems_version: 1.3.7
|
128
159
|
signing_key:
|
129
160
|
specification_version: 3
|
130
161
|
summary: Winnie command line tool
|
131
|
-
test_files:
|
132
|
-
|
133
|
-
|
162
|
+
test_files:
|
163
|
+
- spec/client_spec.rb
|
164
|
+
- spec/command_spec.rb
|
165
|
+
- spec/commands/app_spec.rb
|
166
|
+
- spec/commands/auth_spec.rb
|
167
|
+
- spec/commands/base_spec.rb
|
168
|
+
- spec/spec_helper.rb
|
169
|
+
- spec/winnie_spec.rb
|