diff --git a/.idea/.generators b/.idea/.generators index 1618976..aa3c1a6 100644 --- a/.idea/.generators +++ b/.idea/.generators @@ -5,4 +5,4 @@ You are allowed to: 2. Remove generators 3. Add installed generators To add new installed generators automatically delete this file and reload the project. ---> +--> diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks index 36e25b9..6cb4d5a 100644 --- a/.idea/.rakeTasks +++ b/.idea/.rakeTasks @@ -4,4 +4,4 @@ You are allowed to: 1. Remove rake task 2. Add existing rake tasks To add existing rake tasks automatically delete this file and reload the project. ---> +--> diff --git a/.idea/guoren.iml b/.idea/guoren.iml index a421df4..fe47c83 100644 --- a/.idea/guoren.iml +++ b/.idea/guoren.iml @@ -10,6 +10,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58,56 +108,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -119,71 +119,72 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index 3803ed9..9d57d9d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,14 +1,4 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/Development__guoren.xml b/.idea/runConfigurations/Development__guoren.xml new file mode 100644 index 0000000..0585515 --- /dev/null +++ b/.idea/runConfigurations/Development__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Production__guoren.xml b/.idea/runConfigurations/Production__guoren.xml new file mode 100644 index 0000000..0d25565 --- /dev/null +++ b/.idea/runConfigurations/Production__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/spec__guoren.xml b/.idea/runConfigurations/spec__guoren.xml new file mode 100644 index 0000000..9dfd121 --- /dev/null +++ b/.idea/runConfigurations/spec__guoren.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/test__guoren.xml b/.idea/runConfigurations/test__guoren.xml new file mode 100644 index 0000000..ae53fc4 --- /dev/null +++ b/.idea/runConfigurations/test__guoren.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c0fd5a4..fb192a9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,10 @@ + + + + @@ -23,7 +27,7 @@ - + - + - - + + @@ -47,8 +51,18 @@ - - + + + + + + + + + + + + @@ -57,8 +71,8 @@ - - + + @@ -91,19 +105,10 @@ - - - - - - - - - - + @@ -120,14 +125,11 @@ + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -198,109 +265,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + project + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + @@ -314,36 +322,45 @@ - - + - + - - - - - + + + - - - + + - + - + + + + + + - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gemfile b/Gemfile index 67af890..f528dc7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' - +gem 'rake' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use sqlite3 as the database for Active Record @@ -25,6 +25,7 @@ gem 'jbuilder', '~> 2.5' # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' +gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt" # Use Capistrano for deployment # gem 'capistrano-rails', group: :development diff --git a/Gemfile.lock b/Gemfile.lock index 92c9ada..4a1d941 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,6 +40,8 @@ GEM tzinfo (~> 1.1) arel (7.1.4) bcrypt (3.1.11) + bcrypt (3.1.11-x64-mingw32) + bcrypt-ruby (3.0.1) builder (3.2.2) byebug (9.0.6) coffee-rails (4.2.1) @@ -54,6 +56,7 @@ GEM erubis (2.7.0) execjs (2.7.0) ffi (1.9.14) + ffi (1.9.14-x64-mingw32) globalid (0.3.7) activesupport (>= 4.1.0) i18n (0.7.0) @@ -81,6 +84,8 @@ GEM nio4r (1.2.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + nokogiri (1.6.8.1-x64-mingw32) + mini_portile2 (~> 2.1.0) puma (3.6.2) rack (2.0.1) rack-test (0.6.3) @@ -132,6 +137,7 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.12) + sqlite3 (1.3.12-x64-mingw32) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.5) @@ -140,6 +146,8 @@ GEM turbolinks-source (5.0.0) tzinfo (1.2.2) thread_safe (~> 0.1) + tzinfo-data (1.2016.10) + tzinfo (>= 1.0.0) uglifier (3.0.3) execjs (>= 0.3.0, < 3) web-console (3.4.0) @@ -153,9 +161,11 @@ GEM PLATFORMS ruby + x64-mingw32 DEPENDENCIES bcrypt (~> 3.1.7) + bcrypt-ruby (~> 3.0.0) byebug coffee-rails (~> 4.2) jbuilder (~> 2.5) @@ -163,6 +173,7 @@ DEPENDENCIES listen (~> 3.0.5) puma (~> 3.0) rails (~> 5.0.0, >= 5.0.0.1) + rake sass-rails (~> 5.0) spring spring-watcher-listen (~> 2.0.0) diff --git a/log/development.log b/log/development.log index fd796f5..c545a96 100644 --- a/log/development.log +++ b/log/development.log @@ -172204,3 +172204,112 @@ Processing by ChatController#notify as JSON Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.3ms) +Started GET "/" for 127.0.0.1 at 2016-12-25 16:28:26 +0800 + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" +Processing by LoginController#init as HTML + User Load (15.8ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT ? [["LIMIT", 1]] + Rendering login/init.html.erb within layouts/application + Rendered login/init.html.erb within layouts/application (15.6ms) + Rendered layouts/_title.html.erb (0.0ms) + Rendered layouts/_refer.html.erb (0.0ms) +Completed 200 OK in 141ms (Views: 85.1ms | ActiveRecord: 15.8ms) + + +Started POST "/login?method=post" for 127.0.0.1 at 2016-12-25 16:28:46 +0800 +Processing by LoginController#login as HTML + Parameters: {"utf8"=>"✓", "authenticity_token"=>"atWjLvzGoNsllKxsVGGQynvIDTvLNNWIETaJxpWEcyZdCEsn/9XZHrxIh037tcAvn6paDG/LFRXLqkMJktBpxA==", "email"=>"zhangyu@163.com", "password"=>"[FILTERED]", "method"=>"post"} + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "zhangyu@163.com"], ["LIMIT", 1]] +Redirected to http://localhost:3000/main +Completed 302 Found in 78ms (ActiveRecord: 0.0ms) + + +Started GET "/main" for 127.0.0.1 at 2016-12-25 16:28:46 +0800 +Processing by MainController#show as HTML + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "micro_posts" LIMIT ? OFFSET ?) subquery_for_count [["LIMIT", 20], ["OFFSET", 0]] + MicroPost Load (0.0ms) SELECT "micro_posts".* FROM "micro_posts" ORDER BY "micro_posts"."post_time" DESC LIMIT ? OFFSET ? [["LIMIT", 20], ["OFFSET", 0]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + Rendering main/main.html.erb within layouts/application + Rendered layouts/_nav.html.erb (0.0ms) + Rendered main/main.html.erb within layouts/application (0.0ms) + Rendered layouts/_title.html.erb (0.0ms) + Rendered layouts/_refer.html.erb (0.0ms) +Completed 200 OK in 109ms (Views: 56.8ms | ActiveRecord: 0.0ms) + + +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:28:47 +0800 +Processing by ChatController#notify as JSON + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] +Completed 200 OK in 16ms (Views: 0.2ms | ActiveRecord: 4.0ms) + + +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:28:57 +0800 +Processing by ChatController#notify as JSON + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] +Completed 200 OK in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) + + +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:30:05 +0800 +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:30:05 +0800 + ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" + ActiveRecord::SchemaMigration Load (15.6ms) SELECT "schema_migrations".* FROM "schema_migrations" +Processing by ChatController#notify as JSON +Processing by ChatController#notify as JSON +Started GET "/main" for 127.0.0.1 at 2016-12-25 16:30:05 +0800 +Processing by MainController#show as HTML + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "micro_posts" LIMIT ? OFFSET ?) subquery_for_count [["LIMIT", 20], ["OFFSET", 0]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] + MicroPost Load (0.0ms) SELECT "micro_posts".* FROM "micro_posts" ORDER BY "micro_posts"."post_time" DESC LIMIT ? OFFSET ? [["LIMIT", 20], ["OFFSET", 0]] +Completed 200 OK in 94ms (Views: 0.3ms | ActiveRecord: 0.0ms) + + +Completed 200 OK in 78ms (Views: 0.1ms | ActiveRecord: 0.0ms) + + + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:30:15 +0800 +Started GET "/comments?micropost_id=5" for 127.0.0.1 at 2016-12-25 16:30:15 +0800 + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]] +Processing by ChatController#notify as JSON + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] + CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +Completed 200 OK in 16ms (Views: 0.2ms | ActiveRecord: 0.0ms) + + + Rendering main/main.html.erb within layouts/application + Rendered layouts/_nav.html.erb (0.0ms) + Rendered main/main.html.erb within layouts/application (0.0ms) + Rendered layouts/_title.html.erb (0.0ms) + Rendered layouts/_refer.html.erb (0.0ms) +Completed 200 OK in 10282ms (Views: 43.3ms | ActiveRecord: 10001.0ms) + + +Processing by CommentsController#get as JSON + Parameters: {"micropost_id"=>"5"} + MicroPost Load (0.0ms) SELECT "micro_posts".* FROM "micro_posts" WHERE "micro_posts"."id" = ? LIMIT ? [["id", 5], ["LIMIT", 1]] + Comment Exists (0.0ms) SELECT 1 AS one FROM "comments" WHERE "comments"."micro_post_id" = ? LIMIT ? [["micro_post_id", 5], ["LIMIT", 1]] + Comment Load (0.0ms) SELECT "comments".* FROM "comments" WHERE "comments"."micro_post_id" = ? [["micro_post_id", 5]] + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +Completed 200 OK in 31ms (Views: 0.2ms | ActiveRecord: 0.0ms) + + +Started GET "/notify" for 127.0.0.1 at 2016-12-25 16:30:16 +0800 +Processing by ChatController#notify as JSON + User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]] +  (0.0ms) SELECT COUNT(*) FROM "messages" WHERE "messages"."recieve_user" = ? AND "messages"."readed" = ? [["recieve_user", 1], ["readed", false]] +Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.0ms) + +