Get the code:
git clone https://github.com/vaerohq/codesample
Configure ruby:
- if you use
rbenv
, init as so:eval "$(rbenv init - zsh)"
- if you use
rvm
, init as usual
both should obey .ruby-version
Install the gems from Gemfile
and prep the database:
cd codesample
# install gems
bundle install
# prep the local sqlite3 db
bin/rails db:migrate
Start the local server and verify db connectivity
bundle exec rails s -p 3000
then visit dev server. You should see a landing page with instructions to create a User
.
NB:
-
User
(with devise and password authentication) is preconfigured -
Bootstrap 5.3 is installed and preconfigured. If you prefer, feel free to use tailwind / raw scss.
-
Sample data is available in a tab delimited file at
data/example_data.tsv
; I built a task skeleton inlib/tasks/data.rake
that you can run viabundle exec rake data:insert_data
.
Format: customer name <tab> user email <tab> patent name <tab> patent title <tab> granted
. You may assume that there is a header row, that there are no missing elements, and that each row is complete.
- Don't worry about the formatting on the devise views.
-
Build appropriate database table(s) with migrations to ingest the sample data
-
Insert the data
-
Add a route/controller/views that, for the current user (avail
current_user
), shows that users' patents -
Allow a user to edit his/her patent subjects.
-
Create a private repo with your github account
-
Modify the instructions on the new repo page under "... or push an existing repository" to instead add a new remote, ala
git remote add origin2 git@github.com:earlh/test2.git # turn origin into origin2 (or whatever you prefer), and note that the git url will be different for you
git branch -M main
git push -u origin2 main
-
Reload the repo page (mine was called earlh/test2) to verify it worked
-
Add user
earlh
(NB: email isgithub@earlh.com
) to the repo (Settings -> Collaborators -> Add People and add earlh)
run via
bundle exec rspec