Skip to content
Browse files

Updated readme syntax errors and removed semicolons

  • Loading branch information...
1 parent 2d50272 commit 28693c357f77d37ffb6b99ca0924fbc6033eefba Ramez Mourad committed Apr 30, 2012
Showing with 21 additions and 19 deletions.
  1. +21 −19 README.md
View
40 README.md
@@ -2,49 +2,51 @@ Fastly - client library for interacting with the Fastly web acceleration service
# Example
- fastly = Fastly.new(login_opts);
+ fastly = Fastly.new(login_opts)
- current_user = fastly.current_user;
- current_customer = fastly.current_customer;
+ current_user = fastly.current_user
+ current_customer = fastly.current_customer
- user = fastly.get_user(current_user.id);
- customer = fastly.get_customer(current_customer.id);
+ user = fastly.get_user(current_user.id)
+ customer = fastly.get_customer(current_customer.id)
puts "Name: #{user.name}"
puts "Works for #{user.customer.name}"
puts "Which is the same as #{customer.name}"
puts "Which has the owner #{customer.owner.name}"
# Let's see which services we have defined
- customer.list_services.each do |service|
- puts service.id
- puts service.name
- service.versions.each do |version
- puts "\t#{version.number}"
+ fastly.list_services.each do |service|
+ puts "Service ID: #{service.id}"
+ puts "Service Name: #{service.name}"
+ puts "Service Versions:"
+ service.versions.each do |version|
+ puts "\t#{version.number}"
+ end
end
- service = fastly.create_service(:name => "MyFirstService");
- latest_version = service.version;
+ service = fastly.create_service(:name => "MyFirstService")
+ latest_version = service.version
# Create a domain and a backend for the service ...
- domain = fastly.create_domain(:service_id => service.id, :version => latest_version.number, :name => "www.example.com");
- backend = fastly.create_backend(:service_id => service.id, :version => latest_version.number, :ipv4 => "127.0.0.1", :port => 80);
+ domain = fastly.create_domain(:service_id => service.id, :version => latest_version.number, :name => "www.example.com")
+ backend = fastly.create_backend(:service_id => service.id, :version => latest_version.number, :ipv4 => "127.0.0.1", :port => 80)
# ... and activate it. You're now hosted on Fastly.
latest_version.activate
# Let's take a peek at the VCL that Fastly generated for us
- vcl = latest_version.generated_vcl;
+ vcl = latest_version.generated_vcl
puts "Generated VCL file is:\n#{vcl.content}"
# Now let's create a new version ...
- new_version = latest_version.clone;
+ new_version = latest_version.clone
# ... add a new backend ...
- new_backend = fastly.create_backend(:service_id => service.id, :version => new_version.number, :ipv4 => "192.168.0.1", :port => 8080);
+ new_backend = fastly.create_backend(:service_id => service.id, :version => new_version.number, :ipv4 => "192.168.0.1", :port => 8080)
# ... and upload some custome vcl (presuming we have permissions)
- new_version.upload_vcl(vcl_name, File.read(vcl_file));
+ new_version.upload_vcl(vcl_name, File.read(vcl_file))
- new_version.activate;
+ new_version.activate
# Copyright

0 comments on commit 28693c3

Please sign in to comment.
Something went wrong with that request. Please try again.