Contributing

23 views
Skip to first unread message

Ken Collins

unread,
Jun 27, 2011, 1:03:39 PM6/27/11
to Barby
I just forked the project on Github and would like to contribute.
Would any of these be helpful and/or accepted?

1) A Gemfile for development to just bundle install and run rake test?
I have had horrible experiences getting a matching rspec installed in
some projects and on a clean checkout, I have no idea what is required
to start running tests. I have yet to try installing some things and
getting tests running, but can the author details what is currently
the best practice for running tests?

2) I want to work on an HTML outputter. Something like what rQRCode
does. http://whomwah.github.com/rqrcode/

Thoughts? Feedback?


- TIA, Ken

Tore Darell

unread,
Jun 27, 2011, 1:39:09 PM6/27/11
to ruby-...@googlegroups.com
1) A Gemfile is probably a good idea. I'm not really up to date on all this Bundler stuff, so I don't know what the current best practises are, but I don't like the idea of hard dependencies (not everyone wants to install RMagick, for example), though a hint somewhere which gems are required for various functionality would be nice.

I honestly don't know which version of RSpec should be installed, I just use the newest version. I've had version mismatches before, but updating RSpec usually solved it. Eventually, I'd like to remove the dependency on RSpec and just use Test::Unit.

There shouldn't be anything else required to run the tests, just that some symbologies and outputters have dependencies that you need if you're going to run their tests. It will be pretty obvious what they are if you look at the files in question.

2) Go for it!

> --
> You received this message because you are subscribed to the Google Groups "Barby" group.
> To post to this group, send email to ruby-...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-barby+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-barby?hl=en.
>

Ken Collins

unread,
Jun 27, 2011, 2:18:13 PM6/27/11
to ruby-...@googlegroups.com

Tore,

> 1) A Gemfile is probably a good idea. I'm not really up to date on all this Bundler stuff, so I don't know what the current best practises are, but I don't like the idea of hard dependencies (not everyone wants to install RMagick, for example), though a hint somewhere which gems are required for various functionality would be nice.

Yup, I get that. Typically that is done with simple environment variables in the Gemfile. Something like ENV['BARBY_USE_RMAGIC']. Or putting the gems into group like so. I'll do the later in my pull request.

group :outputter_deps do
# ...
end

> I honestly don't know which version of RSpec should be installed, I just use the newest version. I've had version mismatches before, but updating RSpec usually solved it.

I installed the latest on a new gemset and could not get the test to run. This sums up my experience. What version do you have installed now? I just did "gem install rspec" and got 2.6.0.

> Eventually, I'd like to remove the dependency on RSpec and just use Test::Unit.There shouldn't be anything else required to run the tests, just that some symbologies and outputters have dependencies that you need if you're going to run their tests. It will be pretty obvious what they are if you look at the files in question.

How about MiniTest::Spec? I've switched to that for all my standalone projects. Installs and runs fine in 1.8 and upward. If that is OK, would you be receptive to a set of pull request that does this as well?

I know touching things like Gemfiles, Rakefiles, etc are typically taboo, but if I have your blessing, this should be a good change for getting contributions as it will reduce the barrier to testing.

> 2) Go for it!

Thanks! I'll do the HTML/CSS outputter pull request after the ones above. Again, assuming that is all OK with you?


- Ken

Ken Collins

unread,
Jun 27, 2011, 2:21:12 PM6/27/11
to ruby-...@googlegroups.com

Tore,

Also, can you detail why rqrcode is vendored? Would you be acceptable to a patch that put's that in the gemspec as an official dependency to a specific version, perhaps "~> 0.3.3"?


- Ken


Tore Darell

unread,
Jun 27, 2011, 3:03:20 PM6/27/11
to ruby-...@googlegroups.com

On Jun 27, 2011, at 20:18, Ken Collins wrote:

>
> Tore,
>
>> 1) A Gemfile is probably a good idea. I'm not really up to date on all this Bundler stuff, so I don't know what the current best practises are, but I don't like the idea of hard dependencies (not everyone wants to install RMagick, for example), though a hint somewhere which gems are required for various functionality would be nice.
>
> Yup, I get that. Typically that is done with simple environment variables in the Gemfile. Something like ENV['BARBY_USE_RMAGIC']. Or putting the gems into group like so. I'll do the later in my pull request.
>
> group :outputter_deps do
> # ...
> end

Sounds good. I don't like the idea of using env vars.

>> I honestly don't know which version of RSpec should be installed, I just use the newest version. I've had version mismatches before, but updating RSpec usually solved it.
>
> I installed the latest on a new gemset and could not get the test to run. This sums up my experience. What version do you have installed now? I just did "gem install rspec" and got 2.6.0.

I have 2.5.1 right now, and it works ok. I don't run all specs at once (I don't have JRuby), but running each at a time works fine.

>> Eventually, I'd like to remove the dependency on RSpec and just use Test::Unit.There shouldn't be anything else required to run the tests, just that some symbologies and outputters have dependencies that you need if you're going to run their tests. It will be pretty obvious what they are if you look at the files in question.
>
> How about MiniTest::Spec? I've switched to that for all my standalone projects. Installs and runs fine in 1.8 and upward. If that is OK, would you be receptive to a set of pull request that does this as well?

MiniTest yes, ::Spec no. Unnecessary complexity is my nemesis.

> I know touching things like Gemfiles, Rakefiles, etc are typically taboo, but if I have your blessing, this should be a good change for getting contributions as it will reduce the barrier to testing.

Go ahead. I haven't paid much attention to these anyway.

>> 2) Go for it!
>
> Thanks! I'll do the HTML/CSS outputter pull request after the ones above. Again, assuming that is all OK with you?
>
> - Ken
>

Tore Darell

unread,
Jun 27, 2011, 3:15:26 PM6/27/11
to Barby


On Jun 27, 8:21 pm, Ken Collins <k...@metaskills.net> wrote:
> Tore,
>
> Also, can you detail why rqrcode is vendored? Would you be acceptable to a patch that put's that in the gemspec as an official dependency to a specific version, perhaps "~> 0.3.3"?

Seemed like a good idea at the time, before any other dependencies
were introduced (I should probably remove that bit about "no
dependencies" in the description). If we can add a gem dependency to a
specific version instead, that should work. What I want to avoid is
people having problems using Barby because their installed version of
X gem is too old/new. Though "too new" shouldn't really be a problem.

>  - Ken

Ken Collins

unread,
Jun 27, 2011, 4:20:05 PM6/27/11
to ruby-...@googlegroups.com

>> Also, can you detail why rqrcode is vendored? Would you be acceptable to a patch that put's that in the gemspec as an official dependency to a specific version, perhaps "~> 0.3.3"?
>
> Seemed like a good idea at the time, before any other dependencies
> were introduced (I should probably remove that bit about "no
> dependencies" in the description). If we can add a gem dependency to a
> specific version instead, that should work. What I want to avoid is
> people having problems using Barby because their installed version of
> X gem is too old/new. Though "too new" shouldn't really be a problem.

Yea, in this case the ~> operator on 0.3.3 (current vendored version) would mean 0.3.3 to less than 0.4.0. So when the author releases the 0.3.4 soon it wold just work, assuming they too are following a rational versioning policy.

- Ken

Phil Ayres

unread,
Jun 27, 2011, 6:20:59 PM6/27/11
to ruby-...@googlegroups.com, Barby
You've probably already discussed this, just beware around png output. I think. I have a specific version dependency in my build that have been discussed in the forums I think. Not at my pc to check unfortunately.

Interested in what you are doing here. I may be interested in contributing some hacky code for an outputter soon.

Phil

--
Phil Ayres
617-794-2330

Ken Collins

unread,
Jul 6, 2011, 2:24:47 PM7/6/11
to Barby
I just wanted to follow up on this. Thanks to Tore for working with me
to specify a development Gemfile as well as merging in the new HTML
outputter. I'll be using this to put QRCodes into out web app in both
HTML and PDF using PDFKit. Good stuff and thanks again!

https://github.com/toretore/barby/commit/bb229e39f66c343611299a52d196cd2018adbb12

Tore Darell

unread,
Aug 13, 2011, 11:01:07 AM8/13/11
to Barby
I've just released 0.4.4 which includes all of Ken's work, it should
be installable from rubygems.org by now. Thanks Ken!
> https://github.com/toretore/barby/commit/bb229e39f66c343611299a52d196...
Reply all
Reply to author
Forward
0 new messages