Comments (7)
I should be super stupid.... I cannot make this reader working.
The API is plain bad.
Why I cannot simply say
TonelReader loadFileName: 'Comix/SeriePrinter.class.st'
I have a folder with my files and none of the expressions below work.
TonelReader
on: (FileSystem workingDirectory / 'Comix') asFileReference
fileName: 'SeriePrinter.class.st'
TonelReader
on: 'Comix' asFileReference
fileName: 'SeriePrinter.class.st'
from tonel.
This also raises uncomprehensible errors:
(TonelReader
on: 'Comix' asFileReference
fileName: 'SeriePrinter.class.st') loadDefinitions
Telling that the directory does not exist! Of course this is a file that I pass.
So to me this API REALLY sucks.
At the end I will have lost 3 hours and feel like shit and forced to do everything by hand.
Or hack the reader which I do not want to do.
from tonel.
This is because you are trying to use it in a different way as it was meant for. TonelReader
is a special kind of Monticello reader, hence it was meant to read packages, not classes.
And the API is inherited from Monticello.
In your case, if you do:
(TonelReader
on: '.' asFileReference
fileName: 'Comix')
loadDefinitions
it will work as expected (loading the definitions of the full "Comix" package).
This does not means we should not expand the API to allow simple file-in/file-out of classes (and even methods), but well... we need to implement it, since the original purpose of Tonel was not exactly that.
from tonel.
Ok I understand now.
You should think that Tonel will be in the future the default format for Pharo source
so it should be really easy to use. And you should add this to the class comment.
Tonel is realllllly important. I was waiting for it since 2002.
from tonel.
Esteban if fileName: was packageName: then it would be a lot clearer.
(TonelReader
onFolder: '.' asFileReference
package: 'Comix')
loadDefinitions
from tonel.
yes, we should add that api (but not rename the other, since is needed for compatibility with monticello)
from tonel.
Ok even better. This MC API sucks :)
from tonel.
Related Issues (20)
- Tonel cannot write the attach method
- Conversion from filetree to tonel: package wrongly converted HOT 5
- Tonel ignores MCVersion package name
- Tonel breaks with dots after selector
- Shadow variable in TonelWriter
- Tonel does not check for duplicated methods in .tonel file HOT 1
- TonelWriter should use traceCr: HOT 2
- TonelWriter>>writeSnapshot: includes tag name in package name when there's no OrganizationDefinition HOT 1
- Improve can't parse error
- Missing License
- STON should depend on GitHub STON not STHub STON HOT 1
- Read/write problem when a method has certain "unfinished statements" HOT 3
- Category cleanups and alignments
- Better error report
- TonelWriter uses the platform line ending HOT 3
- run tests on github actions HOT 1
- Tonel should not use MonticelloMocks package - but have own mocks
- Cleanup: Condense MonticelloTonel packages
- Check that there is no user of withSqueakLineEndings or friends
- Tonel doesn't support custom #compilerClass
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tonel.