From bb0f24cbd24bb4ee0327835459225b8e227fc26b Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:10:36 +0900 Subject: [PATCH 01/36] update ruby version form 1.9.3 to 2.2.2 --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..b1b25a5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.2.2 From 9347edde84acac786889cbdbdb6e480f65e94645 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:12:00 +0900 Subject: [PATCH 02/36] rename README --- README.md | 6 ++ README.rdoc | 261 ---------------------------------------------------- 2 files changed, 6 insertions(+), 261 deletions(-) create mode 100644 README.md delete mode 100644 README.rdoc diff --git a/README.md b/README.md new file mode 100644 index 0000000..5dd924f --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +투표대잔치 +=== + +### 설치 +* ruby 2.0 이상 +* rails 4.0 diff --git a/README.rdoc b/README.rdoc deleted file mode 100644 index 7c36f23..0000000 --- a/README.rdoc +++ /dev/null @@ -1,261 +0,0 @@ -== Welcome to Rails - -Rails is a web-application framework that includes everything needed to create -database-backed web applications according to the Model-View-Control pattern. - -This pattern splits the view (also called the presentation) into "dumb" -templates that are primarily responsible for inserting pre-built data in between -HTML tags. The model contains the "smart" domain objects (such as Account, -Product, Person, Post) that holds all the business logic and knows how to -persist themselves to a database. The controller handles the incoming requests -(such as Save New Account, Update Product, Show Post) by manipulating the model -and directing data to the view. - -In Rails, the model is handled by what's called an object-relational mapping -layer entitled Active Record. This layer allows you to present the data from -database rows as objects and embellish these data objects with business logic -methods. You can read more about Active Record in -link:files/vendor/rails/activerecord/README.html. - -The controller and view are handled by the Action Pack, which handles both -layers by its two parts: Action View and Action Controller. These two layers -are bundled in a single package due to their heavy interdependence. This is -unlike the relationship between the Active Record and Action Pack that is much -more separate. Each of these packages can be used independently outside of -Rails. You can read more about Action Pack in -link:files/vendor/rails/actionpack/README.html. - - -== Getting Started - -1. At the command prompt, create a new Rails application: - rails new myapp (where myapp is the application name) - -2. Change directory to myapp and start the web server: - cd myapp; rails server (run with --help for options) - -3. Go to http://localhost:3000/ and you'll see: - "Welcome aboard: You're riding Ruby on Rails!" - -4. Follow the guidelines to start developing your application. You can find -the following resources handy: - -* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html -* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ - - -== Debugging Rails - -Sometimes your application goes wrong. Fortunately there are a lot of tools that -will help you debug it and get it back on the rails. - -First area to check is the application log files. Have "tail -f" commands -running on the server.log and development.log. Rails will automatically display -debugging and runtime information to these files. Debugging info will also be -shown in the browser on requests from 127.0.0.1. - -You can also log your own messages directly into the log file from your code -using the Ruby logger class from inside your controllers. Example: - - class WeblogController < ActionController::Base - def destroy - @weblog = Weblog.find(params[:id]) - @weblog.destroy - logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") - end - end - -The result will be a message in your log file along the lines of: - - Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! - -More information on how to use the logger is at http://www.ruby-doc.org/core/ - -Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are -several books available online as well: - -* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) -* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) - -These two books will bring you up to speed on the Ruby language and also on -programming in general. - - -== Debugger - -Debugger support is available through the debugger command when you start your -Mongrel or WEBrick server with --debugger. This means that you can break out of -execution at any point in the code, investigate and change the model, and then, -resume execution! You need to install ruby-debug to run the server in debugging -mode. With gems, use sudo gem install ruby-debug. Example: - - class WeblogController < ActionController::Base - def index - @posts = Post.all - debugger - end - end - -So the controller will accept the action, run the first line, then present you -with a IRB prompt in the server window. Here you can do things like: - - >> @posts.inspect - => "[#nil, "body"=>nil, "id"=>"1"}>, - #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" - >> @posts.first.title = "hello from a debugger" - => "hello from a debugger" - -...and even better, you can examine how your runtime objects actually work: - - >> f = @posts.first - => #nil, "body"=>nil, "id"=>"1"}> - >> f. - Display all 152 possibilities? (y or n) - -Finally, when you're ready to resume execution, you can enter "cont". - - -== Console - -The console is a Ruby shell, which allows you to interact with your -application's domain model. Here you'll have all parts of the application -configured, just like it is when the application is running. You can inspect -domain models, change values, and save to the database. Starting the script -without arguments will launch it in the development environment. - -To start the console, run rails console from the application -directory. - -Options: - -* Passing the -s, --sandbox argument will rollback any modifications - made to the database. -* Passing an environment name as an argument will load the corresponding - environment. Example: rails console production. - -To reload your controllers and models after launching the console run -reload! - -More information about irb can be found at: -link:http://www.rubycentral.org/pickaxe/irb.html - - -== dbconsole - -You can go to the command line of your database directly through rails -dbconsole. You would be connected to the database with the credentials -defined in database.yml. Starting the script without arguments will connect you -to the development database. Passing an argument will connect you to a different -database, like rails dbconsole production. Currently works for MySQL, -PostgreSQL and SQLite 3. - -== Description of Contents - -The default directory structure of a generated Ruby on Rails application: - - |-- app - | |-- assets - | |-- images - | |-- javascripts - | `-- stylesheets - | |-- controllers - | |-- helpers - | |-- mailers - | |-- models - | `-- views - | `-- layouts - |-- config - | |-- environments - | |-- initializers - | `-- locales - |-- db - |-- doc - |-- lib - | `-- tasks - |-- log - |-- public - |-- script - |-- test - | |-- fixtures - | |-- functional - | |-- integration - | |-- performance - | `-- unit - |-- tmp - | |-- cache - | |-- pids - | |-- sessions - | `-- sockets - `-- vendor - |-- assets - `-- stylesheets - `-- plugins - -app - Holds all the code that's specific to this particular application. - -app/assets - Contains subdirectories for images, stylesheets, and JavaScript files. - -app/controllers - Holds controllers that should be named like weblogs_controller.rb for - automated URL mapping. All controllers should descend from - ApplicationController which itself descends from ActionController::Base. - -app/models - Holds models that should be named like post.rb. Models descend from - ActiveRecord::Base by default. - -app/views - Holds the template files for the view that should be named like - weblogs/index.html.erb for the WeblogsController#index action. All views use - eRuby syntax by default. - -app/views/layouts - Holds the template files for layouts to be used with views. This models the - common header/footer method of wrapping views. In your views, define a layout - using the layout :default and create a file named default.html.erb. - Inside default.html.erb, call <% yield %> to render the view using this - layout. - -app/helpers - Holds view helpers that should be named like weblogs_helper.rb. These are - generated for you automatically when using generators for controllers. - Helpers can be used to wrap functionality for your views into methods. - -config - Configuration files for the Rails environment, the routing map, the database, - and other dependencies. - -db - Contains the database schema in schema.rb. db/migrate contains all the - sequence of Migrations for your schema. - -doc - This directory is where your application documentation will be stored when - generated using rake doc:app - -lib - Application specific libraries. Basically, any kind of custom code that - doesn't belong under controllers, models, or helpers. This directory is in - the load path. - -public - The directory available for the web server. Also contains the dispatchers and the - default HTML files. This should be set as the DOCUMENT_ROOT of your web - server. - -script - Helper scripts for automation and generation. - -test - Unit and functional tests along with fixtures. When using the rails generate - command, template test files will be generated for you and placed in this - directory. - -vendor - External libraries that the application depends on. Also includes the plugins - subdirectory. If the app has frozen rails, those gems also go here, under - vendor/rails/. This directory is in the load path. From abd0765c8ab7081c8c6789fa79be2c9501455b3b Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:17:00 +0900 Subject: [PATCH 03/36] update gems from rails 3 to rails 4 other gems up-to-date --- .gitignore | 3 + Gemfile | 30 ++- Gemfile.lock | 542 +++++++++++++++++++++++++++++++++------------------ 3 files changed, 367 insertions(+), 208 deletions(-) diff --git a/.gitignore b/.gitignore index 7016af9..e540377 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ mongoid.yml # Ignore DS_Store .DS_Store + +# Ignore assets +/public/assets diff --git a/Gemfile b/Gemfile index 85a44ff..aed221e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,16 +1,15 @@ source 'https://rubygems.org' -gem 'rails', '3.2.9' - -# Bundle edge Rails instead: -# gem 'rails', :git => 'git://github.com/rails/rails.git' +#gem 'rails', '3.2.9' +gem 'rails', '4.0' # db gem 'mongoid' +gem 'mongoid-observers' gem 'geocoder' # file upload -gem 'rmagick' +gem 'mini_magick' gem 'carrierwave' gem 'carrierwave-mongoid', require: 'carrierwave/mongoid' gem "fog" @@ -24,16 +23,12 @@ gem 'omniauth-twitter' gem 'koala' gem 'twitter' -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - gem 'uglifier', '>= 1.0.3' - gem "therubyracer" - gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS - gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git' -end +gem 'sass-rails' +gem 'coffee-rails' +gem 'uglifier' +gem "therubyracer" +gem "less-rails" +gem 'twitter-bootstrap-rails', '2.2.8' gem 'jquery-rails' gem 'simple_form' @@ -50,5 +45,6 @@ gem 'jbuilder' # Deploy with Capistrano gem 'capistrano' -# To use debugger -# gem 'debugger' +group :development do + gem 'pry-byebug' +end diff --git a/Gemfile.lock b/Gemfile.lock index ab1c288..1d5de1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,216 +1,371 @@ -GIT - remote: git://github.com/seyhunak/twitter-bootstrap-rails.git - revision: 7d2b3093f654d193f55b6d96e806bc4b2e1bcb93 - specs: - twitter-bootstrap-rails (2.1.7) - actionpack (>= 3.1) - execjs - railties (>= 3.1) - GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.9) - actionpack (= 3.2.9) - mail (~> 2.4.4) - actionpack (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) + CFPropertyList (2.3.2) + actionmailer (4.0.0) + actionpack (= 4.0.0) + mail (~> 2.5.3) + actionpack (4.0.0) + activesupport (= 4.0.0) + builder (~> 3.1.0) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) - activerecord (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - activesupport (3.2.9) - i18n (~> 0.6) - multi_json (~> 1.0) - addressable (2.3.2) - arel (3.0.2) - bcrypt-ruby (3.0.1) - builder (3.0.4) - capistrano (2.13.5) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - carrierwave (0.6.2) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + activemodel (4.0.0) + activesupport (= 4.0.0) + builder (~> 3.1.0) + activerecord (4.0.0) + activemodel (= 4.0.0) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.0) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.4) + activesupport (4.0.0) + i18n (~> 0.6, >= 0.6.4) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + tzinfo (~> 0.3.37) + addressable (2.4.0) + arel (4.0.2) + bcrypt (3.1.10) + bson (4.0.0) + buftok (0.2.0) + builder (3.1.4) + byebug (8.2.1) + capistrano (3.4.0) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + carrierwave (0.10.0) activemodel (>= 3.2.0) activesupport (>= 3.2.0) - carrierwave-mongoid (0.1.0) - carrierwave - mongoid - coffee-rails (3.2.2) + json (>= 1.7) + mime-types (>= 1.16) + carrierwave-mongoid (0.8.1) + carrierwave (>= 0.8.0, < 0.11.0) + mongoid (>= 3.0, < 6.0) + mongoid-grid_fs (>= 1.3, < 3.0) + coderay (1.1.0) + coffee-rails (4.1.1) coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.4.0) - commonjs (0.2.6) - devise (2.1.2) - bcrypt-ruby (~> 3.0) + coffee-script-source (1.10.0) + commonjs (0.2.7) + devise (3.5.3) + bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (~> 3.1) - warden (~> 1.2.1) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + domain_name (0.5.25) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.10) erubis (2.7.0) - excon (0.13.4) - execjs (1.4.0) - multi_json (~> 1.0) - faraday (0.8.4) - multipart-post (~> 1.1) - fog (1.3.1) + excon (0.45.4) + execjs (2.6.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog (1.37.0) + fog-aliyun (>= 0.1.0) + fog-atmos + fog-aws (>= 0.6.0) + fog-brightbox (~> 0.4) + fog-core (~> 1.32) + fog-dynect (~> 0.0.2) + fog-ecloud (~> 0.1) + fog-google (<= 0.1.0) + fog-json + fog-local + fog-powerdns (>= 0.1.1) + fog-profitbricks + fog-radosgw (>= 0.0.2) + fog-riakcs + fog-sakuracloud (>= 0.0.4) + fog-serverlove + fog-softlayer + fog-storm_on_demand + fog-terremark + fog-vmfusion + fog-voxel + fog-vsphere (>= 0.4.0) + fog-xenserver + fog-xml (~> 0.1.1) + ipaddress (~> 0.5) + fog-aliyun (0.1.0) + fog-core (~> 1.27) + fog-json (~> 1.0) + ipaddress (~> 0.8) + xml-simple (~> 1.1) + fog-atmos (0.1.0) + fog-core + fog-xml + fog-aws (0.7.6) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-brightbox (0.10.1) + fog-core (~> 1.22) + fog-json + inflecto (~> 0.0.2) + fog-core (1.35.0) builder - excon (~> 0.13.0) - formatador (~> 0.2.0) - mime-types - multi_json (~> 1.0) - net-scp (~> 1.0.4) - net-ssh (>= 2.1.3) - nokogiri (~> 1.5.0) - ruby-hmac - formatador (0.2.3) - geocoder (1.1.3) - hashie (1.2.0) - highline (1.6.15) - hike (1.2.1) - httpauth (0.2.0) - i18n (0.6.1) - jbuilder (0.8.2) - activesupport (>= 3.0.0) - journey (1.0.4) - jquery-rails (2.1.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) - json (1.7.5) - jwt (0.1.5) - multi_json (>= 1.0) - koala (1.6.0) - addressable (~> 2.2) - faraday (~> 0.8) - multi_json (~> 1.3) - less (2.2.2) - commonjs (~> 0.2.6) - less-rails (2.2.6) - actionpack (>= 3.1) - less (~> 2.2.0) - libv8 (3.3.10.4) - mail (2.4.4) - i18n (>= 0.4.0) + excon (~> 0.45) + formatador (~> 0.2) + fog-dynect (0.0.2) + fog-core + fog-json + fog-xml + fog-ecloud (0.3.0) + fog-core + fog-xml + fog-google (0.1.0) + fog-core + fog-json + fog-xml + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-local (0.2.1) + fog-core (~> 1.27) + fog-powerdns (0.1.1) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + fog-profitbricks (0.0.5) + fog-core + fog-xml + nokogiri + fog-radosgw (0.0.4) + fog-core (>= 1.21.0) + fog-json + fog-xml (>= 0.0.1) + fog-riakcs (0.1.0) + fog-core + fog-json + fog-xml + fog-sakuracloud (1.7.5) + fog-core + fog-json + fog-serverlove (0.1.2) + fog-core + fog-json + fog-softlayer (1.0.2) + fog-core + fog-json + fog-storm_on_demand (0.1.1) + fog-core + fog-json + fog-terremark (0.1.0) + fog-core + fog-xml + fog-vmfusion (0.1.0) + fission + fog-core + fog-voxel (0.1.0) + fog-core + fog-xml + fog-vsphere (0.4.0) + fog-core + rbvmomi (~> 1.8) + fog-xenserver (0.2.2) + fog-core + fog-xml + fog-xml (0.1.2) + fog-core + nokogiri (~> 1.5, >= 1.5.11) + formatador (0.2.5) + geocoder (1.2.14) + hashie (3.4.3) + hike (1.2.3) + http (0.9.8) + addressable (~> 2.3) + http-cookie (~> 1.0) + http-form_data (~> 1.0.1) + http_parser.rb (~> 0.6.0) + http-cookie (1.0.2) + domain_name (~> 0.5) + http-form_data (1.0.1) + http_parser.rb (0.6.0) + i18n (0.7.0) + inflecto (0.0.2) + ipaddress (0.8.0) + jbuilder (2.4.0) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (3.1.4) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) + json (1.8.3) + jwt (1.5.2) + koala (2.2.0) + addressable + faraday + multi_json + less (2.6.0) + commonjs (~> 0.2.7) + less-rails (2.7.0) + actionpack (>= 4.0) + less (~> 2.6.0) + sprockets (> 2, < 4) + tilt + libv8 (3.16.14.13) + mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.19) - mongoid (3.0.6) - activemodel (~> 3.1) - moped (~> 1.1) - origin (~> 1.0) - tzinfo (~> 0.3.22) - moped (1.2.8) - multi_json (1.4.0) - multipart-post (1.1.5) - net-scp (1.0.4) - net-ssh (>= 1.99.1) - net-sftp (2.0.5) - net-ssh (>= 2.0.9) - net-ssh (2.6.1) - net-ssh-gateway (1.1.0) - net-ssh (>= 1.99.1) - nokogiri (1.5.5) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + method_source (0.8.2) + mime-types (1.25.1) + mini_magick (4.3.6) + mini_portile2 (2.0.0) + minitest (4.7.5) + mongo (2.2.1) + bson (~> 4.0) + mongoid (5.0.2) + activemodel (~> 4.0) + mongo (~> 2.1) + origin (~> 2.1) + tzinfo (>= 0.3.37) + mongoid-grid_fs (2.2.1) + mime-types (>= 1.0, < 3.0) + mongoid (>= 3.0, < 6.0) + mongoid-observers (0.1.1) + mongoid (>= 4.0.0.beta1) + rails-observers (~> 0.1.2) + multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + naught (1.1.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (3.0.2) + nokogiri (1.6.7.1) + mini_portile2 (~> 2.0.0.rc2) oauth (0.4.7) - oauth2 (0.8.0) - faraday (~> 0.8) - httpauth (~> 0.1) - jwt (~> 0.1.4) - multi_json (~> 1.0) + oauth2 (1.0.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) rack (~> 1.2) - omniauth (1.1.1) - hashie (~> 1.2) - rack - omniauth-facebook (1.4.1) - omniauth-oauth2 (~> 1.1.0) - omniauth-oauth (1.0.1) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + omniauth-facebook (3.0.0) + omniauth-oauth2 (~> 1.2) + omniauth-oauth (1.1.0) oauth omniauth (~> 1.0) - omniauth-oauth2 (1.1.1) - oauth2 (~> 0.8.0) - omniauth (~> 1.0) - omniauth-twitter (0.0.14) - multi_json (~> 1.3) - omniauth-oauth (~> 1.0) - origin (1.0.10) - orm_adapter (0.4.0) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.2) + omniauth-oauth2 (1.4.0) + oauth2 (~> 1.0) + omniauth (~> 1.2) + omniauth-twitter (1.2.1) + json (~> 1.3) + omniauth-oauth (~> 1.1) + origin (2.1.1) + orm_adapter (0.5.0) + polyglot (0.3.5) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.3.0) + byebug (~> 8.0) + pry (~> 0.10) + rack (1.5.5) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.9) - actionmailer (= 3.2.9) - actionpack (= 3.2.9) - activerecord (= 3.2.9) - activeresource (= 3.2.9) - activesupport (= 3.2.9) - bundler (~> 1.0) - railties (= 3.2.9) - railties (3.2.9) - actionpack (= 3.2.9) - activesupport (= 3.2.9) - rack-ssl (~> 1.3.2) + rails (4.0.0) + actionmailer (= 4.0.0) + actionpack (= 4.0.0) + activerecord (= 4.0.0) + activesupport (= 4.0.0) + bundler (>= 1.3.0, < 2.0) + railties (= 4.0.0) + sprockets-rails (~> 2.0.0) + rails-observers (0.1.2) + activemodel (~> 4.0) + railties (4.0.0) + actionpack (= 4.0.0) + activesupport (= 4.0.0) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.0.2) - rdoc (3.12) - json (~> 1.4) - rmagick (2.13.1) - ruby-hmac (0.4.0) - sass (3.2.3) - sass-rails (3.2.5) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - simple_form (2.0.4) - actionpack (~> 3.0) - activemodel (~> 3.0) - simple_oauth (0.2.0) - sprockets (2.2.2) + thor (>= 0.18.1, < 2.0) + rake (10.4.2) + rbvmomi (1.8.2) + builder + nokogiri (>= 1.4.1) + trollop + ref (2.0.0) + responders (1.1.2) + railties (>= 3.2, < 4.2) + sass (3.4.20) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + simple_form (3.2.0) + actionpack (~> 4.0) + activemodel (~> 4.0) + simple_oauth (0.3.1) + slop (3.6.0) + sprockets (2.12.4) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - therubyracer (0.10.2) - libv8 (~> 3.3.10) - thor (0.16.0) - tilt (1.3.3) - treetop (1.4.12) + sprockets-rails (2.0.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (~> 2.8) + sshkit (1.8.1) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + therubyracer (0.12.0) + libv8 (~> 3.16.14.0) + ref + thor (0.19.1) + thread_safe (0.3.5) + tilt (1.4.1) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) - twitter (4.4.1) - faraday (~> 0.8) - multi_json (~> 1.3) - simple_oauth (~> 0.2) - tzinfo (0.3.35) - uglifier (1.3.0) + trollop (2.1.2) + twitter (5.15.0) + addressable (~> 2.3) + buftok (~> 0.2.0) + equalizer (= 0.0.10) + faraday (~> 0.9.0) + http (>= 0.4, < 0.10) + http_parser.rb (~> 0.6.0) + json (~> 1.8) + memoizable (~> 0.4.0) + naught (~> 1.0) + simple_oauth (~> 0.3.0) + twitter-bootstrap-rails (2.2.8) + actionpack (>= 3.1) + execjs + rails (>= 3.1) + railties (>= 3.1) + tzinfo (0.3.46) + uglifier (2.7.2) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) + json (>= 1.8.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + warden (1.2.4) rack (>= 1.0) + xml-simple (1.1.5) PLATFORMS ruby @@ -219,7 +374,7 @@ DEPENDENCIES capistrano carrierwave carrierwave-mongoid - coffee-rails (~> 3.2.1) + coffee-rails devise fog geocoder @@ -227,14 +382,19 @@ DEPENDENCIES jquery-rails koala less-rails + mini_magick mongoid + mongoid-observers omniauth-facebook omniauth-twitter - rails (= 3.2.9) - rmagick - sass-rails (~> 3.2.3) + pry-byebug + rails (= 4.0) + sass-rails simple_form therubyracer twitter - twitter-bootstrap-rails! - uglifier (>= 1.0.3) + twitter-bootstrap-rails (= 2.2.8) + uglifier + +BUNDLED WITH + 1.11.2 From 862c3fa42a4977cc09de285e5f91880e6ba8b885 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:19:52 +0900 Subject: [PATCH 04/36] add bootstrap files rails generate bootstrap:install less --- app/assets/javascripts/bootstrap.js.coffee | 5 ++-- app/assets/stylesheets/application.css.scss | 3 ++- .../bootstrap_and_overrides.css.less | 24 ++++++++----------- config/locales/en.bootstrap.yml | 23 ++++++++++++++++++ 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 config/locales/en.bootstrap.yml diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee index c9404a8..9440679 100644 --- a/app/assets/javascripts/bootstrap.js.coffee +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -1,4 +1,3 @@ jQuery -> - $("a[rel=popover]").popover() - $(".tooltip").tooltip() - $("a[rel=tooltip]").tooltip() \ No newline at end of file + $("a[rel~=popover], .has-popover").popover() + $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 7d01d57..cfce16e 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -10,6 +10,7 @@ * *= require_self *= require_tree . + *= require bootstrap_and_overrides */ .footer { @@ -31,4 +32,4 @@ div.selected div.infobox { section#promises div.masonry_item:not(.selected), section#awards div.masonry_item:not(.selected) { display: none; -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 7616b79..0cd89fc 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -1,23 +1,19 @@ @import "twitter/bootstrap/bootstrap"; -@import "./responsive"; - -body { padding-top: 40px; } +@import "twitter/bootstrap/responsive"; // Set the correct sprite paths -@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings"); -@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white"); +@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png"); +@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png"); // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) -// Note: If you use asset_path() here, your compiled bootstrap_and_overrides.css will not -// have the proper paths. So for now we use the absolute path. -@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot"); -@fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix"); -@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff"); -@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf"); -@fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg"); +@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot"); +@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix"); +@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff"); +@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf"); +@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular"); // Font Awesome -@import "fontawesome"; +@import "fontawesome/font-awesome"; // Glyphicons //@import "twitter/bootstrap/sprites.less"; @@ -31,4 +27,4 @@ body { padding-top: 40px; } // See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation // // Example: -// @linkColor: #ff0000; \ No newline at end of file +// @linkColor: #ff0000; diff --git a/config/locales/en.bootstrap.yml b/config/locales/en.bootstrap.yml new file mode 100644 index 0000000..8d75119 --- /dev/null +++ b/config/locales/en.bootstrap.yml @@ -0,0 +1,23 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + breadcrumbs: + application: + root: "Index" + pages: + pages: "Pages" + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit %{model}" + save: "Save %{model}" + new: "New %{model}" + delete: "Delete %{model}" From 63ed5f10e490bcdbf7623f015747cdb2b061bc23 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:21:02 +0900 Subject: [PATCH 05/36] update route add match options for rails 4 --- config/routes.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index dc8d367..77eb215 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,10 +15,10 @@ resources :events resources :campaigns - match 'home' => 'pages#home', as: 'home' - match 'info' => 'pages#info', as: 'info' - match 'discuss' => 'pages#discuss', as: 'discuss' - match 'banner' => 'pages#banner', as: 'banner' + match 'home' => 'pages#home', as: 'home', via: [:get, :post] + match 'info' => 'pages#info', as: 'info', via: [:get, :post] + match 'discuss' => 'pages#discuss', as: 'discuss', via: [:get, :post] + match 'banner' => 'pages#banner', as: 'banner', via: [:get, :post] root :to => 'pages#home' -end \ No newline at end of file +end From 5ac7dba7111b88249f3ef286994de2360b1a071a Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:24:33 +0900 Subject: [PATCH 06/36] update image_uploader change from rmagick to mini_magic change from fog-awe to fog-local --- app/uploaders/image_uploader.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index ff5e1eb..6c9c317 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -2,14 +2,16 @@ class ImageUploader < CarrierWave::Uploader::Base - include CarrierWave::RMagick + # include CarrierWave::RMagick + include CarrierWave::MiniMagick # Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility: - include Sprockets::Helpers::RailsHelper - include Sprockets::Helpers::IsolatedHelper + # include Sprockets::Helpers::RailsHelper # 4.0 + # include Sprockets::Helpers::IsolatedHelper # 4.0 # Choose what kind of storage to use for this uploader: - storage :fog + # storage :fog + storage :file # Override the directory where uploaded files will be stored. # This is a sensible default for uploaders that are meant to be mounted: @@ -55,4 +57,4 @@ def get_exif( name ) return img["EXIF:" + name] end end -end \ No newline at end of file +end From 5b747c7d30a0f81ee9ae1aac5d02afe5bd981ec7 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:25:37 +0900 Subject: [PATCH 07/36] update development deprecated config option --- config/environments/development.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 93324c0..b7710b8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -7,7 +7,7 @@ config.cache_classes = false # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true + # config.whiny_nils = true # deprecated # Show full error reports and disable caching config.consider_all_requests_local = true From 5538a706bd243caf3de838fb2ccd09f4b037ad66 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:27:08 +0900 Subject: [PATCH 08/36] update twitter twitter gem do not use global constant for thread-safe --- config/initializers/twitter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/initializers/twitter.rb b/config/initializers/twitter.rb index e069113..0973f6a 100644 --- a/config/initializers/twitter.rb +++ b/config/initializers/twitter.rb @@ -1,4 +1,4 @@ -Twitter.configure do |config| - config.consumer_key = Rails.configuration.twitter['client_id'] - config.consumer_secret = Rails.configuration.twitter['client_secret'] -end \ No newline at end of file +# Twitter.configure do |config| +# config.consumer_key = Rails.configuration.twitter['client_id'] +# config.consumer_secret = Rails.configuration.twitter['client_secret'] +# end From efe29896782f841fd56be4a57d3896a10054a757 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:28:19 +0900 Subject: [PATCH 09/36] update devise update facebook option --- config/initializers/devise.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a17138c..453c35a 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -210,7 +210,7 @@ config.omniauth :facebook, Rails.configuration.facebook['client_id'], Rails.configuration.facebook['client_secret'], - :scope => 'email,read_stream,publish_stream' + scope: 'email,user_posts,public_profile,user_website', info_fields: 'name,link' config.omniauth :twitter, Rails.configuration.twitter['client_id'], @@ -238,4 +238,7 @@ # When using omniauth, Devise cannot automatically set Omniauth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = "/my_engine/users/auth" -end \ No newline at end of file + + # + config.secret_key = 'a17f3c36367ea22e15e77254c24af303a849186533b279bedbdb59c1720178c8e729845d0f58ae3469112e64f9cfa7bd84f9a5dabb8d71aa002bc2ca50629ed9' +end From 3cfc4d301068b7a49a9e1bb8817b6ab087879caa Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:29:38 +0900 Subject: [PATCH 10/36] update application update config for mongoid --- config/application.rb | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/config/application.rb b/config/application.rb index 459ffd0..3d881d9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,22 +1,18 @@ require File.expand_path('../boot', __FILE__) -# Pick the frameworks you want: -# require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" -require "active_resource/railtie" +# require "active_resource/railtie" require "sprockets/railtie" -# require "rails/test_unit/railtie" -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +require "i18n/backend/fallbacks" + +Bundler.require(:default, Rails.env) module Voteaward class Application < Rails::Application + + config.eager_load = false # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. @@ -75,5 +71,14 @@ class Application < Rails::Application # oauth config.facebook = YAML.load_file("#{Rails.root.to_s}/config/credentials/facebook_credential.yml")[Rails.env] config.twitter = YAML.load_file("#{Rails.root.to_s}/config/credentials/twitter_credential.yml")[Rails.env] + + # mongoid + config.generators do |g| + g.orm :mongoid + end + + # Configure fallbacks for mongoid errors: + I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) + config.i18n.fallbacks = {'ko' => 'en'} end end From 98992e342d5b7c0110fee688120a2255fd77b382 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 10 Jan 2016 02:30:42 +0900 Subject: [PATCH 11/36] update models update default_scope parameter using lamda --- app/models/award.rb | 5 +++-- app/models/campaign.rb | 4 ++-- app/models/comment.rb | 4 ++-- app/models/event.rb | 5 +++-- app/models/giveup.rb | 4 ++-- app/models/promise.rb | 4 ++-- app/models/user.rb | 17 ++++++++++++----- app/models/vote.rb | 5 +++-- 8 files changed, 29 insertions(+), 19 deletions(-) diff --git a/app/models/award.rb b/app/models/award.rb index 7d606e7..f31add3 100644 --- a/app/models/award.rb +++ b/app/models/award.rb @@ -18,5 +18,6 @@ class Award validates_presence_of :title, :content, :prize # scopes - default_scope desc(:_id) -end \ No newline at end of file + default_scope -> { order(_id: :desc) } + +end diff --git a/app/models/campaign.rb b/app/models/campaign.rb index d8f6165..aab6b58 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -16,7 +16,7 @@ class Campaign validates_presence_of :url, :title, :description # scope - default_scope desc(:_id) + default_scope -> { order(_id: :desc) } # callbacks -end \ No newline at end of file +end diff --git a/app/models/comment.rb b/app/models/comment.rb index 44f4331..50fd2d8 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -13,5 +13,5 @@ class Comment validates_presence_of :content # scope - default_scope asc(:_id) -end \ No newline at end of file + default_scope -> { order(_id: :asc) } +end diff --git a/app/models/event.rb b/app/models/event.rb index 3fc76f2..a8fe028 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -23,7 +23,8 @@ class Event validates_presence_of :title, :content # scope - default_scope desc(:_id) + default_scope -> { order(_id: :desc) } + # geocode geocoded_by :address @@ -32,4 +33,4 @@ class Event after_validation :geocode # scope -end \ No newline at end of file +end diff --git a/app/models/giveup.rb b/app/models/giveup.rb index 4daf4fc..24e0f7d 100644 --- a/app/models/giveup.rb +++ b/app/models/giveup.rb @@ -15,5 +15,5 @@ class Giveup validates_presence_of :reason, :area, :sex, :age # scopes - default_scope desc(:_id) -end \ No newline at end of file + default_scope -> { order(_id: :desc) } +end diff --git a/app/models/promise.rb b/app/models/promise.rb index ef65bd8..1ca7770 100644 --- a/app/models/promise.rb +++ b/app/models/promise.rb @@ -21,7 +21,7 @@ class Promise validates_uniqueness_of :user_id # scope - default_scope desc(:_id) + default_scope -> { order(_id: :desc) } # callbacks before_create :assign_id @@ -31,4 +31,4 @@ class Promise def assign_id self.seq = Sequence.generate_id(:promise) end -end \ No newline at end of file +end diff --git a/app/models/user.rb b/app/models/user.rb index c4ad216..6e10e50 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -59,6 +59,11 @@ def email_required? field :omniauth_uid field :omniauth_credentials field :omniauth_url + field :omniauth_image + field :omniauth + + field :name + field :password # methods def admin? @@ -74,10 +79,12 @@ def profile_image end def twitter - @twitter ||= Twitter::Client.new( - oauth_token: omniauth_credentials['token'], - oauth_token_secret: omniauth_credentials['secret'] - ) + @twitter ||= Twitter::REST::Client.new do |config| + config.consumer_key = Rails.configuration.twitter['client_id'] + config.consumer_secret = Rails.configuration.twitter['client_secret'] + config.access_token = omniauth_credentials['token'], + config.access_token_secret = omniauth_credentials['secret'] + end end def facebook @@ -87,4 +94,4 @@ def facebook logger.info e.to_s nil # or consider a custom null object end -end \ No newline at end of file +end diff --git a/app/models/vote.rb b/app/models/vote.rb index fb65c4e..ec5bf2f 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -19,7 +19,7 @@ class Vote validates_presence_of :title, :content # scope - default_scope desc(:_id) + default_scope -> { order(_id: :desc) } # callbacks before_create :assign_id @@ -46,6 +46,7 @@ def extract_geocoordinates lng_ref = image.get_exif('GPSLongitudeRef') rescue nil return unless img_lat && img_lng && lat_ref && lng_ref + return if img_lat.blank? && img_lng.blank? && lat_ref.blank? && lng_ref.blank? latitude = to_frac(img_lat[0]) + (to_frac(img_lat[1])/60) + (to_frac(img_lat[2])/3600) longitude = to_frac(img_lng[0]) + (to_frac(img_lng[1])/60) + (to_frac(img_lng[2])/3600) @@ -67,4 +68,4 @@ def to_frac(strng) denominator ||= 1 numerator/denominator end -end \ No newline at end of file +end From 2c171b8de25dc068b5c9f43739bee62311c044c0 Mon Sep 17 00:00:00 2001 From: wagurano Date: Mon, 11 Jan 2016 00:47:28 +0900 Subject: [PATCH 12/36] update gems and fix typos update rails 4..2.5 and update controller using strong parameter fix twitter auth parameter typo update mongoid model sequence inc parameter --- Gemfile | 8 +- Gemfile.lock | 165 ++++++++++-------- app/controllers/awards_controller.rb | 9 +- app/controllers/campaigns_controller.rb | 11 +- app/controllers/candidates_controller.rb | 9 +- app/controllers/comments_controller.rb | 10 +- app/controllers/events_controller.rb | 11 +- app/controllers/giveups_controller.rb | 9 +- app/controllers/promises_controller.rb | 9 +- app/controllers/votes_controller.rb | 11 +- app/models/sequence.rb | 4 +- app/models/user.rb | 2 +- bin/bundle | 3 + bin/rails | 4 + bin/rake | 4 + bin/setup | 29 +++ config/application.rb | 33 ++-- config/boot.rb | 5 +- config/environment.rb | 6 +- config/environments/development.rb | 36 ++-- config/environments/production.rb | 77 ++++---- config/environments/test.rb | 31 ++-- config/initializers/assets.rb | 11 ++ config/initializers/cookies_serializer.rb | 3 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 11 +- config/initializers/mime_types.rb | 1 - config/initializers/session_store.rb | 7 +- config/initializers/wrap_parameters.rb | 8 +- config/locales/en.yml | 22 ++- config/routes.rb | 2 +- config/secrets.yml | 22 +++ 32 files changed, 381 insertions(+), 196 deletions(-) create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/secrets.yml diff --git a/Gemfile b/Gemfile index aed221e..f968273 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ source 'https://rubygems.org' -#gem 'rails', '3.2.9' -gem 'rails', '4.0' +gem 'rails', '4.2.5' # db gem 'mongoid' @@ -26,8 +25,8 @@ gem 'twitter' gem 'sass-rails' gem 'coffee-rails' gem 'uglifier' -gem "therubyracer" -gem "less-rails" +gem 'therubyracer', '0.12.0' +gem 'less-rails' gem 'twitter-bootstrap-rails', '2.2.8' gem 'jquery-rails' @@ -47,4 +46,5 @@ gem 'capistrano' group :development do gem 'pry-byebug' + gem 'spring' end diff --git a/Gemfile.lock b/Gemfile.lock index 1d5de1d..b735305 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,36 +2,47 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.2) - actionmailer (4.0.0) - actionpack (= 4.0.0) - mail (~> 2.5.3) - actionpack (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) + actionmailer (4.2.5) + actionpack (= 4.2.5) + actionview (= 4.2.5) + activejob (= 4.2.5) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.5) + actionview (= 4.2.5) + activesupport (= 4.2.5) + rack (~> 1.6) rack-test (~> 0.6.2) - activemodel (4.0.0) - activesupport (= 4.0.0) - builder (~> 3.1.0) - activerecord (4.0.0) - activemodel (= 4.0.0) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.0) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activesupport (4.0.0) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.5) + activesupport (= 4.2.5) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.5) + activesupport (= 4.2.5) + globalid (>= 0.3.0) + activemodel (4.2.5) + activesupport (= 4.2.5) + builder (~> 3.1) + activerecord (4.2.5) + activemodel (= 4.2.5) + activesupport (= 4.2.5) + arel (~> 6.0) + activesupport (4.2.5) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) addressable (2.4.0) - arel (4.0.2) + arel (6.0.3) bcrypt (3.1.10) bson (4.0.0) buftok (0.2.0) - builder (3.1.4) + builder (3.2.2) byebug (8.2.1) capistrano (3.4.0) i18n @@ -55,6 +66,7 @@ GEM execjs coffee-script-source (1.10.0) commonjs (0.2.7) + concurrent-ruby (1.0.0) devise (3.5.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -106,7 +118,7 @@ GEM fog-atmos (0.1.0) fog-core fog-xml - fog-aws (0.7.6) + fog-aws (0.8.1) fog-core (~> 1.27) fog-json (~> 1.0) fog-xml (~> 0.1) @@ -143,7 +155,7 @@ GEM fog-core fog-xml nokogiri - fog-radosgw (0.0.4) + fog-radosgw (0.0.5) fog-core (>= 1.21.0) fog-json fog-xml (>= 0.0.1) @@ -157,7 +169,7 @@ GEM fog-serverlove (0.1.2) fog-core fog-json - fog-softlayer (1.0.2) + fog-softlayer (1.0.3) fog-core fog-json fog-storm_on_demand (0.1.1) @@ -183,8 +195,9 @@ GEM nokogiri (~> 1.5, >= 1.5.11) formatador (0.2.5) geocoder (1.2.14) + globalid (0.3.6) + activesupport (>= 4.1.0) hashie (3.4.3) - hike (1.2.3) http (0.9.8) addressable (~> 2.3) http-cookie (~> 1.0) @@ -196,12 +209,13 @@ GEM http_parser.rb (0.6.0) i18n (0.7.0) inflecto (0.0.2) - ipaddress (0.8.0) + ipaddress (0.8.2) jbuilder (2.4.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) - jquery-rails (3.1.4) - railties (>= 3.0, < 5.0) + jquery-rails (4.0.5) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) jwt (1.5.2) @@ -211,22 +225,23 @@ GEM multi_json less (2.6.0) commonjs (~> 0.2.7) - less-rails (2.7.0) + less-rails (2.7.1) actionpack (>= 4.0) less (~> 2.6.0) sprockets (> 2, < 4) tilt libv8 (3.16.14.13) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (0.8.2) - mime-types (1.25.1) + mime-types (2.99) mini_magick (4.3.6) mini_portile2 (2.0.0) - minitest (4.7.5) + minitest (5.8.3) mongo (2.2.1) bson (~> 4.0) mongoid (5.0.2) @@ -272,7 +287,6 @@ GEM omniauth-oauth (~> 1.1) origin (2.1.1) orm_adapter (0.5.0) - polyglot (0.3.5) pry (0.10.3) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -280,22 +294,33 @@ GEM pry-byebug (3.3.0) byebug (~> 8.0) pry (~> 0.10) - rack (1.5.5) + rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.0.0) - actionmailer (= 4.0.0) - actionpack (= 4.0.0) - activerecord (= 4.0.0) - activesupport (= 4.0.0) + rails (4.2.5) + actionmailer (= 4.2.5) + actionpack (= 4.2.5) + actionview (= 4.2.5) + activejob (= 4.2.5) + activemodel (= 4.2.5) + activerecord (= 4.2.5) + activesupport (= 4.2.5) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.0) - sprockets-rails (~> 2.0.0) + railties (= 4.2.5) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) rails-observers (0.1.2) activemodel (~> 4.0) - railties (4.0.0) - actionpack (= 4.0.0) - activesupport (= 4.0.0) + railties (4.2.5) + actionpack (= 4.2.5) + activesupport (= 4.2.5) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.4.2) @@ -304,8 +329,8 @@ GEM nokogiri (>= 1.4.1) trollop ref (2.0.0) - responders (1.1.2) - railties (>= 3.2, < 4.2) + responders (2.1.1) + railties (>= 4.2.0, < 5.1) sass (3.4.20) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -313,20 +338,19 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - simple_form (3.2.0) - actionpack (~> 4.0) - activemodel (~> 4.0) + simple_form (3.2.1) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) simple_oauth (0.3.1) slop (3.6.0) - sprockets (2.12.4) - 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) + spring (1.6.2) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) sshkit (1.8.1) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) @@ -335,10 +359,7 @@ GEM ref thor (0.19.1) thread_safe (0.3.5) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) + tilt (2.0.2) trollop (2.1.2) twitter (5.15.0) addressable (~> 2.3) @@ -356,7 +377,8 @@ GEM execjs rails (>= 3.1) railties (>= 3.1) - tzinfo (0.3.46) + tzinfo (1.2.2) + thread_safe (~> 0.1) uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) @@ -388,10 +410,11 @@ DEPENDENCIES omniauth-facebook omniauth-twitter pry-byebug - rails (= 4.0) + rails (= 4.2.5) sass-rails simple_form - therubyracer + spring + therubyracer (= 0.12.0) twitter twitter-bootstrap-rails (= 2.2.8) uglifier diff --git a/app/controllers/awards_controller.rb b/app/controllers/awards_controller.rb index 1bdf878..9b78ce7 100644 --- a/app/controllers/awards_controller.rb +++ b/app/controllers/awards_controller.rb @@ -8,7 +8,7 @@ def new end def create - @award = current_user.awards.build(params[:award]) + @award = current_user.awards.build(award_params) if @award.save message = I18n.t('award.share', username: current_user.name, title: @award.title, content: @award.content, prize: @award.prize) if current_user.omniauth_provider == :twitter @@ -45,4 +45,9 @@ def update end redirect_to award end -end \ No newline at end of file + +private + def award_params + params.require(:award).permit(:title, :content, :prize) + end +end diff --git a/app/controllers/campaigns_controller.rb b/app/controllers/campaigns_controller.rb index 96f44bb..b351f72 100644 --- a/app/controllers/campaigns_controller.rb +++ b/app/controllers/campaigns_controller.rb @@ -8,7 +8,7 @@ def new end def create - @campaign = current_user.campaigns.build(params[:campaign]) + @campaign = current_user.campaigns.build(campaign_params) if @campaign.save redirect_to campaigns_path, notice: I18n.t('campaign.created') else @@ -22,7 +22,7 @@ def edit def update @campaign = Campaign.find(params[:id]) - if @campaign.update_attributes(params[:campaign]) + if @campaign.update_attributes(campaign) redirect_to campaigns_path, notice: I18n.t('campaign.updated') else render action: 'edit' @@ -32,4 +32,9 @@ def update def destroy end -end \ No newline at end of file + +private + def campaign_params + params.require(:campaign).permit() + end +end diff --git a/app/controllers/candidates_controller.rb b/app/controllers/candidates_controller.rb index ca053db..1bb88ca 100644 --- a/app/controllers/candidates_controller.rb +++ b/app/controllers/candidates_controller.rb @@ -40,7 +40,7 @@ def edit # POST /candidates # POST /candidates.json def create - @candidate = Candidate.new(params[:candidate]) + @candidate = Candidate.new(candidate) respond_to do |format| if @candidate.save @@ -59,7 +59,7 @@ def update @candidate = Candidate.find(params[:id]) respond_to do |format| - if @candidate.update_attributes(params[:candidate]) + if @candidate.update_attributes(candidate_params) format.html { redirect_to candidates_url, notice: 'Candidate was successfully updated.' } format.json { head :no_content } else @@ -80,4 +80,9 @@ def destroy format.json { head :no_content } end end + +private + def candidate_params + params.require(:candidate).permit() + end end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index d1e6cae..b764ec0 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,7 +1,7 @@ class CommentsController < ApplicationController def create @commentable = find_commentable - @comment = @commentable.comments.build(params[:comment]) + @comment = @commentable.comments.build(comment_params) @comment.user = current_user respond_to do |format| @@ -26,7 +26,7 @@ def destroy end end - private +private def find_commentable params.each do |name, value| if name =~ /(.+)_id$/ @@ -34,4 +34,8 @@ def find_commentable end end end -end \ No newline at end of file + + def comment_params + params.require(:comment).permit() + end +end diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 897d84d..5bed0f9 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -8,7 +8,7 @@ def new end def create - @event = current_user.events.build(params[:event]) + @event = current_user.events.build(event_params) if @event.save redirect_to events_path, notice: I18n.t('event.created') else @@ -26,7 +26,7 @@ def edit def update @event = current_user.events.find(params[:id]) - if @event.update_attributes(params[:event]) + if @event.update_attributes(event_params) redirect_to events_path, notice: I18n.t('event.updated') else render action: 'edit' @@ -35,4 +35,9 @@ def update def destroy end -end \ No newline at end of file + +private + def event_params + params.require(:event).permit() + end +end diff --git a/app/controllers/giveups_controller.rb b/app/controllers/giveups_controller.rb index f567c34..4acbfc2 100644 --- a/app/controllers/giveups_controller.rb +++ b/app/controllers/giveups_controller.rb @@ -5,7 +5,7 @@ def index end def create - @giveup = current_user.build_giveup(params[:giveup]) + @giveup = current_user.build_giveup(giveup_params) if @giveup.save redirect_to giveups_url, notice: I18n.t('giveup.created') else @@ -21,4 +21,9 @@ def destroy redirect_to giveups_url end end -end \ No newline at end of file + +private + def giveup_params + params.require(:giveup).permit() + end +end diff --git a/app/controllers/promises_controller.rb b/app/controllers/promises_controller.rb index d8b0f17..3f94b6d 100644 --- a/app/controllers/promises_controller.rb +++ b/app/controllers/promises_controller.rb @@ -8,7 +8,7 @@ def new end def create - @promise = current_user.build_promise(params[:promise]) + @promise = current_user.build_promise(promise_params) redirect_to promises_url # if @promise.save # message = I18n.t('promise.share', username: current_user.name, reason: @promise.reason, seq: @promise.seq) @@ -45,4 +45,9 @@ def like @promise = Promise.find(params[:id]) @promise.inc(:likes, 1) end -end \ No newline at end of file + +private + def promise_params + params.require(:promise).permit(:reason) + end +end diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb index a6fbc48..6e5282e 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -14,7 +14,7 @@ def create return nil end - @vote = current_user.votes.build(params[:vote]) + @vote = current_user.votes.build(vote_params) if @vote.save message = I18n.t('vote.share', username: current_user.name, title: @vote.title, content: @vote.content, seq: @vote.seq) if current_user.omniauth_provider == :twitter @@ -34,7 +34,7 @@ def edit def update @vote = current_user.votes.find(params[:id]) - if @vote.update_attributes(params[:vote]) + if @vote.update_attributes(vote_params) redirect_to votes_url, notice: I18n.t('vote.updated') else render action: 'edit' @@ -51,4 +51,9 @@ def like @vote.inc(:likes, 1) @vote.event.inc(:likes, 1) unless @vote.event.blank? end -end \ No newline at end of file + +private + def vote_params + params.require(:vote).permit(:title, :content) + end +end diff --git a/app/models/sequence.rb b/app/models/sequence.rb index d735d17..60aae87 100644 --- a/app/models/sequence.rb +++ b/app/models/sequence.rb @@ -5,11 +5,11 @@ class Sequence def self.generate_id(object) @seq=where(:object => object).first || create(:object => object) - @seq.inc(:last_id,1) + @seq.inc(last_id: 1) end def self.get_last_id(object) @seq=where(:object => object).first (@seq.blank?) ? 0 : @seq.last_id end -end \ No newline at end of file +end diff --git a/app/models/user.rb b/app/models/user.rb index 6e10e50..155aca5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -82,7 +82,7 @@ def twitter @twitter ||= Twitter::REST::Client.new do |config| config.consumer_key = Rails.configuration.twitter['client_id'] config.consumer_secret = Rails.configuration.twitter['client_secret'] - config.access_token = omniauth_credentials['token'], + config.access_token = omniauth_credentials['token'] config.access_token_secret = omniauth_credentials['secret'] end end diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..5191e69 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/config/application.rb b/config/application.rb index 3d881d9..ed93857 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,36 +4,34 @@ require "action_mailer/railtie" # require "active_resource/railtie" require "sprockets/railtie" +# require "active_record/railtie" require "i18n/backend/fallbacks" -Bundler.require(:default, Rails.env) +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) module Voteaward class Application < Rails::Application - - config.eager_load = false # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named. - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + # Do not swallow errors in after_commit/after_rollback callbacks. + # config.active_record.raise_in_transactional_callbacks = true # Activate observers that should always be running. - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer config.mongoid.observers = :promise_observer, :award_observer, :vote_observer # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' config.time_zone = 'Seoul' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de config.i18n.default_locale = :ko # Configure the default encoding used in templates for Ruby 1.9. @@ -45,23 +43,16 @@ class Application < Rails::Application # Enable escaping HTML in JSON. config.active_support.escape_html_entities_in_json = true - # Use SQL instead of Active Record's schema dumper when creating the database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true - # Enable the asset pipeline config.assets.enabled = true # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + # config.assets.compile = true + # config.less.paths << "#{Rails.root}/lib/less/protractor/stylesheets" + # config.less.compress = true + # Prevent scaffold.css, javascripts from being generated config.generators do |g| g.stylesheets false diff --git a/config/boot.rb b/config/boot.rb index 4489e58..6b750f0 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,3 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index 3fa00b0..ee8d90d 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ -# Load the rails application +# Load the Rails application. require File.expand_path('../application', __FILE__) -# Initialize the rails application -Voteaward::Application.initialize! +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index b7710b8..bc7c76a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,31 +1,47 @@ -Voteaward::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Log error messages when you accidentally call methods on nil. - # config.whiny_nils = true # deprecated + # Do not eager load code on boot. + config.eager_load = false - # Show full error reports and disable caching + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - # Don't care if the mailer can't send + # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false - # Print deprecation notices to the Rails logger + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log + # Raise an error on page load if there are pending migrations. + # config.active_record.migration_error = :page_load + # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - # Do not compress assets - config.assets.compress = false + # config.assets.compress = false - # Expands the lines which load the assets + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index ae47eda..5c1b32e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,64 +1,79 @@ -Voteaward::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. - # Code is not reloaded between requests + # Code is not reloaded between requests. config.cache_classes = true - # Full error reports are disabled and caching is turned on + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? - # Compress JavaScripts and CSS - config.assets.compress = true + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass - # Don't fallback to assets pipeline if a precompiled asset is missed + # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false - # Generate digests for assets URLs + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. config.assets.digest = true - # Defaults to nil and saved in location specified by config.assets.prefix - # config.assets.manifest = YOUR_PATH + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # See everything in the log (default is :info) - # config.log_level = :debug + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug - # Prepend all log lines with the following tags + # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] - # Use a different logger for distributed setups + # Use a different logger for distributed setups. # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - # Use a different cache store in production + # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Enable serving of images, stylesheets, and JavaScripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' - # Disable delivery errors, bad email addresses will be ignored + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false - # Enable threaded mode - # config.threadsafe! - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) + # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners + # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 7c971cb..1c19f08 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,5 +1,5 @@ -Voteaward::Application.configure do - # Settings specified here will take precedence over those in config/application.rb +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that @@ -7,29 +7,36 @@ # and recreated between test runs. Don't rely on the data there! config.cache_classes = true - # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false - # Log error messages when you accidentally call methods on nil - config.whiny_nils = true + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' - # Show full error reports and disable caching + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - # Raise exceptions instead of rendering exception templates + # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Randomize the order test cases are executed. + config.active_support.test_order = :random - # Print deprecation notices to the stderr + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..ac5f8b6 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :marshal diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 5d8d9be..ac033bf 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,15 +1,16 @@ # Be sure to restart your server when you modify this file. -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end -# + # These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections do |inflect| +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' # end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e..dc18996 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,3 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index bb0c4e2..af0e1f3 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,8 +1,3 @@ # Be sure to restart your server when you modify this file. -Voteaward::Application.config.session_store :cookie_store, key: '_voteaward_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# Voteaward::Application.config.session_store :active_record_store +Rails.application.config.session_store :cookie_store, key: '_voteaward_session' diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 369b465..33725e9 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,10 +1,14 @@ # Be sure to restart your server when you modify this file. -# + # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml index 179c14c..0653957 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,5 +1,23 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/config/routes.rb b/config/routes.rb index 77eb215..3598b11 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -Voteaward::Application.routes.draw do +Rails.application.routes.draw do #auth devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..536a51b --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 62242d2bbd5d09cf87d10b8b13ad2707a1e18f5f785114a318ceb1b930cd640a4db7ebce625fe27687ed79e7b9773f3a1adf064e7ea0db965baccb69af6dfe96 + +test: + secret_key_base: 7413e7c0c5ac34a12248a961393a494d6f905838a22e058708dd69029a1ae00afecfd387d9731bb9e57344903097f11a4bf208fcce08a0672e5a93e96bdd1472 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> From 3f2e273e133cec4035ed9fc87082ff0a76c2f558 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sat, 26 Mar 2016 21:55:13 +0900 Subject: [PATCH 13/36] commented out for mongoid --- config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 5c1b32e..375e004 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -69,11 +69,11 @@ config.i18n.fallbacks = true # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify + # config.active_support.deprecation = :notify # commented out for mongoid # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false + # config.active_record.dump_schema_after_migration = false # commented out for mongoid end From 7931e570f8dafba64e331c2559246e87ab0a4279 Mon Sep 17 00:00:00 2001 From: wagurano Date: Thu, 7 Apr 2016 22:13:10 +0900 Subject: [PATCH 14/36] add docker files --- .dockerignore | 14 ++++++++++++++ Dockerfile | 20 ++++++++++++++++++++ docker-compose.yml | 15 +++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..92bf09d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.git* +/.bundle +db/*.sqlite3 +db/*.sqlite3-journal +log/* +tmp/* +/tmp +/public/uploads/* +mongoid.yml +/config/credentials/*.yml +.DS_Store +/public/assets +Dockerfile +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..86a31de --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ruby:2.2 +MAINTAINER wagurano wagurano@gmail.com + +RUN apt-get update && apt-get install -y \ + build-essential \ + libxml2-dev \ + libxslt-dev \ + nodejs + +RUN mkdir -p /app +WORKDIR /app + +COPY Gemfile Gemfile.lock ./ +RUN gem install bundler && bundle install --jobs 20 --retry 5 + +COPY . ./ + +EXPOSE 3000 + +# CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f364059 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +app: + build: . + command: rails server -p 3000 -b '0.0.0.0' + volumes: + - .:/app + ports: + - "3000:3000" + external_links: + - my-local-mongo + # links: + # - mongo +# mongo: + # image: mongo:3.0 + # ports: + # - "27017" From 011ffbbec5cf1ae5805d6f99a0c629b75854c8b5 Mon Sep 17 00:00:00 2001 From: wagurano Date: Sat, 29 Apr 2017 22:17:48 +0900 Subject: [PATCH 15/36] Update config files and Remove credentials and Add mongoid.yml and Update Gemfile --- .gitignore | 3 +- Gemfile | 8 +- Gemfile.lock | 325 ++++++++++-------- README.md | 2 + app/views/layouts/application.html.erb | 4 +- config/application.rb | 4 +- .../facebook_credential.yml.example | 13 - config/credentials/fog_credential.yml.example | 3 - .../twitter_credential.yml.example | 13 - config/initializers/carrierwave.rb | 5 +- config/mongoid.yml | 77 +++++ 11 files changed, 281 insertions(+), 176 deletions(-) delete mode 100644 config/credentials/facebook_credential.yml.example delete mode 100644 config/credentials/fog_credential.yml.example delete mode 100644 config/credentials/twitter_credential.yml.example create mode 100644 config/mongoid.yml diff --git a/.gitignore b/.gitignore index e540377..d27de29 100644 --- a/.gitignore +++ b/.gitignore @@ -16,11 +16,12 @@ /public/uploads/* # Ignore configs -mongoid.yml /config/credentials/*.yml +.env # Ignore DS_Store .DS_Store # Ignore assets /public/assets + diff --git a/Gemfile b/Gemfile index f968273..6bb6962 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' gem 'rails', '4.2.5' # db -gem 'mongoid' -gem 'mongoid-observers' +gem 'mongoid', '4.0.2' +gem 'mongoid-observers', '0.2.0' gem 'geocoder' # file upload @@ -44,7 +44,9 @@ gem 'jbuilder' # Deploy with Capistrano gem 'capistrano' -group :development do +group :development, :test do gem 'pry-byebug' gem 'spring' + gem 'rails_12factor' + gem 'dotenv-rails' end diff --git a/Gemfile.lock b/Gemfile.lock index b735305..f4d0b77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.2) + CFPropertyList (2.3.5) actionmailer (4.2.5) actionpack (= 4.2.5) actionview (= 4.2.5) @@ -37,66 +37,80 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) - arel (6.0.3) - bcrypt (3.1.10) - bson (4.0.0) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) + airbrussh (1.2.0) + sshkit (>= 1.6.1, != 1.7.0) + arel (6.0.4) + bcrypt (3.1.11) + bson (3.2.6) buftok (0.2.0) - builder (3.2.2) - byebug (8.2.1) - capistrano (3.4.0) + builder (3.2.3) + byebug (9.0.6) + capistrano (3.8.1) + airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) - sshkit (~> 1.3) - carrierwave (0.10.0) + sshkit (>= 1.9.0) + carrierwave (0.11.2) activemodel (>= 3.2.0) activesupport (>= 3.2.0) json (>= 1.7) mime-types (>= 1.16) - carrierwave-mongoid (0.8.1) - carrierwave (>= 0.8.0, < 0.11.0) - mongoid (>= 3.0, < 6.0) + mimemagic (>= 0.3.0) + carrierwave-mongoid (0.10.0) + carrierwave (>= 0.8.0, < 0.12.0) + mongoid (>= 3.0, < 7.0) mongoid-grid_fs (>= 1.3, < 3.0) - coderay (1.1.0) - coffee-rails (4.1.1) + coderay (1.1.1) + coffee-rails (4.2.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) + railties (>= 4.0.0, < 5.2.x) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) + coffee-script-source (1.12.2) commonjs (0.2.7) - concurrent-ruby (1.0.0) - devise (3.5.3) + concurrent-ruby (1.0.5) + connection_pool (2.2.1) + devise (4.2.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) + railties (>= 4.1.0, < 5.1) responders - thread_safe (~> 0.1) warden (~> 1.2.3) - domain_name (0.5.25) + domain_name (0.5.20170404) unf (>= 0.0.5, < 1.0.0) - equalizer (0.0.10) + dotenv (2.2.1) + dotenv-rails (2.2.1) + dotenv (= 2.2.1) + railties (>= 3.2, < 5.2) + equalizer (0.0.11) erubis (2.7.0) - excon (0.45.4) - execjs (2.6.0) - faraday (0.9.2) + excon (0.55.0) + execjs (2.7.0) + faraday (0.11.0) multipart-post (>= 1.2, < 3) fission (0.5.0) CFPropertyList (~> 2.2) - fog (1.37.0) + fog (1.40.0) fog-aliyun (>= 0.1.0) fog-atmos fog-aws (>= 0.6.0) fog-brightbox (~> 0.4) - fog-core (~> 1.32) + fog-cloudatcost (~> 0.1.0) + fog-core (~> 1.43) + fog-digitalocean (>= 0.3.0) + fog-dnsimple (~> 1.0) fog-dynect (~> 0.0.2) fog-ecloud (~> 0.1) fog-google (<= 0.1.0) fog-json fog-local + fog-openstack fog-powerdns (>= 0.1.1) fog-profitbricks + fog-rackspace fog-radosgw (>= 0.0.2) fog-riakcs fog-sakuracloud (>= 0.0.4) @@ -110,6 +124,7 @@ GEM fog-xenserver fog-xml (~> 0.1.1) ipaddress (~> 0.5) + json (>= 1.8, < 2.0) fog-aliyun (0.1.0) fog-core (~> 1.27) fog-json (~> 1.0) @@ -118,20 +133,33 @@ GEM fog-atmos (0.1.0) fog-core fog-xml - fog-aws (0.8.1) - fog-core (~> 1.27) + fog-aws (1.3.0) + fog-core (~> 1.38) fog-json (~> 1.0) fog-xml (~> 0.1) ipaddress (~> 0.8) - fog-brightbox (0.10.1) + fog-brightbox (0.11.0) fog-core (~> 1.22) fog-json inflecto (~> 0.0.2) - fog-core (1.35.0) + fog-cloudatcost (0.1.2) + fog-core (~> 1.36) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-core (1.43.0) builder - excon (~> 0.45) + excon (~> 0.49) formatador (~> 0.2) - fog-dynect (0.0.2) + fog-digitalocean (0.3.0) + fog-core (~> 1.42) + fog-json (>= 1.0) + fog-xml (>= 0.1) + ipaddress (>= 0.5) + fog-dnsimple (1.0.0) + fog-core (~> 1.38) + fog-json (~> 1.0) + fog-dynect (0.0.3) fog-core fog-json fog-xml @@ -145,16 +173,24 @@ GEM fog-json (1.0.2) fog-core (~> 1.0) multi_json (~> 1.10) - fog-local (0.2.1) + fog-local (0.3.1) fog-core (~> 1.27) + fog-openstack (0.1.20) + fog-core (>= 1.40) + fog-json (>= 1.0) + ipaddress (>= 0.8) fog-powerdns (0.1.1) fog-core (~> 1.27) fog-json (~> 1.0) fog-xml (~> 0.1) - fog-profitbricks (0.0.5) - fog-core - fog-xml - nokogiri + fog-profitbricks (3.0.0) + fog-core (~> 1.42) + fog-json (~> 1.0) + fog-rackspace (0.1.5) + fog-core (>= 1.35) + fog-json (>= 1.0) + fog-xml (>= 0.1) + ipaddress (>= 0.8) fog-radosgw (0.0.5) fog-core (>= 1.21.0) fog-json @@ -169,7 +205,7 @@ GEM fog-serverlove (0.1.2) fog-core fog-json - fog-softlayer (1.0.3) + fog-softlayer (1.1.4) fog-core fog-json fog-storm_on_demand (0.1.1) @@ -184,97 +220,102 @@ GEM fog-voxel (0.1.0) fog-core fog-xml - fog-vsphere (0.4.0) + fog-vsphere (1.9.1) fog-core - rbvmomi (~> 1.8) - fog-xenserver (0.2.2) + rbvmomi (~> 1.9) + fog-xenserver (0.3.0) fog-core fog-xml - fog-xml (0.1.2) + fog-xml (0.1.3) fog-core - nokogiri (~> 1.5, >= 1.5.11) + nokogiri (>= 1.5.11, < 2.0.0) formatador (0.2.5) - geocoder (1.2.14) - globalid (0.3.6) - activesupport (>= 4.1.0) - hashie (3.4.3) - http (0.9.8) + geocoder (1.4.3) + globalid (0.4.0) + activesupport (>= 4.2.0) + hashie (3.5.5) + http (2.2.2) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 1.0.1) http_parser.rb (~> 0.6.0) - http-cookie (1.0.2) + http-cookie (1.0.3) domain_name (~> 0.5) http-form_data (1.0.1) http_parser.rb (0.6.0) - i18n (0.7.0) + i18n (0.8.1) inflecto (0.0.2) - ipaddress (0.8.2) - jbuilder (2.4.0) - activesupport (>= 3.0.0, < 5.1) + ipaddress (0.8.3) + jbuilder (2.6.3) + activesupport (>= 3.0.0, < 5.2) multi_json (~> 1.2) - jquery-rails (4.0.5) - rails-dom-testing (~> 1.0) + jquery-rails (4.3.1) + rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.3) - jwt (1.5.2) - koala (2.2.0) + json (1.8.6) + jwt (1.5.6) + koala (3.0.0) addressable faraday - multi_json + json (>= 1.8) less (2.6.0) commonjs (~> 0.2.7) - less-rails (2.7.1) + less-rails (2.8.0) actionpack (>= 4.0) less (~> 2.6.0) sprockets (> 2, < 4) tilt - libv8 (3.16.14.13) + libv8 (3.16.14.19) loofah (2.0.3) nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) + mail (2.6.5) + mime-types (>= 1.16, < 4) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (0.8.2) - mime-types (2.99) - mini_magick (4.3.6) - mini_portile2 (2.0.0) - minitest (5.8.3) - mongo (2.2.1) - bson (~> 4.0) - mongoid (5.0.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mimemagic (0.3.2) + mini_magick (4.7.0) + mini_portile2 (2.1.0) + minitest (5.10.1) + mongoid (4.0.2) activemodel (~> 4.0) - mongo (~> 2.1) + moped (~> 2.0.0) origin (~> 2.1) tzinfo (>= 0.3.37) - mongoid-grid_fs (2.2.1) - mime-types (>= 1.0, < 3.0) - mongoid (>= 3.0, < 6.0) - mongoid-observers (0.1.1) - mongoid (>= 4.0.0.beta1) + mongoid-grid_fs (2.3.0) + mime-types (>= 1.0, < 4.0) + mongoid (>= 3.0, < 7.0) + mongoid-observers (0.2.0) + mongoid (>= 4.0.0) rails-observers (~> 0.1.2) - multi_json (1.11.2) - multi_xml (0.5.5) + moped (2.0.7) + bson (~> 3.0) + connection_pool (~> 2.0) + optionable (~> 0.2.0) + multi_json (1.12.1) + multi_xml (0.6.0) multipart-post (2.0.0) naught (1.1.0) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (3.0.2) - nokogiri (1.6.7.1) - mini_portile2 (~> 2.0.0.rc2) - oauth (0.4.7) - oauth2 (1.0.0) - faraday (>= 0.8, < 0.10) + net-ssh (4.1.0) + nokogiri (1.7.1) + mini_portile2 (~> 2.1.0) + oauth (0.5.1) + oauth2 (1.3.1) + faraday (>= 0.8, < 0.12) jwt (~> 1.0) multi_json (~> 1.3) multi_xml (~> 0.5) - rack (~> 1.2) - omniauth (1.3.1) - hashie (>= 1.2, < 4) - rack (>= 1.0, < 3) - omniauth-facebook (3.0.0) + rack (>= 1.2, < 3) + omniauth (1.6.1) + hashie (>= 3.4.6, < 3.6.0) + rack (>= 1.6.2, < 3) + omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) omniauth-oauth (1.1.0) oauth @@ -282,19 +323,21 @@ GEM omniauth-oauth2 (1.4.0) oauth2 (~> 1.0) omniauth (~> 1.2) - omniauth-twitter (1.2.1) - json (~> 1.3) + omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) - origin (2.1.1) + rack + optionable (0.2.0) + origin (2.3.0) orm_adapter (0.5.0) - pry (0.10.3) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - pry-byebug (3.3.0) - byebug (~> 8.0) + pry-byebug (3.4.2) + byebug (~> 9.0) pry (~> 0.10) - rack (1.6.4) + public_suffix (2.0.5) + rack (1.6.5) rack-test (0.6.3) rack (>= 1.0) rails (4.2.5) @@ -310,82 +353,88 @@ GEM sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) + rails-dom-testing (1.0.8) activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) + nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.2) + rails-html-sanitizer (1.0.3) loofah (~> 2.0) rails-observers (0.1.2) activemodel (~> 4.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) railties (4.2.5) actionpack (= 4.2.5) activesupport (= 4.2.5) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.4.2) - rbvmomi (1.8.2) - builder - nokogiri (>= 1.4.1) - trollop + rake (12.0.0) + rbvmomi (1.11.2) + builder (~> 3.0) + json (>= 1.8) + nokogiri (~> 1.5) + trollop (~> 2.1) ref (2.0.0) - responders (2.1.1) - railties (>= 4.2.0, < 5.1) - sass (3.4.20) - sass-rails (5.0.4) - railties (>= 4.0.0, < 5.0) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + sass (3.4.23) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - simple_form (3.2.1) + simple_form (3.4.0) actionpack (> 4, < 5.1) activemodel (> 4, < 5.1) simple_oauth (0.3.1) slop (3.6.0) - spring (1.6.2) - sprockets (3.5.2) + spring (2.0.1) + activesupport (>= 4.2) + sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.0.0) + sprockets-rails (3.2.0) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sshkit (1.8.1) + sshkit (1.13.1) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) therubyracer (0.12.0) libv8 (~> 3.16.14.0) ref - thor (0.19.1) - thread_safe (0.3.5) - tilt (2.0.2) + thor (0.19.4) + thread_safe (0.3.6) + tilt (2.0.7) trollop (2.1.2) - twitter (5.15.0) - addressable (~> 2.3) + twitter (6.1.0) + addressable (~> 2.5) buftok (~> 0.2.0) - equalizer (= 0.0.10) - faraday (~> 0.9.0) - http (>= 0.4, < 0.10) + equalizer (= 0.0.11) + faraday (~> 0.11.0) + http (~> 2.1) http_parser.rb (~> 0.6.0) - json (~> 1.8) - memoizable (~> 0.4.0) - naught (~> 1.0) - simple_oauth (~> 0.3.0) + memoizable (~> 0.4.2) + naught (~> 1.1) + simple_oauth (~> 0.3.1) twitter-bootstrap-rails (2.2.8) actionpack (>= 3.1) execjs rails (>= 3.1) railties (>= 3.1) - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) + uglifier (3.2.0) + execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.1) - warden (1.2.4) + unf_ext (0.0.7.4) + warden (1.2.7) rack (>= 1.0) xml-simple (1.1.5) @@ -398,6 +447,7 @@ DEPENDENCIES carrierwave-mongoid coffee-rails devise + dotenv-rails fog geocoder jbuilder @@ -405,12 +455,13 @@ DEPENDENCIES koala less-rails mini_magick - mongoid - mongoid-observers + mongoid (= 4.0.2) + mongoid-observers (= 0.2.0) omniauth-facebook omniauth-twitter pry-byebug rails (= 4.2.5) + rails_12factor sass-rails simple_form spring @@ -420,4 +471,4 @@ DEPENDENCIES uglifier BUNDLED WITH - 1.11.2 + 1.14.6 diff --git a/README.md b/README.md index 5dd924f..9c06d06 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ ### 설치 * ruby 2.0 이상 * rails 4.0 +* mongoid 4.0.2 +* mongoid-observers 0.2.0 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1d39122..97e859b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -93,8 +93,8 @@