Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload methods that require a screen name parameter #112

Closed
sferik opened this issue Nov 4, 2010 · 17 comments
Closed

Overload methods that require a screen name parameter #112

sferik opened this issue Nov 4, 2010 · 17 comments

Comments

@sferik
Copy link
Owner

sferik commented Nov 4, 2010

It should allow implicit fetching of an authenticated user's screen name from configuration.

This value should be cached in the configuration after the first request.

@sferik
Copy link
Owner Author

sferik commented Nov 5, 2010

I've added @todos for all the methods to which this change can be applied.

@gsomoza
Copy link
Contributor

gsomoza commented Nov 30, 2010

Hi,

Don't know if anybody has been addressing this yet but I've made some advances. I'd like to know if you think I'm headed in the right direction though. You can find my branch here:

https://github.com/gabrielsomoza/twitter/tree/screen-name-overloading

Cheers.

UPDATE: A link with a diff, for your convenience: gsomoza/twitter@master...screen-name-overloading

@sferik
Copy link
Owner Author

sferik commented Nov 30, 2010

Thanks for starting to tackle this problem! Your approach looks good to me.

I'd love to see specs that cover each way of calling the method (with and without a screen name passed).

This is the only major feature I had in mind for 1.1, so unless any new feature requests come in before then, we should be able to release 1.1 shortly after you finish.

@gsomoza
Copy link
Contributor

gsomoza commented Nov 30, 2010

Great, I'll go ahead on this path then. Glad to help!

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

I'm getting an error when trying to run bundle exec rake doc:yard. I'm using Ruby 1.9.1 on windows 7, and already run bundle install. Any guidance?

rake aborted!
Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it.
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'

(I finished with the changes, only thing left would be writing the specs)

@sferik
Copy link
Owner Author

sferik commented Dec 1, 2010

What happens if you change line 2 of your Rakefile to:

Bundler::GemHelper.install_tasks, :name => 'twitter'

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Tried that too, the following happens:
No such file or directory - twitter.gemspec
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'

@sferik
Copy link
Owner Author

sferik commented Dec 1, 2010

I assume you haven't deleted the gemspec from the root directory?

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

No, its there, twitter.gemspec

@sferik
Copy link
Owner Author

sferik commented Dec 1, 2010

I just asked about this in #carlhuda on irc.freenode.net. To quote hone:

1.9.1 is fairly broken

He suggested upgrading to Ruby 1.9.2. Is that an option?

FWIW, I can't reproduce in the problem using Ruby 1.9.1p378 in Mac OS X.

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Sure! Will do, thanks for the help.

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Just cloned my branch from my laptop, with Ruby 1.9.2p0, and I'm still getting the same error messages. I reckon this is a problem with my configuration only: I tried running yard:doc against a clean master and I have the same problem.

@sferik
Copy link
Owner Author

sferik commented Dec 1, 2010

Try replacing the Gemfile with:

source "http://rubygems.org"

gem "hashie", "~> 0.4.0"
gem "faraday", "~> 0.5.3"
gem "faraday_middleware", "~> 0.3.0"
gem "jruby-openssl", "~> 0.7.2" if RUBY_PLATFORM == "java"
gem "multi_json", "~> 0.0.5"
gem "multi_xml", "~> 0.2.0"
gem "simple_oauth", "~> 0.1.3"

group :development, :test do
  gem "bundler", "~> 1.0"
  gem "json", "~> 1.4"
  gem "nokogiri", "~> 1.4"
  gem "maruku", "~> 0.6"
  gem "rake", "~> 0.8"
  gem "rspec", "~> 2.1"
  gem "simplecov", "~> 0.3"
  gem "webmock", "~> 1.6"
  gem "yard", "~> 0.6"
  gem "ZenTest", "~> 4.4"
end

@sferik
Copy link
Owner Author

sferik commented Dec 1, 2010

Before replacing the Gemfile, could you please run rake --trace and paste in the full trace (preferably in a Gist)?

Also, what version of bundler are you using?

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Didn't work. I just found a thread on this problem, which indeed seems to be a win-only issue. http://groups.google.com/group/ruby-bundler/browse_thread/thread/96152d7357745bb0. Somebody there apparently was able to come up with a fix and they're now writing tests for it. I'll try to apply the fix (at least temporarily) in order to write the specs.

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Sorry, read your other comment afterwards. The patch worked and now I'm running the tests. Tomorrow I'll start writing the specs.

@gsomoza
Copy link
Contributor

gsomoza commented Dec 1, 2010

Finished writing the specs for the overloads and everything works fine. There may be better ways to test than what I did, in which case I'd appreciate any feedback. I'm sending a pull request in case you think everything is fine as is.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants