Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

style: spacing #449

Merged
merged 2 commits into from

2 participants

@miketheman
Collaborator

First stab at styling.
This is just for a few files, thought it'd be a good place to start.

Let me know what you think of the spacing choices.

@jedi4ever
Owner

fine by me! just keep coming with the changes in small batches, so new pull request don't suffer too much.

@jedi4ever jedi4ever merged commit aa813ac into from
@petecheslock petecheslock referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 14, 2012
  1. @miketheman

    style: spacing

    miketheman authored
  2. @miketheman

    style: spacing the gemspec

    miketheman authored
This page is out of date. Refresh to see the latest.
Showing with 30 additions and 31 deletions.
  1. +23 −23 Rakefile
  2. +7 −8 veewee.gemspec
View
46 Rakefile
@@ -25,33 +25,33 @@ Rake::TestTask.new do |t|
end
desc 'Verify ISO'
-task :iso, [:template_name] do |t,args|
+task :iso, [:template_name] do |t, args|
require 'net/http'
#if args.to_hash.size!=1
#puts "needs one arguments: rake iso [\"yourname\"]"
#exit
#end
Dir.glob("templates/*").each do |name|
- definition_name=File.basename(name)
+ definition_name = File.basename(name)
puts name
- definition=Veewee::Environment.new(:cwd => ".",:definition_dir => "templates").definitions[definition_name]
- next if definition.nil? || definition.iso_src.nil? || definition.iso_src==""
+ definition = Veewee::Environment.new(:cwd => ".", :definition_dir => "templates").definitions[definition_name]
+ next if definition.nil? || definition.iso_src.nil? || definition.iso_src == ""
begin
- url=definition.iso_src
- found=false
+ url = definition.iso_src
+ found = false
response = nil
- while found==false
- uri=URI.parse(url)
+ while found == false
+ uri = URI.parse(url)
if uri.is_a?(URI::HTTP)
- Net::HTTP.start(uri.host,uri.port) {|http|
+ Net::HTTP.start(uri.host, uri.port) { |http|
response = http.head(uri.path)
}
unless response['location'].nil?
#puts "Redirecting to "+response['location']
- url=response['location']
+ url = response['location']
else
- length=response['content-length']
- found=true
+ length = response['content-length']
+ found = true
end
elsif uri.is_a?(URI::FTP)
require 'net/ftp'
@@ -62,7 +62,7 @@ task :iso, [:template_name] do |t,args|
found = true
rescue Net::FTPReplyError => e
reply = e.message
- err_code = reply[0,3].to_i
+ err_code = reply[0, 3].to_i
unless err_code == 500 || err_code == 502
# other problem, raise
raise "Got ftp site but doesn't support size subcommand"
@@ -75,22 +75,22 @@ task :iso, [:template_name] do |t,args|
if length.to_i < 10000
puts definition.iso_src
puts "Incorrect length #{length.to_i}"
- puts uri.host,uri.port, uri.path,response.code
+ puts uri.host, uri.port, uri.path, response.code
end
rescue Exception => ex
- puts "Error"+ex.to_s+definition.iso_src
+ puts "Error" + ex.to_s + definition.iso_src
end
end
end
desc 'Autobuilds all templates and runs validation.'
-task :autotest, [:pattern] do |t,args|
+task :autotest, [:pattern] do |t, args|
# We overrule all timeouts for tcp and ssh
#ENV['VEEWEE_TIMEOUT']='600'
- ve=Veewee::Environment.new()
- ve.templates.each do |name,template|
+ ve = Veewee::Environment.new
+ ve.templates.each do |name, template|
# If pattern was given, only take the ones that match the pattern
unless args[:pattern].nil?
@@ -98,11 +98,11 @@ task :autotest, [:pattern] do |t,args|
end
begin
- ve.definitions.define("auto",name, { 'force' => true})
- vd=ve.definitions["auto"]
- box=ve.providers["virtualbox"].get_box("auto")
+ ve.definitions.define("auto", name, { 'force' => true })
+ vd = ve.definitions["auto"]
+ box = ve.providers["virtualbox"].get_box("auto")
puts "AUTO: Building #{name}"
- box.build({"auto" => true,"force" => true, 'nogui' => true })
+ box.build({ "auto" => true, "force" => true, 'nogui' => true })
puts "AUTO: Validating #{name}"
box.validate_vagrant
puts "AUTO: Success #{name}"
@@ -111,7 +111,7 @@ task :autotest, [:pattern] do |t,args|
puts "AUTO: Template #{name} failed - #{ex}"
if box.running?
begin
- screenshot="screenshot-auto-#{name}.png"
+ screenshot = "screenshot-auto-#{name}.png"
puts "AUTO: Taking snapshot #{screenshot}"
box.screenshot(screenshot)
rescue Veewee::Error => ex
View
15 veewee.gemspec
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.name = "veewee"
s.version = Veewee::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Patrick Debois" ]
+ s.authors = ["Patrick Debois"]
s.email = ["patrick.debois@jedi.be"]
s.homepage = "http://github.com/jedi4ever/veewee/"
s.summary = %q{Vagrant box creation}
@@ -14,15 +14,15 @@ Gem::Specification.new do |s|
s.required_rubygems_version = ">= 1.3.6"
s.rubyforge_project = "veewee"
- s.add_dependency "vagrant", ">= 0.9"
+ s.add_dependency "vagrant", ">= 0.9"
# Currently locked to 2.2.0
# if specifying to >= 2.2.0 it would use 2.3 and bundler would go in a resolver loop
# DEBUG_RESOLVER=1 bundle install
- s.add_dependency "net-ssh", "~> 2.2.0"
+ s.add_dependency "net-ssh", "~> 2.2.0"
- s.add_dependency "popen4", "~> 0.1.2"
- s.add_dependency "thor", "~> 0.15"
+ s.add_dependency "popen4", "~> 0.1.2"
+ s.add_dependency "thor", "~> 0.15"
s.add_dependency "highline"
s.add_dependency "progressbar"
s.add_dependency "i18n"
@@ -39,13 +39,12 @@ Gem::Specification.new do |s|
# See : https://github.com/jedi4ever/veewee/issues/6
#s.add_dependency "CFPropertyList", ">= 2.1.1"
# s.add_dependency "libvirt"
- s.add_dependency "rspec", "~> 2.5"
+ s.add_dependency "rspec", "~> 2.5"
s.add_development_dependency "bundler", ">= 1.0.0"
#s.add_development_dependency('ruby-libvirt','~>0.4.0')
s.files = `git ls-files`.split("\n")
- s.executables = `git ls-files`.split("\n").map{ |f| f =~ /^bin\/(.*)/ ? $1 : nil }.compact
+ s.executables = `git ls-files`.split("\n").map { |f| f =~ /^bin\/(.*)/ ? $1 : nil }.compact
s.require_path = 'lib'
end
-
Something went wrong with that request. Please try again.