Before you start, you will need to:
-
Install git, a distributed version control system. Read the GitHub "Set Up Git" article to learn how to use git.
Some additional resources for familiarizing yourself with git:
-
Install Ruby, a programming language. You can use MRI Ruby 2.0+, or Rubinius 2.0+. Your operating system may already have it installed or offer it as a pre-built package. You can check by typing
ruby -v
in your shell or console. -
Install SQLite3, a database engine. Your operating system may already have it installed or offer it as a pre-built package. You can check by typing
sqlite3 -version
in your shell or console.
-
Get the source code: From your command line, run
git clone https://github.com/calagator/calagator.git
, which will create acalagator
directory with the source code. Change into this directory (cd calagator
) and run the remaining commands from there. -
Install Bundler-managed gems, (the actual libraries that this application uses, like Ruby on Rails) by running
bundle install
. This may take a long time to complete. -
Initialize your database by running:
bundle exec rake app:db:migrate app:db:test:prepare
If you like, you can also generate some sample data with
bundle exec rake app:db:seed
-
At this point, you should be set up to run Calagator's test suite:
bundle exec bin/rails spec
-
You're now ready to start up Calagator in
development
mode, which automatically reloads code as you change it:bundle exec bin/rails server
If all went according to plan, you should be able to access your running Calagator at: http://localhost:3000.
To stop the server, press
CTRL-C
.If you're running calagator in a Vagrantbox, add
-b 0.0.0.0
to the bundle exec command to handle requests from the host OS:bundle exec bin/rails server -b 0.0.0.0
`bundle exec rake spec`
`bundle exec appraisal install && bundle exec appraisal rake spec`
By default the project relies on the released version of the calagator gem on rubygems.org. To test and develop the gem locally you need to build it locally.
To test your own gem you'll want to give it a local version, generally dont commit this version.
Update version number in /lib/calagator/version.rb
`gem build calagator.gemspec && gem install calagator`
You'll need to come out of your project folder. I made a folder called 'ruby_2_6' for this to test against ruby 2.6 projects for example.
bundle exec calendar new yourappname
This process tests the gem works, that the new app gems build and that migrations work and more. If any errors come up, fix these are repeat from step 1.
Go in the new directory.
`bin/rails serve`
Do a quick test by making a new event that is on tomorrow, save it and then check it's on the homepage.