Missing files in rails pr - ruby-on-rails-4

I've pull a rails project from the github. When I ran this project, it didn't work, the message here:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/hien/.rbenv/versions/2.0.0-p451/b
in/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a file
system path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
-B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle install
-G, [--skip-git], [--no-skip-git] # Skip .gitignore file
[--skip-keeps], [--no-skip-keeps] # Skip source control .keep files
-O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files
-V, [--skip-action-view], [--no-skip-action-view] # Skip Action View files
-S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files
[--skip-spring], [--no-skip-spring] # Don't install Spring application preloader
-d, [--database=DATABASE] # Preconfigure for selected database (options: mys
ql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
# Default: jquery
-J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files
[--dev], [--no-dev] # Setup the application with Gemfile pointing to y
our Rails checkout
[--edge], [--no-edge] # Setup the application with Gemfile pointing to R
ails repository
-T, [--skip-test-unit], [--no-skip-test-unit] # Skip Test::Unit files
[--rc=RC] # Path to file containing extra configuration opti
ons for rails command
[--no-rc], [--no-no-rc] # Skip loading of extra configuration options from
.railsrc file
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend], [--no-pretend] # Run but do not make any changes
-q, [--quiet], [--no-quiet] # Suppress status output
-s, [--skip], [--no-skip] # Skip files that already exist
Rails options:
-h, [--help], [--no-help] # Show this help message and quit
-v, [--version], [--no-version] # Show Rails version number and quit
Description:
The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
Example:
rails new ~/Code/Ruby/weblog
This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.
I found that, the project missing config/application.rb and Gemfile files. So what can I do with this problem, should I add these files by my own or any other solution?

rails new . inside folder with the project you pulled, dont overwrite files when prompted (also there is a huge possibility that project you're pulling is missing some config files)

Related

django project: isort ignores local .cfg file's "skip" parameter

I'm using "isort" in my Django project and the problem is when I make the isort command on the project level it ignores app-level ".isort.cfg" file's skip parameters.
My isort version is 5.11.4.
The local/app level ".isort.cfg" file:
[settings]
known_django=django
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
skip=migrations
How to force it to not ignore nested folders cfg files?
Results for command "isort . --resolve-all-configs --verbose
" is a long list(no errors) like following:
./orders/.isort.cfg used for file ./orders/migrations/0001_initial.py
./orders/.isort.cfg used for file ./orders/migrations/init.py
As seen here it 'uses' app-level cfg file but 'migrations' files are not ignored as it should be according the app-level config.
You can add --resolve-all-configs to your isort command. More information in the doc section Supporting multiple config files in single isort run.
For example in my multi-app django-project I have a .isort.cfg at root level, and I added the .isort.cfg file in my settings folder. Here is the output I get with following command: isort --verbose --resolve-all-configs .
.\.isort.cfg used for file .\project\views\project.py # root config file
.\settings\.isort.cfg used for file .\settings\asgi.py # nested config file

How can I rebuild an edited perl6 module that I've downloaded?

I've installed Time::Duration and it failed most of its tests. I want to be able to rebuild the module - with my edits - from the locally stored module.
I edited the file that contains the module (that corresponds to Duration.pm6):
~/.perl6/sources/D00C101A0157E3EAC494310C9961F299240423E7
And then try building via it's json file:
zef --debug build ~/.perl6/dist/83839D8D315EEDEDFEAF211EE42E8D936ACE29CB
This returns:
===> # SKIP: No need to build Time::Duration:ver<2.00>
!!!> Build failure: ~/.perl6/dist/83839D8D315EEDEDFEAF211EE42E8D936ACE29CB at ~/.perl6/dist
I was hoping that this would rebuild the module with the change I made to the source.
Have I done this wrong, or am I going about this entirely wrong?
As it has been noted already you should not modify installed files. However, the workflow for testing changes of some module is pretty straight forward.
First:
# Fetch and extract the distribution, then change into its directory.
# If the distribution is still in zef's local file cache then it will
# skip the fetch and extraction steps.
zef look Time::Duration
Then:
At this point you can edit any of the files you wish.
Finally:
# test your changes without reinstalling (assumes all dependencies are installed)
zef test .
# Reinstall the modified version of Time::Duration using one of the following:
zef install . --force-install
zef uninstall Time::Duration && zef install .
You should git clone the code or download the zip package, edit the code you want, then zef install . if the current directory have a META6.json file.

.gitignore regex for emacs temporary files

I'm trying to .gitignore emacs temporary/autosave files. I'm using...
\.\#.*
in my .gitignore.
But git add -A run in a subfolder is still giving me:
# new file: .#make_collections.py
# new file: .#norm_collections.py
# new file: make_collections.py
# new file: norm_collections.py
even though
\.\#.*
is clearly getting the right file names and not the wrong ones when I test it with a regex tester.
You can also instruct emacs to save the autosave files in a different directory altogether by setting the variable auto-save-file-name-transforms, I have this in my init file
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "auto-save/") t)))
This instructs emacs to store the auto-saves inside the auto-save folder in the user-emacs-directory (usually ~/.emacs.d).
To save backup files in a different directory set the variable backup-directory-alist, the following will save backup files inside backups folder in the user-emacs-directory
(setq backup-directory-alist
`(("." . ,(expand-file-name
(concat user-emacs-directory "backups")))))
gitignore doesn't use regular expressions. Instead it uses shell glob patters. The man page tells you two things important for this situation:
Otherwise, Git treats the pattern as a shell glob suitable for
consumption by fnmatch(3) with the FNM_PATHNAME flag.
and
A line starting with # serves as a comment. Put a backslash ("\")
in front of the first hash for patterns that begin with a hash.
This means that the pattern you want to use is simply .#*.
Now the second pattern that matov mentioned, #*, doesn't do anything as it is treated as a comment by git. Hence me quoting that second sentence from the man page.
Emacs autosave files are ignored with
\#*#
files are ignored with:
\#*\#
.\#*
If you want an easy way to ignore files, you can also use http://www.gitignore.io which helps create useful .gitignore files for your project.
Here is the emacs template: https://www.gitignore.io/api/emacs
There is also documentation demonstrating how to run gi from the command line.
To suppress the temporary Emacs files appearing on git status globally, you can do the following:
Configure git to use a global excludesfile
Since this is a common problem, git has a specific solution to that:
Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice) generally go into a file specified by core.excludesFile in the user’s ~/.gitconfig
git config --global core.excludesfile ~/.gitignore_global
Create the respective file
cd
touch .gitignore_global
Paste the following template into the file
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
Watch git do its magic! :)

Understanding of usage of Java2Wsdl for axis2/c

I have a problem with the installation of Java2Wsdl tool.
I have succesfully created and compiled(generated the .class file from the .java file) a simple Java class inside a directory /home/user/examples/com/mycompany/app.
In there I compile my SimpleClass and so, I have two files: SimpleClass.java & a SimpleClass.class .
Next, I have axis2/c installed on my ubuntu system
$ echo $AXIS2C_HOME
/usr/local/axis2c
I also have axis2/java installed
echo $AXIS2_HOME
/opt/axis2-1.6.2
I also downloaded, extracted and installed from this link the java2wsdl plugin.
This is how the bin directory looks like.
username#usernamePC:/opt/axis2-1.6.2/bin$ ls
axis2.bat axis2server.sh java2wsdl.bat setenv.sh wsdl2java.sh
axis2server.bat axis2.sh java2wsdl.sh wsdl2java.bat
Now, I want to convert my initial project from java to wsdl with java2wsdl but I cannot understand the right place of directory I should put that into, if I have the classpath(?) right and what would be the correct command for the conversion to happen.
I am trying something like that: Java2WSDL.sh -cn com.mycompany.app.SimpleClass
In here I put . instead of / and I am typing that in top directory, meaning com directory.
Can you help me out with this?
I am sorry for the long question but I needed to set all things right.
my-app was build with a simple maven project (maven 2.2.1) through this guide.
You should start codegeneration from build/classes directory.
That directory must have com and META-INF subdirs.
Example of generating WSDL:
# compile your project using ant or mvn
ant
# go to binary dir
cd build/classes
# check SimpleClass.class is here
ls com/mycompany/app/SimpleClass.class
# generate WSDL into current directory
$AXIS2_HOME/bin/java2wsdl.sh -cn com.mycompany.app.SimpleClass
# see generated WSDL
cat SimpleClass.wsdl
To generate WSDL into different directory append -o <directory> switch to command line of wsdl2java.sh script.

Set specified build system as default for a file type on sublime text 2

I have packages SASS and SCSS installed. SCSS provides the syntax highlight while SASS provides the build system i need for scss. My problem is, if build is set to automatic, it wont build the scss files if i press ctrl+b, so i have to always go back and reselect that option. Is there a way to make that build system to be the automatic one for scss?
Set it up using a build system and fire off with F7:
http://readthedocs.org/docs/sublime-text-unofficial-documentation/en/latest/file_processing/build_systems.html?highlight=build for more information about setting that up.
UPDATED ANSWER
Copy the following:
{
"cmd": ["sass", "--update", "$file:${file_path}/${file_base_name}.css", "--stop-on-error", "--no-cache"],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
"windows":
{
"shell": "true"
}
}
In Sublime Text, go Tools > Build System > New Build System > Paste
Give it a name. Bingo.
Simpler Way
SASS Support in Sublime
Adding Support for near everything.
Simplest Way
Why DIY when you do not need to.
Want to have the site update in an open browser every time you save?
Generally a good must to have Ruby Git and Python installed.
Install Nodejs.
(win) the .msi download from main site works well and includes npm
Now you have access to the 'gem' and 'npm' package managers.
Things get easy now, although I may as well write it out longwinded.
Compass:
gem update --system
gem install compass
// can now use this command to build a sass-based project
compass create myFirstWebsite
// ..installs in "/myFirstWebsite"..
Install the Grunt client (global flag)
npm install grunt-cli -g
now have access to the wealth of Grunt automation packages ie:
npm grunt-contrib-jshint --save-dev
"dev" flagged - applies to your local project only (current and sub folders)
also, listed as a "devDependency" in package.json, which means it'll not be
packed with your project on a distro/prod build
Time for some simple awesome... Yeoman
npm install yo -g
installs yeoman (yo commands) a heap of other essentials
and Bower - twitter's response to Node / Gem etc
Bower looks after package dependencies.
AND THE AWESOME?
// make a new folder. cd into it, and type:
yo webapp
// There are multiple 'generators' you can install with yo.
// webapp is the one most suitable for front-end dev / web app building
// other things you might want before you start.. maybe underscore:
bower install underscore
// adds '_' to the set-up as a dependency
// These commands will brighten your day:
grunt test
// comprehensive testing of app
grunt server
// This part you'll love! Starts server and launches app in browser
// - includes live-refreshing... save a file, and all required builds etc
// are preformed (damn fast) and automatically refreshes browser.
// Yup, 'grunt server' = project-wide equiv to 'compass watch'
grunt
// Build application for deploy. Not only do you get minification and concatenation;
// also optimize all your image files, HTML, compile your CoffeeScript and Compass files,
// if you're using AMD, will pass those modules through r.js so you don't have to.