This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jon Tatum
committed
Jun 6, 2014
1 parent
66ae720
commit 4fe5795
Showing
139 changed files
with
14,250 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,18 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile '~/.gitignore_global' | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore the default SQLite database. | ||
/db/*.sqlite3 | ||
/db/*.sqlite3-journal | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
/public/assets/* | ||
|
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,52 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
gem 'rails', '4.0.0.rc2' | ||
|
||
# Use sqlite3 as the database for Active Record | ||
gem 'sqlite3' | ||
|
||
# Use SCSS for stylesheets | ||
gem 'sass-rails', '~> 4.0.0.rc2' | ||
|
||
# Use Uglifier as compressor for JavaScript assets | ||
gem 'uglifier', '>= 1.3.0' | ||
|
||
# Use CoffeeScript for .js.coffee assets and views | ||
gem 'coffee-rails', '~> 4.0.0' | ||
|
||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes | ||
# gem 'therubyracer', platforms: :ruby | ||
|
||
# Use jquery as the JavaScript library | ||
gem 'jquery-rails' | ||
|
||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks | ||
gem 'turbolinks' | ||
|
||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
gem 'jbuilder', '~> 1.2' | ||
|
||
group :doc do | ||
# bundle exec rake doc:rails generates the API under doc/api. | ||
gem 'sdoc', require: false | ||
end | ||
|
||
gem 'twitter' | ||
gem 'devise' | ||
gem 'cancan' | ||
gem 'handlebars_assets' | ||
gem 'gon' | ||
gem 'thin' | ||
|
||
# Use ActiveModel has_secure_password | ||
# gem 'bcrypt-ruby', '~> 3.0.0' | ||
|
||
# Use unicorn as the app server | ||
# gem 'unicorn' | ||
|
||
# Use Capistrano for deployment | ||
# gem 'capistrano', group: :development | ||
|
||
# Use debugger | ||
# gem 'debugger', group: [:development, :test] |
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,171 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionmailer (4.0.0.rc2) | ||
actionpack (= 4.0.0.rc2) | ||
mail (~> 2.5.3) | ||
actionpack (4.0.0.rc2) | ||
activesupport (= 4.0.0.rc2) | ||
builder (~> 3.1.0) | ||
erubis (~> 2.7.0) | ||
rack (~> 1.5.2) | ||
rack-test (~> 0.6.2) | ||
activemodel (4.0.0.rc2) | ||
activesupport (= 4.0.0.rc2) | ||
builder (~> 3.1.0) | ||
activerecord (4.0.0.rc2) | ||
activemodel (= 4.0.0.rc2) | ||
activerecord-deprecated_finders (~> 1.0.2) | ||
activesupport (= 4.0.0.rc2) | ||
arel (~> 4.0.0) | ||
activerecord-deprecated_finders (1.0.3) | ||
activesupport (4.0.0.rc2) | ||
i18n (~> 0.6, >= 0.6.4) | ||
minitest (~> 4.2) | ||
multi_json (~> 1.3) | ||
thread_safe (~> 0.1) | ||
tzinfo (~> 0.3.37) | ||
addressable (2.3.6) | ||
arel (4.0.2) | ||
bcrypt (3.1.7) | ||
buftok (0.2.0) | ||
builder (3.1.4) | ||
cancan (1.6.10) | ||
coffee-rails (4.0.0) | ||
coffee-script (>= 2.2.0) | ||
railties (>= 4.0.0.beta, < 5.0) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.7.0) | ||
daemons (1.1.9) | ||
devise (3.2.4) | ||
bcrypt (~> 3.0) | ||
orm_adapter (~> 0.1) | ||
railties (>= 3.2.6, < 5) | ||
thread_safe (~> 0.1) | ||
warden (~> 1.2.3) | ||
equalizer (0.0.9) | ||
erubis (2.7.0) | ||
eventmachine (1.0.3) | ||
execjs (2.0.2) | ||
faraday (0.9.0) | ||
multipart-post (>= 1.2, < 3) | ||
gon (4.1.0) | ||
actionpack (>= 2.3.0) | ||
json | ||
handlebars_assets (0.12.1) | ||
execjs (>= 1.2.9) | ||
sprockets (>= 2.0.3) | ||
tilt | ||
hike (1.2.3) | ||
http (0.5.0) | ||
http_parser.rb | ||
http_parser.rb (0.6.0) | ||
i18n (0.6.9) | ||
jbuilder (1.5.3) | ||
activesupport (>= 3.0.0) | ||
multi_json (>= 1.2.0) | ||
jquery-rails (3.1.0) | ||
railties (>= 3.0, < 5.0) | ||
thor (>= 0.14, < 2.0) | ||
json (1.8.1) | ||
mail (2.5.4) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
memoizable (0.4.2) | ||
thread_safe (~> 0.3, >= 0.3.1) | ||
mime-types (1.25.1) | ||
minitest (4.7.5) | ||
multi_json (1.9.2) | ||
multipart-post (2.0.0) | ||
naught (1.0.0) | ||
orm_adapter (0.5.0) | ||
polyglot (0.3.4) | ||
rack (1.5.2) | ||
rack-test (0.6.2) | ||
rack (>= 1.0) | ||
rails (4.0.0.rc2) | ||
actionmailer (= 4.0.0.rc2) | ||
actionpack (= 4.0.0.rc2) | ||
activerecord (= 4.0.0.rc2) | ||
activesupport (= 4.0.0.rc2) | ||
bundler (>= 1.3.0, < 2.0) | ||
railties (= 4.0.0.rc2) | ||
sprockets-rails (~> 2.0.0) | ||
railties (4.0.0.rc2) | ||
actionpack (= 4.0.0.rc2) | ||
activesupport (= 4.0.0.rc2) | ||
rake (>= 0.8.7) | ||
thor (>= 0.18.1, < 2.0) | ||
rake (10.2.2) | ||
rdoc (4.1.1) | ||
json (~> 1.4) | ||
sass (3.3.5) | ||
sass-rails (4.0.0) | ||
railties (>= 4.0.0.beta, < 5.0) | ||
sass (>= 3.1.10) | ||
sprockets-rails (~> 2.0.0) | ||
sdoc (0.4.0) | ||
json (~> 1.8) | ||
rdoc (~> 4.0, < 5.0) | ||
simple_oauth (0.2.0) | ||
sprockets (2.12.0) | ||
hike (~> 1.2) | ||
multi_json (~> 1.0) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
sprockets-rails (2.0.1) | ||
actionpack (>= 3.0) | ||
activesupport (>= 3.0) | ||
sprockets (~> 2.8) | ||
sqlite3 (1.3.9) | ||
thin (1.5.1) | ||
daemons (>= 1.0.9) | ||
eventmachine (>= 0.12.6) | ||
rack (>= 1.0.0) | ||
thor (0.19.1) | ||
thread_safe (0.3.3) | ||
tilt (1.4.1) | ||
treetop (1.4.15) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
turbolinks (2.2.2) | ||
coffee-rails | ||
twitter (5.8.0) | ||
addressable (~> 2.3) | ||
buftok (~> 0.2.0) | ||
equalizer (~> 0.0.9) | ||
faraday (~> 0.9.0) | ||
http (~> 0.5.0) | ||
http_parser.rb (~> 0.6.0) | ||
json (~> 1.8) | ||
memoizable (~> 0.4.0) | ||
naught (~> 1.0) | ||
simple_oauth (~> 0.2.0) | ||
tzinfo (0.3.39) | ||
uglifier (2.5.0) | ||
execjs (>= 0.3.0) | ||
json (>= 1.8.0) | ||
warden (1.2.3) | ||
rack (>= 1.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
cancan | ||
coffee-rails (~> 4.0.0) | ||
devise | ||
gon | ||
handlebars_assets | ||
jbuilder (~> 1.2) | ||
jquery-rails | ||
rails (= 4.0.0.rc2) | ||
sass-rails (~> 4.0.0.rc2) | ||
sdoc | ||
sqlite3 | ||
thin | ||
turbolinks | ||
uglifier (>= 1.3.0) |
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,36 @@ | ||
## README | ||
Simple Tweet Curation App. | ||
Data is stored in sqlite database on the deployed machine. | ||
Notable Packages Used: | ||
- Openssl for connection level security | ||
- Devise for Users / User Access Control | ||
- Handlebars for templating | ||
- Bootstrap for styling | ||
|
||
### Orientation | ||
If you are unfamiliar with RoR applications: | ||
* Object Relational Mapping (ORM) is handled in subclasses of ActiveRecord::Base. | ||
* In this app, these classes do the heavy lifting in terms of computational tasks | ||
* Model Classes are in app/model | ||
* tweeter.rb -> wrapper for a twitter user | ||
* user.rb -> a TweetScrubber User | ||
* Handling requests and returning the appropriate response Are handled by controllers | ||
* app/controllers | ||
* application_controller -> base class, allows for global configurations | ||
* index_controller -> handles requests to homepage | ||
* tweeters_controller -> handles requests to curation app | ||
* users_controller -> handles user configuration (specifying password and twitter credentials) | ||
* Page templates (Views) | ||
* app/views | ||
* mixed ruby and html code page templates | ||
* grouped by controller | ||
* Client Side Assets (eg javascripts) are in app/assets | ||
* assets/javascripts/tweeters.js -> logic for curation application | ||
* assets/javascripts/templates/ -> handle bars templates used on various pages | ||
* General Settings are in config/ | ||
* DB specific Settings (credentials, connection parameters, schema) are in db/ | ||
|
||
### Setup | ||
Tested and deployed with RoR 4.0 on Ruby 2.1. Uses Thin as the webserver. | ||
App forces SSL on all connections. | ||
|
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,6 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
|
||
TweetScrubber::Application.load_tasks |
Empty file.
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 @@ | ||
// This is a manifest file that'll be compiled into application.js, which will include all the files | ||
// listed below. | ||
// | ||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | ||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | ||
// | ||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | ||
// compiled file. | ||
// | ||
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details | ||
// about supported directives. | ||
// | ||
//= require handlebars | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require turbolinks | ||
//= require_tree . | ||
//= require bootstrap.min | ||
//= require_tree ./templates |
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 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
Empty file.
28 changes: 28 additions & 0 deletions
28
TweetScrubber/app/assets/javascripts/templates/tweeters/example.json
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,28 @@ | ||
/* | ||
* example.json | ||
* Example user and timeline | ||
*/ | ||
{ | ||
"user_id": "99999999", | ||
"description": { | ||
"screen_name": "Example", | ||
"description": "Demo - example twitter user." | ||
}, | ||
"statuses": [ | ||
{ | ||
"created_at": "Wed Apr 30 20:00:00 +0000 2014", | ||
"place": null, | ||
"text": "Another Example Tweet" | ||
}, | ||
{ | ||
"created_at": "Wed Apr 30 19:00:00 +0000 2014", | ||
"place": null, | ||
"text": "A second Example Tweet" | ||
}, | ||
{ | ||
"created_at": "Wed Apr 30 18:00:00 +0000 2014", | ||
"place": null, | ||
"text": "An Example Tweet" | ||
} | ||
] | ||
} |
37 changes: 37 additions & 0 deletions
37
TweetScrubber/app/assets/javascripts/templates/tweeters/show_user.hbs
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,37 @@ | ||
<!-- show_timeline.hbs--> | ||
<div class="tweeter-user-wrapper panel panel-default" data-tuid="{{user_id}}"> | ||
<div class="panel-heading"> | ||
<h3>{{local_idx}}: Twitter-user ID: {{user_id}} | ||
| ||
<small class="tweeter-header-info" data-tuid="{{user_id}}"> </small> | ||
</h3> | ||
<a data-toggle="collapse" href=".tweeter-description-panel[data-tuid={{user_id}}]"> | ||
<span>+ Expand</span> | ||
</a> | ||
|
||
</div> | ||
<div class="tweeter-description-panel panel-body collapse in" data-tuid={{user_id}}> | ||
<p><b>@{{description.screen_name}}</b>: {{description.description}} </p> | ||
<div data-tuid={{user_id}} class="tweeter-form-wrapper"> | ||
<p> | ||
Spam <input type="checkbox" class="spam-check"></input> | ||
: | ||
Selected <input type="checkbox" class="cohort-check"> </input> | ||
</p> | ||
<textarea class='info-text'> </textarea> | ||
|
||
|
||
</div> | ||
<a data-toggle="collapse" href=".timeline[data-tuid={{user_id}}]"> | ||
<span>+ Expand Timeline</span> | ||
</a> | ||
<button type="button" class="btn btn-default btn-lg tweeter-load-btn" data-tuid="{{user_id}}"> | ||
Load <span class="glyphicon glyphicon glyphicon-chevron-down"></span> | ||
</button> | ||
|
||
<div class="timeline collapse collapse" style="height:400px;overflow:auto;" data-tuid="{{user_id}}"> | ||
{{! insertion point for table }} | ||
|
||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.