Permalink
Browse files

Rename files in cf-autoconfig and cf-runtime gems

- In Rails, requiring the gem now automatically requires the gem
  files
- Also bump gem versions to 0.2.0
  • Loading branch information...
1 parent b15552c commit e9729e62031d94985528cd6d4aae6e6742aee934 Dennis Schmidt & Matt Royal committed Feb 27, 2013
Showing with 189 additions and 172 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 README
  3. +0 −1 auto-reconfiguration/Gemfile
  4. +7 −3 auto-reconfiguration/Gemfile.lock
  5. +13 −0 auto-reconfiguration/README.md
  6. +2 −2 auto-reconfiguration/cf-autoconfig.gemspec
  7. +3 −0 auto-reconfiguration/lib/cf-autoconfig.rb
  8. +3 −3 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/blob/aws_s3.rb
  9. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/blob/aws_s3_configurer.rb
  10. 0 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/configuration_helper.rb
  11. +9 −9 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/configurer.rb
  12. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/document/mongodb.rb
  13. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/document/mongodb_configurer.rb
  14. +3 −3 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/keyvalue/redis.rb
  15. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/keyvalue/redis_configurer.rb
  16. +3 −3 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/messaging/amqp.rb
  17. +2 −2 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/messaging/amqp_configurer.rb
  18. +3 −3 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/messaging/carrot.rb
  19. +2 −2 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/messaging/carrot_configurer.rb
  20. +3 −3 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/relational/mysql.rb
  21. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/relational/mysql_configurer.rb
  22. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/relational/postgres.rb
  23. +1 −1 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/relational/postgres_configurer.rb
  24. +2 −2 auto-reconfiguration/lib/{cfautoconfig → cf-autoconfig}/version.rb
  25. +0 −3 auto-reconfiguration/lib/cfautoconfig.rb
  26. +4 −4 auto-reconfiguration/spec/unit/blob/aws_s3_configurer_spec.rb
  27. +2 −2 auto-reconfiguration/spec/unit/configuration_helper_spec.rb
  28. +3 −3 auto-reconfiguration/spec/unit/document/mongo_configurer_spec.rb
  29. +5 −5 auto-reconfiguration/spec/unit/keyvalue/redis_configurer_spec.rb
  30. +5 −5 auto-reconfiguration/spec/unit/messaging/amqp_configurer_spec.rb
  31. +5 −5 auto-reconfiguration/spec/unit/messaging/carrot_configurer_spec.rb
  32. +3 −3 auto-reconfiguration/spec/unit/relational/mysql_configurer_spec.rb
  33. +4 −4 auto-reconfiguration/spec/unit/relational/postgres_configurer_spec.rb
  34. +2 −2 cfruntime-tests/spec/assets/amqp_service_bindings_by_name/app.rb
  35. +2 −2 cfruntime-tests/spec/assets/amqp_service_bindings_by_type/app.rb
  36. +1 −1 cfruntime-tests/spec/assets/service_bindings_by_name/app.rb
  37. +2 −2 cfruntime-tests/spec/assets/service_bindings_by_type/app.rb
  38. +1 −1 cfruntime/Gemfile
  39. +1 −1 cfruntime/Gemfile.lock
  40. +2 −2 cfruntime/README.md
  41. +1 −1 cfruntime/cf-runtime.gemspec
  42. +30 −0 cfruntime/lib/cf-runtime.rb
  43. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/amqp.rb
  44. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/aws_s3.rb
  45. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/carrot.rb
  46. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/mongodb.rb
  47. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/mysql.rb
  48. 0 cfruntime/lib/{cfruntime → cf-runtime}/okjson.rb
  49. +7 −0 cfruntime/lib/cf-runtime/parser.rb
  50. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/blob_parser.rb
  51. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/default_parser.rb
  52. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/mongodb_parser.rb
  53. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/mysql_parser.rb
  54. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/postgresql_parser.rb
  55. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/rabbitmq_parser.rb
  56. 0 cfruntime/lib/{cfruntime → cf-runtime}/parser/redis_parser.rb
  57. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/postgres.rb
  58. +3 −3 cfruntime/lib/{cfruntime → cf-runtime}/properties.rb
  59. +2 −2 cfruntime/lib/{cfruntime → cf-runtime}/redis.rb
  60. +1 −1 cfruntime/lib/{cfruntime → cf-runtime}/version.rb
  61. +0 −30 cfruntime/lib/cfruntime.rb
  62. +0 −7 cfruntime/lib/cfruntime/parser.rb
  63. +2 −2 cfruntime/spec/amqp_spec.rb
  64. +2 −2 cfruntime/spec/aws_s3_spec.rb
  65. +2 −2 cfruntime/spec/carrot_spec.rb
  66. +2 −2 cfruntime/spec/mongodb_spec.rb
  67. +2 −2 cfruntime/spec/mysql_spec.rb
  68. +2 −2 cfruntime/spec/parser/default_parser_spec.rb
  69. +2 −2 cfruntime/spec/parser/mongodb_parser_spec.rb
  70. +2 −2 cfruntime/spec/parser/mysql_parser_spec.rb
  71. +2 −2 cfruntime/spec/parser/postgresql_parser_spec.rb
  72. +2 −2 cfruntime/spec/parser/rabbitmq_parser_spec.rb
  73. +2 −2 cfruntime/spec/parser/redis_parser_spec.rb
  74. +2 −2 cfruntime/spec/postgres_spec.rb
  75. +1 −1 cfruntime/spec/properties_spec.rb
  76. +2 −2 cfruntime/spec/redis_spec.rb
View
@@ -0,0 +1 @@
+.idea/
View
2 README
@@ -8,7 +8,7 @@ deployment to multiple clouds.
== What is this component
-The vcap-ruby repo contains the auto-reconfiguration and cfruntime modules. cf-runtime is a client library that makes it easier to connect to Cloud Foundry services from your Ruby applications. The auto-reconfiguration module is used internally by the Cloud Foundry staging plugins to automatically connect Ruby and Sinatra applications to Cloud Foundry services.
+The vcap-ruby repo contains the auto-reconfiguration and cf-runtime modules. cf-runtime is a client library that makes it easier to connect to Cloud Foundry services from your Ruby applications. The auto-reconfiguration module is used internally by the Cloud Foundry staging plugins to automatically connect Ruby and Sinatra applications to Cloud Foundry services.
== License
@@ -1,4 +1,3 @@
source "http://rubygems.org"
gemspec
-
@@ -1,8 +1,12 @@
PATH
remote: .
specs:
- cf-autoconfig (0.1.0)
- cf-runtime (= 0.1.1)
+ cf-autoconfig (0.2.0)
+
+PATH
+ remote: ../cfruntime/
+ specs:
+ cf-runtime (0.1.1)
GEM
remote: http://rubygems.org/
@@ -22,7 +26,6 @@ GEM
bson (1.6.1)
builder (3.0.0)
carrot (1.2.0)
- cf-runtime (0.1.1)
ci_reporter (1.6.9)
builder (>= 2.1.2)
diff-lcs (1.1.3)
@@ -59,6 +62,7 @@ DEPENDENCIES
aws-s3 (~> 0.6.3)
carrot (~> 1.0)
cf-autoconfig!
+ cf-runtime (= 0.1.1)!
ci_reporter (~> 1.6.5)
mongo (~> 1.2.0)
mysql2 (~> 0.2.7)
@@ -0,0 +1,13 @@
+In rails simply add cf-autoconfig to your Gemfile.
+
+~~~ruby
+gem "cf-autoconfig"
+~~~
+
+Everywhere else also require it
+
+~~~ruby
+require "rubygems"
+require "cf-autoconfig"
+~~~
+
@@ -1,7 +1,7 @@
$:.unshift File.expand_path("../lib", __FILE__)
-require 'cfautoconfig/version'
+require 'cf-autoconfig/version'
spec = Gem::Specification.new do |s|
s.name = "cf-autoconfig"
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
s.extra_rdoc_files = ["LICENSE"]
s.rdoc_options = ["-N", "--tab-width=2", "--exclude='cf-autoconfig.gemspec|spec'"]
- s.add_dependency "cf-runtime", "= 0.1.1"
+ s.add_dependency "cf-runtime", "= 0.2.0"
s.add_development_dependency "redis", "~> 2.0"
s.add_development_dependency "amqp", "~> 0.8"
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'cf-autoconfig/configurer'
+require 'cf-autoconfig/version'
@@ -1,5 +1,5 @@
-require 'cfruntime/properties'
-require 'cfruntime/aws_s3'
+require 'cf-runtime/properties'
+require 'cf-runtime/aws_s3'
module AutoReconfiguration
SUPPORTED_AWS_S3_VERSION = '0.6.3'
@@ -20,4 +20,4 @@ def connect_with_cf(options = {})
original_connect options
end
end
-end
+end
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
require 'aws/s3'
require File.join(File.dirname(__FILE__), 'aws_s3')
@@ -1,44 +1,44 @@
-require 'cfruntime/properties'
+require 'cf-runtime/properties'
if CFRuntime::CloudApp.service_props('redis')
puts "Loading Redis auto-reconfiguration."
- require 'cfautoconfig/keyvalue/redis_configurer'
+ require 'cf-autoconfig/keyvalue/redis_configurer'
else
puts "No Redis service bound to app. Skipping auto-reconfiguration."
end
if CFRuntime::CloudApp.service_props('mongodb')
puts "Loading MongoDB auto-reconfiguration."
- require 'cfautoconfig/document/mongodb_configurer'
+ require 'cf-autoconfig/document/mongodb_configurer'
else
puts "No Mongo service bound to app. Skipping auto-reconfiguration."
end
if CFRuntime::CloudApp.service_props('mysql')
puts "Loading MySQL auto-reconfiguration."
- require 'cfautoconfig/relational/mysql_configurer'
+ require 'cf-autoconfig/relational/mysql_configurer'
else
puts "No MySQL service bound to app. Skipping auto-reconfiguration."
end
if CFRuntime::CloudApp.service_props('postgresql')
puts "Loading PostgreSQL auto-reconfiguration."
- require 'cfautoconfig/relational/postgres_configurer'
+ require 'cf-autoconfig/relational/postgres_configurer'
else
puts "No PostgreSQL service bound to app. Skipping auto-reconfiguration."
end
if CFRuntime::CloudApp.service_props('rabbitmq')
puts "Loading RabbitMQ auto-reconfiguration."
- require 'cfautoconfig/messaging/amqp_configurer'
- require 'cfautoconfig/messaging/carrot_configurer'
+ require 'cf-autoconfig/messaging/amqp_configurer'
+ require 'cf-autoconfig/messaging/carrot_configurer'
else
puts "No RabbitMQ service bound to app. Skipping auto-reconfiguration."
end
if CFRuntime::CloudApp.service_props('blob')
puts "Loading Blob auto-reconfiguration."
- require 'cfautoconfig/blob/aws_s3_configurer'
+ require 'cf-autoconfig/blob/aws_s3_configurer'
else
puts "No Blob service bound to app. Skipping auto-reconfiguration."
-end
+end
@@ -1,4 +1,4 @@
-require 'cfruntime/properties'
+require 'cf-runtime/properties'
module AutoReconfiguration
SUPPORTED_MONGO_VERSION = '1.2.0'
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
#Require mongo here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "mongo"
@@ -1,5 +1,5 @@
-require 'cfruntime/properties'
-require 'cfruntime/redis'
+require 'cf-runtime/properties'
+require 'cf-runtime/redis'
module AutoReconfiguration
SUPPORTED_REDIS_VERSION = '2.0'
@@ -21,4 +21,4 @@ def initialize_with_cf(options = {})
end
end
end
-end
+end
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
require 'redis'
require File.join(File.dirname(__FILE__), 'redis')
@@ -1,5 +1,5 @@
-require 'cfruntime/properties'
-require 'cfruntime/amqp'
+require 'cf-runtime/properties'
+require 'cf-runtime/amqp'
module AutoReconfiguration
SUPPORTED_AMQP_VERSION = '0.8'
@@ -27,4 +27,4 @@ def connect_with_cf(connection_options_or_string = {}, other_options = {}, &bloc
end
end
end
-end
+end
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
#Require amqp here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "amqp"
@@ -30,4 +30,4 @@ class << AMQP
end
rescue LoadError
puts "No AMQP Library Found. Skipping auto-reconfiguration."
-end
+end
@@ -1,5 +1,5 @@
-require 'cfruntime/properties'
-require 'cfruntime/carrot'
+require 'cf-runtime/properties'
+require 'cf-runtime/carrot'
module AutoReconfiguration
SUPPORTED_CARROT_VERSION = '1.0'
@@ -21,4 +21,4 @@ def initialize_with_cf(opts = {})
end
end
end
-end
+end
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
#Require carrot here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "carrot"
@@ -30,4 +30,4 @@ class Carrot
end
rescue LoadError
puts "No Carrot Library Found. Skipping auto-reconfiguration."
-end
+end
@@ -1,5 +1,5 @@
-require 'cfruntime/properties'
-require 'cfruntime/mysql'
+require 'cf-runtime/properties'
+require 'cf-runtime/mysql'
module AutoReconfiguration
SUPPORTED_MYSQL2_VERSION = '0.2.7'
@@ -9,7 +9,7 @@ def self.included( base )
base.send( :alias_method, :original_initialize, :initialize)
base.send( :alias_method, :initialize, :initialize_with_cf )
end
-
+
def initialize_with_cf(opts = {})
service_names = CFRuntime::CloudApp.service_names_of_type('mysql')
if service_names.length == 1
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
#Require mysql2 here is mandatory for configurer to ensure class is loaded before applying OpenClass
@@ -1,4 +1,4 @@
-require 'cfruntime/properties'
+require 'cf-runtime/properties'
module AutoReconfiguration
SUPPORTED_PG_VERSION = '0.11.0'
module Postgres
@@ -1,4 +1,4 @@
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
begin
#Require pg here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "pg"
@@ -1,3 +1,3 @@
module AutoReconfiguration
- VERSION = '0.1.0'
-end
+ VERSION = '0.2.0'
+end
@@ -1,3 +0,0 @@
-require 'rubygems'
-require 'cfautoconfig/configurer'
-require 'cfautoconfig/version'
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '../../','spec_helper')
require 'aws/s3'
-require 'cfautoconfig/blob/aws_s3_configurer'
+require 'cf-autoconfig/blob/aws_s3_configurer'
describe 'AutoReconfiguration::AwsS3' do
@@ -61,7 +61,7 @@
end
it 'does not open Connection class to apply methods twice' do
- load 'cfautoconfig/blob/aws_s3_configurer.rb'
+ load 'cf-autoconfig/blob/aws_s3_configurer.rb'
#This would blow up massively (stack trace too deep) if we
#aliased connect twice
AWS::S3::Base.establish_connection!(
@@ -74,7 +74,7 @@
it 'disables Blob auto-reconfig if DISABLE_AUTO_CONFIG includes blob' do
ENV['DISABLE_AUTO_CONFIG'] = "redis:blob:mongodb"
- load 'cfautoconfig/blob/aws_s3_configurer.rb'
+ load 'cf-autoconfig/blob/aws_s3_configurer.rb'
AWS::S3::Base.establish_connection!(
:access_key_id => "myid",
:secret_access_key => "mykey",
@@ -84,4 +84,4 @@
AWS::S3::Base.connection.options.should == {:server=>"myserver.com",
:port=>10001, :access_key_id=>"myid", :secret_access_key=>"mykey"}
end
-end
+end
@@ -1,5 +1,5 @@
require File.join(File.dirname(__FILE__), '../','spec_helper')
-require 'cfautoconfig/configuration_helper'
+require 'cf-autoconfig/configuration_helper'
describe 'AutoReconfiguration::ConfigurationHelper' do
@@ -22,4 +22,4 @@
(AutoReconfiguration::ConfigurationHelper::disabled? :mysql).should == true
end
-end
+end
@@ -1,6 +1,6 @@
File.join(File.dirname(__FILE__), '../../','spec_helper')
require 'mongo'
-require 'cfautoconfig/document/mongodb_configurer'
+require 'cf-autoconfig/document/mongodb_configurer'
describe 'AutoReconfiguration::Mongo' do
@@ -155,8 +155,8 @@ def add_auth(database, username, password)
it 'disables Mongo auto-reconfig if DISABLE_AUTO_CONFIG includes mongodb' do
ENV['DISABLE_AUTO_CONFIG'] = "redis:mongodb"
- load 'cfautoconfig/document/mongodb_configurer.rb'
+ load 'cf-autoconfig/document/mongodb_configurer.rb'
mongo = Mongo::Connection.new('127.0.0.1', 27017, {:connect => false})
mongo.host_to_try.should == mongo.send(:format_pair, '127.0.0.1', 27017)
end
-end
+end
@@ -1,7 +1,7 @@
require File.join(File.dirname(__FILE__), '../../','spec_helper')
require 'redis'
-require 'cfautoconfig/keyvalue/redis_configurer'
-require 'cfruntime/properties.rb'
+require 'cf-autoconfig/keyvalue/redis_configurer'
+require 'cf-runtime/properties.rb'
describe 'AutoReconfiguration::Redis' do
@@ -56,7 +56,7 @@
end
it 'does not open Redis class to apply methods twice' do
- load 'cfautoconfig/keyvalue/redis_configurer.rb'
+ load 'cf-autoconfig/keyvalue/redis_configurer.rb'
#This would blow up massively (stack trace too deep) if we
#aliased initialize twice
redis = Redis.new(:host => '127.0.0.1',
@@ -69,12 +69,12 @@
it 'disables Redis auto-reconfig if DISABLE_AUTO_CONFIG includes redis' do
ENV['DISABLE_AUTO_CONFIG'] = "redis:mongodb"
- load 'cfautoconfig/keyvalue/redis_configurer.rb'
+ load 'cf-autoconfig/keyvalue/redis_configurer.rb'
redis = Redis.new(:host => '127.0.0.1',
:port => '6321',
:password => 'mypw')
redis.client.host.should == '127.0.0.1'
redis.client.port.should == 6321
redis.client.password.should == 'mypw'
end
-end
+end
Oops, something went wrong.

0 comments on commit e9729e6

Please sign in to comment.