www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to correctly import tsv-utilites functions?

reply p.shkadzko <p.shkadzko gmail.com> writes:
I need to use "bufferedByLine" function from "tsv-utilities" 
package located: 
https://github.com/eBay/tsv-utils/blob/master/common/src/tsv_utils/common/utils.d

I have the following dub config

/+ dub.sdl:
     name "demo"
     dependency "tsv-utils" version="~>1.6.0"
     dflags-ldc "-mcpu=native"
     targetType "executable"
+/

Now, in the script file I am trying to

import tsv_utils.common.utils: bufferedByLine;

and this fails "Error: module utils is in file 
'tsv_utils\common\utils.d' which cannot be read"

tsv-utils do not have a "source" dir which I guess is needed for 
the imports to work correctly. Maybe it's not supposed to be used 
this way?
Apr 14 2020
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 4/14/20 3:34 PM, p.shkadzko wrote:
 I need to use "bufferedByLine" function from "tsv-utilities" package 
 located: 
 https://github.com/eBay/tsv-utils/blob/master/common/src/tsv_
tils/common/utils.d 
 
 
 I have the following dub config
 
 /+ dub.sdl:
      name "demo"
      dependency "tsv-utils" version="~>1.6.0"
      dflags-ldc "-mcpu=native"
      targetType "executable"
 +/
 
 Now, in the script file I am trying to
 
 import tsv_utils.common.utils: bufferedByLine;
 
 and this fails "Error: module utils is in file 
 'tsv_utils\common\utils.d' which cannot be read"
 
 tsv-utils do not have a "source" dir which I guess is needed for the 
 imports to work correctly. Maybe it's not supposed to be used this way?
 
What about using dependency tsv-utils:common ? Looks like tsv-utils is a collection of subpackages, and the main package just serves as a namespace. -Steve
Apr 14 2020
parent reply p.shkadzko <p.shkadzko gmail.com> writes:
On Tuesday, 14 April 2020 at 20:05:28 UTC, Steven Schveighoffer 
wrote:
 On 4/14/20 3:34 PM, p.shkadzko wrote:
 [...]
What about using dependency tsv-utils:common ? Looks like tsv-utils is a collection of subpackages, and the main package just serves as a namespace. -Steve
Yes, it works! Thank you.
Apr 14 2020
parent Jon Degenhardt <jond noreply.com> writes:
On Tuesday, 14 April 2020 at 20:25:08 UTC, p.shkadzko wrote:
 On Tuesday, 14 April 2020 at 20:05:28 UTC, Steven Schveighoffer 
 wrote:
 On 4/14/20 3:34 PM, p.shkadzko wrote:
 [...]
What about using dependency tsv-utils:common ? Looks like tsv-utils is a collection of subpackages, and the main package just serves as a namespace. -Steve
Yes, it works! Thank you.
Glad that worked for you. (And thanks Steve!) I have a small app with an example of a dub.json file that pulls the tsv-utils common dependencies this way: https://github.com/jondegenhardt/dcat-perf/blob/master/dub.json --Jon
Apr 14 2020