filip7d/7digital — Issue #1: Regex in peachy_patchy.rb causes warnings on Ruby 1.9.3
Author: gerrit
Created: 2012-01-21 11:36:23+00:00
State: open

When doing a `require 'sevendigital'` on Ruby 1.9.3 I get the following warnings, multiple times:

/Users/gerrit/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: nested repeat operator + and * was replaced with '*'
/Users/gerrit/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: nested repeat operator + and * was replaced with '*'
/Users/gerrit/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: nested repeat operator + and * was replaced with '*'

This seems to be caused by the following regex in peachy_patchy.rb

@method_name =~ /^[a-z0-9]+(?:[_a-z0-9]+)*(?:NS[a-z0-9]+(?:[_a-z0-9]+)*)?$/

Otherwise the library appears to be working fine under 1.9.3, just those repeated warnings are annoying. I didn’t want to jump in and tear that complex regex apart because there didn‘t seem to be any tests for it directly. Also, running the tests on my system errored:

```

1)
Errno::ENOENT in 'UserManager purchase_basket should call user/purchase/basket api method and return digested locker items'
No such file or directory - /Users/gerrit/Development/7digital/spec/test-xml/methods/user/purchase/basket.xml
/Users/gerrit/Development/7digital/spec/spec_helper.rb:39:in `read'
/Users/gerrit/Development/7digital/spec/spec_helper.rb:39:in `load_sample_method_xml'
/Users/gerrit/Development/7digital/spec/spec_helper.rb:48:in `fake_api_response'
spec/management/user_manager_spec.rb:136:in `block (2 levels) in '

2)
'Sevendigital Gem should fail to sign up an existing user' FAILED
expected: "User with given email already exists",
got: "OAuth authentication error: Access to resource denied" (using ==)
spec/sevendigital_spec.rb:34:in `block (2 levels) in '

3)
Sevendigital::SevendigitalError in 'Sevendigital Gem should create and purchase basket'
401 - OAuth authentication error: Access to resource denied
/Users/gerrit/Development/7digital/lib/sevendigital/api_operator.rb:52:in `digest_http_response'
```