Merge branch 'develop'

This commit is contained in:
Devin Howard 2016-04-13 10:26:01 +08:00
commit 0de7333d6a
15 changed files with 55 additions and 35 deletions

View file

@ -18,6 +18,7 @@ gem 'kaminari' # pagination
gem 'uservoice-ruby'
gem 'dotenv'
gem 'snorlax'
gem 'rack-cors'
gem 'httparty'
gem 'active_model_serializers', '~> 0.8.1'
gem 'delayed_job', '~> 4.0.2'

View file

@ -160,6 +160,7 @@ GEM
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4)
rack-cors (0.4.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.4)
@ -286,6 +287,7 @@ DEPENDENCIES
pundit
pundit_extra
quiet_assets
rack-cors
rails (= 4.2.4)
rails3-jquery-autocomplete
rails_12factor

View file

@ -1,8 +1,8 @@
Metamaps
=======
[![Join the chat at https://gitter.im/metamaps/metamaps_gen002](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/metamaps/metamaps_gen002?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/metamaps/metamaps_gen002.svg)](https://travis-ci.org/metamaps/metamaps_gen002)
[![Join the chat at https://gitter.im/metamaps/metamaps](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/metamaps/metamaps?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/metamaps/metamaps.svg)](https://travis-ci.org/metamaps/metamaps)
Welcome to the Metamaps GitHub repo.
@ -20,11 +20,11 @@ To get connected with the community interested in Metamaps, join our [Google+ co
If you are on Mac or Ubuntu you can use the following instructions to quickly get a local copy of metamaps up and running using a Vagrant virtualbox. Don't be intimidated, it's easy!
```
git clone git@github.com:metamaps/metamaps_gen002.git
git clone git@github.com:metamaps/metamaps.git
```
Now ensure you have VirtualBox and Vagrant installed on your computer
```
cd metamaps_gen002
cd metamaps
./bin/configure.sh
```
This will do all the setup steps to make Metamaps work with a bit of behind the scenes ninja magick.
@ -73,7 +73,7 @@ Copyright (c) 2015 Connor Turland
[site-blog]: http://blog.metamaps.cc
[site-beta]: http://metamaps.cc
[community]: https://plus.google.com/u/0/communities/115060009262157699234
[license]: https://github.com/metamaps/metamaps_gen002/blob/develop/LICENSE
[contributing]: https://github.com/metamaps/metamaps_gen002/blob/develop/doc/CONTRIBUTING.md
[contributing-issues]: https://github.com/metamaps/metamaps_gen002/blob/develop/doc/CONTRIBUTING.md#reporting-bugs-and-other-issues
[windows-installation]: https://github.com/metamaps/metamaps_gen002/blob/develop/doc/WindowsInstallation.md
[license]: https://github.com/metamaps/metamaps/blob/develop/LICENSE
[contributing]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md
[contributing-issues]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md#reporting-bugs-and-other-issues
[windows-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/WindowsInstallation.md

View file

@ -0,0 +1,7 @@
Metamaps.Debug = function() {
console.debug(Metamaps)
console.debug(`Metamaps Version: ${Metamaps.VERSION}`)
}
Metamaps.debug = function() {
Metamaps.Debug()
}

View file

@ -16,11 +16,12 @@ var labelType, useGradients, nativeTextSupport, animate;
animate = !(iStuff || !nativeCanvasSupport);
})();
// TODO eliminate these 4 top-level variables
// TODO eliminate these 5 top-level variables
Metamaps.panningInt = null;
Metamaps.tempNode = null;
Metamaps.tempInit = false;
Metamaps.tempNode2 = null;
Metamaps.VERSION = '<%= VERSION %>'
Metamaps.Settings = {
embed: false, // indicates that the app is on a page that is optimized for embedding in iFrames on other web pages

View file

@ -5,7 +5,7 @@
Metamaps.cc is an open source project, and we are always looking for new
developers to help contribute to our codebase! To get involved, send an
email to team@metamaps.cc or find us on Github at
https://github.com/metamaps/metamaps_gen002.
https://github.com/metamaps/metamaps.
-->

View file

@ -18,7 +18,7 @@
<div id="rightAboutParms">
<p>PRIVATE BETA</p>
<p>2.8</p>
<p><%= VERSION %></p>
<p>Mar 26, 2016</p>
</div>
<div class="clearfloat">
@ -51,7 +51,7 @@
</a>
</li>
<li>
<a id="lightbox_source" href="https://github.com/metamaps/metamaps_gen002" target="_blank">
<a id="lightbox_source" href="https://github.com/metamaps/metamaps" target="_blank">
<div class="lightboxAboutIcon"></div>
source code
</a>
@ -205,7 +205,7 @@
<p><b>MEMBERS</b> are contributors who act as stewards and guardians of the collective and are responsible for maintaining our culture and purpose. We're working on a set of agreements to formalize what it means to be a member.</p>
<p>We welcome people of all skillsets to create value within our network. There's open possibilities for designers, researchers, academics, strategists, and facilitators to contribute. If you're a developer, help us advance the code and take a look around our <a href="https://github.com/metamaps/metamaps_gen002" target="_blank">Github</a>.</p>
<p>We welcome people of all skillsets to create value within our network. There's open possibilities for designers, researchers, academics, strategists, and facilitators to contribute. If you're a developer, help us advance the code and take a look around our <a href="https://github.com/metamaps/metamaps" target="_blank">Github</a>.</p>
<p>Thanks for your interest in helping out with Metamaps! Hopefully this gets you pointed in the right direction to get involved. The next step is to read the links on this page and then contribute! </p>

View file

@ -34,7 +34,7 @@
</div><!-- end yield -->
<div class="github-fork-ribbon-wrapper right-bottom">
<div class="github-fork-ribbon">
<a href="https://github.com/metamaps/metamaps_gen002" target="_blank">Fork me on GitHub</a>
<a href="https://github.com/metamaps/metamaps" target="_blank">Fork me on GitHub</a>
</div>
</div>
<script>

View file

@ -0,0 +1,8 @@
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '/api/*',
headers: :any,
methods: [:get, :post, :put, :delete, :options, :head]
end
end

View file

@ -0,0 +1 @@
VERSION = '2.8.4'

View file

@ -90,7 +90,7 @@ If you'd like to contribute a fix for a bug you've encountered, first read up on
aware of the issue. By filing the issue first, we may be able to provide you
with some insight that guides you in the right direction.
[metamaps-issues]: https://github.com/metamaps/metamaps_gen002/labels/bug
[metamaps-issues]: https://github.com/metamaps/metamaps/labels/bug
[git-branching-model]: http://nvie.com/posts/a-successful-git-branching-model/
[fork-metamaps]: https://github.com/metamaps/metamaps_gen002/fork
[fork-metamaps]: https://github.com/metamaps/metamaps/fork
[cla]: http://metamaps.cc/cla

View file

@ -30,7 +30,7 @@ Within the app/ folder, you can find these important folders:
The lifecycle works something like this.
1. run `rake routes` inside the metamaps_gen002 directory on your computer, and it will generate a list with entries looking something like `GET /maps/:id maps#show`. This tells you which URL will end up at which *controller*. In this example, if you accessed `https://metamaps.cc/maps/2`, you are looking for the maps_controller's `show` function, and there will be a variable params["id"] that is equal to 2.
1. run `rake routes` inside the metamaps directory on your computer, and it will generate a list with entries looking something like `GET /maps/:id maps#show`. This tells you which URL will end up at which *controller*. In this example, if you accessed `https://metamaps.cc/maps/2`, you are looking for the maps_controller's `show` function, and there will be a variable params["id"] that is equal to 2.
2. Now in `app/controllers/maps_controller.rb`, you can find the function. It should do some calculations, create an instance variable @map, and then do one of two things:
- If it doesn't call anything, ruby on rails will automatically load app/views/map/show.html.erb. (NB: If you loaded `/maps/2.json`, it would look for app/views/map/show.json.erb). Any instance variables assigned (e.g. @map) will be available to the view file (show.html.erb).
- You can also call the render function directly. See the codebase or http://guides.rubyonrails.org/layouts_and_rendering.html#using-render for details.

View file

@ -32,7 +32,7 @@ Running this will check your system for requirements as well so you will need to
All right now we can download metamaps from the master using git
git clone https://github.com/metamaps/metamaps_gen002.git
git clone https://github.com/metamaps/metamaps.git
Now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server
@ -48,14 +48,14 @@ ImageMagick in the Ubuntu Software Centre
Install the specific version of ruby needed this will take some time
rvm install $(cat metamaps_gen002/.ruby-version)
rvm install $(cat metamaps/.ruby-version)
Now we also need to copy .example-env to a new file named .env. Review the
configuration in here to see if you need any changes.
cp .example-env .env
Now run inside your metamaps_gen002 folder:
Now run inside your metamaps folder:
gem install bundle
bundle install

View file

@ -13,16 +13,16 @@ folder writable by your user account.
Now you are ready to clone the Metamaps git repository:
git clone https://github.com/metamaps/metamaps_gen002.git --branch develop
cd metamaps_gen002
git clone https://github.com/metamaps/metamaps.git --branch develop
cd metamaps
bundle install
The third `bundle install` command downloads and installs the rubygem
dependencies of Metamaps.
At this point you should be in C:\git\metamaps_gen002, or whatever equivalent
At this point you should be in C:\git\metamaps, or whatever equivalent
directory you've chosen. The next step is to set up your database
configuration. From the metamaps_gen002 directory, run
configuration. From the metamaps directory, run
start config

View file

@ -36,16 +36,16 @@
sudo su - metamaps
rvm user gemsets
git clone https://github.com/metamaps/metamaps_gen002 \
git clone https://github.com/metamaps/metamaps \
--branch instance/mycoolinstance
rvm install $(cat metamaps_gen002/.ruby-version) #ensure ruby is installed
cd metamaps_gen002
rvm install $(cat metamaps/.ruby-version) #ensure ruby is installed
cd metamaps
gem install bundle
bundle install
#### Connect rails database
Run this in the metamaps_gen002 directory, still as metamaps:
Run this in the metamaps directory, still as metamaps:
cp .example-env .env
nano .env # fill in DB_* values, and realtime server at least. Ctrl+X to save/exit.
@ -59,7 +59,7 @@ Get an SSL certificate and encrypt it for the realtime video.
#### And finally
passenger-config restart-app /home/metamaps/metamaps_gen002
passenger-config restart-app /home/metamaps/metamaps
If this command fails, it may be helpful for debugging to run a test server to
see what problems show up:
@ -71,13 +71,13 @@ see what problems show up:
sudo aptitude install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g forever
(crontab -u metamaps -l 2>/dev/null; echo "@reboot $(which forever) --append -l /home/metamaps/logs/forever.realtime.log start /home/metamaps/metamaps_gen002/realtime/realtime-server.js") | crontab -u metamaps -
(crontab -u metamaps -l 2>/dev/null; echo "@reboot $(which forever) --append -l /home/metamaps/logs/forever.realtime.log start /home/metamaps/metamaps/realtime/realtime-server.js") | crontab -u metamaps -
cd /home/metamaps/metamaps_gen002/realtime
cd /home/metamaps/metamaps/realtime
npm install
mkdir -p /home/metamaps/logs
forever --append -l /home/metamaps/logs/forever.realtime.log \
start /home/metamaps/metamaps_gen002/realtime/realtime-server.js
start /home/metamaps/metamaps/realtime/realtime-server.js
#### Upstart service for delayed_worker:
@ -90,11 +90,11 @@ Put the following code into `/etc/init/metamaps_delayed_worker.conf`:
setuid metamaps
setgid metamaps
chdir /home/metamaps/metamaps_gen002
chdir /home/metamaps/metamaps
env HOME=/home/metamaps
env PATH="/usr/local/rvm/gems/ruby-2.1.3@metamaps_gen002/bin:/usr/local/rvm/gems/ruby-2.1.3@global/bin:/usr/local/rvm/rubies/ruby-2.1.3/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin"
env GEM_PATH="/usr/local/rvm/gems/ruby-2.1.3@metamaps_gen002:/usr/local/rvm/gems/ruby-2.1.3@global"
env PATH="/usr/local/rvm/gems/ruby-2.1.3@metamaps/bin:/usr/local/rvm/gems/ruby-2.1.3@global/bin:/usr/local/rvm/rubies/ruby-2.1.3/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin"
env GEM_PATH="/usr/local/rvm/gems/ruby-2.1.3@metamaps:/usr/local/rvm/gems/ruby-2.1.3@global"
env RAILS_ENV="production"
respawn