These are chat archives for dry-rb/chat

17th
Nov 2016
Sascha Korth
@skorth
Nov 17 2016 10:32
Hey there, anyone already build a Rails form object by using Dry::Struct and Dry::Validation? Would like to see an example.
Peter Leitzen
@splattael
Nov 17 2016 13:14
Are dry projects still using code climate? I've seen some deps on codeclimate-test-reporter but CODECLIMATE_REPO_TOKEN is not set in .travis.yml.
The reason: Due to codeclimate's version bump to 1.0 things have to be adjusted:
dry-logic$ rake
/home/ps/.rvm/rubies/ruby-2.3.1/bin/ruby -I/home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-core-3.5.4/lib:/home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-support-3.5.0/lib /home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
W, [2016-11-17T14:14:58.423796 #28715]  WARN -- :       This usage of the Code Climate Test Reporter is now deprecated. Since version
      1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
      run the provided `codeclimate-test-reporter` binary separately to report your
      results to Code Climate.

      More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md

/home/ps/.rvm/rubies/ruby-2.3.1/bin/ruby -I/home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-core-3.5.4/lib:/home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-support-3.5.0/lib /home/ps/.rvm/gems/ruby-2.3.1@pg/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
Mh, https://codeclimate.com/github/dry-rb/dry-logic looks fine, but how does it work w/o CODECLIMATE_REPO_TOKEN being set?
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:19
@splattael yeah, need to be updated like this dry-rb/dry-monads@2bbc5cf
Peter Leitzen
@splattael
Nov 17 2016 13:21
@flash-gordon a nice! Should we pin codeclimate-test-reporter to ~> 1.0.3?
@flash-gordon Does CodeClimate track GH repos or how does it work w/o providing CODECLIMATE_REPO_TOKEN
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:23
@splattael it doesn't change a lot actually, let's leave it unrestricted for now. Results are uploaded at this line https://github.com/dry-rb/dry-monads/commit/2bbc5cfc6f2d4fdf333b1d361d0c2c215655a29d#diff-354f30a63fb0907d4ad57269548329e3R10
I mean coverage results
code style issues are handled by codeclimate itself, no token required
Peter Leitzen
@splattael
Nov 17 2016 13:24
@flash-gordon aah, ok, got it! thanks!
@flash-gordon any reason to have sudo: required in .travis.yml?
dist: trusty is also available for containers
AFAIK
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:26
there were issues with getting rbx to work without it
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:26
I guess something was not quite right with rvm setup or sutin
Peter Leitzen
@splattael
Nov 17 2016 13:27
ok, I'm just asking because I'd like to streamline things in all dry repos :D
streamline: add rbx-3, codeclimate, jruby version
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:28
re sudo, just try it :) If it works then we'll stick with sudo: false :)
Peter Leitzen
@splattael
Nov 17 2016 13:28
:+1:
Peter Leitzen
@splattael
Nov 17 2016 13:46
@flash-gordon As Travis is running Ruby 2.3.2 the codeclimate after hook should be updated to 2.3.2, no?
@flash-gordon rbx-3 is failing during bundle (same as before my PR): https://travis-ci.org/dry-rb/dry-monads/jobs/176699958#L176
Nikita Shilnikov
@flash-gordon
Nov 17 2016 13:53
@splattael re codeclimate correct, need a more smart check for this :)
re rbx I'll have a look tonight
Peter Leitzen
@splattael
Nov 17 2016 13:54
:+1:
Peter Leitzen
@splattael
Nov 17 2016 14:04
@flash-gordon how about running codeclimate only for the job "1.1" as defined via envvar TRAVIS_JOB_NUMBER="1.1". We need to tweak the order of ruby version of course so the most stable one is running first (e.g. 2.3.2 or 2.3.1).
Nikita Shilnikov
@flash-gordon
Nov 17 2016 14:37
@splattael yeah, this makes sense :+1:
Peter Leitzen
@splattael
Nov 17 2016 14:40
except it does not work like this. I'm fixing it right now: ${TRAVIS_JOB_NUMBER#*.} = 1
Soumya Ray
@soumyaray
Nov 17 2016 15:01
Hi everyone, I notice a dry-types decorator module (https://github.com/dry-rb/dry-types/blob/master/lib/dry/types/decorator.rb) but I can't find any documentation for it. Is this a public feature? I'm using Roar's decorators right now and wondering how they compare.
Sascha Korth
@skorth
Nov 17 2016 21:03
Question about Dry::Struct. Anyone knows how to use a params hash within the constructor? MyStruct.new({'foo' => 123, 'bar' => 123}) instead of MyStruct.new({foo: 123, bar: 123})?
Tim Riley
@timriley
Nov 17 2016 21:06
@skorth make your own subclass that symbolizes keys on initialization?