Permalink
Browse files

Fixed problems with Ruby 1.9 and with json gem

  • Loading branch information...
Philip (flip) Kromer
Philip (flip) Kromer committed Nov 15, 2010
1 parent b8145fd commit c729c4e8c51d350be3f5b97e9559f9382ce6bc63
View
@@ -1,6 +1,3 @@
[submodule "vendor/gems/amazon-ec2"]
path = vendor/gems/amazon-ec2
url = git://github.com/grempe/amazon-ec2.git
-[submodule "vendor/gems/json"]
- path = vendor/gems/json
- url = git://github.com/flori/json.git
View
@@ -1,7 +1,7 @@
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
-
+$: << File.dirname(__FILE__)
require 'config/requirements'
begin
@@ -25,24 +25,24 @@ namespace :poolparty do
end
task :vendor => ["poolparty:vendor:submodules"]
-
+
task :cleanup_test do
::FileUtils.rm_rf "/tmp/poolparty"
end
-
+
# task :test do
# sh "ruby -Ilib:test #{Dir["#{File.dirname(__FILE__)}/../test/poolparty/*/*.rb"].join(" ")}"
# end
-
+
Rake::TestTask.new(:test) do |t|
t.test_files = FileList['test/lib/**/*_test.rb']
t.warning = false
t.verbose = false
end
-
+
begin
require 'rcov/rcovtask'
-
+
Rcov::RcovTask.new(:rcov) do |t|
t.libs << FileList['lib/**/*.rb']
t.rcov_opts = [
@@ -62,7 +62,7 @@ end
desc "Clean tmp directory"
task :clean_tmp do |t|
- FileUtils.rm_rf("#{File.dirname(__FILE__)}/Manifest.txt") if ::File.exists?("#{File.dirname(__FILE__)}/Manifest.txt")
+ FileUtils.rm_rf("#{File.dirname(__FILE__)}/Manifest.txt") if ::File.exists?("#{File.dirname(__FILE__)}/Manifest.txt")
FileUtils.touch("#{File.dirname(__FILE__)}/Manifest.txt")
%w(logs tmp).each do |dir|
FileUtils.rm_rf("#{File.dirname(__FILE__)}/#{dir}") if ::File.exists?("#{File.dirname(__FILE__)}/#{dir}")
@@ -79,10 +79,10 @@ end
namespace :gem do
task(:build).prerequisites.unshift :gemspec # Prepend the gemspec generation
-
+
desc "Build the gem only if the tests pass"
task :test_then_build => [:test, :build]
-
+
desc "Build and install the gem only if the tests pass"
task :test_then_install => [:test, :install]
end
View
@@ -17,7 +17,7 @@ class Keypair
def initialize(fpath, extra_paths=[], opts={})
@filepath = fpath
@opts = opts
- @extra_paths = extra_paths.map {|a| File.expand_path(a) }
+ @extra_paths = [extra_paths].flatten.map {|a| File.expand_path(a) }
@search_suffixes = SEARCH_SUFFIXES
end
View
@@ -1,6 +1,6 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Ari Lerner", "Michael Fairchild", "Nate Murray"]
- s.date = %q{2010-04-16}
+ s.date = %q{2010-11-15}
s.description = %q{PoolParty: The easy, open-source, cross-cloud management solution}
s.email = %q{arilerner@mac.com}
s.executables = ["cloud", "cloud-bootstrap", "cloud-compile", "cloud-configure", "cloud-console", "cloud-contract", "cloud-expand", "cloud-list", "cloud-reboot", "cloud-rsync", "cloud-run", "cloud-show", "cloud-ssh", "cloud-start", "cloud-terminate", "cloud-vnc"]
@@ -291,6 +291,76 @@ Gem::Specification.new do |s|
"test/lib/poolparty/rds_test.rb",
"test/test_helper.rb",
"test/test_methods.rb",
+ "vendor/gems/amazon-ec2/ChangeLog",
+ "vendor/gems/amazon-ec2/LICENSE",
+ "vendor/gems/amazon-ec2/README.rdoc",
+ "vendor/gems/amazon-ec2/README_dev.rdoc",
+ "vendor/gems/amazon-ec2/Rakefile",
+ "vendor/gems/amazon-ec2/VERSION",
+ "vendor/gems/amazon-ec2/amazon-ec2.gemspec",
+ "vendor/gems/amazon-ec2/bin/ec2-gem-example.rb",
+ "vendor/gems/amazon-ec2/bin/ec2-gem-profile.rb",
+ "vendor/gems/amazon-ec2/bin/ec2sh",
+ "vendor/gems/amazon-ec2/bin/setup.rb",
+ "vendor/gems/amazon-ec2/deps.rip",
+ "vendor/gems/amazon-ec2/lib/AWS.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/Autoscaling.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/Autoscaling/autoscaling.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/Cloudwatch.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/Cloudwatch/monitoring.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/availability_zones.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/console.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/devpay.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/elastic_ips.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/image_attributes.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/images.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/instances.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/keypairs.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/products.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/security_groups.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/spot_instance_requests.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/spot_prices.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/subnets.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/EC2/volumes.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/ELB.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/ELB/load_balancers.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/RDS.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/RDS/rds.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/exceptions.rb",
+ "vendor/gems/amazon-ec2/lib/AWS/responses.rb",
+ "vendor/gems/amazon-ec2/perftools/ec2prof",
+ "vendor/gems/amazon-ec2/perftools/ec2prof-results.dot",
+ "vendor/gems/amazon-ec2/perftools/ec2prof-results.txt",
+ "vendor/gems/amazon-ec2/perftools/ec2prof.symbols",
+ "vendor/gems/amazon-ec2/test/test_Autoscaling_groups.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_availability_zones.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_console.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_elastic_ips.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_image_attributes.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_images.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_instances.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_keypairs.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_products.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_responses.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_s3_xmlsimple.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_security_groups.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_snapshots.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_spot_instance_requests.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_spot_prices.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_subnets.rb",
+ "vendor/gems/amazon-ec2/test/test_EC2_volumes.rb",
+ "vendor/gems/amazon-ec2/test/test_ELB_load_balancers.rb",
+ "vendor/gems/amazon-ec2/test/test_RDS.rb",
+ "vendor/gems/amazon-ec2/test/test_helper.rb",
+ "vendor/gems/amazon-ec2/wsdl/2007-08-29.ec2.wsdl",
+ "vendor/gems/amazon-ec2/wsdl/2008-02-01.ec2.wsdl",
+ "vendor/gems/amazon-ec2/wsdl/2008-05-05.ec2.wsdl",
+ "vendor/gems/amazon-ec2/wsdl/2008-12-01.ec2.wsdl",
+ "vendor/gems/amazon-ec2/wsdl/2009-10-31.ec2.wsdl",
+ "vendor/gems/amazon-ec2/wsdl/2009-11-30.ec2.wsdl",
"vendor/gems/dslify/LICENSE",
"vendor/gems/dslify/README.rdoc",
"vendor/gems/dslify/Rakefile",
@@ -326,94 +396,6 @@ Gem::Specification.new do |s|
"vendor/gems/git-style-binaries/test/running_binaries_test.rb",
"vendor/gems/git-style-binaries/test/shoulda_macros/matching_stdio.rb",
"vendor/gems/git-style-binaries/test/test_helper.rb",
- "vendor/gems/json/CHANGES",
- "vendor/gems/json/GPL",
- "vendor/gems/json/README",
- "vendor/gems/json/RUBY",
- "vendor/gems/json/Rakefile",
- "vendor/gems/json/TODO",
- "vendor/gems/json/VERSION",
- "vendor/gems/json/benchmarks/benchmark.txt",
- "vendor/gems/json/benchmarks/benchmark_generator.rb",
- "vendor/gems/json/benchmarks/benchmark_parser.rb",
- "vendor/gems/json/benchmarks/benchmark_rails.rb",
- "vendor/gems/json/bin/edit_json.rb",
- "vendor/gems/json/bin/prettify_json.rb",
- "vendor/gems/json/data/example.json",
- "vendor/gems/json/data/index.html",
- "vendor/gems/json/data/prototype.js",
- "vendor/gems/json/ext/json/ext/generator/extconf.rb",
- "vendor/gems/json/ext/json/ext/generator/generator.c",
- "vendor/gems/json/ext/json/ext/generator/unicode.c",
- "vendor/gems/json/ext/json/ext/generator/unicode.h",
- "vendor/gems/json/ext/json/ext/parser/Makefile",
- "vendor/gems/json/ext/json/ext/parser/extconf.rb",
- "vendor/gems/json/ext/json/ext/parser/gem_make.out",
- "vendor/gems/json/ext/json/ext/parser/parser.c",
- "vendor/gems/json/ext/json/ext/parser/parser.rl",
- "vendor/gems/json/ext/json/ext/parser/unicode.c",
- "vendor/gems/json/ext/json/ext/parser/unicode.h",
- "vendor/gems/json/ext/json/ext/parser/unicode.o",
- "vendor/gems/json/install.rb",
- "vendor/gems/json/lib/json.rb",
- "vendor/gems/json/lib/json/Array.xpm",
- "vendor/gems/json/lib/json/FalseClass.xpm",
- "vendor/gems/json/lib/json/Hash.xpm",
- "vendor/gems/json/lib/json/Key.xpm",
- "vendor/gems/json/lib/json/NilClass.xpm",
- "vendor/gems/json/lib/json/Numeric.xpm",
- "vendor/gems/json/lib/json/String.xpm",
- "vendor/gems/json/lib/json/TrueClass.xpm",
- "vendor/gems/json/lib/json/add/core.rb",
- "vendor/gems/json/lib/json/add/rails.rb",
- "vendor/gems/json/lib/json/common.rb",
- "vendor/gems/json/lib/json/editor.rb",
- "vendor/gems/json/lib/json/ext.rb",
- "vendor/gems/json/lib/json/json.xpm",
- "vendor/gems/json/lib/json/pure.rb",
- "vendor/gems/json/lib/json/pure/generator.rb",
- "vendor/gems/json/lib/json/pure/parser.rb",
- "vendor/gems/json/lib/json/version.rb",
- "vendor/gems/json/tests/fixtures/fail1.json",
- "vendor/gems/json/tests/fixtures/fail10.json",
- "vendor/gems/json/tests/fixtures/fail11.json",
- "vendor/gems/json/tests/fixtures/fail12.json",
- "vendor/gems/json/tests/fixtures/fail13.json",
- "vendor/gems/json/tests/fixtures/fail14.json",
- "vendor/gems/json/tests/fixtures/fail18.json",
- "vendor/gems/json/tests/fixtures/fail19.json",
- "vendor/gems/json/tests/fixtures/fail2.json",
- "vendor/gems/json/tests/fixtures/fail20.json",
- "vendor/gems/json/tests/fixtures/fail21.json",
- "vendor/gems/json/tests/fixtures/fail22.json",
- "vendor/gems/json/tests/fixtures/fail23.json",
- "vendor/gems/json/tests/fixtures/fail24.json",
- "vendor/gems/json/tests/fixtures/fail25.json",
- "vendor/gems/json/tests/fixtures/fail27.json",
- "vendor/gems/json/tests/fixtures/fail28.json",
- "vendor/gems/json/tests/fixtures/fail3.json",
- "vendor/gems/json/tests/fixtures/fail4.json",
- "vendor/gems/json/tests/fixtures/fail5.json",
- "vendor/gems/json/tests/fixtures/fail6.json",
- "vendor/gems/json/tests/fixtures/fail7.json",
- "vendor/gems/json/tests/fixtures/fail8.json",
- "vendor/gems/json/tests/fixtures/fail9.json",
- "vendor/gems/json/tests/fixtures/pass1.json",
- "vendor/gems/json/tests/fixtures/pass15.json",
- "vendor/gems/json/tests/fixtures/pass16.json",
- "vendor/gems/json/tests/fixtures/pass17.json",
- "vendor/gems/json/tests/fixtures/pass2.json",
- "vendor/gems/json/tests/fixtures/pass26.json",
- "vendor/gems/json/tests/fixtures/pass3.json",
- "vendor/gems/json/tests/runner.rb",
- "vendor/gems/json/tests/test_json.rb",
- "vendor/gems/json/tests/test_json_addition.rb",
- "vendor/gems/json/tests/test_json_fixtures.rb",
- "vendor/gems/json/tests/test_json_generate.rb",
- "vendor/gems/json/tests/test_json_rails.rb",
- "vendor/gems/json/tests/test_json_unicode.rb",
- "vendor/gems/json/tools/fuzz.rb",
- "vendor/gems/json/tools/server.rb",
"vendor/gems/searchable_paths/LICENSE",
"vendor/gems/searchable_paths/README.rdoc",
"vendor/gems/searchable_paths/Rakefile",
@@ -434,7 +416,7 @@ Gem::Specification.new do |s|
s.homepage = %q{http://poolpartyrb.com}
s.rdoc_options = ["--quiet", "--title", "PoolParty documentation", "--line-numbers", "--main", "README.rdoc"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
+ s.rubygems_version = %q{1.3.7}
s.summary = %q{Self-healing, auto-scaling system administration, provisioning and maintaining tool that makes cloud computing easier.}
s.test_files = [
"test/test_helper.rb",
@@ -445,7 +427,7 @@ Gem::Specification.new do |s|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
else
end
else
@@ -2,7 +2,7 @@
# Colorize String class extension.
#
class String
-
+
#
# Version string
#
@@ -21,7 +21,7 @@ class String
:cyan => 6,
:white => 7,
:default => 9,
-
+
:light_black => 10,
:light_red => 11,
:light_green => 12,
@@ -43,9 +43,9 @@ class String
:swap => 7, # Exchange foreground and background colors
:hide => 8 # Hide text (foreground color would be the same as background)
}
-
+
protected
-
+
#
# Set color values in new string intance
#
@@ -79,18 +79,18 @@ def set_color_parameters( params )
# puts "This is blue text on red".blue.on_red.blink
#
def colorize( params )
-
+
unless STDOUT.use_color
return self unless STDOUT.isatty
end
return self if ENV['NO_COLOR']
-
+
begin
- require 'Win32/Console/ANSI' if PLATFORM =~ /win32/
+ require 'Win32/Console/ANSI' if RUBY_PLATFORM =~ /win32/
rescue LoadError
raise 'You must gem install win32console to use color on Windows'
end
-
+
color_parameters = {}
if (params.instance_of?(Hash))
@@ -100,13 +100,13 @@ def colorize( params )
elsif (params.instance_of?(Symbol))
color_parameters[:color] = COLORS[params]
end
-
+
color_parameters[:color] ||= @color || 9
color_parameters[:background] ||= @background || 9
color_parameters[:mode] ||= @mode || 0
color_parameters[:uncolorized] ||= @uncolorized || self.dup
-
+
# calculate bright mode
color_parameters[:color] += 50 if color_parameters[:color] > 10
@@ -115,14 +115,14 @@ def colorize( params )
return "\033[#{color_parameters[:mode]};#{color_parameters[:color]+30};#{color_parameters[:background]+40}m#{color_parameters[:uncolorized]}\033[0m".set_color_parameters( color_parameters )
end
-
+
#
# Return uncolorized string
#
def uncolorize
return @uncolorized || self
end
-
+
#
# Return true if sting is colorized
#
@@ -156,7 +156,7 @@ def #{key.to_s}
end
class << self
-
+
#
# Return array of available modes used by colorize method
#
@@ -177,7 +177,7 @@ def colors
keys << key
end
keys
- end
+ end
#
# Display color matrix with color names.
@@ -192,7 +192,7 @@ def color_matrix( txt = "[X]" )
end
String.colors.reverse.each_with_index do | back, index |
puts "#{"|".rjust(txt.length)*(size-index)} < #{back}"
- end
+ end
end
end
end
Oops, something went wrong.

0 comments on commit c729c4e

Please sign in to comment.