infrataster 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/infrataster/contexts/capybara_context.rb +4 -4
- data/lib/infrataster/server.rb +2 -2
- data/lib/infrataster/version.rb +1 -1
- data/spec/integration/http_spec.rb +9 -0
- data/spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb +9 -1
- data/spec/integration/vm/cookbooks/proxy/templates/default/integration-test.erb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b02e1a94765dc0d775d830797454180472654009
|
4
|
+
data.tar.gz: 29d0856e7cdce1920a7df6690b5f57f145cb2fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37fd588b2774e7219915bddd22016bfe7158ffd09bad938259f526e4ace64fc21abfda87884bd0dbb925aef07002f36dcec005cb7fde760dc23b8182e0b2ab20
|
7
|
+
data.tar.gz: 7b10de04e16a5a507f9119aacd8c35f72948a595907c25f96ab7c61a004a69b812f67c3fa2d724c3405f2a91715a9eb2b1b6410e46b1936eafcedd0e09e5503a
|
data/CHANGELOG.md
CHANGED
@@ -5,21 +5,21 @@ require 'capybara/poltergeist'
|
|
5
5
|
module Infrataster
|
6
6
|
module Contexts
|
7
7
|
class CapybaraContext < BaseContext
|
8
|
+
CAPYBARA_DRIVER_NAME = :infrataster_driver
|
9
|
+
|
8
10
|
def self.session
|
9
11
|
@session ||= prepare_session
|
10
12
|
end
|
11
13
|
|
12
14
|
def self.prepare_session
|
13
|
-
capybara_driver_name = :infrataster_driver
|
14
|
-
|
15
15
|
proxy = BrowsermobProxy.proxy
|
16
|
-
Capybara.register_driver
|
16
|
+
Capybara.register_driver CAPYBARA_DRIVER_NAME do |app|
|
17
17
|
Capybara::Poltergeist::Driver.new(
|
18
18
|
app,
|
19
19
|
phantomjs_options: ["--proxy=http://#{proxy.host}:#{proxy.port}"],
|
20
20
|
)
|
21
21
|
end
|
22
|
-
Capybara::Session.new(
|
22
|
+
Capybara::Session.new(CAPYBARA_DRIVER_NAME)
|
23
23
|
end
|
24
24
|
|
25
25
|
def initialize(*args)
|
data/lib/infrataster/server.rb
CHANGED
@@ -124,7 +124,7 @@ module Infrataster
|
|
124
124
|
|
125
125
|
if @options[:ssh]
|
126
126
|
config = @options[:ssh]
|
127
|
-
config[:
|
127
|
+
config[:host_name] ||= @address
|
128
128
|
elsif @options[:vagrant]
|
129
129
|
vagrant_name = if @options[:vagrant] != true
|
130
130
|
@options[:vagrant]
|
@@ -136,7 +136,7 @@ module Infrataster
|
|
136
136
|
raise Error, "Can't get configuration to connect to the server via SSH. Please set ssh option or vagrant option."
|
137
137
|
end
|
138
138
|
|
139
|
-
[config[:
|
139
|
+
[config[:host_name], config[:user], config]
|
140
140
|
end
|
141
141
|
|
142
142
|
def ssh_config_for_vagrant(name)
|
data/lib/infrataster/version.rb
CHANGED
@@ -13,6 +13,15 @@ describe server(:proxy) do
|
|
13
13
|
expect(response.body).to include('static')
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
# If accept-encoding is not specified explicitly,
|
18
|
+
# Net::HTTP (faraday's default adapter) sends request with accept-encoding=gzip
|
19
|
+
# and inflate response as gzip automaticallly
|
20
|
+
describe http('http://static.example.com', headers: {"Accept-Encoding" => "gzip"}) do
|
21
|
+
it "gets response compressed by gzip" do
|
22
|
+
expect(response.headers['content-encoding']).to eq('gzip')
|
23
|
+
end
|
24
|
+
end
|
16
25
|
end
|
17
26
|
|
18
27
|
describe server(:app) do
|
@@ -1,4 +1,12 @@
|
|
1
|
-
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
apt_servers = Net::HTTP.get(URI.parse('http://mirrors.ubuntu.com/mirrors.txt')).split("\n")
|
5
|
+
# ftp.riken.jp is unstable and slow?
|
6
|
+
apt_servers.delete('http://ftp.riken.jp/Linux/ubuntu/')
|
7
|
+
apt_server = apt_servers[rand(apt_servers.size)]
|
8
|
+
|
9
|
+
execute "sed -i -e 's| \\(http[^ ]\\+\\)| #{apt_server}|g' /etc/apt/sources.list"
|
2
10
|
|
3
11
|
include_recipe 'apt'
|
4
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infrataster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|