Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating users signup and posts order #1327

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7ab2c96
added links and updated url
ravensears Feb 7, 2022
9a20280
initialising-repo
jmodiale Feb 7, 2022
76fd584
add platform x86_64-linux
ravensears Feb 7, 2022
8748d9e
first heroku version
ravensears Feb 7, 2022
ac3b6ba
Procfile added
ravensears Feb 7, 2022
02da21b
add .env to .gitignore
ravensears Feb 7, 2022
b602044
added rubocop and simplecov
floriov Feb 7, 2022
bd4e9ca
updating and mering files
floriov Feb 7, 2022
5e64bc9
Updated Gemfile
ravensears Feb 7, 2022
158f5a6
Merge https://github.com/ravensears/acebook-five-aces
ravensears Feb 7, 2022
329dd33
update
jmodiale Feb 8, 2022
314029d
Changed Procfile
ravensears Feb 8, 2022
f587a3a
removed procfile
ravensears Feb 8, 2022
c0cfba7
added Procfile
ravensears Feb 8, 2022
eb67cba
changed asset
ravensears Feb 8, 2022
e7ede0a
Heroku Troubleshooting
ravensears Feb 8, 2022
e7a5e89
added favicon
ravensears Feb 8, 2022
aa14505
Merge https://github.com/ravensears/acebook-five-aces
ravensears Feb 8, 2022
0f0968a
Create rubyonrails.yml
floriov Feb 8, 2022
7d99b28
Reversing posts_order
ElliottZaki Feb 8, 2022
d01f7d0
Update rubyonrails.yml
floriov Feb 8, 2022
67eae0d
Updated Ruby Gem File and Config Routes
ravensears Feb 8, 2022
2e26f53
Gemfile
ravensears Feb 8, 2022
9b1a26e
Updated storage file
ravensears Feb 8, 2022
85003ae
Added CI/CD instructions to README file
floriov Feb 8, 2022
e158cae
troubleshooting heroku
ravensears Feb 8, 2022
dce3249
Added CI/CD instructions to README file
floriov Feb 8, 2022
d4ba006
Merge pull request #2 from ravensears/U4_test_CI_CD
floriov Feb 8, 2022
c3cb64f
fixing heroku
ravensears Feb 8, 2022
d66e4a9
Added documetnation for github actions process and updated README.md …
floriov Feb 8, 2022
ccb4de6
Merge https://github.com/ravensears/acebook-five-aces
ravensears Feb 8, 2022
26cb85f
Merge branch 'master' into Creating_Users_Signup_and_Posts_order
floriov Feb 8, 2022
56cfcf7
Merge branch 'master' into Creating_Users_Signup_and_Posts_order
floriov Feb 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Ruby on Rails CI"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v2
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@8f312efe1262fb463d906e9bf040319394c18d3e # v1.92
with:
bundler-cache: true
# Add or replace database setup steps here
- name: Set up database schema
run: bin/rails db:schema:load
# Add or replace test runners here
- name: Run tests
run: bin/rake

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Ruby and gems
uses: ruby/setup-ruby@8f312efe1262fb463d906e9bf040319394c18d3e # v1.92
with:
bundler-cache: true
# Add or replace any other lints here


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
/yarn-error.log

.byebug_history
.env
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
3.0.0
15 changes: 14 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end



ruby "3.0.0"


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1'
gem 'rails', '~> 6.1.0'
# Use postgresql as the database for Active Record
gem 'pg'
# Use Puma as the app server
Expand All @@ -28,7 +33,15 @@ gem 'jbuilder', '~> 2.5'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :test do
gem 'rspec'
gem 'simplecov', require: false, group: :test
gem 'simplecov-console', require: false, group: :test
end

group :development, :test do
gem 'rubocop', '1.20'
gem 'twilio-ruby'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
Expand Down
85 changes: 82 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
ast (2.4.2)
bindex (0.8.1)
builder (3.2.4)
byebug (11.1.3)
Expand All @@ -76,8 +78,22 @@ GEM
concurrent-ruby (1.1.9)
crass (1.0.6)
diff-lcs (1.5.0)
docile (1.4.0)
erubi (1.10.0)
execjs (2.8.1)
faraday (1.9.3)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
Expand All @@ -86,7 +102,8 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.1.5)
jwt (2.3.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
Expand All @@ -98,6 +115,16 @@ GEM
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.15.0)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.13.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.1-x86_64-linux)
racc (~> 1.4)
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
mini_portile2 (2.7.1)
minitest (5.15.0)
nio4r (2.5.8)
Expand Down Expand Up @@ -137,10 +164,18 @@ GEM
method_source
rake (>= 0.13)
thor (~> 1.0)

rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.2.0)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rexml (3.2.5)
rspec-core (3.10.2)
rspec-support (~> 3.10.0)
Expand All @@ -159,6 +194,20 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.3)
rubocop (1.20.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)

ruby_dep (1.5.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
Expand All @@ -175,19 +224,38 @@ GEM
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-console (0.9.1)
ansi
simplecov
terminal-table
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
tilt (2.0.10)
twilio-ruby (5.63.1)
faraday (>= 0.9, < 2.0)
jwt (>= 1.5, <= 2.5)
nokogiri (>= 1.6, < 2.0)
thor (1.2.1)
tilt (2.0.10)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.1.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -201,7 +269,9 @@ GEM
zeitwerk (2.5.4)

PLATFORMS
ruby
arm64-darwin-20
arm64-darwin-21
x86_64-linux

DEPENDENCIES
byebug
Expand All @@ -210,13 +280,22 @@ DEPENDENCIES
listen (>= 3.0.5, < 3.2)
pg
puma (~> 3.12.6)
rails (~> 6.1)
rails (~> 6.1.0)
rspec
rspec-rails (~> 4)
rubocop (= 1.20)
sass-rails (~> 6.0)
selenium-webdriver
simplecov
simplecov-console
twilio-ruby
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

RUBY VERSION
ruby 3.0.0p0

BUNDLED WITH
2.3.4
2.3.6
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

REQUIRED INSTRUCTIONS:

1. Fork this repository to `acebook-teamname` and customize
1. Fork this repository to `five-aces` and customize
the below**

[You can find the engineering project outline here.](https://github.com/makersacademy/course/tree/master/engineering_projects/rails)
[You can find the engineering project outline here.](https://github.com/ravensears/five-aces-group-project)

2. The card wall is here: <please update>
2. The card wall is here: <https://trello.com/b/ezLGgoKk/acebook-five-aces>

## How to contribute to this project
See [CONTRIBUTING.md](CONTRIBUTING.md)
Expand All @@ -34,3 +34,17 @@ ExecJS::RuntimeUnavailable:
```
That is because Rails will use a Javascript runtime (such as Node) under the hood. The easiest way is to install Node by running `brew install node` -
and then run `bundle exec rspec` again



## CI/CD process - commands

git fetch https://github.com/ravensears/acebook-five-aces.git
git branch -a
git checkout U4_test_CI_CD
git fetch
git checkout U4_test_CI_CD

## Github Actions - This is part of CI/CD automation
After merging files into the main repo, go to this link: https://github.com/ravensears/acebook-five-aces/actions
and wait until the tick changes from orange to green. You can click on the process name i.e. 'Merge pull request #2' to see any issues or errors.
2 changes: 1 addition & 1 deletion app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def create
end

def index
@posts = Post.all
@posts = Post.all.order('created_at DESC')
end

private
Expand Down
1 change: 1 addition & 0 deletions app/views/posts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<% @posts.each do |post| %>
<p><%= post.message %></p>
<p><%= post.created_at %></p>
<% end %>

<%= link_to new_post_path do %>
Expand Down
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
require 'rails/commands'
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
config.assets.compile = true

# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'posts#index'

resources :posts
end
31 changes: 31 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>

# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket
# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name
# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]
5 changes: 5 additions & 0 deletions coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"result": {
"line": 100.0
}
}
Loading