Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit 7ea1dc1d675790a19b99d3789ebda9010e8ff588 @rbin committed Sep 19, 2013
Showing with 1,259 additions and 0 deletions.
  1. +16 −0 .gitignore
  2. +23 −0 Gemfile
  3. +163 −0 Gemfile.lock
  4. +7 −0 Rakefile
  5. BIN app/assets/images/rails.png
  6. +15 −0 app/assets/javascripts/application.js
  7. +3 −0 app/assets/javascripts/sessions.js.coffee
  8. +3 −0 app/assets/javascripts/vines.js.coffee
  9. +18 −0 app/assets/stylesheets/application.sass
  10. +69 −0 app/assets/stylesheets/scaffolds.css.scss
  11. +3 −0 app/assets/stylesheets/vines.css.scss
  12. +22 −0 app/controllers/application_controller.rb
  13. +8 −0 app/controllers/dashboards_controller.rb
  14. +13 −0 app/controllers/sessions_controller.rb
  15. +86 −0 app/controllers/vines_controller.rb
  16. +11 −0 app/helpers/application_helper.rb
  17. +2 −0 app/helpers/sessions_helper.rb
  18. +2 −0 app/helpers/vines_helper.rb
  19. 0 app/mailers/.gitkeep
  20. 0 app/models/.gitkeep
  21. +18 −0 app/models/user.rb
  22. +29 −0 app/models/vine.rb
  23. +5 −0 app/models/vine/all/map.js
  24. +9 −0 app/views/dashboards/show.haml
  25. +9 −0 app/views/layouts/application.haml
  26. +11 −0 app/views/vines/_form.html.haml
  27. +18 −0 app/views/vines/edit.html.haml
  28. +20 −0 app/views/vines/index.html.haml
  29. +5 −0 app/views/vines/new.html.haml
  30. +16 −0 app/views/vines/show.html.haml
  31. +4 −0 config.ru
  32. +73 −0 config/application.rb
  33. +6 −0 config/boot.rb
  34. +23 −0 config/couchbase.yml
  35. +5 −0 config/environment.rb
  36. +31 −0 config/environments/development.rb
  37. +64 −0 config/environments/production.rb
  38. +35 −0 config/environments/test.rb
  39. +7 −0 config/initializers/backtrace_silencers.rb
  40. +15 −0 config/initializers/inflections.rb
  41. +5 −0 config/initializers/mime_types.rb
  42. +3 −0 config/initializers/omniauth.rb
  43. +7 −0 config/initializers/secret_token.rb
  44. +8 −0 config/initializers/session_store.rb
  45. +10 −0 config/initializers/wrap_parameters.rb
  46. +5 −0 config/locales/en.yml
  47. +18 −0 config/routes.rb
  48. +7 −0 db/seeds.rb
  49. 0 lib/assets/.gitkeep
  50. 0 lib/tasks/.gitkeep
  51. 0 log/.gitkeep
  52. +26 −0 public/404.html
  53. +26 −0 public/422.html
  54. +25 −0 public/500.html
  55. 0 public/favicon.ico
  56. +241 −0 public/index.html
  57. +5 −0 public/robots.txt
  58. +6 −0 script/rails
  59. 0 vendor/assets/javascripts/.gitkeep
  60. 0 vendor/assets/stylesheets/.gitkeep
  61. 0 vendor/plugins/.gitkeep
@@ -0,0 +1,16 @@
+# 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
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+.DS_Store
23 Gemfile
@@ -0,0 +1,23 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.12'
+gem 'puma'
+
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+gem 'couchbase'
+gem 'couchbase-model'
+gem 'haml-rails', :group => :development
+gem 'html2haml'
+gem 'omniauth'
+gem 'omniauth-twitter'
+gem 'nokogiri'
+
+gem 'better_errors'
+gem 'binding_of_caller'
@@ -0,0 +1,163 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.12)
+ actionpack (= 3.2.12)
+ mail (~> 2.4.4)
+ actionpack (3.2.12)
+ activemodel (= 3.2.12)
+ activesupport (= 3.2.12)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.5)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.12)
+ activesupport (= 3.2.12)
+ builder (~> 3.0.0)
+ activerecord (3.2.12)
+ activemodel (= 3.2.12)
+ activesupport (= 3.2.12)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.12)
+ activemodel (= 3.2.12)
+ activesupport (= 3.2.12)
+ activesupport (3.2.12)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ better_errors (0.7.2)
+ coderay (>= 1.0.0)
+ erubis (>= 2.6.6)
+ binding_of_caller (0.7.1)
+ debug_inspector (>= 0.0.1)
+ builder (3.0.4)
+ coderay (1.0.9)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.6.2)
+ couchbase (1.2.2)
+ multi_json (~> 1.0)
+ yaji (~> 0.3.2)
+ couchbase-model (0.5.1)
+ couchbase (~> 1.2.0.dp)
+ debug_inspector (0.0.2)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ haml (4.0.3)
+ tilt
+ haml-rails (0.4)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (>= 3.1, < 4.1)
+ railties (>= 3.1, < 4.1)
+ hashie (1.2.0)
+ hike (1.2.2)
+ hpricot (0.8.6)
+ html2haml (1.0.1)
+ erubis (~> 2.7.0)
+ haml (>= 4.0.0.rc.1)
+ hpricot (~> 0.8.6)
+ ruby_parser (~> 3.1.1)
+ i18n (0.6.4)
+ journey (1.0.4)
+ jquery-rails (3.0.0)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.8.0)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.23)
+ multi_json (1.7.4)
+ nokogiri (1.5.9)
+ oauth (0.4.7)
+ omniauth (1.1.3)
+ hashie (~> 1.2)
+ rack
+ omniauth-oauth (1.0.1)
+ oauth
+ omniauth (~> 1.0)
+ omniauth-twitter (0.0.14)
+ multi_json (~> 1.3)
+ omniauth-oauth (~> 1.0)
+ polyglot (0.3.3)
+ puma (1.6.3)
+ rack (~> 1.2)
+ rack (1.4.5)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.3)
+ rack
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (3.2.12)
+ actionmailer (= 3.2.12)
+ actionpack (= 3.2.12)
+ activerecord (= 3.2.12)
+ activeresource (= 3.2.12)
+ activesupport (= 3.2.12)
+ bundler (~> 1.0)
+ railties (= 3.2.12)
+ railties (3.2.12)
+ actionpack (= 3.2.12)
+ activesupport (= 3.2.12)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.4)
+ rdoc (3.12.2)
+ json (~> 1.4)
+ ruby_parser (3.1.3)
+ sexp_processor (~> 4.1)
+ sass (3.2.9)
+ sass-rails (3.2.6)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sexp_processor (4.2.1)
+ sprockets (2.2.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thor (0.18.1)
+ tilt (1.4.1)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.37)
+ uglifier (2.1.1)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
+ yaji (0.3.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ better_errors
+ binding_of_caller
+ coffee-rails (~> 3.2.1)
+ couchbase
+ couchbase-model
+ haml-rails
+ html2haml
+ jquery-rails
+ nokogiri
+ omniauth
+ omniauth-twitter
+ puma
+ rails (= 3.2.12)
+ sass-rails (~> 3.2.3)
+ uglifier (>= 1.0.3)
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# 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__)
+
+Rvine::Application.load_tasks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,15 @@
+// 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
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -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://jashkenas.github.com/coffee-script/
@@ -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://jashkenas.github.com/coffee-script/
@@ -0,0 +1,18 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
+
+body
+ width: 1100px
+ height: auto
+ margin: 20px auto
@@ -0,0 +1,69 @@
+body {
+ background-color: #fff;
+ color: #333;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+}
+
+p, ol, ul, td {
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+}
+
+pre {
+ background-color: #eee;
+ padding: 10px;
+ font-size: 11px;
+}
+
+a {
+ color: #000;
+ &:visited {
+ color: #666;
+ }
+ &:hover {
+ color: #fff;
+ background-color: #000;
+ }
+}
+
+div {
+ &.field, &.actions {
+ margin-bottom: 10px;
+ }
+}
+
+#notice {
+ color: green;
+}
+
+.field_with_errors {
+ padding: 2px;
+ background-color: red;
+ display: table;
+}
+
+#error_explanation {
+ width: 450px;
+ border: 2px solid red;
+ padding: 7px;
+ padding-bottom: 0;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ margin-bottom: 0px;
+ background-color: #c00;
+ color: #fff;
+ }
+ ul li {
+ font-size: 12px;
+ list-style: square;
+ }
+}
@@ -0,0 +1,3 @@
+// Place all the styles related to the Vines controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,22 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+
+ def authenticate!
+ if signed_in?
+ return true
+ else
+ flash[:error] = "You aren't authorized to access this page"
+ redirect_to(root_path)
+ end
+ end
+
+ def current_user
+ @current_user ||= User.find_by_id(session[:user_id])
+ end
+ helper_method :current_user
+
+ def signed_in?
+ !!current_user
+ end
+ helper_method :signed_in?
+end
@@ -0,0 +1,8 @@
+class DashboardsController < ApplicationController
+ before_filter :authenticate!
+
+ def show
+
+ end
+
+end
@@ -0,0 +1,13 @@
+class SessionsController < ApplicationController
+ def create
+ user = User.find_or_create_from_auth_hash(auth_hash)
+ session[:user_id] = user.id
+ flash[:success] = "Welcome to the club!"
+ redirect_to dashboard_path
+ end
+
+ protected
+ def auth_hash
+ request.env['omniauth.auth']
+ end
+end
Oops, something went wrong.

0 comments on commit 7ea1dc1

Please sign in to comment.