These are chat archives for dry-rb/chat

17th
Jul 2016
John Backus
@backus
Jul 17 2016 01:27
I'm trying to get the dry-struct gemspec to use Dry::Struct::VERSION but I'm getting some weird behavior via dry-configurable
When I make this very simple change:
$ git --no-pager diff dry-struct.gemspec
diff --git i/dry-struct.gemspec w/dry-struct.gemspec
index 4e3e085..c73876f 100644
--- i/dry-struct.gemspec
+++ w/dry-struct.gemspec
@@ -1,5 +1,8 @@
 # coding: utf-8

+$LOAD_PATH.unshift('lib')
+require 'dry/struct/version'
+
 Gem::Specification.new do |spec|
   spec.name          = 'dry-struct'
   spec.version       = '0.0.0'
I get
$ bundle exec rspec
/Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-configurable-0.1.6/lib/dry/configurable.rb:53:in `initialize': wrong number of arguments (given 3, expected 0) (ArgumentError)
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-configurable-0.1.6/lib/dry/configurable.rb:53:in `new'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-configurable-0.1.6/lib/dry/configurable.rb:53:in `block in config'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-configurable-0.1.6/lib/dry/configurable.rb:51:in `synchronize'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-configurable-0.1.6/lib/dry/configurable.rb:51:in `config'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/dry-container-0.3.4/lib/dry/container/mixin.rb:91:in `register'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-logic-2d6c06e8864f/lib/dry/logic/predicate_set.rb:9:in `predicate'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-logic-2d6c06e8864f/lib/dry/logic/predicates.rb:18:in `<module:Predicates>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-logic-2d6c06e8864f/lib/dry/logic/predicates.rb:9:in `<module:Logic>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-logic-2d6c06e8864f/lib/dry/logic/predicates.rb:8:in `<module:Dry>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-logic-2d6c06e8864f/lib/dry/logic/predicates.rb:7:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/constraints.rb:2:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/constraints.rb:2:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/constrained.rb:2:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/constrained.rb:2:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/builder.rb:51:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/builder.rb:51:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/definition.rb:1:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types/definition.rb:1:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types.rb:13:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry/types.rb:13:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry-types.rb:1:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/bundler/gems/dry-types-d7c573742043/lib/dry-types.rb:1:in `<top (required)>'
    from /Users/johnbackus/Projects/dry-struct/lib/dry/struct.rb:1:in `require'
    from /Users/johnbackus/Projects/dry-struct/lib/dry/struct.rb:1:in `<top (required)>'
    from /Users/johnbackus/Projects/dry-struct/lib/dry-struct.rb:1:in `require'
    from /Users/johnbackus/Projects/dry-struct/lib/dry-struct.rb:1:in `<top (required)>'
    from /Users/johnbackus/Projects/dry-struct/spec/spec_helper.rb:9:in `require'
    from /Users/johnbackus/Projects/dry-struct/spec/spec_helper.rb:9:in `<top (required)>'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `require'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `block in requires='
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `each'
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `requires='
    from /Users/johnbackus/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb:109:in `block in process_options_into'
    from /
@AMHOL any idea what the deal might be?
I don't think it is an issue with load path either
John Backus
@backus
Jul 17 2016 01:32
making the change simply
diff --git i/dry-struct.gemspec w/dry-struct.gemspec
index 4e3e085..4d58866 100644
--- i/dry-struct.gemspec
+++ w/dry-struct.gemspec
@@ -1,5 +1,7 @@
 # coding: utf-8

+require File.join(File.expand_path(__dir__), 'lib/dry/struct/version.rb')
+
still leads to the same problem
Odin Dutton
@twe4ked
Jul 17 2016 02:10
Hello. Can anyone point me to an example of optional formats in a path using Roda?
Tim Riley
@timriley
Jul 17 2016 02:39
@twe4ked like a single route matching both "foo" and "foo.json"?
I'm not sure if there's anything built in specifically to achieve that, but you could definitely use a regexp for that matcher
The latest roda release also included support for format marchers using the "accept" header.
You could probably combine all of these behaviors into your own matcher plugin if you needed :)
John Backus
@backus
Jul 17 2016 02:44

The latest roda release also included support for format marchers using the "accept" header.

Oh wow thats great news

Odin Dutton
@twe4ked
Jul 17 2016 02:44
Thanks @timriley :)
John Backus
@backus
Jul 17 2016 02:46
This message was deleted
John Backus
@backus
Jul 17 2016 03:16
@AMHOL see dry-rb/dry-configurable#7
John Backus
@backus
Jul 17 2016 03:47
@solnic I've updated dry-rb/dry-types#108
Tim Riley
@timriley
Jul 17 2016 03:48
@backus good stuff!
That VERSION bug sounds super weird
John Backus
@backus
Jul 17 2016 03:49
Yeah
Very strange
John Backus
@backus
Jul 17 2016 21:23
@AMHOL feel free to release 0.1.7 of dry-configurable