What is the purpose of .yo-repository directory created with code generated by yeoman? - yeoman

I was using a code generator that uses yeoman underneath. Recently, suddenly, started generating a .yo-repository directory.
I can't find what that is by a quick Google search.
Any help?

it looks that they are using this folder for installing packages. Check the yeoman-environment library here:
https://github.com/yeoman/environment/blob/4e75d3692ede9205118737b9522c3514faaaef5f/lib/util/repository.js#L173

Related

ActiveStorage::UnpreviewableError

I'm trying to create a PDF preview for my PDF files, but I don't know where to start, I'm using poppler gem on Ruby on Rails.
The app is giving me this message: "ActiveStorage::UnpreviewableError in Tasks#show"
So I'm not understanding where should I need to declare the preview
Looking on google I found several sites with methods, but I don't know where to add this code, I've tried by creating a new folder on the app directory, but this didn't work.
In activestorage documentation says about requirements to use this feature.
libvips v8.6+ or ImageMagick for image analysis and transformations
ffmpeg v3.4+ for video previews and ffprobe for video/audio analysis
poppler or muPDF for PDF previews
Check if in your environment has the requirements
Thanks for the advice, I realized I haven't installed muPDF on my environment, the thing that worked for me was to install it from the home directory (outside my project) and that's it, now the preview is working perfectly fine.
https://ubuntuhandbook.org/index.php/2018/05/install-mupdf-1-3-0-ubuntu-18-04/

Structure of Ruby code which is not intended to be a gem

I'm working on a specific project where I have to write a SDK (kind of gem) on top of openid_connect gem. Currently my code consists of single file (but I'm also going to write some tests for it) and sample app which shows the use of SDK. Problem is that I cannot ship SDK as a rubygem as it has to be pushed to the same git repository as sample app. Client is going to use only SDK. SDK is a single class with methods in it.
My current approach is to write SDK in RubyOnRails /lib folder (but SDK has to work with other ruby frameworks as well) and let client download the SDK located inside sample app's lib folder.
1)Should my code go inside lib or vendor directory? Or there is some better approach?
2)How this code can be included in ruby app? Installed as a gem or included by require...
3)Can the tests go in the same folder as SDK (not in rails /test folder)?
1) It sounds like this code is not at all dependent on Rails. As such, do not create a Rails project for it. That would be adding ceremony and dependency that are unnecessary.
2) There is nothing wrong with having sample files in a gem's git repo. You can put them in a directory named samples or examples, for example.
3) To create a conventional gem directory structure, use bundle:
bundle gem my_gem_name
4) Your tests should go in a directory named test if they are Minitest, or spec if they are RSpec.

Missing yo.rc.json file

I generated a mean stack template using the mean generator
yo mean
I am trying to create submodules but it always creates the entire app again because there is no .yo.rc.json file in the folder.
yo doctor says everything is ok
Where should this .yo.rc.json be and is there a way to generate one based on the files I have in my app?
Looks like this is a bug in the generator itself. I've tried other generators and they create the .yo-rc.json file. The angular full stack generator provides a similar structure if anyone encounters the same problem.

Importing Node Modules in to Rails

I'm working with Jasmine. I spotted this handy looking library: https://github.com/JamieMason/Jasmine-Matchers and I thought its collection of customer matchers would help me a lot.
Problem is, it's loaded with files common to Node applications, such as JSHint, Grunt, travis.yml etc
The project I'm working on, that would love these matchers, is a Rails application. I've tried dropping them into my assets/javascripts and requiring in application.js, but obviously, life isn't that simple.
What is the correct way to install these files, and integrate them with Jasmine in a Rails context? Is Bower the tool for the job? If so, what's the right procedure to adding JS dependencies/integrating them off the bat?
Author of Jasmine-Matchers here, the only file you need to load into your test environment is this one https://github.com/JamieMason/Jasmine-Matchers/blob/master/dist/jasmine-matchers.js.
The other files are part of the development repo, I'll open an issue to have those excluded from npm/bower packages to save confusion.
You should be able to copy that file to your assets/javascripts directory, then embed it after Jasmine but before your tests.
Please comment if I've missed anything out here.
I was also trying to use Node modules inside my Rails application and the easiest way I found to achieve it was through browserify-rails gem.
The installation is pretty straightforward, just follow the getting started section and everything should be working. :-)

How to install/add packages from github to rails?

I'm trying to learn how to install/add packages (if that's the correct term) into my rails application. Specifically https://github.com/codegram/ember-forms. I can't seem to find any tutorials or step by steps on how to do something like this, and don't recognize the folder/file structure for ember-forms.
Any help is greatly appreciated!!
That is just a Javascript library - build it using the supplied rake tasks or download the released version from the downloads page.
Unless you want to work on the library itself all you need are the generated javascript - pop it in vendor/assets/javascripts

Resources