Skip to content

Commit

Permalink
Merge pull request #77 from HWYA/prod-fix
Browse files Browse the repository at this point in the history
Merge Prod-Fix Into Master
  • Loading branch information
sunsheeppoplar authored Mar 26, 2017
2 parents af59123 + f4abc07 commit 4dbafe4
Show file tree
Hide file tree
Showing 21 changed files with 513 additions and 51 deletions.
32 changes: 32 additions & 0 deletions .add_git_remotes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

output_array=($(git remote 2>&1))

h="heroku"
u="upstream"
o="origin"

h_remote="git remote add heroku https://git.heroku.com/shapeofteam.git"
u_remote="git remote add upstream [email protected]:HWYA/shapeOfTeam.git"

if [ ${#output_array[@]} == 3 ]; then
for remote in "${output_array[@]}"
do
echo $remote "remote is already present"
done
elif [ ${#output_array[@]} == 2 ]; then
for remote in "${output_array[@]}"
do
if [ "$remote" == $o ]; then
unset output_array[$remote]
fi
done

if [ ${output_array[@]} = $u ]; then
$h_remote
echo "heroku remote added!"
else
$u_remote
echo "upstream remote added!"
fi
fi
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: ruby
rvm:
- 2.3.1

services:
- postgresql

before_script:
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres

script:
- export RAILS_ENV=test
- bundle exec rake db:schema:load db:test:prepare
- bundle exec rspec spec --require spec_helper --require rails_helper
24 changes: 22 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,36 @@ gem 'active_model_serializers'

gem "d3-rails"

# http request gem
gem "httparty"

# helps with keeping rake tasks from failing if there are socket/timeout errors with data source
gem "em-resolv-replace"
gem "eventmachine"

# helps rails console readability
gem 'pry-rails'



group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri

# test suite
gem 'rspec-rails', '~> 3.5'

# watcher for test suite
gem 'guard-rspec', require: false

# add-on for data management in testing
gem 'factory_girl_rails'

# makes sure our db doesn't have residual objects
gem 'database_cleaner'

# additional add-on for rspec testing ease
gem 'shoulda-matchers'
end

group :development do
Expand All @@ -55,8 +76,7 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# helps rails console readability
gem 'pry-rails'

# used to dump database into yaml format
gem 'yaml_db'
end
Expand Down
58 changes: 57 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,36 @@ GEM
concurrent-ruby (1.0.2)
d3-rails (4.3.0)
railties (>= 3.1)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
diff-lcs (1.3)
em-resolv-replace (1.1.3)
erubis (2.7.0)
eventmachine (1.2.2)
execjs (2.7.0)
factory_girl (4.8.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
ffi (1.9.14)
formatador (0.2.5)
globalid (0.3.7)
activesupport (>= 4.1.0)
guard (2.14.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
httparty (0.14.0)
multi_xml (>= 0.5.2)
i18n (0.7.0)
Expand All @@ -82,6 +104,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
lumberjack (1.0.11)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
Expand All @@ -92,9 +115,13 @@ GEM
minitest (5.10.1)
multi_json (1.12.1)
multi_xml (0.5.5)
nenv (0.3.0)
nio4r (1.2.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
pg (0.19.0)
pry (0.10.4)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -133,13 +160,37 @@ GEM
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
shellany (0.0.1)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
slop (3.6.0)
spring (2.0.0)
activesupport (>= 4.2)
Expand Down Expand Up @@ -183,8 +234,11 @@ DEPENDENCIES
byebug
coffee-rails (~> 4.2)
d3-rails
database_cleaner
em-resolv-replace
eventmachine
factory_girl_rails
guard-rspec
httparty
jbuilder (~> 2.5)
jquery-rails
Expand All @@ -193,7 +247,9 @@ DEPENDENCIES
pry-rails
puma (~> 3.0)
rails (~> 5.0.0, >= 5.0.0.1)
rspec-rails (~> 3.5)
sass-rails (~> 5.0)
shoulda-matchers
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand All @@ -203,4 +259,4 @@ DEPENDENCIES
yaml_db

BUNDLED WITH
1.13.6
1.14.6
70 changes: 70 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}

## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'

guard :rspec, cmd: "bundle exec rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)

# Feel free to open issues for suggestions and improvements

# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)

# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)

# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)

watch(rails.controllers) do |m|
[
rspec.spec.call("routing/#{m[1]}_routing"),
rspec.spec.call("controllers/#{m[1]}_controller"),
rspec.spec.call("acceptance/#{m[1]}")
]
end

# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }

# Capybara features specs
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end
end
4 changes: 3 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require d3
//= require d3.min.js
//= require topojson.min.js
//= require datamaps.world.hires.min.js
//= require fetchClubs
//= require_tree .
29 changes: 15 additions & 14 deletions app/assets/javascripts/fetchClubs.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
$(document).ready(function() {
$("#the_only_button").on('click', function(event) {
$(window).ready(function() {
$("#get_club_name").on('change', function(event) {

event.preventDefault();

// encodeURIComponent converts text field params for GET
var club_name = encodeURIComponent($("#the_only_text_field").val());
var club_name = encodeURIComponent($("#get_club_name").val());
// to prevent mixed content issues
if (window.location.protocol === "http:") {
var myDomain = "http://" + window.location.host;
} else {
myDomain = "https://" + window.location.host;
}

$.ajax({

method: "GET",
url: "http://localhost:3000/clubs?name="+club_name,
url: myDomain + "/clubs?name=" + club_name,
dataType: "json",
success: function(data) {
for (i=0;i<data.length;i++){
data[i].radius=2;
data[i].fillKey='playerFill';
data[i].latitude=data[i].bp_latitude;
data[i].longitude=data[i].bp_longitude;
for (i=0; i < data.length; i++) {
data[i].radius = 2.5;
data[i].fillKey = 'playerFill';
data[i].latitude = data[i].bp_latitude;
data[i].longitude = data[i].bp_longitude;
};

map.bubbles(data);
}


});

});
});
29 changes: 29 additions & 0 deletions app/assets/stylesheets/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#container {
height: 100%;
width: 100%;
position: relative;
}

#get_club_name {
border-color: #000000;
left: 45%;
position: absolute;
top: 95%;
z-index: 100001;
}

#player_info {
background-color: #e90052;
border-radius: 5px;
color: #ffffff;
font-size: x-small;
padding: 5px 5px;
}

#country_info {
background-color: #000000;
border-radius: 5px;
color: #ffffff;
font-size: x-small;
padding: 5px 5px;
}
Loading

0 comments on commit 4dbafe4

Please sign in to comment.