Skip to content

Commit

Permalink
Fixed .gitignore to remove dropbox env conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Gehani committed Dec 25, 2015
2 parents a86e3d7 + 6843607 commit 66d38d4
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 37 deletions.
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
source 'https://rubygems.org'
ruby '2.2.3' #previously 2.0.0
ruby '2.2.3'
# Application gems
gem 'rails', '4.2.5' #previously 4.0.0
gem 'jquery-rails'
gem 'devise'
gem 'simple_form', '~> 3.0.0.rc'
gem "paperclip", "~> 4.3" #previously 3.0"
#gem "paperclip-dropbox"
gem 'aws-sdk', '~> 1.5.7'
gem "paperclip-dropbox", ">=1.1.7"
gem 'aws-sdk' #'~> 1.5.7'
gem "masonry-rails", '~> 0.2.0'
gem 'faker', "~> 1.2.0"
gem 'will_paginate', '~> 3.0.3'
gem 'bootstrap-will_paginate'
gem 'acts_as_follower'
gem "binding_of_caller"
gem "figaro"
#gem 'pg'

group :production do
Expand Down
17 changes: 15 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ GEM
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.0.3.0)
sass (~> 3.2)
bootstrap-will_paginate (0.0.10)
Expand All @@ -65,17 +67,22 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.10.0)
debug_inspector (0.0.2)
devise (3.5.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
dropbox-sdk (1.6.5)
json
erubis (2.7.0)
execjs (2.6.0)
faker (1.2.0)
i18n (~> 0.5)
figaro (1.1.1)
thor (~> 0.14)
globalid (0.3.6)
activesupport (>= 4.1.0)
hike (1.2.3)
Expand Down Expand Up @@ -105,7 +112,7 @@ GEM
minitest (5.8.3)
multi_json (1.11.2)
multi_xml (0.5.5)
nokogiri (1.6.7)
nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2)
orm_adapter (0.5.0)
paperclip (4.3.2)
Expand All @@ -114,6 +121,9 @@ GEM
cocaine (~> 0.5.5)
mime-types
mimemagic (= 0.3.0)
paperclip-dropbox (1.3.2)
dropbox-sdk (~> 1.3)
paperclip (>= 3.1, < 5)
pg (0.18.4)
protected_attributes (1.1.3)
activemodel (>= 4.0.1, < 5.0)
Expand Down Expand Up @@ -195,18 +205,21 @@ PLATFORMS

DEPENDENCIES
acts_as_follower
aws-sdk (~> 1.5.7)
aws-sdk
better_errors
binding_of_caller
bootstrap-sass (~> 3.0.3.0)
bootstrap-will_paginate
coffee-rails (~> 4.0.0)
devise
faker (~> 1.2.0)
figaro
jbuilder (= 1.2)
jquery-rails
jquery-turbolinks
masonry-rails (~> 0.2.0)
paperclip (~> 4.3)
paperclip-dropbox (>= 1.1.7)
pg
protected_attributes
rails (= 4.2.5)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# One Month Rails
# Based on One Month Rails Tutorial

This is the sample application for
[*One Month Rails: Teach Yourself to Code*](http://onemonthrails.com)
This is modified to use paperclip and jQuery continuous scroll

by [Mattan Griffel](http://mattangriffel.com)

by [Neil Gehani](http://gehani.me)
9 changes: 8 additions & 1 deletion app/models/pin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
class Pin < ActiveRecord::Base
attr_accessible :description, :image, :image_remote_url
has_attached_file :image
has_attached_file :image,
:storage => :dropbox,
:dropbox_credentials => { app_key: ENV['APP_KEY'],
app_secret: ENV['APP_SECRET'],
access_token: ENV['ACCESS_TOKEN'],
access_token_secret: ENV['ACCESS_TOKEN_SECRET'],
user_id: ENV['USER_ID'],
access_type: 'app_folder'}

validates :image, presence: true
validates :description, presence: true
Expand Down
15 changes: 15 additions & 0 deletions config/dropbox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#Dropbox credentials - view them via heroku config on cmd line
#development:
# app_key: <%= ENV["APP_KEY"] %>
# app_secret: <%= ENV["APP_SECRET"] %>
# access_token: <%= ENV["ACCESS_TOKEN"] %>
# access_token_secret: <%= ENV["ACCESS_TOKEN_SECRET"] %>
# user_id: <%= ENV["USER_ID"] %>
# access_type: "app_folder"
development:
app_key: ENV['APP_KEY']
app_secret: ENV['APP_SECRET']
access_token: ENV['ACCESS_TOKEN']
access_token_secret: ENV['ACCESS_TOKEN_SECRET']
user_id: ENV['USER_ID']
access_type: 'app_folder'
16 changes: 16 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,21 @@
config.assets.debug = true
#In production, :host should be set to the actual host of your application.
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
#config.paperclip_defaults = {
#:storage => :dropbox,
#:dropbox_credentials => {
# :app_key => ENV['APP_KEY'],
# :app_secret => ENV['APP_SECRET'],
# :access_token => ENV['ACCESS_TOKEN'],
# :access_token_secret => ENV['ACCESS_TOKEN_SECRET'],
# :user_id => ENV['USER_ID'],
# :access_type => 'app_folder',
# :dropbox_visibility => 'private' }
#}
#config.paperclip_defaults = {
#:storage => :dropbox,
# :dropbox_credentials => Rails.root.join("config/dropbox.yml"),
# :dropbox_options => {...}
#}
Paperclip.options[:command_path] = "/usr/local/bin/"
end
8 changes: 6 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@
config.paperclip_defaults = {
:storage => :s3,
:s3_credentials => {
:bucket => ENV['AWS_BUCKET'],
:bucket => ENV['AWS_BUCKET'],
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
}
}
#config.paperclip_defaults = {
#:storage => :dropbox,
# :dropbox_credentials => Rails.root.join("config/dropbox.yml"),
# #:dropbox_options => {...}
#}
end
1 change: 1 addition & 0 deletions config/initializers/paperclip.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# config/initializers/paperclip.rb
unless Rails.env.development?
#Paperclip::Attachment.default_options[:url] = ':event_sample_images.s3-website-us-east-1.amazonaws.com'
Paperclip::Attachment.default_options[:url] = ':event_sample_images.s3-website-us-east-1.amazonaws.com'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
end
48 changes: 24 additions & 24 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,58 @@

ActiveRecord::Schema.define(version: 20131218231554) do

create_table "follows", force: true do |t|
t.integer "followable_id", null: false
t.string "followable_type", null: false
t.integer "follower_id", null: false
t.string "follower_type", null: false
t.boolean "blocked", default: false, null: false
create_table "follows", force: :cascade do |t|
t.integer "followable_id", null: false
t.string "followable_type", limit: 255, null: false
t.integer "follower_id", null: false
t.string "follower_type", limit: 255, null: false
t.boolean "blocked", default: false, null: false
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "follows", ["followable_id", "followable_type"], name: "fk_followables"
add_index "follows", ["follower_id", "follower_type"], name: "fk_follows"

create_table "locations", force: true do |t|
t.string "address"
t.string "city"
t.string "state"
t.string "zip"
create_table "locations", force: :cascade do |t|
t.string "address", limit: 255
t.string "city", limit: 255
t.string "state", limit: 255
t.string "zip", limit: 255
t.float "lat"
t.float "lng"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "pins", force: true do |t|
t.string "description"
create_table "pins", force: :cascade do |t|
t.string "description", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.string "image_file_name"
t.string "image_content_type"
t.string "image_file_name", limit: 255
t.string "image_content_type", limit: 255
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "image_remote_url"
t.string "image_remote_url", limit: 255
end

add_index "pins", ["user_id"], name: "index_pins_on_user_id"

create_table "users", force: true do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
create_table "users", force: :cascade do |t|
t.string "email", limit: 255, default: "", null: false
t.string "encrypted_password", limit: 255, default: "", null: false
t.string "reset_password_token", limit: 255
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "current_sign_in_ip", limit: 255
t.string "last_sign_in_ip", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
t.string "name", limit: 255
end

add_index "users", ["email"], name: "index_users_on_email", unique: true
Expand Down
3 changes: 2 additions & 1 deletion lib/tasks/populateimages3.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'open-uri'
remote_base_url = "https://s3.amazonaws.com/event_sample_images/sample"
#remote_base_url = "https://www.dropbox.com/home/Apps/social-butterfly-images"

#remote_files = Dir.entries("sampleimage").select {|x| x =~ /.*(jpg)/ }
remote_files = ["IMG_0537.jpg", "IMG_0555.jpg", "IMG_0556.jpg", "IMG_0574.jpg", "IMG_0582.jpg", "IMG_0588.jpg", "IMG_0590.jpg", "IMG_0595.jpg", "IMG_0606.jpg", "IMG_0620.jpg", "IMG_0622.jpg", "IMG_0632.jpg", "IMG_0641.jpg", "IMG_0644.jpg", "IMG_0657.jpg", "IMG_0660.jpg", "IMG_0666.jpg", "IMG_0683.jpg", "IMG_0698.jpg", "IMG_0710.jpg", "IMG_0714.jpg", "IMG_0733.jpg", "IMG_0739.jpg", "IMG_0750.jpg", "IMG_0771.jpg", "IMG_0798.jpg", "IMG_0809.jpg", "IMG_0814.jpg", "IMG_0819.jpg", "IMG_0820.jpg", "IMG_0823.jpg", "IMG_0825.jpg", "IMG_0833.jpg", "IMG_0856.jpg", "IMG_0865.jpg", "IMG_0901.jpg", "IMG_0909.jpg", "IMG_0921.jpg", "IMG_0930.jpg", "IMG_0936.jpg", "IMG_0948.jpg", "IMG_0959.jpg", "IMG_0962.jpg", "IMG_0967.jpg", "IMG_0969.jpg", "IMG_0993.jpg", "IMG_1006.jpg", "IMG_1042.jpg", "IMG_1098.jpg", "IMG_1099.jpg", "IMG_1109.jpg", "IMG_1137.jpg", "IMG_1138.jpg", "IMG_1354.jpg", "IMG_3621.jpg", "IMG_4099.jpg", "IMG_4796.jpg", "IMG_5490.jpg", "IMG_5580.jpg"]
Expand All @@ -22,4 +23,4 @@ namespace :db do
end
end
end
end
end

0 comments on commit 66d38d4

Please sign in to comment.