Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@jnunemaker
Copy link

Allows people to use this alongside another Statsd class perhaps from another gem.

To avoid collision with other top level Statsd classes.

Also gets the specs passing again and adds a gemfile to make it easier to work on.
When checking 3 explicitly we sometimes get failures because 1.1.to_s is "1.1" instead of "1.10".

According to vmg, one or more should be fine and we want more than 2 points of precision, so it is better to change the test than the implementation.
@jnunemaker jnunemaker self-assigned this Aug 1, 2016
@vmg
Copy link

vmg commented Aug 1, 2016

This looks good to me. Sorry you had to tackle the tests too!

.gitignore Outdated
#*.swp

# deps should be good enough in Gemfile and gemspec that this isn't needed
Gemfile.lock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree.
Pushing Gemfile.lock to git is a better option IMO, because it makes easier to git bisect issues, as you would use the same dependencies at that point in time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally fine with that. I've been avoiding gemfile.lock because for some reason at some point the community did it that way. I'll add it in here.

@arthurnn
Copy link
Member

arthurnn commented Aug 2, 2016

🚢

lib/statsd.rb Outdated
end
end
end
require "github/statsd"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this file maintains backwards compatibility but makes it harder to load this alongside other gems that use the statsd namespace entry in the Ruby LOAD_PATH for their code.

Keiths-MacBook:Desktop keith$ ls lib/*/*.rb
lib/github/stats.rb lib/others/stats.rb
Keiths-MacBook:Desktop keith$ cat lib/*/*.rb
puts "github stats"
puts "other stats"
Keiths-MacBook:Desktop keith$ ruby -Ilib/github -Ilib/others -e "puts $:; require 'stats'"
/Users/keith/Desktop/lib/github
/Users/keith/Desktop/lib/others
/usr/local/Cellar/rbenv/1.0.0/rbenv.d/exec/gem-rehash
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin15
/Library/Ruby/Site/2.0.0/universal-darwin15
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
github stats

The one you get will depend on the LOAD_PATH ordering, what do you think about removing this file and just having github/statsd?

@jnunemaker
Copy link
Author

Keeping the file is only to get through atomic deploys. Once we are out and both old and new are pointed at the namespaced file I'll remove the lib/statsd.rb file and merge this. That is what I didn't explain so well I guess when I said temporarily in the commit.

No longer needed.
@jnunemaker jnunemaker merged commit f54e166 into master Aug 8, 2016
@jnunemaker jnunemaker deleted the namespace branch August 8, 2016 14:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants