├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── actors.coffee │ │ ├── application.js │ │ ├── cable.js │ │ ├── channels │ │ │ └── .keep │ │ ├── news.coffee │ │ ├── relationships.coffee │ │ ├── stars.coffee │ │ ├── users.coffee │ │ ├── videos.coffee │ │ └── welcome.coffee │ └── stylesheets │ │ ├── actors.scss │ │ ├── application.scss │ │ ├── base.scss │ │ ├── news.scss │ │ ├── relationships.scss │ │ ├── stars.scss │ │ ├── users.scss │ │ ├── videos.scss │ │ └── welcome.scss ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── actors_controller.rb │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ ├── news_controller.rb │ ├── relationships_controller.rb │ ├── stars_controller.rb │ ├── users_controller.rb │ ├── videos_controller.rb │ └── welcome_controller.rb ├── helpers │ ├── actors_helper.rb │ ├── application_helper.rb │ ├── flashes_helper.rb │ ├── news_helper.rb │ ├── relationships_helper.rb │ ├── stars_helper.rb │ ├── users_helper.rb │ ├── videos_helper.rb │ └── welcome_helper.rb ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── actor.rb │ ├── application_record.rb │ ├── concerns │ │ └── .keep │ ├── genre.rb │ ├── label.rb │ ├── news.rb │ ├── star.rb │ ├── user.rb │ └── video.rb └── views │ ├── actors │ ├── _chart.html.erb │ ├── _follow.html.erb │ ├── _follower.html.erb │ ├── _genres.html.erb │ ├── _unfollow.html.erb │ ├── index.html.erb │ └── show.html.erb │ ├── common │ ├── _flashes.html.erb │ ├── _footer.html.erb │ ├── _navbar.html.erb │ └── _search.html.erb │ ├── devise │ ├── confirmations │ │ └── new.html.erb │ ├── mailer │ │ ├── confirmation_instructions.html.erb │ │ ├── email_changed.html.erb │ │ ├── password_change.html.erb │ │ ├── reset_password_instructions.html.erb │ │ └── unlock_instructions.html.erb │ ├── passwords │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── registrations │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── shared │ │ └── _links.html.erb │ └── unlocks │ │ └── new.html.erb │ ├── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb │ ├── relationships │ ├── create.js.erb │ └── destroy.js.erb │ ├── stars │ └── index.html.erb │ ├── users │ ├── _recent.html.erb │ ├── feed.rss.builder │ ├── show.html.erb │ └── videos.html.erb │ ├── videos │ ├── _like.html.erb │ ├── _unlike.html.erb │ ├── fave.js.erb │ ├── index.html.erb │ ├── search.html.erb │ ├── show.html.erb │ └── unfave.js.erb │ └── welcome │ ├── index.html.erb │ └── rss.html.erb ├── bin ├── bundle ├── rails ├── rake ├── setup ├── spring └── update ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── new_framework_defaults.rb │ ├── session_store.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ └── en.yml ├── puma.rb ├── routes.rb ├── schedule.rb ├── secrets.yml └── spring.rb ├── db ├── migrate │ ├── 20170922091734_create_labels.rb │ ├── 20170922124028_create_actors.rb │ ├── 20170922124434_create_videos.rb │ ├── 20170923022344_create_genres.rb │ ├── 20170923031648_rename_actor_type.rb │ ├── 20170923053510_add_videos_actors_table.rb │ ├── 20170923053646_add_videos_genres_table.rb │ ├── 20170924132742_create_stars.rb │ ├── 20170928121704_add_img_to_actors.rb │ ├── 20170928122204_add_javbus_label_to_actors.rb │ ├── 20170928122658_remove_img_from_actors.rb │ ├── 20171030103803_devise_create_users.rb │ ├── 20171106072830_add_username_to_users.rb │ ├── 20171109091006_add_actors_and_users_table.rb │ ├── 20171117130144_create_users_videos.rb │ └── 20171120130511_create_news.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ ├── .keep │ ├── actor_crawler.rake │ ├── genre_crawler.rake │ ├── label_crawler.rake │ ├── star_crawler.rake │ └── video_crawler.rake ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── test ├── controllers │ ├── .keep │ ├── actors_controller_test.rb │ ├── news_controller_test.rb │ ├── relationships_controller_test.rb │ ├── stars_controller_test.rb │ ├── users_controller_test.rb │ ├── videos_controller_test.rb │ └── welcome_controller_test.rb ├── fixtures │ ├── .keep │ ├── actors.yml │ ├── files │ │ └── .keep │ ├── genres.yml │ ├── labels.yml │ ├── news.yml │ ├── stars.yml │ ├── users.yml │ └── videos.yml ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── actor_test.rb │ ├── genre_test.rb │ ├── label_test.rb │ ├── news_test.rb │ ├── star_test.rb │ ├── user_test.rb │ └── video_test.rb └── test_helper.rb ├── tmp └── .keep └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore Byebug command history file. 21 | .byebug_history 22 | 23 | *.out 24 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | git_source(:github) do |repo_name| 4 | repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 5 | "https://github.com/#{repo_name}.git" 6 | end 7 | 8 | 9 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 10 | gem 'rails', '~> 5.0.6' 11 | # Use sqlite3 as the database for Active Record 12 | # gem 'sqlite3' 13 | gem 'mysql2' 14 | # Use Puma as the app server 15 | gem 'puma', '~> 3.0' 16 | # Use SCSS for stylesheets 17 | gem 'sass-rails', '~> 5.0' 18 | # Use Uglifier as compressor for JavaScript assets 19 | gem 'uglifier', '>= 1.3.0' 20 | # Use CoffeeScript for .coffee assets and views 21 | gem 'coffee-rails', '~> 4.2' 22 | # See https://github.com/rails/execjs#readme for more supported runtimes 23 | # gem 'therubyracer', platforms: :ruby 24 | 25 | # Use jquery as the JavaScript library 26 | gem 'jquery-rails' 27 | # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 28 | gem 'turbolinks', '~> 5' 29 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 30 | gem 'jbuilder', '~> 2.5' 31 | # Use Redis adapter to run Action Cable in production 32 | # gem 'redis', '~> 3.0' 33 | # Use ActiveModel has_secure_password 34 | # gem 'bcrypt', '~> 3.1.7' 35 | 36 | # Use Capistrano for deployment 37 | # gem 'capistrano-rails', group: :development 38 | 39 | gem 'mechanize' 40 | gem 'whenever' 41 | gem 'grape' 42 | gem 'grape-entity' 43 | 44 | gem 'bootstrap-sass' 45 | gem 'bootswatch-rails' 46 | gem "font-awesome-rails" 47 | 48 | gem 'ransack' 49 | 50 | gem 'devise' 51 | 52 | # Char.js 53 | gem 'chart-js-rails' 54 | 55 | # 分页 56 | gem 'will_paginate-bootstrap' 57 | 58 | gem 'whenever', :require => false 59 | 60 | group :development, :test do 61 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 62 | gem 'byebug', platform: :mri 63 | end 64 | 65 | group :development do 66 | # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 67 | gem 'web-console', '>= 3.3.0' 68 | gem 'listen', '~> 3.0.5' 69 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 70 | gem 'spring' 71 | gem 'spring-watcher-listen', '~> 2.0.0' 72 | end 73 | 74 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 75 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 76 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (5.0.6) 5 | actionpack (= 5.0.6) 6 | nio4r (>= 1.2, < 3.0) 7 | websocket-driver (~> 0.6.1) 8 | actionmailer (5.0.6) 9 | actionpack (= 5.0.6) 10 | actionview (= 5.0.6) 11 | activejob (= 5.0.6) 12 | mail (~> 2.5, >= 2.5.4) 13 | rails-dom-testing (~> 2.0) 14 | actionpack (5.0.6) 15 | actionview (= 5.0.6) 16 | activesupport (= 5.0.6) 17 | rack (~> 2.0) 18 | rack-test (~> 0.6.3) 19 | rails-dom-testing (~> 2.0) 20 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 | actionview (5.0.6) 22 | activesupport (= 5.0.6) 23 | builder (~> 3.1) 24 | erubis (~> 2.7.0) 25 | rails-dom-testing (~> 2.0) 26 | rails-html-sanitizer (~> 1.0, >= 1.0.3) 27 | activejob (5.0.6) 28 | activesupport (= 5.0.6) 29 | globalid (>= 0.3.6) 30 | activemodel (5.0.6) 31 | activesupport (= 5.0.6) 32 | activerecord (5.0.6) 33 | activemodel (= 5.0.6) 34 | activesupport (= 5.0.6) 35 | arel (~> 7.0) 36 | activesupport (5.0.6) 37 | concurrent-ruby (~> 1.0, >= 1.0.2) 38 | i18n (~> 0.7) 39 | minitest (~> 5.1) 40 | tzinfo (~> 1.1) 41 | arel (7.1.4) 42 | autoprefixer-rails (7.1.0) 43 | execjs 44 | axiom-types (0.1.1) 45 | descendants_tracker (~> 0.0.4) 46 | ice_nine (~> 0.11.0) 47 | thread_safe (~> 0.3, >= 0.3.1) 48 | bcrypt (3.1.11) 49 | bindex (0.5.0) 50 | bootstrap-sass (3.3.7) 51 | autoprefixer-rails (>= 5.2.1) 52 | sass (>= 3.3.4) 53 | bootswatch-rails (3.3.5) 54 | railties (>= 3.1) 55 | builder (3.2.3) 56 | byebug (9.1.0) 57 | chart-js-rails (0.1.3) 58 | railties (> 3.1) 59 | chronic (0.10.2) 60 | coercible (1.0.0) 61 | descendants_tracker (~> 0.0.1) 62 | coffee-rails (4.2.2) 63 | coffee-script (>= 2.2.0) 64 | railties (>= 4.0.0) 65 | coffee-script (2.4.1) 66 | coffee-script-source 67 | execjs 68 | coffee-script-source (1.12.2) 69 | concurrent-ruby (1.0.5) 70 | descendants_tracker (0.0.4) 71 | thread_safe (~> 0.3, >= 0.3.1) 72 | devise (4.2.1) 73 | bcrypt (~> 3.0) 74 | orm_adapter (~> 0.1) 75 | railties (>= 4.1.0, < 5.1) 76 | responders 77 | warden (~> 1.2.3) 78 | domain_name (0.5.20170404) 79 | unf (>= 0.0.5, < 1.0.0) 80 | equalizer (0.0.11) 81 | erubis (2.7.0) 82 | execjs (2.7.0) 83 | ffi (1.9.18) 84 | font-awesome-rails (4.7.0.1) 85 | railties (>= 3.2, < 5.1) 86 | globalid (0.4.0) 87 | activesupport (>= 4.2.0) 88 | grape (1.0.1) 89 | activesupport 90 | builder 91 | mustermann-grape (~> 1.0.0) 92 | rack (>= 1.3.0) 93 | rack-accept 94 | virtus (>= 1.0.0) 95 | grape-entity (0.6.1) 96 | activesupport (>= 5.0.0) 97 | multi_json (>= 1.3.2) 98 | http-cookie (1.0.3) 99 | domain_name (~> 0.5) 100 | i18n (0.8.6) 101 | ice_nine (0.11.2) 102 | jbuilder (2.7.0) 103 | activesupport (>= 4.2.0) 104 | multi_json (>= 1.2) 105 | jquery-rails (4.3.1) 106 | rails-dom-testing (>= 1, < 3) 107 | railties (>= 4.2.0) 108 | thor (>= 0.14, < 2.0) 109 | listen (3.0.8) 110 | rb-fsevent (~> 0.9, >= 0.9.4) 111 | rb-inotify (~> 0.9, >= 0.9.7) 112 | loofah (2.0.3) 113 | nokogiri (>= 1.5.9) 114 | mail (2.6.6) 115 | mime-types (>= 1.16, < 4) 116 | mechanize (2.7.5) 117 | domain_name (~> 0.5, >= 0.5.1) 118 | http-cookie (~> 1.0) 119 | mime-types (>= 1.17.2) 120 | net-http-digest_auth (~> 1.1, >= 1.1.1) 121 | net-http-persistent (~> 2.5, >= 2.5.2) 122 | nokogiri (~> 1.6) 123 | ntlm-http (~> 0.1, >= 0.1.1) 124 | webrobots (>= 0.0.9, < 0.2) 125 | method_source (0.8.2) 126 | mime-types (3.1) 127 | mime-types-data (~> 3.2015) 128 | mime-types-data (3.2016.0521) 129 | mini_portile2 (2.3.0) 130 | minitest (5.10.3) 131 | multi_json (1.12.2) 132 | mustermann (1.0.1) 133 | mustermann-grape (1.0.0) 134 | mustermann (~> 1.0.0) 135 | mysql2 (0.4.9) 136 | net-http-digest_auth (1.4.1) 137 | net-http-persistent (2.9.4) 138 | nio4r (2.1.0) 139 | nokogiri (1.8.1) 140 | mini_portile2 (~> 2.3.0) 141 | ntlm-http (0.1.1) 142 | orm_adapter (0.5.0) 143 | polyamorous (1.3.1) 144 | activerecord (>= 3.0) 145 | puma (3.10.0) 146 | rack (2.0.3) 147 | rack-accept (0.4.5) 148 | rack (>= 0.4) 149 | rack-test (0.6.3) 150 | rack (>= 1.0) 151 | rails (5.0.6) 152 | actioncable (= 5.0.6) 153 | actionmailer (= 5.0.6) 154 | actionpack (= 5.0.6) 155 | actionview (= 5.0.6) 156 | activejob (= 5.0.6) 157 | activemodel (= 5.0.6) 158 | activerecord (= 5.0.6) 159 | activesupport (= 5.0.6) 160 | bundler (>= 1.3.0) 161 | railties (= 5.0.6) 162 | sprockets-rails (>= 2.0.0) 163 | rails-dom-testing (2.0.3) 164 | activesupport (>= 4.2.0) 165 | nokogiri (>= 1.6) 166 | rails-html-sanitizer (1.0.3) 167 | loofah (~> 2.0) 168 | railties (5.0.6) 169 | actionpack (= 5.0.6) 170 | activesupport (= 5.0.6) 171 | method_source 172 | rake (>= 0.8.7) 173 | thor (>= 0.18.1, < 2.0) 174 | rake (12.1.0) 175 | ransack (1.8.3) 176 | actionpack (>= 3.0) 177 | activerecord (>= 3.0) 178 | activesupport (>= 3.0) 179 | i18n 180 | polyamorous (~> 1.3) 181 | rb-fsevent (0.10.2) 182 | rb-inotify (0.9.10) 183 | ffi (>= 0.5.0, < 2) 184 | responders (2.4.0) 185 | actionpack (>= 4.2.0, < 5.3) 186 | railties (>= 4.2.0, < 5.3) 187 | sass (3.5.1) 188 | sass-listen (~> 4.0.0) 189 | sass-listen (4.0.0) 190 | rb-fsevent (~> 0.9, >= 0.9.4) 191 | rb-inotify (~> 0.9, >= 0.9.7) 192 | sass-rails (5.0.6) 193 | railties (>= 4.0.0, < 6) 194 | sass (~> 3.1) 195 | sprockets (>= 2.8, < 4.0) 196 | sprockets-rails (>= 2.0, < 4.0) 197 | tilt (>= 1.1, < 3) 198 | spring (2.0.2) 199 | activesupport (>= 4.2) 200 | spring-watcher-listen (2.0.1) 201 | listen (>= 2.7, < 4.0) 202 | spring (>= 1.2, < 3.0) 203 | sprockets (3.7.1) 204 | concurrent-ruby (~> 1.0) 205 | rack (> 1, < 3) 206 | sprockets-rails (3.2.1) 207 | actionpack (>= 4.0) 208 | activesupport (>= 4.0) 209 | sprockets (>= 3.0.0) 210 | thor (0.20.0) 211 | thread_safe (0.3.6) 212 | tilt (2.0.8) 213 | turbolinks (5.0.1) 214 | turbolinks-source (~> 5) 215 | turbolinks-source (5.0.3) 216 | tzinfo (1.2.3) 217 | thread_safe (~> 0.1) 218 | uglifier (3.2.0) 219 | execjs (>= 0.3.0, < 3) 220 | unf (0.1.4) 221 | unf_ext 222 | unf_ext (0.0.7.4) 223 | virtus (1.0.5) 224 | axiom-types (~> 0.1) 225 | coercible (~> 1.0) 226 | descendants_tracker (~> 0.0, >= 0.0.3) 227 | equalizer (~> 0.0, >= 0.0.9) 228 | warden (1.2.7) 229 | rack (>= 1.0) 230 | web-console (3.5.1) 231 | actionview (>= 5.0) 232 | activemodel (>= 5.0) 233 | bindex (>= 0.4.0) 234 | railties (>= 5.0) 235 | webrobots (0.1.2) 236 | websocket-driver (0.6.5) 237 | websocket-extensions (>= 0.1.0) 238 | websocket-extensions (0.1.2) 239 | whenever (0.9.7) 240 | chronic (>= 0.6.3) 241 | will_paginate (3.1.6) 242 | will_paginate-bootstrap (1.0.1) 243 | will_paginate (>= 3.0.3) 244 | 245 | PLATFORMS 246 | ruby 247 | 248 | DEPENDENCIES 249 | bootstrap-sass 250 | bootswatch-rails 251 | byebug 252 | chart-js-rails 253 | coffee-rails (~> 4.2) 254 | devise 255 | font-awesome-rails 256 | grape 257 | grape-entity 258 | jbuilder (~> 2.5) 259 | jquery-rails 260 | listen (~> 3.0.5) 261 | mechanize 262 | mysql2 263 | puma (~> 3.0) 264 | rails (~> 5.0.6) 265 | ransack 266 | sass-rails (~> 5.0) 267 | spring 268 | spring-watcher-listen (~> 2.0.0) 269 | turbolinks (~> 5) 270 | tzinfo-data 271 | uglifier (>= 1.3.0) 272 | web-console (>= 3.3.0) 273 | whenever 274 | will_paginate-bootstrap 275 | 276 | BUNDLED WITH 277 | 1.15.3 278 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 BronyS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AVDICT 2 | 3 | AVDICT => AV + Addict 一种优雅的方式创建你自己的AV数据库。 4 | 5 | ## 使用什么 6 | 7 | * Ruby - 程序员好朋友 8 | * Rails - 可靠 && 易用的web框架 9 | 10 | ## 数据来源 11 | 12 | 不同于手机用户常用的Javbus,AVDICT的数据来自于Javlibrary。 13 | 14 | ## 你需要做什么 15 | 16 | * 在你的服务器上快速部署 Ruby && Rails 环境 17 | * Clone this rails app 18 | * bundle install 19 | 20 | ## 如何生成数据库 21 | ```ruby 22 | # 查看相关命令 23 | rake --task 24 | 25 | rake crawler:genre 26 | rake crawler:actor 27 | rake crawler:label 28 | rake crawler:video 29 | ``` 30 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/actors.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. JavaScript code in this file should be added after the last require_* statement. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require bootstrap 17 | //= require Chart.min 18 | //= require_tree . 19 | -------------------------------------------------------------------------------- /app/assets/javascripts/cable.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the rails generate channel command. 3 | // 4 | //= require action_cable 5 | //= require_self 6 | //= require_tree ./channels 7 | 8 | (function() { 9 | this.App || (this.App = {}); 10 | 11 | App.cable = ActionCable.createConsumer(); 12 | 13 | }).call(this); 14 | -------------------------------------------------------------------------------- /app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/app/assets/javascripts/channels/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/news.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/relationships.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/stars.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/users.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/videos.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/actors.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the actors controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | #chart-wrapper { 5 | position: relative; 6 | width: 800px; 7 | height: 400px; 8 | } 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | 17 | // Example using 'Cerulean' bootswatch 18 | 19 | //Import bootstrap-sprockets 20 | @import "bootstrap-sprockets"; 21 | 22 | // Import cerulean variables 23 | @import "bootswatch/flatly/variables"; 24 | 25 | // Then bootstrap itself 26 | @import "bootstrap"; 27 | 28 | // Bootstrap body padding for fixed navbar 29 | body { padding-top: 70px; } 30 | 31 | // And finally bootswatch style itself 32 | @import "bootswatch/flatly/bootswatch"; 33 | 34 | // Whatever application styles you have go last 35 | @import "base"; 36 | 37 | // Add font-awesome-rails 38 | @import "font-awesome"; 39 | -------------------------------------------------------------------------------- /app/assets/stylesheets/base.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/app/assets/stylesheets/base.scss -------------------------------------------------------------------------------- /app/assets/stylesheets/news.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the news controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/relationships.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Relationships controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/stars.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the stars controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/videos.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the videos controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/actors_controller.rb: -------------------------------------------------------------------------------- 1 | class ActorsController < ApplicationController 2 | def index 3 | @actors = Actor.paginate(:page => params[:page], :per_page => 30) 4 | 5 | @q = Actor.ransack(params[:q]) 6 | @actor = @q.result(distinct: true) 7 | end 8 | 9 | def show 10 | @actor = Actor.find(params[:id]) 11 | end 12 | 13 | def output 14 | @actor = Actor.find(params[:id]) 15 | render :json => @actor.videos_dataset 16 | end 17 | 18 | def genres 19 | @actor = Actor.find(params[:id]) 20 | render :json => @actor.genres_dataset 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | before_action :configure_permitted_parameters, if: :devise_controller? 4 | 5 | 6 | protected 7 | def configure_permitted_parameters 8 | devise_parameter_sanitizer.permit :sign_up, keys: [:username, :email, :password] 9 | # devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :password, :current_password, :is_female, :date_of_birth) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/news_controller.rb: -------------------------------------------------------------------------------- 1 | class NewsController < ApplicationController 2 | def show 3 | 4 | end 5 | 6 | def create 7 | 8 | end 9 | 10 | def destroy 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/relationships_controller.rb: -------------------------------------------------------------------------------- 1 | class RelationshipsController < ApplicationController 2 | before_action :authenticate_user! 3 | 4 | def create 5 | @actor = Actor.find(params[:actor_id]) 6 | current_user.follow(@actor.id) 7 | respond_to do |format| 8 | format.html { redirect_to @actor } 9 | format.js 10 | end 11 | end 12 | 13 | def destroy 14 | @actor = Actor.find(params[:actor_id]) 15 | current_user.unfollow(@actor.id) 16 | respond_to do |format| 17 | format.html { redirect_to @actor } 18 | format.js 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/stars_controller.rb: -------------------------------------------------------------------------------- 1 | class StarsController < ApplicationController 2 | def index 3 | @stars = Star.all 4 | end 5 | 6 | def show 7 | @star = Star.find(params[:id]) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | def show 3 | @user = User.find(params[:id]) 4 | end 5 | 6 | def videos 7 | @user = current_user 8 | @videos = @user.videos 9 | end 10 | 11 | def feed 12 | @user = User.find(params[:id]) 13 | @videos = @user.recent_videos_without_actors 14 | respond_to do |format| 15 | format.html 16 | format.rss { render :layout => false } 17 | end 18 | 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/controllers/videos_controller.rb: -------------------------------------------------------------------------------- 1 | class VideosController < ApplicationController 2 | before_action :validate_search_key, only: [:index, :search] 3 | def index 4 | @videos = Video.paginate(:page => params[:page], :per_page => 30) 5 | end 6 | 7 | def show 8 | @video = Video.find(params[:id]) 9 | end 10 | 11 | def search 12 | if @query_string.present? 13 | @videos = search_params 14 | end 15 | end 16 | 17 | def fave 18 | @video = Video.find(params[:video_id]) 19 | current_user.fave_video(@video.id) 20 | respond_to do |format| 21 | format.html { redirect_to @video } 22 | format.js 23 | end 24 | end 25 | 26 | def unfave 27 | @video = Video.find(params[:video_id]) 28 | current_user.unfave_video(@video.id) 29 | respond_to do |format| 30 | format.html { redirect_to @video } 31 | format.js 32 | end 33 | end 34 | 35 | protected 36 | def validate_search_key 37 | @query_string = params[:q].gsub(/\\|\'|\/|\?/, "") if params[:q].present? 38 | end 39 | 40 | def search_params 41 | Video.ransack({:video_id_cont => @query_string}).result(distinct: true) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | # flash[:notice] = "早安!你好!" 4 | end 5 | 6 | def rss 7 | # Add rss controller here 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/helpers/actors_helper.rb: -------------------------------------------------------------------------------- 1 | module ActorsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/flashes_helper.rb: -------------------------------------------------------------------------------- 1 | module FlashesHelper 2 | FLASH_CLASSES = { alert: "danger", notice: "success", warning: "warning"}.freeze 3 | def flash_class(key) 4 | FLASH_CLASSES.fetch key.to_sym, key 5 | end 6 | def user_facing_flashes 7 | flash.to_hash.slice "alert", "notice","warning" 8 | end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /app/helpers/news_helper.rb: -------------------------------------------------------------------------------- 1 | module NewsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/relationships_helper.rb: -------------------------------------------------------------------------------- 1 | module RelationshipsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/stars_helper.rb: -------------------------------------------------------------------------------- 1 | module StarsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/videos_helper.rb: -------------------------------------------------------------------------------- 1 | module VideosHelper 2 | def format_video_name(str) 3 | str = str[0..-1] if str.size < 30 4 | str = str[0..30] + "···" if str.size >= 30 5 | str 6 | end 7 | 8 | def video_genres(video) 9 | genres = [] 10 | video.genres.each do |genre| 11 | genres << genre.name 12 | end 13 | genres 14 | end 15 | 16 | def video_rating_format(rating) 17 | return '0.0' if rating == '' 18 | rating 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/actor.rb: -------------------------------------------------------------------------------- 1 | class Actor < ApplicationRecord 2 | # Actor: actor_label should be unique 3 | validates :actor_label, uniqueness: true 4 | 5 | has_and_belongs_to_many :videos 6 | has_and_belongs_to_many :users, -> { distinct } 7 | 8 | def followers 9 | self.users.size 10 | end 11 | 12 | def first_year 13 | Time.new(self.videos.sort_by(&:release_date).first.release_date).year 14 | end 15 | 16 | def annual 17 | last_time = Time.new.year; annual_info = Hash.new 18 | self.first_year.upto(last_time) do |year| 19 | count = 0 20 | self.videos.map do |video| 21 | count += 1 if video.release_date[0..3] == year.to_s 22 | end 23 | annual_info[year] = count 24 | end 25 | 26 | annual_info 27 | end 28 | 29 | def videos_dataset 30 | info = self.annual; index_result = []; result = {} 31 | info.each { |index, value| index_result << index } 32 | result['labels'] = index_result; result['values'] = info.values 33 | result 34 | end 35 | 36 | def genres_dataset 37 | result = Hash.new; name = Array.new; json = Hash.new 38 | 39 | self.videos.each do |video| 40 | video.genres.each do |genre| 41 | result[genre.name] = 1 if result[genre.name] == nil 42 | result[genre.name] += 1 43 | end 44 | end 45 | 46 | result.each { |index, value| name << index } 47 | json['genres'] = name; json['values'] = result.values 48 | json 49 | end 50 | 51 | end 52 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/genre.rb: -------------------------------------------------------------------------------- 1 | class Genre < ApplicationRecord 2 | validates :name, uniqueness: true 3 | 4 | has_and_belongs_to_many :videos 5 | end 6 | -------------------------------------------------------------------------------- /app/models/label.rb: -------------------------------------------------------------------------------- 1 | class Label < ApplicationRecord 2 | validates :video_label, uniqueness: true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/news.rb: -------------------------------------------------------------------------------- 1 | class News < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /app/models/star.rb: -------------------------------------------------------------------------------- 1 | class Star < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable and :omniauthable 4 | devise :database_authenticatable, :registerable, 5 | :recoverable, :rememberable, :trackable, :validatable 6 | 7 | has_and_belongs_to_many :actors, -> { distinct } 8 | has_and_belongs_to_many :videos, -> { distinct } 9 | 10 | 11 | def follow(actor_id) 12 | self.actors << Actor.find(actor_id) unless self.actors.include?(Actor.find(actor_id)) 13 | end 14 | 15 | def unfollow(actor_id) 16 | self.actors.delete(Actor.find(actor_id)) if self.actors.include?(Actor.find(actor_id)) 17 | end 18 | 19 | def following?(other_actor) 20 | self.actors.include?(other_actor) 21 | end 22 | 23 | def recent_videos 24 | now = Time.new; time = now.to_s.split[0][0..-4] 25 | 26 | videos = [] 27 | self.actors.each do |actor| 28 | actor.videos.each do |video| 29 | videos << [actor.name, video] if video.release_date[0..-4] == time 30 | end 31 | end 32 | videos 33 | end 34 | 35 | def recent_videos_without_actors 36 | now = Time.new; time = now.to_s.split[0][0..-4] 37 | 38 | videos = [] 39 | self.actors.each do |actor| 40 | actor.videos.each do |video| 41 | videos << video if video.release_date[0..-4] == time 42 | end 43 | end 44 | videos.uniq 45 | end 46 | 47 | =begin 48 | def recent_videos_rss 49 | result = Array.new 50 | self.recent_videos_without_actors.each do |video| 51 | origin = Hash.new 52 | origin.store('ID', video.video_id) 53 | origin.store('NAME', video.video_name.gsub(video.video_id, '').strip) 54 | origin.store('RELEASE_DATE', video.release_date) 55 | origin.store('LENGTH', video.length) 56 | origin.store('MAKER', video.maker) 57 | end 58 | result 59 | end 60 | =end 61 | 62 | def fave_video(video_id) 63 | self.videos << Video.find(video_id) unless self.videos.include?(Video.find(video_id)) 64 | end 65 | 66 | def unfave_video(video_id) 67 | self.videos.delete(Video.find(video_id)) if self.videos.include?(Video.find(video_id)) 68 | end 69 | 70 | def genres_statistic 71 | result = Hash.new 72 | self.videos.each do |video| 73 | video.genres.each do |genre| 74 | result[genre.name] = 1 if result[genre.name] == nil 75 | result[genre.name] += 1 76 | end 77 | end 78 | result 79 | end 80 | 81 | end 82 | -------------------------------------------------------------------------------- /app/models/video.rb: -------------------------------------------------------------------------------- 1 | class Video < ApplicationRecord 2 | validates :video_id, uniqueness: true 3 | 4 | has_and_belongs_to_many :genres 5 | has_and_belongs_to_many :actors 6 | 7 | has_and_belongs_to_many :users, -> { distinct } 8 | 9 | 10 | def actors_string 11 | result = String.new 12 | self.actors.each do |actor| 13 | result << actor.name << " " 14 | end 15 | 16 | result.strip 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /app/views/actors/_chart.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
Annual Output
3 |
4 |
5 | 6 |
7 |
8 |
9 | 10 | 44 | -------------------------------------------------------------------------------- /app/views/actors/_follow.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= form_for current_user, :url => relationships_path, :html => {:method => :post}, :remote => true do |f| %> 3 |
<%= hidden_field_tag :actor_id, @actor.id %>
4 | <%= f.submit "Follow", class: "btn btn-primary btn-block" %> 5 | <% end %> 6 |
7 | -------------------------------------------------------------------------------- /app/views/actors/_follower.html.erb: -------------------------------------------------------------------------------- 1 | <%= @actor.followers %> Followers 2 | -------------------------------------------------------------------------------- /app/views/actors/_genres.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
Genres Statistics
3 |
4 |
5 | 6 |
7 |
8 |
9 | 10 | 42 | -------------------------------------------------------------------------------- /app/views/actors/_unfollow.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= form_for current_user, :url => relationships_path, :html => {:method => :delete}, :remote => true do |f| %> 3 |
<%= hidden_field_tag :actor_id, @actor.id %>
4 | <%= f.submit "Unfollow", class: "btn btn-secondary btn-block" %> 5 | <% end %> 6 |
7 | -------------------------------------------------------------------------------- /app/views/actors/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% @actors.each do |actor| %> 18 | 19 | 20 | 21 | 22 | 23 | 25 | <% end %> 26 | 27 |
#IDNameLabelType
#<%= link_to(actor.id, actor_path(actor)) %><%= actor.name %><%= actor.actor_label.upcase %><%= actor.actor_type %> 24 |
28 |
<%= will_paginate @actors, renderer: BootstrapPagination::Rails %>
29 |
30 | -------------------------------------------------------------------------------- /app/views/actors/show.html.erb: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | <% if @actor.javbus_label != nil %> 10 | 11 | <% end %> 12 |

<%= @actor.name %>

13 | <%= render 'follower' %> 14 | <% unless !current_user %> 15 |
16 | <% if current_user.following?(@actor) %> 17 | <%= render 'unfollow' %> 18 | <% else %> 19 | <%= render 'follow' %> 20 | <% end %> 21 |
22 | <% end %> 23 |
24 |

Information

25 |
26 |
27 | 40 |
41 |
42 |
43 |
44 | <% @actor.videos.order('release_date DESC').each do |video| %> 45 | <%= link_to video_path(video) do %> 46 | 47 | <% end %> 48 | <% end %> 49 |
50 |
51 | 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | <% @actor.videos.order("release_date DESC").each do |video| %> 65 | 66 | 67 | 68 | 69 | 70 | 71 | <% end %> 72 | 73 |
#IDRelease DateRating
#<%= link_to(video.video_id, video_path(video)) %><%= video.release_date %><%= video.rating %>
74 |
75 | 79 | 82 |
83 |
84 |
85 | -------------------------------------------------------------------------------- /app/views/common/_flashes.html.erb: -------------------------------------------------------------------------------- 1 | <% if flash.any? %> 2 | <% user_facing_flashes.each do |key, value| %> 3 |
4 | 5 | <%= value %> 6 |
7 | <% end %> 8 | <% end %> 9 | -------------------------------------------------------------------------------- /app/views/common/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /app/views/common/_navbar.html.erb: -------------------------------------------------------------------------------- 1 | 60 | -------------------------------------------------------------------------------- /app/views/common/_search.html.erb: -------------------------------------------------------------------------------- 1 | 7 | 15 | -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend confirmation instructions

2 | 3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> 9 |
10 | 11 |
12 | <%= f.submit "Resend confirmation instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome <%= @email %>!

2 | 3 |

You can confirm your account email through the link below:

4 | 5 |

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/email_changed.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @email %>!

2 | 3 | <% if @resource.try(:unconfirmed_email?) %> 4 |

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

5 | <% else %> 6 |

We're contacting you to notify you that your email has been changed to <%= @resource.email %>.

7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

We're contacting you to notify you that your password has been changed.

4 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Someone has requested a link to change your password. You can do this through the link below.

4 | 5 |

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

6 | 7 |

If you didn't request this, please ignore this email.

8 |

Your password won't change until you access the link above and create a new one.

9 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

Hello <%= @resource.email %>!

2 | 3 |

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

4 | 5 |

Click the link below to unlock your account:

6 | 7 |

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

8 | -------------------------------------------------------------------------------- /app/views/devise/passwords/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Change your password

2 | 3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> 4 | <%= devise_error_messages! %> 5 | <%= f.hidden_field :reset_password_token %> 6 | 7 |
8 | <%= f.label :password, "New password" %>
9 | <% if @minimum_password_length %> 10 | (<%= @minimum_password_length %> characters minimum)
11 | <% end %> 12 | <%= f.password_field :password, autofocus: true, autocomplete: "off" %> 13 |
14 | 15 |
16 | <%= f.label :password_confirmation, "Confirm new password" %>
17 | <%= f.password_field :password_confirmation, autocomplete: "off" %> 18 |
19 | 20 |
21 | <%= f.submit "Change my password" %> 22 |
23 | <% end %> 24 | 25 | <%= render "devise/shared/links" %> 26 | -------------------------------------------------------------------------------- /app/views/devise/passwords/new.html.erb: -------------------------------------------------------------------------------- 1 |

Forgot your password?

2 | 3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %> 9 |
10 | 11 |
12 | <%= f.submit "Send me reset password instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/devise/registrations/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Edit <%= resource_name.to_s.humanize %>

4 | 5 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> 6 | <%= devise_error_messages! %> 7 | 8 |
9 | <%= f.label :email %>
10 | <%= f.email_field :email, autofocus: true, class: "form-control" %> 11 |
12 | 13 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> 14 |
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
15 | <% end %> 16 | 17 |
18 | <%= f.label :password %> (leave blank if you don't want to change it)
19 | <%= f.password_field :password, autocomplete: "off", class: "form-control" %> 20 | <% if @minimum_password_length %> 21 |
22 | <%= @minimum_password_length %> characters minimum 23 | <% end %> 24 |
25 | 26 |
27 | <%= f.label :password_confirmation %>
28 | <%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control" %> 29 |
30 | 31 |
32 | <%= f.label :current_password %> (we need your current password to confirm your changes)
33 | <%= f.password_field :current_password, autocomplete: "off", class: "form-control" %> 34 |
35 | 36 |
37 | <%= f.submit "Update", class: "btn btn-primary" %> 38 |
39 | <% end %> 40 | 41 |

Cancel my account

42 | 43 |

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "form-control" %>

44 | 45 | <%= link_to "Back", :back %> 46 |
47 |
48 | -------------------------------------------------------------------------------- /app/views/devise/registrations/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | 41 |
42 |
43 | -------------------------------------------------------------------------------- /app/views/devise/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | 34 | <%= render "devise/shared/links" %> 35 |
36 |
37 | -------------------------------------------------------------------------------- /app/views/devise/shared/_links.html.erb: -------------------------------------------------------------------------------- 1 | <%- if controller_name != 'sessions' %> 2 | 3 | <% end -%> 4 | 5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %> 6 | 7 | <% end -%> 8 | 9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> 10 | 11 | <% end -%> 12 | 13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> 14 | 15 | <% end -%> 16 | 17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> 18 | 19 | <% end -%> 20 | 21 | <%- if devise_mapping.omniauthable? %> 22 | <%- resource_class.omniauth_providers.each do |provider| %> 23 | 24 | <% end -%> 25 | <% end -%> 26 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= devise_error_messages! %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %> 9 |
10 | 11 |
12 | <%= f.submit "Resend unlock instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AVDICT 5 | 6 | <%= csrf_meta_tags %> 7 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 8 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 9 | 10 | 11 |
12 | <%= render "common/navbar" %> 13 |
14 |
15 | <%= render "common/flashes" %> 16 | <%= yield %> 17 |
18 | 19 | 20 |
21 | 22 | <%= render "common/footer" %> 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/relationships/create.js.erb: -------------------------------------------------------------------------------- 1 | $("#follow_form").html("<%= escape_javascript(render('actors/unfollow')) %>"); 2 | $("#followers").html('<%= @actor.followers %>'); 3 | -------------------------------------------------------------------------------- /app/views/relationships/destroy.js.erb: -------------------------------------------------------------------------------- 1 | $("#follow_form").html("<%= escape_javascript(render('actors/follow')) %>"); 2 | $("#followers").html('<%= @actor.followers %>'); 3 | -------------------------------------------------------------------------------- /app/views/stars/index.html.erb: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 |

Stars page

8 |
9 |

Source: <%= link_to 'Javlibray', 'http://www.ja14b.com/cn/star_mostfav.php' %>

10 |

Last update time: <%= @stars[0].updated_at %>

11 |
12 | 13 | 21 | -------------------------------------------------------------------------------- /app/views/users/_recent.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <% @user.recent_videos.each do |array| %> 12 | <% video = array[1] %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | <% end %> 20 | 21 |
#IDActorRelease Date
<%= video.id %><%= video.video_id %><%= array[0] %><%= video.release_date %>
22 | -------------------------------------------------------------------------------- /app/views/users/feed.rss.builder: -------------------------------------------------------------------------------- 1 | xml.instruct! :xml, :version => "1.0" 2 | xml.rss :version => "2.0" do 3 | xml.channel do 4 | xml.title "Videos" 5 | xml.description "User " + @user.username 6 | xml.link "http://www.syhdaily.com" 7 | 8 | @videos.each do |video| 9 | xml.item do 10 | xml.title video.video_name 11 | xml.description video.actors_string 12 | xml.pubDate video.created_at.to_s(:rfc822) 13 | xml.link video_url(video) 14 | xml.guid video_url(video) 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/views/users/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 9 | 10 |
11 | 12 |

Warning!

13 |

Best check yo self, vel scelerisque nisl consectetur et.

14 |
15 | 16 |
17 |
Recent Videos
18 |
19 | <%= render 'recent' %> 20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | 40 |

Following

41 |
    42 | <% @user.actors.each do |actor| %> 43 |
  • 44 | <%= link_to actor.name, actor_path(Actor.where('actor_label = ?', actor.actor_label).first.id) %> 45 |
  • 46 | <% end %> 47 |
48 | 49 |
50 | 51 |
52 |
53 | -------------------------------------------------------------------------------- /app/views/users/videos.html.erb: -------------------------------------------------------------------------------- 1 |

Liked Video List

2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | <% @videos.each do |video| %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | <% end %> 21 | 22 |
#IDNameRelease Date
<%= video.id %><%= link_to video.video_id, video_path(video) %><%= format_video_name(video.video_name) %><%= video.release_date %>
23 | -------------------------------------------------------------------------------- /app/views/videos/_like.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= form_for current_user, :url => fave_videos_path, :html => {:method => :post}, :remote => true do |f| %> 3 |
<%= hidden_field_tag :video_id, @video.id %>
4 | <%= f.submit "Like it!", class: "btn btn-primary btn-lg" %> 5 | <% end %> 6 |
7 | -------------------------------------------------------------------------------- /app/views/videos/_unlike.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= form_for current_user, :url => unfave_videos_path, :html => {:method => :delete}, :remote => true do |f| %> 3 |
<%= hidden_field_tag :video_id, @video.id %>
4 | <%= f.submit "Unlike", class: "btn btn-secondary btn-lg" %> 5 | <% end %> 6 |
7 | -------------------------------------------------------------------------------- /app/views/videos/fave.js.erb: -------------------------------------------------------------------------------- 1 | $("#like_form").html("<%= escape_javascript(render('videos/unlike')) %>"); 2 | -------------------------------------------------------------------------------- /app/views/videos/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% @videos.each do |video| %> 16 | 17 | 18 | 19 | 20 | 21 | <% end %> 22 | 23 |
#IDName
#<%= link_to(video.video_id, video_path(video)) %><%= format_video_name(video.video_name) %>
24 |
<%= will_paginate @videos, renderer: BootstrapPagination::Rails %>
25 |
26 | -------------------------------------------------------------------------------- /app/views/videos/search.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <% @videos.order("release_date DESC").each do |video| %> 12 | 13 | 14 | 15 | 16 | 17 | <% end %> 18 | 19 |
#IDName
#<%= link_to(video.video_id, video_path(video)) %><%= format_video_name(video.video_name) %>
20 |
21 | -------------------------------------------------------------------------------- /app/views/videos/show.html.erb: -------------------------------------------------------------------------------- 1 | 5 |
6 | <% video_genres(@video).each do |genre| %> 7 | <%= genre %> 8 | <% end %> 9 |

<%= @video.video_id %>

10 |

<%= @video.video_name %>

11 |
12 | 13 |
14 |
15 | <% if current_user %> 16 |

<%= render 'like' %>

17 | <% end %> 18 |
19 |

Actors

20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | <% @video.actors.each do |actor| %> 31 | 32 | 33 | 34 | 35 | 36 | 37 | <% end %> 38 | 39 |
#IDNAMELABEL
#<%= actor.id %><%= link_to actor.name, actor_path(actor) %><%= actor.actor_label.upcase %>
40 |
41 |

Video Info

42 |
43 |
44 |
45 |
Release Date
46 |
47 | <%= @video.release_date %> 48 |
49 |
50 |
51 | 52 |
53 |
54 |
Maker
55 |
56 | <%= @video.maker %> 57 |
58 |
59 |
60 | 61 |
62 |
63 |
Length
64 |
65 | <%= @video.length %> 66 |
67 |
68 |
69 | 70 |
71 |
72 |
Director
73 |
74 | <%= @video.director %> 75 |
76 |
77 |
78 | 79 |
80 |
81 |
Rating
82 |
83 | <%= video_rating_format(@video.rating) %> 84 |
85 |
86 |
87 | 88 |
89 |
90 |
Lable
91 |
92 | <%= @video.label %> 93 |
94 |
95 |
96 | 97 |
98 | -------------------------------------------------------------------------------- /app/views/videos/unfave.js.erb: -------------------------------------------------------------------------------- 1 | $("#like_form").html("<%= escape_javascript(render('videos/like')) %>"); 2 | -------------------------------------------------------------------------------- /app/views/welcome/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

Avdict

3 |

The platform for JAV addicts. Elegant way to explore the av and share your thoughts.

4 |

5 |

6 | 7 | <%= fa_icon "diamond" %> Project here 8 | 9 |

10 |
11 | -------------------------------------------------------------------------------- /app/views/welcome/rss.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

AVDICT RSS SUPPORT PAGE

3 |
4 |
5 | 6 |
7 |

8 | Avdict provides RSS service(Avdict RSS) to save your time. 9 |

10 |

11 | AVDICT RSS feeds can, for example, allow you to keep track of many different actors in a single RSS aggregator. 12 | AVDICT use RSS feeds to publish frequently updated information, such as new release videos or the actor who were newly added in the actor list. 13 |

14 |

15 | You can also customize your own RSS feeds by Follow some actors in AVDICT. The customized feeds publish your following's recent published videos. 16 |

17 |
18 |

19 | AVDICT 提供多个高效的 RSS 服务 20 |

21 |

22 | AVDICT RSS 服务可以做到很多功能, 例如它可以让你在一个新闻聚合器中同时追踪多个你喜欢的演员。 23 | 同时它利用 RSS 服务去发布一定频率更新的信息, 例如最新的影片和刚加入演员列表的新演员。 24 |

25 |

26 | 当然你可以自己定制你的个性 RSS 源, 定制这个源你只需要在 AVDICT 里 Follow 你喜欢的演员, 个性的 RSS 源将会发布你追踪的演员最近的影片。 27 |

28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | <% if current_user %> 39 | 40 | 41 | 42 | 43 | <% end %> 44 | 45 |
RSS NameRSS Link
The customized RSS<%= link_to 'Customized RSS', user_path(current_user) + '/feed' %>
46 | 47 |
48 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a starting point to setup your application. 15 | # Add necessary setup steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | # puts "\n== Copying sample files ==" 22 | # unless File.exist?('config/database.yml') 23 | # cp 'config/database.yml.sample', 'config/database.yml' 24 | # end 25 | 26 | puts "\n== Preparing database ==" 27 | system! 'bin/rails db:setup' 28 | 29 | puts "\n== Removing old logs and tempfiles ==" 30 | system! 'bin/rails log:clear tmp:clear' 31 | 32 | puts "\n== Restarting application server ==" 33 | system! 'bin/rails restart' 34 | end 35 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a way to update your development environment automatically. 15 | # Add necessary update steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | puts "\n== Updating database ==" 22 | system! 'bin/rails db:migrate' 23 | 24 | puts "\n== Removing old logs and tempfiles ==" 25 | system! 'bin/rails log:clear tmp:clear' 26 | 27 | puts "\n== Restarting application server ==" 28 | system! 'bin/rails restart' 29 | end 30 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module JavLibraryRails 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Define ENV['url'] for this crawler, default javlibrary url. 16 | $JAVLIBRARY_URL = "http://www.ja14b.com" 17 | 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: mysql2 3 | encoding: utf8 4 | pool: 5 5 | username: root 6 | password: grys003 7 | socket: /var/run/mysqld/mysqld.sock 8 | 9 | development: 10 | <<: *default 11 | database: jav_development 12 | 13 | # Warning: The database defined as "test" will be erased and 14 | # re-generated from your development database when you run "rake". 15 | # Do not set this db to the same as development or production. 16 | test: 17 | <<: *default 18 | database: jav_test 19 | 20 | # As with config/secrets.yml, you never want to store sensitive information, 21 | # like your database password, in your source code. If your source code is 22 | # ever seen by anyone, they now have access to your database. 23 | # 24 | # Instead, provide the password as a unix environment variable when you boot 25 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 26 | # for a full rundown on how to provide these environment variables in a 27 | # production deployment. 28 | # 29 | # On Heroku and other platform providers, you may have a full connection URL 30 | # available as an environment variable. For example: 31 | # 32 | # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" 33 | # 34 | # You can use this database configuration with: 35 | # 36 | # production: 37 | # url: <%= ENV['DATABASE_URL'] %> 38 | # 39 | production: 40 | <<: *default 41 | database: jav_production 42 | username: syhsyh9696 43 | password: <%= ENV['UJN-WECHAT-API_DATABASE_PASSWORD'] %> 44 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports. 13 | config.consider_all_requests_local = true 14 | 15 | # Enable/disable caching. By default caching is disabled. 16 | if Rails.root.join('tmp/caching-dev.txt').exist? 17 | config.action_controller.perform_caching = true 18 | 19 | config.cache_store = :memory_store 20 | config.public_file_server.headers = { 21 | 'Cache-Control' => 'public, max-age=172800' 22 | } 23 | else 24 | config.action_controller.perform_caching = false 25 | 26 | config.cache_store = :null_store 27 | end 28 | 29 | # Don't care if the mailer can't send. 30 | config.action_mailer.raise_delivery_errors = false 31 | 32 | config.action_mailer.perform_caching = false 33 | 34 | # Print deprecation notices to the Rails logger. 35 | config.active_support.deprecation = :log 36 | 37 | # Raise an error on page load if there are pending migrations. 38 | config.active_record.migration_error = :page_load 39 | 40 | # Debug mode disables concatenation and preprocessing of assets. 41 | # This option may cause significant delays in view rendering with a large 42 | # number of complex assets. 43 | config.assets.debug = true 44 | 45 | # Suppress logger output for asset requests. 46 | config.assets.quiet = true 47 | 48 | # Raises error for missing translations 49 | # config.action_view.raise_on_missing_translations = true 50 | 51 | # Use an evented file watcher to asynchronously detect changes in source code, 52 | # routes, locales, etc. This feature depends on the listen gem. 53 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 54 | 55 | # Devise supported 56 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 57 | end 58 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Disable serving static files from the `/public` folder by default since 18 | # Apache or NGINX already handles this. 19 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 20 | 21 | # Compress JavaScripts and CSS. 22 | config.assets.js_compressor = :uglifier 23 | # config.assets.css_compressor = :sass 24 | 25 | # Do not fallback to assets pipeline if a precompiled asset is missed. 26 | config.assets.compile = false 27 | 28 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 29 | 30 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 31 | # config.action_controller.asset_host = 'http://assets.example.com' 32 | 33 | # Specifies the header that your server uses for sending files. 34 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 35 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 36 | 37 | # Mount Action Cable outside main process or domain 38 | # config.action_cable.mount_path = nil 39 | # config.action_cable.url = 'wss://example.com/cable' 40 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Use the lowest log level to ensure availability of diagnostic information 46 | # when problems arise. 47 | config.log_level = :debug 48 | 49 | # Prepend all log lines with the following tags. 50 | config.log_tags = [ :request_id ] 51 | 52 | # Use a different cache store in production. 53 | # config.cache_store = :mem_cache_store 54 | 55 | # Use a real queuing backend for Active Job (and separate queues per environment) 56 | # config.active_job.queue_adapter = :resque 57 | # config.active_job.queue_name_prefix = "jav-library-rails_#{Rails.env}" 58 | config.action_mailer.perform_caching = false 59 | 60 | # Ignore bad email addresses and do not raise email delivery errors. 61 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 62 | # config.action_mailer.raise_delivery_errors = false 63 | 64 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 65 | # the I18n.default_locale when a translation cannot be found). 66 | config.i18n.fallbacks = true 67 | 68 | # Send deprecation notices to registered listeners. 69 | config.active_support.deprecation = :notify 70 | 71 | # Use default logging formatter so that PID and timestamp are not suppressed. 72 | config.log_formatter = ::Logger::Formatter.new 73 | 74 | # Use a different logger for distributed setups. 75 | # require 'syslog/logger' 76 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 77 | 78 | if ENV["RAILS_LOG_TO_STDOUT"].present? 79 | logger = ActiveSupport::Logger.new(STDOUT) 80 | logger.formatter = config.log_formatter 81 | config.logger = ActiveSupport::TaggedLogging.new(logger) 82 | end 83 | 84 | # Do not dump schema after migrations. 85 | config.active_record.dump_schema_after_migration = false 86 | end 87 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure public file server for tests with Cache-Control for performance. 16 | config.public_file_server.enabled = true 17 | config.public_file_server.headers = { 18 | 'Cache-Control' => 'public, max-age=3600' 19 | } 20 | 21 | # Show full error reports and disable caching. 22 | config.consider_all_requests_local = true 23 | config.action_controller.perform_caching = false 24 | 25 | # Raise exceptions instead of rendering exception templates. 26 | config.action_dispatch.show_exceptions = false 27 | 28 | # Disable request forgery protection in test environment. 29 | config.action_controller.allow_forgery_protection = false 30 | config.action_mailer.perform_caching = false 31 | 32 | # Tell Action Mailer not to deliver emails to the real world. 33 | # The :test delivery method accumulates sent emails in the 34 | # ActionMailer::Base.deliveries array. 35 | config.action_mailer.delivery_method = :test 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | # Use this hook to configure devise mailer, warden hooks and so forth. 2 | # Many of these configuration options can be set straight in your model. 3 | Devise.setup do |config| 4 | # The secret key used by Devise. Devise uses this key to generate 5 | # random tokens. Changing this key will render invalid all existing 6 | # confirmation, reset password and unlock tokens in the database. 7 | # Devise will use the `secret_key_base` as its `secret_key` 8 | # by default. You can change it below and use your own secret key. 9 | # config.secret_key = '6d1fe484990b049ff97e3c76b3c3a79e915abaebedf2809f6d38145b511df6bcfbe4177280ee5498f33545709f4e1e16cf7ff8d0bf1129774def95d3b803ef8b' 10 | 11 | # ==> Mailer Configuration 12 | # Configure the e-mail address which will be shown in Devise::Mailer, 13 | # note that it will be overwritten if you use your own mailer class 14 | # with default "from" parameter. 15 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' 16 | 17 | # Configure the class responsible to send e-mails. 18 | # config.mailer = 'Devise::Mailer' 19 | 20 | # Configure the parent class responsible to send e-mails. 21 | # config.parent_mailer = 'ActionMailer::Base' 22 | 23 | # ==> ORM configuration 24 | # Load and configure the ORM. Supports :active_record (default) and 25 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 26 | # available as additional gems. 27 | require 'devise/orm/active_record' 28 | 29 | # ==> Configuration for any authentication mechanism 30 | # Configure which keys are used when authenticating a user. The default is 31 | # just :email. You can configure it to use [:username, :subdomain], so for 32 | # authenticating a user, both parameters are required. Remember that those 33 | # parameters are used only when authenticating and not when retrieving from 34 | # session. If you need permissions, you should implement that in a before filter. 35 | # You can also supply a hash where the value is a boolean determining whether 36 | # or not authentication should be aborted when the value is not present. 37 | # config.authentication_keys = [:email] 38 | # config.authentication_keys = [:username, :email] 39 | 40 | # Configure parameters from the request object used for authentication. Each entry 41 | # given should be a request method and it will automatically be passed to the 42 | # find_for_authentication method and considered in your model lookup. For instance, 43 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. 44 | # The same considerations mentioned for authentication_keys also apply to request_keys. 45 | # config.request_keys = [] 46 | 47 | # Configure which authentication keys should be case-insensitive. 48 | # These keys will be downcased upon creating or modifying a user and when used 49 | # to authenticate or find a user. Default is :email. 50 | config.case_insensitive_keys = [:email] 51 | 52 | # Configure which authentication keys should have whitespace stripped. 53 | # These keys will have whitespace before and after removed upon creating or 54 | # modifying a user and when used to authenticate or find a user. Default is :email. 55 | config.strip_whitespace_keys = [:email] 56 | 57 | # Tell if authentication through request.params is enabled. True by default. 58 | # It can be set to an array that will enable params authentication only for the 59 | # given strategies, for example, `config.params_authenticatable = [:database]` will 60 | # enable it only for database (email + password) authentication. 61 | # config.params_authenticatable = true 62 | 63 | # Tell if authentication through HTTP Auth is enabled. False by default. 64 | # It can be set to an array that will enable http authentication only for the 65 | # given strategies, for example, `config.http_authenticatable = [:database]` will 66 | # enable it only for database authentication. The supported strategies are: 67 | # :database = Support basic authentication with authentication key + password 68 | # config.http_authenticatable = false 69 | 70 | # If 401 status code should be returned for AJAX requests. True by default. 71 | # config.http_authenticatable_on_xhr = true 72 | 73 | # The realm used in Http Basic Authentication. 'Application' by default. 74 | # config.http_authentication_realm = 'Application' 75 | 76 | # It will change confirmation, password recovery and other workflows 77 | # to behave the same regardless if the e-mail provided was right or wrong. 78 | # Does not affect registerable. 79 | # config.paranoid = true 80 | 81 | # By default Devise will store the user in session. You can skip storage for 82 | # particular strategies by setting this option. 83 | # Notice that if you are skipping storage for all authentication paths, you 84 | # may want to disable generating routes to Devise's sessions controller by 85 | # passing skip: :sessions to `devise_for` in your config/routes.rb 86 | config.skip_session_storage = [:http_auth] 87 | 88 | # By default, Devise cleans up the CSRF token on authentication to 89 | # avoid CSRF token fixation attacks. This means that, when using AJAX 90 | # requests for sign in and sign up, you need to get a new CSRF token 91 | # from the server. You can disable this option at your own risk. 92 | # config.clean_up_csrf_token_on_authentication = true 93 | 94 | # When false, Devise will not attempt to reload routes on eager load. 95 | # This can reduce the time taken to boot the app but if your application 96 | # requires the Devise mappings to be loaded during boot time the application 97 | # won't boot properly. 98 | # config.reload_routes = true 99 | 100 | # ==> Configuration for :database_authenticatable 101 | # For bcrypt, this is the cost for hashing the password and defaults to 11. If 102 | # using other algorithms, it sets how many times you want the password to be hashed. 103 | # 104 | # Limiting the stretches to just one in testing will increase the performance of 105 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use 106 | # a value less than 10 in other environments. Note that, for bcrypt (the default 107 | # algorithm), the cost increases exponentially with the number of stretches (e.g. 108 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). 109 | config.stretches = Rails.env.test? ? 1 : 11 110 | 111 | # Set up a pepper to generate the hashed password. 112 | # config.pepper = '78404a287d6fec652be5f501d4567f3ddbf6abfbc322bc347165bf83ad8fd2f66d9d6373f61973cc1bd76158852bd36248b72b296f433f4f93eeb7b29622fbb8' 113 | 114 | # Send a notification to the original email when the user's email is changed. 115 | # config.send_email_changed_notification = false 116 | 117 | # Send a notification email when the user's password is changed. 118 | # config.send_password_change_notification = false 119 | 120 | # ==> Configuration for :confirmable 121 | # A period that the user is allowed to access the website even without 122 | # confirming their account. For instance, if set to 2.days, the user will be 123 | # able to access the website for two days without confirming their account, 124 | # access will be blocked just in the third day. Default is 0.days, meaning 125 | # the user cannot access the website without confirming their account. 126 | # config.allow_unconfirmed_access_for = 2.days 127 | 128 | # A period that the user is allowed to confirm their account before their 129 | # token becomes invalid. For example, if set to 3.days, the user can confirm 130 | # their account within 3 days after the mail was sent, but on the fourth day 131 | # their account can't be confirmed with the token any more. 132 | # Default is nil, meaning there is no restriction on how long a user can take 133 | # before confirming their account. 134 | # config.confirm_within = 3.days 135 | 136 | # If true, requires any email changes to be confirmed (exactly the same way as 137 | # initial account confirmation) to be applied. Requires additional unconfirmed_email 138 | # db field (see migrations). Until confirmed, new email is stored in 139 | # unconfirmed_email column, and copied to email column on successful confirmation. 140 | config.reconfirmable = true 141 | 142 | # Defines which key will be used when confirming an account 143 | # config.confirmation_keys = [:email] 144 | 145 | # ==> Configuration for :rememberable 146 | # The time the user will be remembered without asking for credentials again. 147 | # config.remember_for = 2.weeks 148 | 149 | # Invalidates all the remember me tokens when the user signs out. 150 | config.expire_all_remember_me_on_sign_out = true 151 | 152 | # If true, extends the user's remember period when remembered via cookie. 153 | # config.extend_remember_period = false 154 | 155 | # Options to be passed to the created cookie. For instance, you can set 156 | # secure: true in order to force SSL only cookies. 157 | # config.rememberable_options = {} 158 | 159 | # ==> Configuration for :validatable 160 | # Range for password length. 161 | config.password_length = 6..128 162 | 163 | # Email regex used to validate email formats. It simply asserts that 164 | # one (and only one) @ exists in the given string. This is mainly 165 | # to give user feedback and not to assert the e-mail validity. 166 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ 167 | 168 | # ==> Configuration for :timeoutable 169 | # The time you want to timeout the user session without activity. After this 170 | # time the user will be asked for credentials again. Default is 30 minutes. 171 | # config.timeout_in = 30.minutes 172 | 173 | # ==> Configuration for :lockable 174 | # Defines which strategy will be used to lock an account. 175 | # :failed_attempts = Locks an account after a number of failed attempts to sign in. 176 | # :none = No lock strategy. You should handle locking by yourself. 177 | # config.lock_strategy = :failed_attempts 178 | 179 | # Defines which key will be used when locking and unlocking an account 180 | # config.unlock_keys = [:email] 181 | 182 | # Defines which strategy will be used to unlock an account. 183 | # :email = Sends an unlock link to the user email 184 | # :time = Re-enables login after a certain amount of time (see :unlock_in below) 185 | # :both = Enables both strategies 186 | # :none = No unlock strategy. You should handle unlocking by yourself. 187 | # config.unlock_strategy = :both 188 | 189 | # Number of authentication tries before locking an account if lock_strategy 190 | # is failed attempts. 191 | # config.maximum_attempts = 20 192 | 193 | # Time interval to unlock the account if :time is enabled as unlock_strategy. 194 | # config.unlock_in = 1.hour 195 | 196 | # Warn on the last attempt before the account is locked. 197 | # config.last_attempt_warning = true 198 | 199 | # ==> Configuration for :recoverable 200 | # 201 | # Defines which key will be used when recovering the password for an account 202 | # config.reset_password_keys = [:email] 203 | 204 | # Time interval you can reset your password with a reset password key. 205 | # Don't put a too small interval or your users won't have the time to 206 | # change their passwords. 207 | config.reset_password_within = 6.hours 208 | 209 | # When set to false, does not sign a user in automatically after their password is 210 | # reset. Defaults to true, so a user is signed in automatically after a reset. 211 | # config.sign_in_after_reset_password = true 212 | 213 | # ==> Configuration for :encryptable 214 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default). 215 | # You can use :sha1, :sha512 or algorithms from others authentication tools as 216 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20 217 | # for default behavior) and :restful_authentication_sha1 (then you should set 218 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper). 219 | # 220 | # Require the `devise-encryptable` gem when using anything other than bcrypt 221 | # config.encryptor = :sha512 222 | 223 | # ==> Scopes configuration 224 | # Turn scoped views on. Before rendering "sessions/new", it will first check for 225 | # "users/sessions/new". It's turned off by default because it's slower if you 226 | # are using only default views. 227 | # config.scoped_views = false 228 | config.scoped_views = true 229 | 230 | # Configure the default scope given to Warden. By default it's the first 231 | # devise role declared in your routes (usually :user). 232 | # config.default_scope = :user 233 | 234 | # Set this configuration to false if you want /users/sign_out to sign out 235 | # only the current scope. By default, Devise signs out all scopes. 236 | # config.sign_out_all_scopes = true 237 | 238 | # ==> Navigation configuration 239 | # Lists the formats that should be treated as navigational. Formats like 240 | # :html, should redirect to the sign in page when the user does not have 241 | # access, but formats like :xml or :json, should return 401. 242 | # 243 | # If you have any extra navigational formats, like :iphone or :mobile, you 244 | # should add them to the navigational formats lists. 245 | # 246 | # The "*/*" below is required to match Internet Explorer requests. 247 | # config.navigational_formats = ['*/*', :html] 248 | 249 | # The default HTTP method used to sign out a resource. Default is :delete. 250 | config.sign_out_via = :delete 251 | 252 | # ==> OmniAuth 253 | # Add a new OmniAuth provider. Check the wiki for more information on setting 254 | # up on your models and hooks. 255 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' 256 | 257 | # ==> Warden configuration 258 | # If you want to use other strategies, that are not supported by Devise, or 259 | # change the failure app, you can configure them inside the config.warden block. 260 | # 261 | # config.warden do |manager| 262 | # manager.intercept_401 = false 263 | # manager.default_strategies(scope: :user).unshift :some_external_strategy 264 | # end 265 | 266 | # ==> Mountable engine configurations 267 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine 268 | # is mountable, there are some extra configurations to be taken into account. 269 | # The following options are available, assuming the engine is mounted as: 270 | # 271 | # mount MyEngine, at: '/my_engine' 272 | # 273 | # The router that invoked `devise_for`, in the example above, would be: 274 | # config.router_name = :my_engine 275 | # 276 | # When using OmniAuth, Devise cannot automatically set OmniAuth path, 277 | # so you need to do it manually. For the users scope, it would be: 278 | # config.omniauth_path_prefix = '/my_engine/users/auth' 279 | end 280 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/new_framework_defaults.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains migration options to ease your Rails 5.0 upgrade. 4 | # 5 | # Read the Guide for Upgrading Ruby on Rails for more info on each option. 6 | 7 | Rails.application.config.action_controller.raise_on_unfiltered_parameters = true 8 | 9 | # Enable per-form CSRF tokens. Previous versions had false. 10 | Rails.application.config.action_controller.per_form_csrf_tokens = true 11 | 12 | # Enable origin-checking CSRF mitigation. Previous versions had false. 13 | Rails.application.config.action_controller.forgery_protection_origin_check = true 14 | 15 | # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. 16 | # Previous versions had false. 17 | ActiveSupport.to_time_preserves_timezone = true 18 | 19 | # Require `belongs_to` associations by default. Previous versions had false. 20 | Rails.application.config.active_record.belongs_to_required_by_default = true 21 | 22 | # Do not halt callback chains when a callback returns false. Previous versions had true. 23 | ActiveSupport.halt_callback_chains_on_return_false = false 24 | 25 | # Configure SSL options to enable HSTS with subdomains. Previous versions had false. 26 | Rails.application.config.ssl_options = { hsts: { subdomains: true } } 27 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_jav-library-rails_session' 4 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your email address has been successfully confirmed." 7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." 8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid %{authentication_keys} or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account is locked." 15 | not_found_in_database: "Invalid %{authentication_keys} or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your email address before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock instructions" 26 | email_changed: 27 | subject: "Email Changed" 28 | password_change: 29 | subject: "Password Changed" 30 | omniauth_callbacks: 31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 32 | success: "Successfully authenticated from %{kind} account." 33 | passwords: 34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." 35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." 36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." 37 | updated: "Your password has been changed successfully. You are now signed in." 38 | updated_not_active: "Your password has been changed successfully." 39 | registrations: 40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." 41 | signed_up: "Welcome! You have signed up successfully." 42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." 45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." 46 | updated: "Your account has been updated successfully." 47 | sessions: 48 | signed_in: "Signed in successfully." 49 | signed_out: "Signed out successfully." 50 | already_signed_out: "Signed out successfully." 51 | unlocks: 52 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." 53 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." 54 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 55 | errors: 56 | messages: 57 | already_confirmed: "was already confirmed, please try signing in" 58 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 59 | expired: "has expired, please request a new one" 60 | not_found: "not found" 61 | not_locked: "was not locked" 62 | not_saved: 63 | one: "1 error prohibited this %{resource} from being saved:" 64 | other: "%{count} errors prohibited this %{resource} from being saved:" 65 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum, this matches the default thread size of Active Record. 6 | # 7 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i 8 | threads threads_count, threads_count 9 | 10 | # Specifies the `port` that Puma will listen on to receive requests, default is 3000. 11 | # 12 | port ENV.fetch("PORT") { 3000 } 13 | 14 | # Specifies the `environment` that Puma will run in. 15 | # 16 | environment ENV.fetch("RAILS_ENV") { "development" } 17 | 18 | # Specifies the number of `workers` to boot in clustered mode. 19 | # Workers are forked webserver processes. If using threads and workers together 20 | # the concurrency of the application would be max `threads` * `workers`. 21 | # Workers do not work on JRuby or Windows (both of which do not support 22 | # processes). 23 | # 24 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 25 | 26 | # Use the `preload_app!` method when specifying a `workers` number. 27 | # This directive tells Puma to first boot the application and load code 28 | # before forking the application. This takes advantage of Copy On Write 29 | # process behavior so workers use less memory. If you use this option 30 | # you need to make sure to reconnect any threads in the `on_worker_boot` 31 | # block. 32 | # 33 | # preload_app! 34 | 35 | # The code in the `on_worker_boot` will be called if you are using 36 | # clustered mode by specifying a number of `workers`. After each worker 37 | # process is booted this block will be run, if you are using `preload_app!` 38 | # option you will want to use this block to reconnect to any threads 39 | # or connections that may have been created at application boot, Ruby 40 | # cannot share connections between processes. 41 | # 42 | # on_worker_boot do 43 | # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) 44 | # end 45 | 46 | # Allow puma to be restarted by `rails restart` command. 47 | plugin :tmp_restart 48 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | devise_for :users 3 | # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 4 | resources :videos, only:[:index, :show] do 5 | collection do 6 | get :search 7 | post :fave 8 | delete :unfave 9 | end 10 | end 11 | 12 | resources :actors, only:[:index, :show] do 13 | member do 14 | get 'output' 15 | get 'genres' 16 | end 17 | end 18 | 19 | resources :stars, only:[:index, :show] 20 | 21 | resources :users do 22 | collection do 23 | get 'videos' 24 | end 25 | 26 | member do 27 | get 'feed', format: 'rss' 28 | end 29 | end 30 | 31 | resource :news 32 | 33 | resource :relationships, only:[:create, :destroy] 34 | 35 | root 'welcome#index' 36 | get '/rss', to: 'welcome#rss' 37 | end 38 | -------------------------------------------------------------------------------- /config/schedule.rb: -------------------------------------------------------------------------------- 1 | # Use this file to easily define all of your cron jobs. 2 | # 3 | # It's helpful, but not entirely necessary to understand cron before proceeding. 4 | # http://en.wikipedia.org/wiki/Cron 5 | 6 | # Example: 7 | # 8 | # set :output, "/path/to/my/cron_log.log" 9 | # 10 | # every 2.hours do 11 | # command "/usr/bin/some_great_command" 12 | # runner "MyModel.some_method" 13 | # rake "some:great:rake:task" 14 | # end 15 | # 16 | # every 4.days do 17 | # runner "AnotherModel.prune_old_records" 18 | # end 19 | 20 | # Learn more: http://github.com/javan/whenever 21 | set :environment, "development" 22 | set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"} 23 | 24 | every :day, :at => '01:00am' do 25 | rake "crawler:star" 26 | rake "crawler:actor" 27 | rake "crawler:labels_update_release" 28 | rake "crawler:video" 29 | end 30 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rails secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: a83225bcf5e1c46a0cb428827280d913274d7ec9e4a903f73081a60218ddd617595acb0f3604c93ea8a6a94a0164ef5a40c4d56b1386794efd9f800062a0879b 15 | 16 | test: 17 | secret_key_base: 198475e27dd4212af6dcce8fab2ebe74489c678de2767618a6c98c61579e82d65f9c1344dfba9f37217caca9e762729321de818dbc1c83fa70551d8dfe478149 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /db/migrate/20170922091734_create_labels.rb: -------------------------------------------------------------------------------- 1 | class CreateLabels < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :labels do |t| 4 | t.string :video_label 5 | t.boolean :downloaded 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170922124028_create_actors.rb: -------------------------------------------------------------------------------- 1 | class CreateActors < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :actors do |t| 4 | t.string :name 5 | t.string :actor_label 6 | t.string :type 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170922124434_create_videos.rb: -------------------------------------------------------------------------------- 1 | class CreateVideos < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :videos do |t| 4 | t.string :video_id 5 | t.string :video_name 6 | t.string :release_date 7 | t.string :length 8 | t.string :director 9 | t.string :maker 10 | t.string :label 11 | t.string :rating 12 | t.string :img 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20170923022344_create_genres.rb: -------------------------------------------------------------------------------- 1 | class CreateGenres < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :genres do |t| 4 | t.string :name 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170923031648_rename_actor_type.rb: -------------------------------------------------------------------------------- 1 | class RenameActorType < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :actors, :type, :actor_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170923053510_add_videos_actors_table.rb: -------------------------------------------------------------------------------- 1 | class AddVideosActorsTable < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :actors_videos, id: false do |t| 4 | t.belongs_to :video, index: true 5 | t.belongs_to :actor, index: true 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170923053646_add_videos_genres_table.rb: -------------------------------------------------------------------------------- 1 | class AddVideosGenresTable < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :genres_videos, id: false do |t| 4 | t.belongs_to :video, index: true 5 | t.belongs_to :genre, index: true 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20170924132742_create_stars.rb: -------------------------------------------------------------------------------- 1 | class CreateStars < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :stars do |t| 4 | t.string :name 5 | t.string :rank 6 | t.string :img 7 | t.string :actor_label 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20170928121704_add_img_to_actors.rb: -------------------------------------------------------------------------------- 1 | class AddImgToActors < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :actors, :img, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170928122204_add_javbus_label_to_actors.rb: -------------------------------------------------------------------------------- 1 | class AddJavbusLabelToActors < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :actors, :javbus_label, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170928122658_remove_img_from_actors.rb: -------------------------------------------------------------------------------- 1 | class RemoveImgFromActors < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :actors, :img 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20171030103803_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | class DeviseCreateUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :users do |t| 4 | ## Database authenticatable 5 | t.string :email, null: false, default: "" 6 | t.string :encrypted_password, null: false, default: "" 7 | 8 | ## Recoverable 9 | t.string :reset_password_token 10 | t.datetime :reset_password_sent_at 11 | 12 | ## Rememberable 13 | t.datetime :remember_created_at 14 | 15 | ## Trackable 16 | t.integer :sign_in_count, default: 0, null: false 17 | t.datetime :current_sign_in_at 18 | t.datetime :last_sign_in_at 19 | t.string :current_sign_in_ip 20 | t.string :last_sign_in_ip 21 | 22 | ## Confirmable 23 | # t.string :confirmation_token 24 | # t.datetime :confirmed_at 25 | # t.datetime :confirmation_sent_at 26 | # t.string :unconfirmed_email # Only if using reconfirmable 27 | 28 | ## Lockable 29 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 30 | # t.string :unlock_token # Only if unlock strategy is :email or :both 31 | # t.datetime :locked_at 32 | 33 | 34 | t.timestamps null: false 35 | end 36 | 37 | add_index :users, :email, unique: true 38 | add_index :users, :reset_password_token, unique: true 39 | # add_index :users, :confirmation_token, unique: true 40 | # add_index :users, :unlock_token, unique: true 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /db/migrate/20171106072830_add_username_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddUsernameToUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :users, :username, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20171109091006_add_actors_and_users_table.rb: -------------------------------------------------------------------------------- 1 | class AddActorsAndUsersTable < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :actors_users do |t| 4 | t.belongs_to :actor, index: true 5 | t.belongs_to :user, index: true 6 | 7 | t.timestamps 8 | end 9 | 10 | add_index :actors_users, [:actor_id, :user_id], unique: true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20171117130144_create_users_videos.rb: -------------------------------------------------------------------------------- 1 | class CreateUsersVideos < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :users_videos do |t| 4 | t.belongs_to :user, index: true 5 | t.belongs_to :video, index: true 6 | end 7 | 8 | add_index :users_videos, [:user_id, :video_id], unique: true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20171120130511_create_news.rb: -------------------------------------------------------------------------------- 1 | class CreateNews < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :news do |t| 4 | t.string :title 5 | t.text :content 6 | t.string :publisher 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 20171120130511) do 14 | 15 | create_table "actors", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 16 | t.string "name" 17 | t.string "actor_label" 18 | t.string "actor_type" 19 | t.datetime "created_at", null: false 20 | t.datetime "updated_at", null: false 21 | t.string "javbus_label" 22 | end 23 | 24 | create_table "actors_users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 25 | t.integer "actor_id" 26 | t.integer "user_id" 27 | t.datetime "created_at", null: false 28 | t.datetime "updated_at", null: false 29 | t.index ["actor_id", "user_id"], name: "index_actors_users_on_actor_id_and_user_id", unique: true, using: :btree 30 | t.index ["actor_id"], name: "index_actors_users_on_actor_id", using: :btree 31 | t.index ["user_id"], name: "index_actors_users_on_user_id", using: :btree 32 | end 33 | 34 | create_table "actors_videos", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 35 | t.integer "video_id" 36 | t.integer "actor_id" 37 | t.index ["actor_id"], name: "index_actors_videos_on_actor_id", using: :btree 38 | t.index ["video_id"], name: "index_actors_videos_on_video_id", using: :btree 39 | end 40 | 41 | create_table "genres", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 42 | t.string "name" 43 | t.datetime "created_at", null: false 44 | t.datetime "updated_at", null: false 45 | end 46 | 47 | create_table "genres_videos", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 48 | t.integer "video_id" 49 | t.integer "genre_id" 50 | t.index ["genre_id"], name: "index_genres_videos_on_genre_id", using: :btree 51 | t.index ["video_id"], name: "index_genres_videos_on_video_id", using: :btree 52 | end 53 | 54 | create_table "labels", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 55 | t.string "video_label" 56 | t.boolean "downloaded" 57 | t.datetime "created_at", null: false 58 | t.datetime "updated_at", null: false 59 | end 60 | 61 | create_table "news", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 62 | t.string "title" 63 | t.text "content", limit: 65535 64 | t.string "publisher" 65 | t.datetime "created_at", null: false 66 | t.datetime "updated_at", null: false 67 | end 68 | 69 | create_table "relationships", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 70 | t.integer "follower_id" 71 | t.integer "followed_id" 72 | t.datetime "created_at", null: false 73 | t.datetime "updated_at", null: false 74 | t.index ["followed_id"], name: "index_relationships_on_followed_id", using: :btree 75 | t.index ["follower_id", "followed_id"], name: "index_relationships_on_follower_id_and_followed_id", unique: true, using: :btree 76 | t.index ["follower_id"], name: "index_relationships_on_follower_id", using: :btree 77 | end 78 | 79 | create_table "stars", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 80 | t.string "name" 81 | t.string "rank" 82 | t.string "img" 83 | t.string "actor_label" 84 | t.datetime "created_at", null: false 85 | t.datetime "updated_at", null: false 86 | end 87 | 88 | create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 89 | t.string "email", default: "", null: false 90 | t.string "encrypted_password", default: "", null: false 91 | t.string "reset_password_token" 92 | t.datetime "reset_password_sent_at" 93 | t.datetime "remember_created_at" 94 | t.integer "sign_in_count", default: 0, null: false 95 | t.datetime "current_sign_in_at" 96 | t.datetime "last_sign_in_at" 97 | t.string "current_sign_in_ip" 98 | t.string "last_sign_in_ip" 99 | t.datetime "created_at", null: false 100 | t.datetime "updated_at", null: false 101 | t.string "username" 102 | t.index ["email"], name: "index_users_on_email", unique: true, using: :btree 103 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree 104 | end 105 | 106 | create_table "users_videos", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 107 | t.integer "user_id" 108 | t.integer "video_id" 109 | t.index ["user_id", "video_id"], name: "index_users_videos_on_user_id_and_video_id", unique: true, using: :btree 110 | t.index ["user_id"], name: "index_users_videos_on_user_id", using: :btree 111 | t.index ["video_id"], name: "index_users_videos_on_video_id", using: :btree 112 | end 113 | 114 | create_table "videos", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| 115 | t.string "video_id" 116 | t.string "video_name" 117 | t.string "release_date" 118 | t.string "length" 119 | t.string "director" 120 | t.string "maker" 121 | t.string "label" 122 | t.string "rating" 123 | t.string "img" 124 | t.datetime "created_at", null: false 125 | t.datetime "updated_at", null: false 126 | end 127 | 128 | end 129 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/lib/tasks/.keep -------------------------------------------------------------------------------- /lib/tasks/actor_crawler.rake: -------------------------------------------------------------------------------- 1 | namespace :crawler do 2 | desc 'Download all actors' 3 | task :actor => :environment do 4 | get_all_actors() 5 | end 6 | 7 | desc 'Get all javbus actors labels' 8 | task :javbus_label => :environment do 9 | get_all_actors_label_from_javbus() 10 | end 11 | 12 | desc 'Format all javbus labels(remove "nowprinting.gif")' 13 | task :javbus_label_format => :environment do 14 | format_javbus_labels() 15 | end 16 | end 17 | 18 | # --- Method --- 19 | def get_all_actors 20 | firsturl = "#{$JAVLIBRARY_URL}/cn/star_list.php?prefix=" 21 | 22 | 'A'.upto('Z') do |alphabet| 23 | response = Mechanize.new 24 | tempurl = firsturl + alphabet 25 | response.get tempurl 26 | 27 | doc = Nokogiri::HTML(response.page.body) 28 | last_page = author_page_num(doc) 29 | 30 | 1.upto(last_page) do |page_num| 31 | temp_page_url = tempurl + "&page=#{page_num.to_s}" 32 | response.get temp_page_url 33 | 34 | doc_page = Nokogiri::HTML(response.page.body) 35 | doc_page.search('//div[@class="starbox"]/div[@class="searchitem"]/a').each do |row| 36 | # row.text Actor.name 37 | # row['href'].split("=")[-1] Actor.label 38 | name = row.text; label = row['href'].split("=")[-1] 39 | actor = Actor.new 40 | actor.name = name 41 | actor.actor_label = label 42 | actor.actor_type = alphabet 43 | actor.save 44 | end 45 | end 46 | end 47 | end 48 | 49 | def author_page_num(nokogiri_doc) 50 | last_page = 1 51 | nokogiri_doc.search('//div[@class="page_selector"]/a[@class="page last"]').each do |row| 52 | last_page = row['href'].split("=")[-1].to_i 53 | end 54 | last_page 55 | end 56 | 57 | # Max page https://www.javbus2.pw/actresses/717 58 | JAVBUS_MAX_PAGE = 717 59 | 60 | def get_all_actors_label_from_javbus 61 | page = Mechanize.new 62 | firsturl = "https://www.javbus2.pw/actresses/" 63 | #1.upto(JAVBUS_MAX_PAGE).each do |num| 64 | 1.upto(JAVBUS_MAX_PAGE).each do |num| 65 | url = firsturl + num.to_s 66 | doc = Nokogiri::HTML(page.get(url).body) 67 | doc.search('//div[@id="waterfall"]/div/a/div[1]/img').each do |item| 68 | label = item.attributes['src'].value.split('/')[-1].split('_')[0] 69 | name = item.attributes['title'].value.split('(')[0].strip 70 | 71 | next if label == "nowprinting.gif" 72 | 73 | actor = Actor.where('name = ?', name).first 74 | next if actor == nil 75 | 76 | actor.javbus_label = label 77 | actor.save 78 | end 79 | end 80 | end 81 | 82 | def format_javbus_labels 83 | Actor.all.each do |actor| 84 | if actor.javbus_label == "nowprinting.gif" 85 | actor.javbus_label = nil 86 | actor.save 87 | end 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /lib/tasks/genre_crawler.rake: -------------------------------------------------------------------------------- 1 | namespace :crawler do 2 | desc 'Download all genres' 3 | task :genre => :environment do 4 | get_all_genres() 5 | end 6 | end 7 | 8 | # --- Method --- 9 | 10 | def get_all_genres 11 | response = Mechanize.new; genres = Array.new 12 | response.get "#{$JAVLIBRARY_URL}/cn/genres.php" 13 | 14 | Nokogiri::HTML(response.page.body).search('//div[@class="genreitem"]/a').each do |row| 15 | genres << row.children.text 16 | end 17 | genres.uniq 18 | 19 | genres.each do |item| 20 | genre = Genre.new; genre.name = item; genre.save 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/tasks/label_crawler.rake: -------------------------------------------------------------------------------- 1 | namespace :crawler do 2 | desc 'Download all video labels' 3 | task :label => :environment do 4 | create() 5 | end 6 | 7 | desc 'Update all video labels' 8 | task :label_update => :environment do 9 | update() 10 | end 11 | 12 | desc 'Update all new release labels' 13 | task :labels_update_release => :environment do 14 | update_new_release() 15 | end 16 | end 17 | 18 | # --- Method --- 19 | def download_actor_videos_label(actor_id, method) 20 | firsturl = "#{$JAVLIBRARY_URL}/cn/vl_star.php?s=#{actor_id}" 21 | baseurl = "#{$JAVLIBRARY_URL}/cn/vl_star.php?list&mode=2&s=#{actor_id}&page=" 22 | response = Mechanize.new do |agent| 23 | # Set timeout preference here 24 | agent.open_timeout = 3 25 | agent.read_timeout = 3 26 | end 27 | 28 | begin 29 | response.get firsturl 30 | rescue 31 | return nil 32 | end 33 | 34 | doc = Nokogiri::HTML(response.page.body) 35 | 36 | # Judge method here(:update, :create) 37 | last_page = 1 38 | last_page = 1 if method == :update 39 | if method == :create 40 | doc.search('//div[@class="page_selector"]/a[@class="page last"]').each do |row| 41 | last_page = row['href'].split("=")[-1].to_i 42 | end 43 | end 44 | 45 | 1.upto(last_page) do |page| 46 | tempurl = baseurl + page.to_s 47 | begin 48 | response.get tempurl 49 | rescue 50 | next 51 | end 52 | 53 | Nokogiri::HTML(response.page.body).search('//div[@class="video"]/a').each do |row| 54 | # Data: 55 | # Video_label: row['href'].split("=")[-1] 56 | # Video_title: row['title'] 57 | 58 | label = Label.new 59 | label.video_label = row['href'].split("=")[-1] 60 | label.downloaded = false 61 | label.save 62 | end 63 | end 64 | 65 | end 66 | 67 | def create 68 | actors = Actor.all 69 | actors.each do |actor| 70 | download_actor_videos_label(actor.actor_label, :create) 71 | end 72 | end 73 | 74 | def update 75 | actors = Actor.all 76 | actors.each do |actor| 77 | download_actor_videos_label(actor.actor_label, :update) 78 | end 79 | end 80 | 81 | def update_new_release 82 | baseurl = "#{$JAVLIBRARY_URL}/cn/vl_newrelease.php?list&mode=2&page=" 83 | response = Mechanize.new do |agent| 84 | # Set timeout preference here 85 | agent.open_timeout = 3 86 | agent.read_timeout = 3 87 | end 88 | 89 | 1.upto(new_release_max_page()).each do |page| 90 | begin 91 | response.get(baseurl + page.to_s) 92 | rescue 93 | retry 94 | end 95 | 96 | Nokogiri::HTML(response.page.body).search('//div[@class="video"]/a').each do |row| 97 | # Data: 98 | # Video_label: row['href'].split("=")[-1] 99 | # Video_title: row['title'] 100 | 101 | label = Label.new 102 | label.video_label = row['href'].split("=")[-1] 103 | label.downloaded = false 104 | label.save 105 | end 106 | end 107 | 108 | end 109 | 110 | def new_release_max_page 111 | baseurl = "#{$JAVLIBRARY_URL}/cn/vl_newrelease.php?list&mode=2&page=" 112 | response = Mechanize.new do |agent| 113 | # Set timeout preference here 114 | agent.open_timeout = 3 115 | agent.read_timeout = 3 116 | end 117 | 118 | 1.upto(20).each do |page| 119 | begin 120 | response.get(baseurl + page.to_s) 121 | rescue 122 | retry 123 | end 124 | doc = Nokogiri::HTML(response.page.body) 125 | label = doc.search('//div[@class="video"]/a')[0]['href'].split("=")[-1] 126 | 127 | return page - 1 if Label.where("video_label = ?", label).first != nil 128 | end # Upto page end 129 | end # Method end 130 | -------------------------------------------------------------------------------- /lib/tasks/star_crawler.rake: -------------------------------------------------------------------------------- 1 | namespace :crawler do 2 | desc 'Download all stars' 3 | task :star => :environment do 4 | Star.delete_all 5 | get_all_stars() 6 | end 7 | end 8 | 9 | # --- Method --- 10 | def get_all_stars 11 | url = "#{$JAVLIBRARY_URL}/cn/star_mostfav.php" 12 | 13 | response = Mechanize.new do |agent| 14 | # Set timeout preference here 15 | agent.open_timeout = 5 16 | agent.read_timeout = 5 17 | end 18 | response.get url 19 | 20 | doc = Nokogiri::HTML(response.page.body.gsub(/( |\s)+/, " ")) 21 | doc.search("//div[@class='starbox']/div[@class='searchitem']").each do |item| 22 | star = Star.new 23 | star.id = item.search("./h3").text[1..2].to_i 24 | star.rank = item.search("./h3").text[1..2].to_i 25 | star.img = item.search("./table/tr/td/img")[0].attributes['src'].value 26 | star.name = item.search("./table/tr/td/img")[0].attributes['title'].value 27 | star.actor_label = item.search("./a")[0].attributes['href'].value.split('=')[-1] 28 | star.save 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/tasks/video_crawler.rake: -------------------------------------------------------------------------------- 1 | namespace :crawler do 2 | desc 'Download all videos' 3 | task :video => :environment do 4 | Label.where('downloaded = ?', 0).each do |label| 5 | next if label.downloaded? 6 | sign = video_downloader(label.video_label, label.id) 7 | 8 | next if sign == 0 9 | 10 | if sign 11 | label.downloaded = true 12 | label.save 13 | else 14 | label.destroy 15 | end 16 | end 17 | end 18 | 19 | desc "Download test" 20 | task :video_test do 21 | download_test("javli4qw7m") 22 | end 23 | 24 | end 25 | 26 | # --- Method --- 27 | def video_downloader(identifer, vid) 28 | video = Video.new; video.id = vid 29 | baseurl = "#{$JAVLIBRARY_URL}/cn/?v=#{identifer}" 30 | response = Mechanize.new do |agent| 31 | agent.read_timeout = 2 32 | agent.open_timeout = 2 33 | # agent.user_agent = Mechanize::AGENT_ALIASES.values[rand(21)] 34 | end 35 | 36 | begin 37 | response.get baseurl 38 | # rescue Timeout::Error 39 | # retry 40 | rescue 41 | return 0 42 | end 43 | 44 | doc = Nokogiri::HTML(response.page.body.gsub!(/( |\s)+/, " ")) 45 | 46 | casts, genres = [], [] 47 | 48 | video.video_name = doc.search('div[@id="video_title"]/h3/a').children.text.strip 49 | 50 | video.video_id = doc.search('//div[@id="video_info"]/div[@id="video_id"]/table/tr/td[@class="text"]').children.text.strip 51 | 52 | video.release_date = doc.search('//div[@id="video_info"]/div[@id="video_date"]/table/tr/td[@class="text"]').children.text.strip 53 | 54 | video.length = doc.search('//div[@id="video_info"]/div[@id="video_length"]/table/tr/td[2]/span').children.text.strip 55 | 56 | video.director = doc.search('//div[@id="video_info"]/div[@id="video_director"]/table/tr/td[@class="text"]').children.text.strip 57 | 58 | video.maker = doc.search('//div[@id="video_info"]/div[@id="video_maker"]/table/tr/td[@class="text"]').children.text.strip 59 | 60 | video.label = doc.search('//div[@id="video_info"]/div[@id="video_label"]/table/tr/td[@class="text"]').children.text.strip 61 | 62 | video.rating = doc.search('//div[@id="video_info"]/div[@id="video_review"]/table/tr/td[@class="text"]/span[@class="score"]').children.text.strip.gsub('(', '').gsub(')', '') 63 | 64 | doc.search('//img[@id="video_jacket_img"]').each do |row| 65 | video.img = 'http:' + row['src'] 66 | end 67 | 68 | doc.search('//span[@class="star"]/a').each do |row| 69 | casts << row.attributes['href'].value.split('=')[-1] 70 | end 71 | 72 | doc.search('//div[@id="video_genres"]/table/tr/td[@class="text"]/span[@class="genre"]/a').each do |row| 73 | genres << row.children.text 74 | end 75 | 76 | casts.each do |cast| 77 | begin 78 | video.actors << Actor.where("actor_label = ?", cast).first 79 | rescue 80 | next 81 | end 82 | end 83 | 84 | genres.each do |genre| 85 | begin 86 | video.genres << Genre.where("name = ?", genre).first 87 | rescue 88 | next 89 | end 90 | end 91 | 92 | return video.save 93 | end 94 | 95 | def download_test(identifer) 96 | baseurl = "#{$JAVLIBRARY_URL}/cn/?v=#{identifer}" 97 | response = Mechanize.new do |agent| 98 | agent.read_timeout = 2 99 | agent.open_timeout = 2 100 | # agent.user_agent = Mechanize::AGENT_ALIASES.values[rand(21)] 101 | end 102 | 103 | begin 104 | response.get baseurl 105 | # rescue Timeout::Error 106 | # retry 107 | rescue 108 | return 0 109 | end 110 | 111 | doc = Nokogiri::HTML(response.page.body.gsub!(/( |\s)+/, " ")) 112 | casts = [] 113 | 114 | doc.search('//span[@class="star"]/a').each do |row| 115 | casts << row 116 | pp row.attributes['href'].value.split('=')[-1] 117 | end 118 | 119 | end 120 | -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/log/.keep -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/actors_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ActorsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/news_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NewsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/relationships_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class RelationshipsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/stars_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class StarsControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/videos_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VideosControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionDispatch::IntegrationTest 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/actors.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/fixtures/files/.keep -------------------------------------------------------------------------------- /test/fixtures/genres.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/labels.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/news.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/stars.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/fixtures/videos.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/test/models/.keep -------------------------------------------------------------------------------- /test/models/actor_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ActorTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/genre_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class GenreTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/label_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class LabelTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/news_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NewsTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/star_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class StarTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/video_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class VideoTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/tmp/.keep -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syhsyh9696/javlibrary-rails/102147371581b9fb96ef7ade67e274f4cebbae35/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------