Comments (6)
Hey @quirinux I've changed gemspec to read a manifest file in order to figure out which files to include which heavily relies on your findings.
Thanks for bringing this to my attention and coming up with a solution!
from tty.
btw, same here with ruby 2.4.1
from tty.
Found the issue, it only happens when requiring tty package and do not happen when requiring a sub-package like tty-table for example, checking the tty.gemspec file at line 17:
spec.files = `git ls-files`.split($/)
Looks like the issue is right there, checking on this conversation on bundler package: rubygems/bundler#2039 (comment)
They found a better way to sort out those files like:
spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
spec.files.reject! { |fn| fn.include? "CVS" }
so I simple did on my local gemspec:
#spec.files = `git ls-files`.split($/)
spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
spec.files.reject! { |fn| fn.include? "CVS" }
and dan-dah, it worked like a charm, I'm gonna open a PR for that
from tty.
Hi,
Thanks for trying out tty gem!
First of all, as a general point you shouldn't be really using require 'tty'
. This library is a meta gem for scaffolding terminal apps. It is not meant to be used as a direct requirement. In future, I'm planning on having a manifest file that pulls in latest tty packages and injects them into scaffolded application without actually requiring them directly in gemspec. I would encourage you to directly specify and use the tty gems you need, mix and match! Similar to coinpare
When you require the tty
file it loads all the plugins by reading them from the tty.gemspec
and I can only assume evaluating the spec.files=
assignment in the process. On the other hand, the tty-table
uses exactly the same code as hundreds of Ruby gems generated with bundler see tty-table gemspec with a difference that it doesn't evalute gemspec when required, only on installation.
Having read rubygems/bundler#2023 & rubygems/bundler#1043 I can see both sides of the issue. There is certainly a good case for dropping reliance on external utility such as git to ensure that things with tty can be packaged easily. It would be prudent to ensure that no necessary files are skipped in the process such as dotfiles etc...
I do appreciate you bringing this to my attention and working on the fix. I'm not saying this is not the solution that I will end up using, but I need a little bit of time to investigate and make my mind up. In the meantime let's continue the dialogue and work on the solution.
from tty.
perfect @piotrmurach totally agreed, one of my solutions I use a good bunch of tty libs, so it's easier require tty straight forward, but have replaced by each gem I meant to use, indeed got ruby vm bootup time reduced, so the best option is really requiring only needed gems, haven't checked memory footprint yet
About the fix, I submitted a PR, I know it's a minor issue and the changes I made can impact in the whole solution ans user experience, so feel free to reject it or, even better, add your comments here or on the PR and I make the needed changes
from tty.
it is a such good idea, better than mine, cheers
from tty.
Related Issues (20)
- teletype new broken in 0.9.0 HOT 1
- Bundler 2 compatibility HOT 24
- Feature request: add hyperlinks support HOT 2
- Overwrite executable warning when trying to install gem HOT 1
- `teletype new` errors if path contains space HOT 1
- integration tests don't work ootb HOT 2
- e2e testing doesn't feel good HOT 1
- Warnings with ruby 2.7 HOT 1
- Error with add config HOT 1
- Add vim modeline for indentation HOT 5
- Documentation for template usage HOT 1
- Initial project creation; 'teletype' command throws exception until gemspec is edited HOT 1
- Only require `tty-...` gems that are used in the app HOT 1
- Getting a success indicator in TTY::File.copy_file() HOT 2
- teletype new app -> wrong number of arguments (given 1, expected 0) HOT 6
- TTY is using old version of gem unicorn-display_width HOT 3
- tty not working with Ruby 3.0.0 HOT 1
- tty is not accepting input when generating a new app using Ruby 2.7.2 via asdf HOT 6
- `teletype new` rejects argument HOT 11
- Consider upgrading versions
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 tty.