README.md in recurly-0.2.0 vs README.md in recurly-0.2.1

- old
+ new

@@ -14,37 +14,68 @@ Installation ------------ This library can be installed as a gem or a plugin. Your choice. -**Rails3 Bundle Integration:** +**Rails3 Stable Version:** - gem "recurly", :git => "http://github.com/railsjedi/recurly-client-ruby.git" + gem 'recurly' +**Bleeding Edge Version:** + gem 'recurly', :git => "http://github.com/recurly/recurly-client-ruby.git" -**Plugin Installation (not recommended):** - script/plugin install http://github.com/railsjedi/recurly-client-ruby.git - - -Authentication +Setup (Rails 3) -------------- The Recurly Ruby Client requires a username and password to connect. We recommend creating a user just for your API. Please see the [Authentication](http://support.recurly.com/faqs/api/authentication) documentation for more information. -Create a file in your Rails app at __/config/initializers/recurly_config.rb__ with contents like: +If using Rails 3, the easiest way to get Recurly set up is to run `rake recurly:setup`. This will create a config/recurly.yml that has your recurly account authentication, and the Recurly rails initializer will pick it up on restart of your web app. + +Setup (Rails 2 and other frameworks) +-------------- + +Alternatively, if not using Rails 3, just make sure to call a Recurly configure block somewhere in your applications initialization. + Recurly.configure do |c| c.username = 'api@yourcompany.com' c.password = 'super_secret_password' c.site = 'https://my-recurly-site.recurly.com' end +In Rails 2.x, this code should be in config/initializers/recurly.rb -Demo Application +In Sinatra, it should be within a `configure` block. + + +Manual Setup via YAML +-------------- + +You can also configure Recurly via a YAML file by using: + + Recurly.configure_via_yaml("./config/recurly.yml") + + +The Recurly Configuration YAML is in the format of: + + username: myrecurlyuser@domain.com + password: myrecurlypassword + site: https://myrecurlysite.recurly.com + + +Clearing test data (Rails3) ---------------- + The Recurly Railtie (for rails3) includes a rake task that allows you to easily clear out the test data on your Account. This is useful when automating the testing of the api interation within your own app. + + rake recurly:clear_test_data + + +Rails Demo Application +---------------- + [Recurly Ruby Demo App](http://github.com/recurly/recurly-client-ruby-demo) Examples -------- @@ -65,11 +96,11 @@ The next thing is to setup all the spec dependencies bundle -When first running the specs, you'll need to setup a recurly test account. Use the provided rake task to walk you through creating spec/spec_settings.yml with all the authentication info. +When first running the specs, you'll need to setup a recurly test account. Use the provided rake task to walk you through creating spec/config/recurly.yml with all the authentication info. rake recurly:setup Now when you run `rake` it will hit recurly's api to run all the specs. Subsequent calls will no longer hit the API (and be run locally). @@ -78,23 +109,17 @@ ------------------ You can view the full http interactions with Recurly at spec/vcr. Please attached these to any bug reports so we can replicate. -Clearing Test Data ------------------- +Clearing Test Data in Specs +---------------------------- -You can delete the spec/vcr folder at any time, and it will regenerate the requests to recurly's apis. However if you do this, you'll also need to clear the test data on your recurly account. Here's how (manually): +You can delete the spec/vcr folder at any time, and it will regenerate the requests to recurly's apis. However if you do this, you'll also need to clear the test data on your recurly account. To do this run: -* Login to Recurly -* Click "Configuration"" on the top right menu -* Select "Clear Test Data" - -This is also automated via a rake task. It will delete the spec/vcr files, and clear the data for you on the server (using your spec_settings.yml authentication info). - rake recurly:clear - +This will run `recurly:clear_test_data` (using your spec/config/recurly.yml authentication info) to clear out the test data on the server and then delete the associated spec/vcr files so you can start from scratch. API Documentation ----------------- Please see the [Recurly API](http://docs.recurly.com/api/basics) for more information. \ No newline at end of file