├── .gitignore ├── .rspec ├── Gemfile ├── Gemfile.lock ├── README.md ├── app.rb ├── lib ├── profile.rb ├── sinatra │ └── oauth_routes.rb └── we_got_coders │ └── trainee.rb ├── primes.rb ├── public ├── images │ └── logo.png └── stylesheets │ ├── main.css │ └── reset.css ├── spec ├── primes_spec.rb └── spec_helper.rb └── views ├── error.erb ├── index.erb ├── main.erb └── primes.erb /.gitignore: -------------------------------------------------------------------------------- 1 | README.html 2 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format progress 3 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'sinatra' 4 | gem 'oauth2' 5 | gem 'httparty' 6 | gem 'json' 7 | 8 | group :development, :test do 9 | gem 'pry' 10 | gem 'rspec' 11 | end -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | coderay (1.1.1) 5 | diff-lcs (1.3) 6 | faraday (0.11.0) 7 | multipart-post (>= 1.2, < 3) 8 | httparty (0.14.0) 9 | multi_xml (>= 0.5.2) 10 | json (2.1.0) 11 | jwt (1.5.6) 12 | method_source (0.8.2) 13 | multi_json (1.12.1) 14 | multi_xml (0.6.0) 15 | multipart-post (2.0.0) 16 | oauth2 (1.3.1) 17 | faraday (>= 0.8, < 0.12) 18 | jwt (~> 1.0) 19 | multi_json (~> 1.3) 20 | multi_xml (~> 0.5) 21 | rack (>= 1.2, < 3) 22 | pry (0.10.4) 23 | coderay (~> 1.1.0) 24 | method_source (~> 0.8.1) 25 | slop (~> 3.4) 26 | rack (1.6.5) 27 | rack-protection (1.5.3) 28 | rack 29 | rspec (3.6.0) 30 | rspec-core (~> 3.6.0) 31 | rspec-expectations (~> 3.6.0) 32 | rspec-mocks (~> 3.6.0) 33 | rspec-core (3.6.0) 34 | rspec-support (~> 3.6.0) 35 | rspec-expectations (3.6.0) 36 | diff-lcs (>= 1.2.0, < 2.0) 37 | rspec-support (~> 3.6.0) 38 | rspec-mocks (3.6.0) 39 | diff-lcs (>= 1.2.0, < 2.0) 40 | rspec-support (~> 3.6.0) 41 | rspec-support (3.6.0) 42 | sinatra (1.4.8) 43 | rack (~> 1.5) 44 | rack-protection (~> 1.4) 45 | tilt (>= 1.3, < 3) 46 | slop (3.6.0) 47 | tilt (2.0.7) 48 | 49 | PLATFORMS 50 | ruby 51 | 52 | DEPENDENCIES 53 | httparty 54 | json 55 | oauth2 56 | pry 57 | rspec 58 | sinatra 59 | 60 | BUNDLED WITH 61 | 1.14.3 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | We Got Coders 3 |

4 | 5 | # Programming Challenge 6 | 7 | This is the application that you will be using to demonstrate your preparedness for the course. If you've already applied and are ready to get started, follow the instructions below. If you haven't yet applied, please read about We Got Coders and apply on our website, http://wegotcoders.com/trainees. 8 | 9 | ## INSTALL 10 | 11 | Follow these steps to get going. 12 | 13 | * Prepare a folder to put your work inside. We recommend using ```projects``` in your home folder. 14 | ```mkdir ~/projects``` 15 | * Fork this repository into your own GitHub account. 16 | * Clone a copy to your local machine. 17 | ``` 18 | cd ~/projects 19 | git clone 20 | ``` 21 | * Change directory to your cloned workspace in the terminal. ```cd wgc_groundwork``` 22 | * We now need to install some dependencies that will make the application work. If you've not done so already, install bundler using the ```gem install bundler``` command. Then run the ```bundle``` command, and you should see a number of gems being installed (see http://bundler.io for more information on how this works). 23 | * Update app.rb to include your OAuth application id and application secret, 24 | which you can find on your profile page (http://wegotcoders.com/trainees/sign_in). 25 | * Run the application using the following command: ```ruby app.rb```. Don't forget 26 | that every time you change app.rb, you must restart the server by entering ```CTRL+C``` 27 | in the terminal, and re-run ```ruby app.rb```. 28 | * Cut + paste this URL into your browser: ```http://localhost:4567```. You should see the We Got Coders logo and some welcome text. 29 | * Click the authorize link. The application will retrieve your profile data from We Got Coders. You may need to sign-in with your username and password. 30 | 31 | ## TODO 32 | 33 | Attempt the following tasks. The list is meant to be progressively more 34 | difficult and open-ended; the aim is to demonstrate your approach when dealing with programming issues and to test your initiative. Complete as much as you can within the time limit; you will not be penalised for not finishing the list. We are looking for self-motivated effort and to see how much of the groundwork you have grasped. 35 | 36 | Don't forget to ```git add .``` and ```git commit``` after each step, if you have made any changes to your code! 37 | 38 | * You should see a list of the profile data that you submitted to us when you 39 | applied to We Got Coders. Use your knowledge of HTML / CSS to redesign and 40 | layout the page in a presentable way. Show us what you can do with: 41 | 42 | * Headings 43 | * Lists 44 | * Backgrounds / Gradients 45 | * Multiple columns 46 | 47 | * Add an image of yourself to your profile. Add CSS where necessary to ensure that it looks presentable. 48 | 49 | * Observe how the about field works. What makes it bound to the data from your profile? Add more fields so that you can edit your profile. 50 | 51 | * Add a field to the form so that you can add your Codecademy account to 52 | your profile. You will need an input text box, with the appropriate ```name``` attribute. 53 | 54 | * Add some Javascript to the provided ``` -------------------------------------------------------------------------------- /views/main.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | We Got Coders - My Amazing Application 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 |
18 | <%= yield %> 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /views/primes.erb: -------------------------------------------------------------------------------- 1 |

Prime Numbers

2 | 3 | Sum : <%= @sum %> 4 | 5 |
6 | Back 7 |
--------------------------------------------------------------------------------