Godwin
aba8635eb9
|
8 years ago | |
---|---|---|
app | 8 years ago | |
bin | 9 years ago | |
config | 8 years ago | |
db | 8 years ago | |
doc | 10 years ago | |
features | 8 years ago | |
lib/tasks | 9 years ago | |
nbproject | 11 years ago | |
public | 9 years ago | |
script | 9 years ago | |
tmp/locales | 10 years ago | |
vendor/assets | 8 years ago | |
.coveralls.yml | 12 years ago | |
.gitignore | 8 years ago | |
.rspec | 11 years ago | |
.slugignore | 12 years ago | |
.travis.yml | 8 years ago | |
CHANGELOG.md | 11 years ago | |
Capfile | 9 years ago | |
DB specs.txt | 11 years ago | |
Gemfile | 8 years ago | |
Gemfile.lock | 8 years ago | |
Guardfile | 8 years ago | |
LICENSE | 12 years ago | |
README.md | 8 years ago | |
Rakefile | 8 years ago | |
VERSION | 11 years ago | |
bower.json | 11 years ago | |
config.rb | 11 years ago | |
config.ru | 12 years ago | |
jpegoptim.exe | 11 years ago | |
optipng.exe | 11 years ago | |
pngquant.exe | 8 years ago |
README.md
Bike!Bike!
Environment | Build Status |
---|---|
Development | |
Production |
This is the repository for the Bike!Bike! website. It can be found in development at preview.bikebike.org and in production at bikebike.org
Feel free to clone or fork the repository any time to start working on new features or fixes. To get help create an issue or contact Godwin: goodgodwin
@
hotmail.com
any time.
Technologies
Internal Gems
We will make a commitment to extract any functionality that makes sense to do so, into separate gems in order to share functionality with others, with our other projects (such as bikecollectives.org), and to enable easier collaboration amongst ourselves.
It is recommended that you at least use also clone bikecollectives_core
into you workspace. To override the gem location execute:
bundle config local.bikecollectives_core PATH_TO/bikecollectives_core
Here is a list of the gems we have created so far, if you are a collaborator on this project you may need to become a collaborator on these gems as well. Don't hesitate to make a request, it won't be denied:
Lingua Franca
Lingua Franca provides an easy way to include translatable content and provides a user interface for translators to provide translations. See Translations for best practices on the Bike!Bike! website.
Bumbleberry
Bumbleberry provides cross-browser support with little effort and minimum file sizes. Basically it creates a different stylesheet for every known browser and only includes supported rules for each using information obtained from caniuse.com.
Github Workflow
If you are a git wiz, feel free to adjust the steps below slightly, otherwise follow these steps until you are familiar enough to stray. What should remain constant is that we need to branch, code review, and merge with master.
- Before you start working on a new feature, start working on a new branch (alternatively you can fork):
git checkout -b myname_new_feature
- Write your new feature
- Add tests and execute them using
bundle exec i18n
- Make any adjustments, make sure you have included comments and abided other coding conventions
- Check your git status to make sure you are on the correct branch and have any new files to add:
git status
- Add any new files using:
git add [myfile]
- Commit your changes:
git commit -am 'My commit message'
- Switch back to the development branch and pull the latest:
git checkout master && git pull
- Switch back to your branch:
git checkout myname_new_feature
- If there were any changes, rebase. This merges in the new code with your new code:
git rebase -i origin/development
- Push your changes:
git push origin myname_new_feature
- Make a pull request and wait for your code to be reviewed
- If any changes are required, make them commit your changes, and rebase again. This time you need to make sure that you squash your commits (makes sure you only add one commit in the end). Where you see your commit message, change 'pick' to 'fixup' or 'f'.
- Push your code again and repeat 12 and 13 until your code gets merged with development
- Once your code is in development it will be released to our development site, once new translations are added and the site is manually tested it will be moved to master and the production site
Deployment Process
Please note, we currently don't have this process set up, we're working to get here.
- Write code and get it pulled into master
- Your changes will be automatically be deployed to our preview site
- Your changes will be tested there, if tests fail deployers will be notified
- Once that deployment process completes and tests pass, translators will be notified if there are new translations
- Once translators have completed translations, translations will be committed to master and your changes will be deployed to production
Translations
Translating our site into multiple languages is a key part of opening it up to the world. When coding, never include any English text as in a string or Haml. Instead, we shall always use the underscore helper method _
. The method takes a translation key and some optional parameters.
All translation is done in a collaborative, volunteer based system on the site itself, even the English text. If a user has sufficient permissions, the underscore method will produce highlighted text which can be edited directly by the user.
The method can be used as follows:
_ 'basename.my_key'
_ 'basename.my_key', :paragraph
end
If the key does not exist, the previous lines will produce the following respectively:
'my_key'
'Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Vivamus magna justo, lacinia eget consectetur sed, convallis at
tellus. Proin eget tortor risus. Donec sollicitudin molestie
malesuada. Donec rutrum congue leo eget malesuada.'
If the user has sufficient rights, these blocks will also be surrounded by the necessary markup to allow them to be selected and edited by the user.
Translations are recorded during testing and committed to the repository when pushing to github. After pulling down the latest version from github you should always run rake translations:migrate
to put the latest migrations into your database.
Testing Practices
Our focus will be on integration testing using Capybara. While testing the app records all translations that it finds, whether or not they exist, and which pages that they were found on.
Before commiting you shuold always run:
bundle exec cucumber
and:
bundle exec rake i18n
The former is going to be faster but does not perform checks for untranslated content, it is recommneded that you run this regularily while developing while running the i18n
check will ensure that you have not missed translations.
If you are creating any new content you will also want to add a new feature or scenario to ensure the new translations are picked up.