-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from codeunion/initial-files
Initial files
- Loading branch information
Showing
14 changed files
with
775 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL=sqlite:development.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.DS_Store | ||
.env | ||
*.db | ||
|
||
*.gem | ||
*.rbc | ||
/.config | ||
/coverage/ | ||
/InstalledFiles | ||
/pkg/ | ||
/spec/reports/ | ||
/test/tmp/ | ||
/test/version_tmp/ | ||
/tmp/ | ||
|
||
## Specific to RubyMotion: | ||
.dat* | ||
.repl_history | ||
build/ | ||
|
||
## Documentation cache and generated files: | ||
/.yardoc/ | ||
/_yardoc/ | ||
/doc/ | ||
/rdoc/ | ||
|
||
## Environment normalisation: | ||
/.bundle/ | ||
/lib/bundler/man/ | ||
|
||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'sinatra' | ||
gem 'data_mapper' | ||
|
||
gem 'rake' | ||
gem 'faker' | ||
|
||
group :development do | ||
gem 'sqlite3' | ||
gem 'dm-sqlite-adapter' | ||
gem 'dotenv' | ||
gem 'rerun' | ||
end | ||
|
||
group :production do | ||
gem 'dm-postgres-adapter' | ||
gem 'pg' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
addressable (2.3.6) | ||
bcrypt (3.1.9) | ||
bcrypt-ruby (3.1.5) | ||
bcrypt (>= 3.1.3) | ||
celluloid (0.16.0) | ||
timers (~> 4.0.0) | ||
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.14) | ||
addressable (~> 2.1) | ||
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-sqlite-adapter (1.2.0) | ||
dm-do-adapter (~> 1.2.0) | ||
do_sqlite3 (~> 0.10.6) | ||
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.14) | ||
data_objects (= 0.10.14) | ||
do_sqlite3 (0.10.14) | ||
data_objects (= 0.10.14) | ||
dotenv (1.0.2) | ||
faker (1.4.3) | ||
i18n (~> 0.5) | ||
fastercsv (1.5.5) | ||
ffi (1.9.6) | ||
hitimes (1.2.2) | ||
i18n (0.6.11) | ||
json (1.8.1) | ||
json_pure (1.8.1) | ||
listen (2.7.11) | ||
celluloid (>= 0.15.2) | ||
rb-fsevent (>= 0.9.3) | ||
rb-inotify (>= 0.9) | ||
multi_json (1.10.1) | ||
pg (0.17.1) | ||
rack (1.5.2) | ||
rack-protection (1.5.3) | ||
rack | ||
rake (10.3.2) | ||
rb-fsevent (0.9.4) | ||
rb-inotify (0.9.5) | ||
ffi (>= 0.5.0) | ||
rerun (0.10.0) | ||
listen (~> 2.7, >= 2.7.3) | ||
sinatra (1.4.5) | ||
rack (~> 1.4) | ||
rack-protection (~> 1.4) | ||
tilt (~> 1.3, >= 1.3.4) | ||
sqlite3 (1.3.9) | ||
stringex (1.5.1) | ||
tilt (1.4.1) | ||
timers (4.0.1) | ||
hitimes | ||
uuidtools (2.1.5) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
data_mapper | ||
dm-postgres-adapter | ||
dm-sqlite-adapter | ||
dotenv | ||
faker | ||
pg | ||
rake | ||
rerun | ||
sinatra | ||
sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require_relative './config/dotenv' | ||
require_relative './models' | ||
|
||
require 'faker' | ||
|
||
task 'db:seed' do | ||
# Create a new user | ||
user = User.create({ :name => Faker::Name.name, | ||
:bio => Faker::Lorem.paragraph(2), | ||
:email => Faker::Internet.email, | ||
:phone => Faker::PhoneNumber.phone_number, | ||
:website => Faker::Internet.url }) | ||
|
||
# Create 5 jobs | ||
jobs = Array.new(5) { Job.create({ :job_title => Faker::Name.title, | ||
:job_description => Faker::Company.bs, | ||
:company_name => Faker::Company.name }) | ||
} | ||
|
||
# Create a random number of skills | ||
skills = Array.new(rand(10)) { Skill.create({ :name => Faker::Hacker.ingverb }) } | ||
|
||
# Associate the jobs and skills with the user | ||
jobs.each { |job| user.jobs << job } | ||
skills.each { |skill| user.skills << skill } | ||
|
||
# Save the user and all associations | ||
user.save | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require './linkedout.rb' | ||
|
||
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if ENV['RACK_ENV'] != 'production' | ||
require 'dotenv' | ||
Dotenv.load('.env') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'sinatra' | ||
|
||
require_relative 'config/dotenv' | ||
require_relative 'models' | ||
|
||
helpers do | ||
def default_user | ||
@default_user ||= User.last | ||
end | ||
end | ||
|
||
get "/" do | ||
@jobs = default_user.jobs | ||
@skills = default_user.skills | ||
|
||
erb :'resumes/show' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'data_mapper' | ||
|
||
DataMapper.setup(:default, ENV['DATABASE_URL']) | ||
|
||
class User | ||
include DataMapper::Resource | ||
|
||
property :id, Serial | ||
property :name, String, { :required => true } | ||
property :bio, Text, { :required => true } | ||
property :email, String, { :required => true, | ||
:unique => true, | ||
:format => :email_address } | ||
property :phone, String | ||
property :website, String, { :format => :url } | ||
|
||
has n, :jobs, { :child_key => [:user_id] } | ||
has n, :skills, { :child_key => [:user_id] } | ||
end | ||
|
||
class Job | ||
include DataMapper::Resource | ||
|
||
property :id, Serial | ||
property :job_title, String, { :required => true } | ||
property :job_description, String, { :required => true } | ||
property :company_name, String, { :required => true } | ||
|
||
belongs_to :user | ||
end | ||
|
||
class Skill | ||
include DataMapper::Resource | ||
|
||
property :id, Serial | ||
property :name, String, { :required => true } | ||
|
||
belongs_to :user | ||
end | ||
|
||
DataMapper.finalize | ||
DataMapper.auto_upgrade! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
header { | ||
min-width: 100%; | ||
text-align: center; | ||
} | ||
|
||
.resume { | ||
margin: 0 auto; | ||
width: 720px; | ||
} |
Oops, something went wrong.