rumm 0.0.3 → 0.0.4

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.
@@ -3,11 +3,19 @@ require "vcr"
3
3
  require "aruba/api"
4
4
  require "rspec-given"
5
5
 
6
+ module Rumm::WillType
7
+ def will_type(string)
8
+ Aruba::InProcess.main_class.input << _ensure_newline(string)
9
+ end
10
+ end
11
+
6
12
  RSpec.configure do |config|
7
13
  config.color_enabled = true
8
14
  config.include Aruba::Api, :example_group => {
9
- :file_path => /spec\/features/
15
+ :file_path => /spec\/features/
10
16
  }
17
+ config.include Rumm::WillType
18
+
11
19
  config.before(:each) do
12
20
  @__aruba_original_paths = (ENV['PATH'] || '').split(File::PATH_SEPARATOR)
13
21
  ENV['PATH'] = ([File.expand_path('bin')] + @__aruba_original_paths).join(File::PATH_SEPARATOR)
@@ -19,16 +27,30 @@ RSpec.configure do |config|
19
27
  end
20
28
 
21
29
  VCR.configure do |c|
22
- c.default_cassette_options = { :record => :new_episodes }
30
+ c.default_cassette_options = {:record => :new_episodes}
23
31
  c.hook_into :excon
24
- # c.debug_logger = $stderr
32
+ #c.debug_logger = $stderr
25
33
 
26
34
  c.cassette_library_dir = 'spec/fixtures/cassettes'
27
- c.filter_sensitive_data("<rackspace-login>") do
28
- ENV['RACKSPACE_LOGIN']
35
+ c.filter_sensitive_data("<rackspace-username>") do
36
+ ENV['RACKSPACE_USERNAME']
29
37
  end
30
- c.filter_sensitive_data("<rackspace-api-token>") do
31
- ENV['RACKSPACE_API_TOKEN']
38
+ c.filter_sensitive_data("<rackspace-password>") do
39
+ ENV['RACKSPACE_PASSWORD']
40
+ end
41
+ c.filter_sensitive_data("<rackspace-api-token>") do |interaction|
42
+ if interaction.response.body =~ /"token":{"id":"(\w+)"/
43
+ $1
44
+ elsif token = interaction.request.headers['X-Auth-Token']
45
+ token.first
46
+ end
47
+ end
48
+ c.filter_sensitive_data("<rackspace-api-key>") do |interaction|
49
+ if interaction.response.body =~ /"apiKey":"(\w+)"/
50
+ $1
51
+ else
52
+ ENV['RACKSPACE_API_KEY']
53
+ end
32
54
  end
33
55
  end
34
56
 
@@ -38,14 +60,32 @@ require_relative "../app"
38
60
  Aruba.process = Aruba::InProcess
39
61
  class Aruba::InProcess
40
62
  attr_reader :stdin
41
- self.main_class = Class.new do
42
63
 
43
- def initialize(argv, stdin=STDIN, stdout=STDOUT, stderr=STDERR, kernel=Kernel)
44
- @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
64
+ def self.main_class;
65
+ @@main_class;
45
66
  end
46
67
 
47
- def execute!
48
- @kernel.exit Rumm::App.main @argv, @stdin, @stdout, @stderr
49
- end
68
+ self.main_class = Class.new do
69
+ @@input = ""
70
+ class << self
71
+ def input
72
+ @@input
73
+ end
74
+ end
75
+
76
+ def initialize(argv, stdin=STDIN, stdout=STDOUT, stderr=STDERR, kernel=Kernel)
77
+ @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
78
+
79
+ def @stdin.noecho
80
+ yield self
81
+ end
82
+
83
+ @stdin << @@input
84
+ @stdin.rewind
85
+ end
86
+
87
+ def execute!
88
+ @kernel.exit Rumm::App.main @argv, @stdin, @stdout, @stderr
89
+ end
50
90
  end
51
91
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell
@@ -29,7 +29,7 @@ cert_chain:
29
29
  UgImJlChAzCoDP9zi9tdm6jAr7ttF25R9PPYr11ILb7dYe3qUzlNlM6zJx/nb31b
30
30
  IhdyRVup4qLcqYSTPsm6u7VA
31
31
  -----END CERTIFICATE-----
32
- date: 2013-06-26 00:00:00.000000000 Z
32
+ date: 2013-06-28 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: mvcli
@@ -82,6 +82,7 @@ extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
84
  - .gitignore
85
+ - .travis.yml
85
86
  - Gemfile
86
87
  - LICENSE.txt
87
88
  - README.md
@@ -97,8 +98,11 @@ files:
97
98
  - app/controllers/loadbalancers_controller.rb
98
99
  - app/controllers/nodes_controller.rb
99
100
  - app/controllers/servers_controller.rb
101
+ - app/controllers/users_controller.rb
100
102
  - app/controllers/volumes_controller.rb
101
103
  - app/forms/loadbalancers/create_form.rb
104
+ - app/forms/servers/create_form.rb
105
+ - app/forms/users/create_form.rb
102
106
  - app/models/loadbalancers/node.rb
103
107
  - app/models/node.rb
104
108
  - app/providers/compute_provider.rb
@@ -152,6 +156,8 @@ files:
152
156
  - app/views/servers/destroy.txt.erb
153
157
  - app/views/servers/index.txt.erb
154
158
  - app/views/servers/show.txt.erb
159
+ - app/views/users/create.txt.erb
160
+ - app/views/users/index.txt.erb
155
161
  - app/views/volumes/create.txt.erb
156
162
  - app/views/volumes/destroy.txt.erb
157
163
  - app/views/volumes/index.txt.erb
@@ -166,6 +172,7 @@ files:
166
172
  - spec/fixtures/cassettes/destroy-server.yml
167
173
  - spec/fixtures/cassettes/show-server.yml
168
174
  - spec/fixtures/cassettes/show-servers.yml
175
+ - spec/fixtures/cassettes/successful-login.yml
169
176
  - spec/spec_helper.rb
170
177
  - tmp/aruba/.gitkeep
171
178
  homepage: https://github.com/rackerlabs/rumm
@@ -199,5 +206,6 @@ test_files:
199
206
  - spec/fixtures/cassettes/destroy-server.yml
200
207
  - spec/fixtures/cassettes/show-server.yml
201
208
  - spec/fixtures/cassettes/show-servers.yml
209
+ - spec/fixtures/cassettes/successful-login.yml
202
210
  - spec/spec_helper.rb
203
211
  has_rdoc: