Skip to content

Commit

Permalink
Merge 06c3242 into cbb44dd
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rods committed May 5, 2017
2 parents cbb44dd + 06c3242 commit a08c4e1
Show file tree
Hide file tree
Showing 29 changed files with 891 additions and 88 deletions.
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
source 'https://rubygems.org'
ruby '2.4.0'

gem 'capybara'
gem 'database_cleaner'
gem 'sinatra'
gem 'pry'
gem 'bcrypt'
gem 'data_mapper'
gem 'sinatra-flash'
gem 'dm-postgres-adapter'
gem 'rack'

group :test do
gem 'rspec'
gem 'cucumber'
gem 'rake'
gem 'coveralls', require: false
end


120 changes: 111 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
bcrypt (3.1.11)
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
builder (3.2.3)
coveralls (0.8.19)
capybara (2.13.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
coderay (1.1.1)
coveralls (0.8.20)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
simplecov (~> 0.14.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
thor (~> 0.19.4)
tins (~> 1.6)
cucumber (2.4.0)
builder (>= 2.1.2)
Expand All @@ -19,12 +32,80 @@ GEM
cucumber-core (1.5.0)
gherkin (~> 4.0)
cucumber-wire (0.0.1)
data_mapper (1.2.0)
dm-aggregates (~> 1.2.0)
dm-constraints (~> 1.2.0)
dm-core (~> 1.2.0)
dm-migrations (~> 1.2.0)
dm-serializer (~> 1.2.0)
dm-timestamps (~> 1.2.0)
dm-transactions (~> 1.2.0)
dm-types (~> 1.2.0)
dm-validations (~> 1.2.0)
data_objects (0.10.17)
addressable (~> 2.1)
database_cleaner (1.5.3)
diff-lcs (1.3)
dm-aggregates (1.2.0)
dm-core (~> 1.2.0)
dm-constraints (1.2.0)
dm-core (~> 1.2.0)
dm-core (1.2.1)
addressable (~> 2.3)
dm-do-adapter (1.2.0)
data_objects (~> 0.10.6)
dm-core (~> 1.2.0)
dm-migrations (1.2.0)
dm-core (~> 1.2.0)
dm-postgres-adapter (1.2.0)
dm-do-adapter (~> 1.2.0)
do_postgres (~> 0.10.6)
dm-serializer (1.2.2)
dm-core (~> 1.2.0)
fastercsv (~> 1.5)
json (~> 1.6)
json_pure (~> 1.6)
multi_json (~> 1.0)
dm-timestamps (1.2.0)
dm-core (~> 1.2.0)
dm-transactions (1.2.0)
dm-core (~> 1.2.0)
dm-types (1.2.2)
bcrypt-ruby (~> 3.0)
dm-core (~> 1.2.0)
fastercsv (~> 1.5)
json (~> 1.6)
multi_json (~> 1.0)
stringex (~> 1.4)
uuidtools (~> 2.1)
dm-validations (1.2.0)
dm-core (~> 1.2.0)
do_postgres (0.10.17)
data_objects (= 0.10.17)
docile (1.1.5)
gherkin (4.0.0)
json (2.0.3)
fastercsv (1.5.5)
gherkin (4.1.1)
json (1.8.6)
json_pure (1.8.6)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
multi_json (1.12.1)
multi_test (0.1.2)
nokogiri (1.7.1)
mini_portile2 (~> 2.1.0)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (2.0.5)
rack (1.6.5)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
Expand All @@ -39,27 +120,48 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
simplecov (0.12.0)
simplecov (0.14.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
term-ansicolor (1.4.0)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sinatra-flash (0.3.0)
sinatra (>= 1.0.0)
slop (3.6.0)
stringex (1.5.1)
term-ansicolor (1.5.0)
tins (~> 1.0)
thor (0.19.4)
tins (1.13.0)
tilt (2.0.7)
tins (1.13.2)
uuidtools (2.1.5)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
bcrypt
capybara
coveralls
cucumber
data_mapper
database_cleaner
dm-postgres-adapter
pry
rack
rake
rspec
sinatra
sinatra-flash

RUBY VERSION
ruby 2.4.0p0

BUNDLED WITH
1.13.7
1.14.6
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec rackup config.ru -p $PORT
117 changes: 40 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,71 @@
Chitter Challenge
=================

* Challenge time: rest of the day and weekend, until Monday 9am
* Feel free to use google, your notes, books, etc. but work on your own
* If you refer to the solution of another coach or student, please put a link to that in your README
* If you have a partial solution, **still check in a partial solution**
* You must submit a pull request to this repo with your code by 9am Monday morning
Write a little Twitter clone that will allow the users to post messages to a public stream.

Challenge:
-------

As usual please start by forking this repo.

We are going to write a little Twitter clone that will allow the users to post messages to a public stream.

Features:
-------
### User stories for the project:

```
As a Maker
As a User
So that I can post messages on Chitter as me
I want to sign up for Chitter
As a Maker
As a User
So that I can post messages on Chitter as me
I want to log in to Chitter
As a Maker
As a User
So that I can avoid others posting messages on Chitter as me
I want to log out of Chitter
As a Maker
As a User
So that I can let people know what I am doing
I want to post a message (peep) to chitter
As a maker
As a User
So that I can see what others are saying
I want to see all peeps in reverse chronological order
As a maker
As a User
So that I can better appreciate the context of a peep
I want to see the time at which it was made
```

## To install:

* Fork this repo & clone to your machine.
* Make sure to have Ruby 2.4 installed for this application.
* Run bundler to install gems. (You may also need to bundle update)
* Run RSpec to view or test drive new features.
* Run Rackup and type in browser your localhost address to start using the application.
* Follow the app structure below as a guide to the application structure.

![Sign in](https://raw.githubusercontent.com/j-rods/chitter-challenge/master/readme-assets/1.png)


![Hub](https://raw.githubusercontent.com/j-rods/chitter-challenge/master/readme-assets/2.png)

## Technologies used:

* Ruby 2.4
* Sinatra
* RSpec
* Heroku
* Capybara
* Rack
* DataMapper
* SQL
* BCrypt
* Sinatra-Flash
* Database-Cleaner
* HTML5
* CSS3

Notes on functionality:
------

* Drive the creation of your app using tests - either cucumber or rspec as you prefer
* Makers sign up to chitter with their email, password, name and a user name (e.g. sam@makersacademy.com, s3cr3t, Samuel Russell Hampden Joseph, tansaku).
* Users can sign up to chitter with their email, password, name and a user name (e.g. test@gmail.com, s3cr3t, Samuel Russell Hampden Joseph, tansaku).
* The username and email are unique.
* Peeps (posts to chitter) have the name of the maker and their user handle.
* Use bcrypt to secure the passwords.
* Use data mapper and postgres to save the data.
* Peeps (posts to chitter) have the name of the user and their user handle.
* You don't have to be logged in to see the peeps.
* You only can peep if you are logged in.
* Please ensure that you update your README to indicate the technologies used, and give instructions on how to install and run the tests
* Finally submit a pull request before Monday at 9am with your solution or partial solution. However much or little amount of code you wrote please please please submit a pull request before Monday at 9am

Bonus:
-----

If you have time you can implement the following:

* In order to start a conversation as a maker I want to reply to a peep from another maker.

And/Or:

* Work on the css to make it look good (we all like beautiful things).

Good luck and let the chitter begin!

Code Review
-----------

In code review we'll be hoping to see:

* All tests passing
* High [Test coverage](https://github.com/makersacademy/course/blob/master/pills/test_coverage.md) (>95% is good)
* The code is elegant: every class has a clear responsibility, methods are short etc.

Reviewers will potentially be using this [code review rubric](docs/review.md). Referring to this rubric in advance may make the challenge somewhat easier. You should be the judge of how much challenge you want this weekend.

Notes on test coverage
----------------------

Please ensure you have the following **AT THE TOP** of your spec_helper.rb in order to have test coverage stats generated
on your pull request:

```ruby
require 'coveralls'
require 'simplecov'

SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
Coveralls.wear!
```

You can see your [test coverage](https://github.com/makersacademy/course/blob/master/pills/test_coverage.md) when you submit a pull request, and you can also get a summary locally by running:

```
$ coveralls report
```

This repo works with [Coveralls](https://coveralls.io/) to calculate test coverage statistics on each pull request.

21 changes: 19 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
if ENV['RACK_ENV'] != 'production'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new :spec

task default: [:spec]
end

require 'data_mapper'
require './app/app.rb'

namespace :db do
desc "Non destructive upgrade"
task :auto_upgrade do
DataMapper.auto-upgrade!
puts "Auto-upgrade complete (no data loss)"
end

desc "Destructive upgrade"
task :auto_migrate do
DataMapper.auto_migrate!
puts "Auto-migrate complete (data was lost)"
end
end
Loading

0 comments on commit a08c4e1

Please sign in to comment.