Showing preview only (1,345K chars total). Download the full file or copy to clipboard to get everything.
Repository: smartvpnbiz/smartvpn-billing
Branch: master
Commit: 44ac32aaf542
Files: 593
Total size: 1.2 MB
Directory structure:
gitextract_v37n_0v_/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .hound.yml
├── .irbrc
├── .rspec
├── .rubocop.yml
├── .travis.yml
├── Dockerfile
├── Dockerfile.dev
├── Gemfile
├── LICENSE
├── Procfile
├── README.md
├── Rakefile
├── Vagrantfile
├── app/
│ ├── assets/
│ │ ├── fonts/
│ │ │ └── FontAwesome.otf
│ │ ├── images/
│ │ │ ├── README.txt
│ │ │ └── invoice/
│ │ │ └── license.txt
│ │ ├── javascripts/
│ │ │ ├── admin.js.coffee
│ │ │ ├── application.js.coffee
│ │ │ ├── main.js.coffee
│ │ │ ├── options.js.coffee
│ │ │ └── theme/
│ │ │ ├── bootstrap-affix.js
│ │ │ ├── bootstrap-alert.js
│ │ │ ├── bootstrap-button.js
│ │ │ ├── bootstrap-carousel.js
│ │ │ ├── bootstrap-collapse.js
│ │ │ ├── bootstrap-dropdown.js
│ │ │ ├── bootstrap-modal.js
│ │ │ ├── bootstrap-popover.js
│ │ │ ├── bootstrap-scrollspy.js
│ │ │ ├── bootstrap-tab.js
│ │ │ ├── bootstrap-tooltip.js
│ │ │ ├── bootstrap-transition.js
│ │ │ ├── bootstrap-typeahead.js
│ │ │ ├── html5shim.js
│ │ │ ├── jquery.flexslider-min.js
│ │ │ ├── jquery.quicksand.js
│ │ │ └── script.js
│ │ └── stylesheets/
│ │ ├── admin.scss
│ │ ├── application.scss
│ │ ├── main-admin.scss
│ │ ├── main.scss
│ │ ├── shared.css.scss
│ │ └── theme/
│ │ ├── bootstrap.css.scss
│ │ ├── custom-colour.css
│ │ ├── flexslider.css
│ │ ├── responsive.css
│ │ └── theme-style.css
│ ├── cells/
│ │ └── web/
│ │ ├── admin/
│ │ │ └── change_locale_link_cell.rb
│ │ └── base_cell.rb
│ ├── controllers/
│ │ ├── admin/
│ │ │ ├── base_controller.rb
│ │ │ ├── change_languages_controller.rb
│ │ │ ├── connections_controller.rb
│ │ │ ├── home_controller.rb
│ │ │ ├── options_controller.rb
│ │ │ ├── pay_systems_controller.rb
│ │ │ ├── plans_controller.rb
│ │ │ ├── profiles_controller.rb
│ │ │ ├── promos_controller.rb
│ │ │ ├── referrers_controller.rb
│ │ │ ├── servers_controller.rb
│ │ │ ├── traffic_reports_controller.rb
│ │ │ ├── transactions_controller.rb
│ │ │ └── users_controller.rb
│ │ ├── admins/
│ │ │ └── sessions_controller.rb
│ │ ├── api/
│ │ │ ├── authentication_controller.rb
│ │ │ ├── base_controller.rb
│ │ │ ├── connection_controller.rb
│ │ │ └── servers_controller.rb
│ │ ├── application_controller.rb
│ │ ├── billing/
│ │ │ ├── base_controller.rb
│ │ │ ├── home_controller.rb
│ │ │ ├── merchant_controller.rb
│ │ │ ├── options_controller.rb
│ │ │ ├── payments_controller.rb
│ │ │ ├── paypal_controller.rb
│ │ │ ├── promotions_controller.rb
│ │ │ ├── referrers_controller.rb
│ │ │ ├── robokassa_controller.rb
│ │ │ ├── servers_controller.rb
│ │ │ └── webmoney_controller.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── main_controller.rb
│ │ ├── referrers_controller.rb
│ │ └── users/
│ │ ├── passwords_controller.rb
│ │ ├── registrations_controller.rb
│ │ └── sessions_controller.rb
│ ├── decorators/
│ │ ├── admin/
│ │ │ └── options_decorator.rb
│ │ ├── option_attribute_decorator.rb
│ │ ├── pay_system_decorator.rb
│ │ ├── promo_decorator.rb
│ │ ├── transaction_decorator.rb
│ │ └── user_decorator.rb
│ ├── exceptions/
│ │ └── api_exception.rb
│ ├── helpers/
│ │ ├── admin_helper.rb
│ │ ├── application_helper.rb
│ │ ├── main_helper.rb
│ │ ├── options_helper.rb
│ │ ├── promos_helper.rb
│ │ └── servers_helper.rb
│ ├── inputs/
│ │ └── datepicker_input.rb
│ ├── mailers/
│ │ ├── user_connection_config_mailer.rb
│ │ └── user_mailer.rb
│ ├── models/
│ │ ├── ability.rb
│ │ ├── admin.rb
│ │ ├── authenticator.rb
│ │ ├── concerns/
│ │ │ ├── .keep
│ │ │ └── last_days_filterable.rb
│ │ ├── connection.rb
│ │ ├── connections/
│ │ │ ├── connect.rb
│ │ │ └── disconnect.rb
│ │ ├── connector.rb
│ │ ├── option.rb
│ │ ├── options/
│ │ │ ├── attributes/
│ │ │ │ └── proxy.rb
│ │ │ └── hooks/
│ │ │ └── proxy.rb
│ │ ├── pay_system.rb
│ │ ├── payment.rb
│ │ ├── plan.rb
│ │ ├── plan_has_server.rb
│ │ ├── promo.rb
│ │ ├── promoter.rb
│ │ ├── promoters/
│ │ │ └── discount_promoter.rb
│ │ ├── promoters_repository.rb
│ │ ├── promotion.rb
│ │ ├── proxy/
│ │ │ ├── connect.rb
│ │ │ └── node.rb
│ │ ├── proxy.rb
│ │ ├── referrer/
│ │ │ ├── account.rb
│ │ │ └── reward.rb
│ │ ├── referrer.rb
│ │ ├── server/
│ │ │ └── signature.rb
│ │ ├── server.rb
│ │ ├── server_config.rb
│ │ ├── test_period.rb
│ │ ├── traffic_report.rb
│ │ ├── traffic_reports/
│ │ │ ├── date_traffic_report.rb
│ │ │ ├── server_traffic_report.rb
│ │ │ └── user_traffic_report.rb
│ │ ├── transaction.rb
│ │ ├── user.rb
│ │ ├── user_option.rb
│ │ ├── withdrawal.rb
│ │ └── withdrawal_prolongation.rb
│ ├── operations/
│ │ └── ops/
│ │ └── admin/
│ │ └── user/
│ │ ├── base.rb
│ │ └── create.rb
│ ├── ransackers/
│ │ ├── base_ransacker.rb
│ │ └── never_paid_users_ransacker.rb
│ ├── serializers/
│ │ ├── admin/
│ │ │ └── users_serializer.rb
│ │ └── api/
│ │ ├── connect_serializer.rb
│ │ ├── connection_serializer.rb
│ │ └── disconnect_serializer.rb
│ ├── services/
│ │ ├── dto/
│ │ │ ├── admin/
│ │ │ │ ├── dashboard.rb
│ │ │ │ ├── discrete_base.rb
│ │ │ │ ├── discrete_customers_registrations.rb
│ │ │ │ ├── discrete_payments.rb
│ │ │ │ └── discrete_traffic.rb
│ │ │ └── base.rb
│ │ ├── forced_disconnect.rb
│ │ ├── newsletter_manager.rb
│ │ ├── option/
│ │ │ ├── activation_price_calc.rb
│ │ │ ├── activator.rb
│ │ │ └── deactivator.rb
│ │ ├── proxy/
│ │ │ ├── fetchers/
│ │ │ │ ├── base.rb
│ │ │ │ ├── free_proxy_list_net/
│ │ │ │ │ ├── row_parser.rb
│ │ │ │ │ └── web_parser.rb
│ │ │ │ └── free_proxy_lists/
│ │ │ │ ├── row_parser.rb
│ │ │ │ └── web_parser.rb
│ │ │ ├── proxy_dto.rb
│ │ │ ├── rater.rb
│ │ │ ├── repository.rb
│ │ │ └── updater.rb
│ │ ├── referrer/
│ │ │ ├── reward_calculator.rb
│ │ │ └── rewarder.rb
│ │ ├── server_config_builder.rb
│ │ ├── unpaid_users_notificator.rb
│ │ ├── withdrawal_amount_calculator.rb
│ │ └── withdrawer.rb
│ ├── uploaders/
│ │ └── config_uploader.rb
│ ├── views/
│ │ ├── admin/
│ │ │ ├── connections/
│ │ │ │ ├── _filter.html.slim
│ │ │ │ ├── active.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── home/
│ │ │ │ └── index.html.slim
│ │ │ ├── options/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── pay_systems/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── new.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── plans/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── profiles/
│ │ │ │ └── edit.html.slim
│ │ │ ├── promos/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── referrers/
│ │ │ │ ├── _referrals.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── servers/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── new.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── shared/
│ │ │ │ ├── _menu.html.slim
│ │ │ │ └── _paginate.html.slim
│ │ │ ├── traffic_reports/
│ │ │ │ ├── _filter.html.slim
│ │ │ │ ├── _submenu.html.slim
│ │ │ │ ├── date.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── servers.html.slim
│ │ │ │ └── users.html.slim
│ │ │ ├── transactions/
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── payments.html.slim
│ │ │ │ └── withdrawals.html.slim
│ │ │ └── users/
│ │ │ ├── _filter.html.slim
│ │ │ ├── _payment.html.slim
│ │ │ ├── _prolongation.html.slim
│ │ │ ├── _submenu.html.slim
│ │ │ ├── _table.html.slim
│ │ │ ├── _test_period.html.slim
│ │ │ ├── edit.html.slim
│ │ │ ├── index.html.slim
│ │ │ ├── new.html.slim
│ │ │ ├── payers.html.slim
│ │ │ ├── show.html.slim
│ │ │ └── this_month_payers.html.slim
│ │ ├── admins/
│ │ │ ├── confirmations/
│ │ │ │ └── new.html.erb
│ │ │ ├── mailer/
│ │ │ │ ├── confirmation_instructions.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.slim
│ │ │ ├── shared/
│ │ │ │ └── _links.erb
│ │ │ └── unlocks/
│ │ │ └── new.html.erb
│ │ ├── application/
│ │ │ └── _notifications.html.slim
│ │ ├── billing/
│ │ │ ├── home/
│ │ │ │ ├── _account_info.html.slim
│ │ │ │ ├── _current_connection.html.slim
│ │ │ │ ├── _last_transactions.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── options/
│ │ │ │ ├── _subscribed_options.html.slim
│ │ │ │ ├── _unsubscribed_options.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── payments/
│ │ │ │ ├── forms/
│ │ │ │ │ ├── _cc.html.slim
│ │ │ │ │ ├── _paypal.html.erb
│ │ │ │ │ ├── _wmr.html.slim
│ │ │ │ │ ├── _wmz.html.slim
│ │ │ │ │ └── _yandex.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── merchant.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── referrers/
│ │ │ │ ├── _operations.html.slim
│ │ │ │ ├── _referrals.html.slim
│ │ │ │ └── index.html.slim
│ │ │ └── servers/
│ │ │ └── index.html.slim
│ │ ├── kaminari/
│ │ │ ├── _first_page.html.erb
│ │ │ ├── _gap.html.erb
│ │ │ ├── _last_page.html.erb
│ │ │ ├── _next_page.html.erb
│ │ │ ├── _page.html.erb
│ │ │ ├── _paginator.html.erb
│ │ │ └── _prev_page.html.erb
│ │ ├── layouts/
│ │ │ ├── admin.html.slim
│ │ │ ├── application.html.slim
│ │ │ ├── billing.html.slim
│ │ │ └── blank.html.slim
│ │ ├── mailers/
│ │ │ ├── _signature.html.slim
│ │ │ ├── user_connection_config_mailer/
│ │ │ │ └── notify.html.slim
│ │ │ └── user_mailer/
│ │ │ ├── balance_withdrawal.html.slim
│ │ │ ├── could_not_withdraw_funds.html.slim
│ │ │ ├── funds_recieved.html.slim
│ │ │ ├── test_period_enabled.html.slim
│ │ │ └── unpaid_user_notification.html.slim
│ │ ├── main/
│ │ │ ├── auth.html.slim
│ │ │ └── index.html.slim
│ │ ├── shared/
│ │ │ ├── _footer.html.slim
│ │ │ ├── _rollbar_js.html.erb
│ │ │ ├── _yandex_metrika.html.erb
│ │ │ └── _zendesk.html.erb
│ │ └── users/
│ │ ├── confirmations/
│ │ │ └── new.html.erb
│ │ ├── mailer/
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── reset_password_instructions.html.erb
│ │ │ └── unlock_instructions.html.erb
│ │ ├── passwords/
│ │ │ ├── edit.html.slim
│ │ │ └── new.html.slim
│ │ ├── registrations/
│ │ │ ├── _promo.html.slim
│ │ │ ├── edit.html.slim
│ │ │ └── new.html.slim
│ │ ├── sessions/
│ │ │ └── new.html.slim
│ │ ├── shared/
│ │ │ └── _links.erb
│ │ └── unlocks/
│ │ └── new.html.erb
│ └── workers/
│ ├── add_user_to_newsletter_worker.rb
│ ├── can_not_withdraw_notification_worker.rb
│ ├── create_user_mail_worker.rb
│ ├── decrease_balance_mail_worker.rb
│ ├── increase_balance_mail_worker.rb
│ ├── refresh_proxy_list_worker.rb
│ ├── unpaid_user_notification_worker.rb
│ ├── update_courses_worker.rb
│ └── withdrawals_worker.rb
├── bin/
│ ├── build-image
│ ├── bundle
│ ├── cop
│ ├── rails
│ ├── rake
│ └── setup
├── config/
│ ├── application.rb
│ ├── boot.rb
│ ├── clock.rb
│ ├── countries.json
│ ├── database.yml.sample
│ ├── environment.rb
│ ├── environments/
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── i18n-tasks.yml
│ ├── initializers/
│ │ ├── active_merchant.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── devise.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── kaminari_config.rb
│ │ ├── mime_types.rb
│ │ ├── rails_config.rb
│ │ ├── rollbar.rb
│ │ ├── secret_token.rb
│ │ ├── session_store.rb
│ │ ├── show_for.rb
│ │ ├── simple_form.rb
│ │ ├── simple_form_bootstrap.rb
│ │ └── wrap_parameters.rb
│ ├── locales/
│ │ ├── admin/
│ │ │ ├── en.yml
│ │ │ └── ru.yml
│ │ ├── billing/
│ │ │ ├── en.yml
│ │ │ └── ru.yml
│ │ ├── devise.en.yml
│ │ ├── devise.ru.yml
│ │ ├── en.yml
│ │ ├── kaminari.en.yml
│ │ ├── kaminari.ru.yml
│ │ ├── ru.yml
│ │ ├── show_for.en.yml
│ │ ├── show_for.ru.yml
│ │ ├── simple_form.en.yml
│ │ ├── simple_form.ru.yml
│ │ └── site/
│ │ ├── en.yml
│ │ └── ru.yml
│ ├── newrelic.yml
│ ├── routes.rb
│ ├── sample.server.ovpn.erb
│ ├── settings/
│ │ ├── development.yml
│ │ ├── production.yml
│ │ └── test.yml
│ └── settings.yml
├── config.ru
├── db/
│ ├── migrate/
│ │ ├── 20130409190444_create_posts.rb
│ │ ├── 20130421110154_devise_create_users.rb
│ │ ├── 20130421110911_create_admins.rb
│ │ ├── 20130501081828_add_fields_to_user.rb
│ │ ├── 20130501083417_create_plans.rb
│ │ ├── 20130504105921_create_payments.rb
│ │ ├── 20130504144707_create_pay_systems.rb
│ │ ├── 20130504150703_add_description_to_pay_system.rb
│ │ ├── 20130505183444_create_withdrawals.rb
│ │ ├── 20130810125453_create_servers.rb
│ │ ├── 20130925101441_add_vpn_login_and_vpn_password_to_user.rb
│ │ ├── 20131005133458_create_connections.rb
│ │ ├── 20131013140201_add_state_to_user.rb
│ │ ├── 20140105134117_add_special_and_disabled_to_plan.rb
│ │ ├── 20140112113325_create_plan_has_servers.rb
│ │ ├── 20140112123216_remove_plan_id_from_server.rb
│ │ ├── 20140112180259_add_tunnelblick_bundle_and_ios_bundle_and_linux_bundle_to_server.rb
│ │ ├── 20140116192804_add_cant_withdraw_counter_to_user.rb
│ │ ├── 20140125084325_replace_configs_by_one_universal.rb
│ │ ├── 20140202164317_create_promos.rb
│ │ ├── 20140202164614_create_promotions.rb
│ │ ├── 20140202175203_add_attributes_to_promo.rb
│ │ ├── 20140203184711_add_state_to_promo.rb
│ │ ├── 20140207114415_add_promo_id_user_id_uniqueness_index_to_promo.rb
│ │ ├── 20140227113644_add_state_to_pay_system.rb
│ │ ├── 20140301125212_add_currency_to_pay_system.rb
│ │ ├── 20140301130258_add_usd_amount_to_payment.rb
│ │ ├── 20140506135933_create_withdrawal_prolongations.rb
│ │ ├── 20140507085918_add_manual_payment_to_payment.rb
│ │ ├── 20140518132954_create_options.rb
│ │ ├── 20140518133314_create_plan_option_table.rb
│ │ ├── 20140518134712_add_state_to_option.rb
│ │ ├── 20140525091015_add_option_prices_to_plan.rb
│ │ ├── 20140525103921_create_options_users.rb
│ │ ├── 20140727094748_add_reflink_to_user.rb
│ │ ├── 20140728204118_add_referrer_id_to_user.rb
│ │ ├── 20140801123341_create_referrer_rewards.rb
│ │ ├── 20140805112916_generate_reflink_to_old_users.rb
│ │ ├── 20140817131003_create_proxy_nodes.rb
│ │ ├── 20140819160419_remove_options_users_table.rb
│ │ ├── 20140819160716_create_user_options.rb
│ │ ├── 20140823162252_create_proxy_connects.rb
│ │ ├── 20140823164144_add_option_attributes_to_connect.rb
│ │ ├── 20150104180714_add_state_to_user_option.rb
│ │ ├── 20150109161843_add_protocol_to_server.rb
│ │ ├── 20150109164839_add_port_to_server.rb
│ │ ├── 20150110141211_add_country_code_to_server.rb
│ │ ├── 20150125133216_add_test_period_enabled_to_user.rb
│ │ ├── 20150125141501_add_test_period_started_at_to_user.rb
│ │ ├── 20181014150549_add_default_user.rb
│ │ └── 20190122184018_add_pki_to_server.rb
│ ├── schema.rb
│ ├── seeds/
│ │ ├── 01_options.rb
│ │ ├── 02_plans.rb
│ │ ├── 03_pay_systems.rb
│ │ ├── 04_default_user.rb
│ │ ├── 05_default_user_referrals.rb
│ │ ├── 06_admin.rb
│ │ ├── 07_servers.rb
│ │ └── 08_default_user_connects.rb
│ └── seeds.rb
├── docker-compose.development.yml
├── lib/
│ ├── assets/
│ │ └── .keep
│ ├── bytes_converter.rb
│ ├── currencies/
│ │ ├── course.rb
│ │ └── course_converter.rb
│ ├── exceptions/
│ │ ├── admin_access_denied_exception.rb
│ │ ├── api_exception.rb
│ │ ├── billing_exception.rb
│ │ ├── dto_exception.rb
│ │ ├── not_implemented_exception.rb
│ │ ├── smartvpn_exception.rb
│ │ ├── unauthorized_exception.rb
│ │ └── withdrawer_exception.rb
│ ├── random_string.rb
│ ├── signer.rb
│ ├── tasks/
│ │ ├── .keep
│ │ ├── assets.rake
│ │ └── seed_initial_data.rake
│ └── templates/
│ └── erb/
│ └── scaffold/
│ ├── _form.html.erb
│ └── show.html.erb
├── public/
│ ├── 404.html
│ ├── 500.html
│ ├── css/
│ │ ├── bootstrap.css
│ │ ├── colour-blue.css
│ │ ├── colour-red.css
│ │ ├── custom-colour.css
│ │ ├── custom-style.css
│ │ ├── flexslider.css
│ │ ├── font/
│ │ │ └── FontAwesome.otf
│ │ ├── responsive.css
│ │ └── theme-style.css
│ ├── img/
│ │ └── README.txt
│ └── index.html
├── spec/
│ ├── cells/
│ │ └── web/
│ │ └── admin/
│ │ └── change_locale_link_cell_spec.rb
│ ├── config/
│ │ └── clock_spec.rb
│ ├── controllers/
│ │ ├── admin/
│ │ │ ├── change_languages_controller_spec.rb
│ │ │ ├── connections_controller_spec.rb
│ │ │ ├── options_controller_spec.rb
│ │ │ ├── pay_systems_controller_spec.rb
│ │ │ ├── plans_controller_spec.rb
│ │ │ ├── profiles_controller_spec.rb
│ │ │ ├── promos_controller_spec.rb
│ │ │ ├── referrers_controller_spec.rb
│ │ │ ├── servers_controller_spec.rb
│ │ │ ├── traffic_reports_controller_spec.rb
│ │ │ ├── transactions_controller_spec.rb
│ │ │ └── users_controller_spec.rb
│ │ ├── api/
│ │ │ ├── authentication_controller_spec.rb
│ │ │ ├── connection_controller_spec.rb
│ │ │ └── servers_controller_spec.rb
│ │ ├── application_controller_spec.rb
│ │ ├── billing/
│ │ │ ├── options_controller_spec.rb
│ │ │ ├── payments_controller_spec.rb
│ │ │ ├── paypal_controller_spec.rb
│ │ │ ├── promotions_controller_spec.rb
│ │ │ ├── referrers_controller_spec.rb
│ │ │ ├── robokassa_controller_spec.rb
│ │ │ ├── servers_controller_spec.rb
│ │ │ └── webmoney_controller_spec.rb
│ │ ├── referrers_controller_spec.rb
│ │ └── users/
│ │ └── registrations_controller_spec.rb
│ ├── decorators/
│ │ ├── admin/
│ │ │ └── options_decorator_spec.rb
│ │ ├── option_attribute_decorator_spec.rb
│ │ ├── pay_system_decorator_spec.rb
│ │ ├── promo_decorator_spec.rb
│ │ ├── transaction_decorator_spec.rb
│ │ └── user_decorator_spec.rb
│ ├── factories.rb
│ ├── features/
│ │ ├── admin/
│ │ │ ├── plans/
│ │ │ │ ├── plans_option_prices_spec.rb
│ │ │ │ └── update_plan_servers_spec.rb
│ │ │ ├── referrers/
│ │ │ │ └── referrals_list_toggle_spec.rb
│ │ │ ├── servers/
│ │ │ │ └── update_server_plans_spec.rb
│ │ │ └── users/
│ │ │ ├── manual_payment_spec.rb
│ │ │ ├── user_profile_page_spec.rb
│ │ │ └── withdrawal_prolongation_spec.rb
│ │ └── billing/
│ │ ├── discount_promotion_applying_spec.rb
│ │ ├── options_page_spec.rb
│ │ ├── payments_page_spec.rb
│ │ ├── referrers_page_spec.rb
│ │ ├── servers_page_spec.rb
│ │ ├── settings_page_spec.rb
│ │ ├── test_period_at_user_dashboard_spec.rb
│ │ ├── user_password_reset_spec.rb
│ │ ├── user_sign_in_spec.rb
│ │ └── user_sign_up_spec.rb
│ ├── helpers/
│ │ ├── admin_helper_spec.rb
│ │ └── application_helper_spec.rb
│ ├── i18n_spec.rb
│ ├── lib/
│ │ ├── bytes_converter_spec.rb
│ │ ├── currencies/
│ │ │ ├── course_converter_spec.rb
│ │ │ └── course_spec.rb
│ │ ├── random_string_spec.rb
│ │ └── signer_spec.rb
│ ├── mailers/
│ │ └── user_connection_config_mailer_spec.rb
│ ├── models/
│ │ ├── authenticator_spec.rb
│ │ ├── connect_spec.rb
│ │ ├── connection_spec.rb
│ │ ├── connector_spec.rb
│ │ ├── disconnect_spec.rb
│ │ ├── option_spec.rb
│ │ ├── options/
│ │ │ └── hooks/
│ │ │ └── proxy_spec.rb
│ │ ├── pay_system_spec.rb
│ │ ├── payment_spec.rb
│ │ ├── plan_has_server_spec.rb
│ │ ├── plan_spec.rb
│ │ ├── promo_spec.rb
│ │ ├── promoters/
│ │ │ └── discount_promoter_spec.rb
│ │ ├── promoters_repository_spec.rb
│ │ ├── promotion_spec.rb
│ │ ├── proxy/
│ │ │ ├── connect_spec.rb
│ │ │ └── node_spec.rb
│ │ ├── referrer/
│ │ │ ├── account_spec.rb
│ │ │ └── reward_spec.rb
│ │ ├── server/
│ │ │ └── signature_spec.rb
│ │ ├── server_config_spec.rb
│ │ ├── server_spec.rb
│ │ ├── test_period_spec.rb
│ │ ├── traffic_report_spec.rb
│ │ ├── traffic_reports/
│ │ │ ├── date_traffic_report_spec.rb
│ │ │ ├── server_traffic_report_spec.rb
│ │ │ └── user_traffic_report_spec.rb
│ │ ├── transaction_spec.rb
│ │ ├── user_option_spec.rb
│ │ ├── user_spec.rb
│ │ ├── withdrawal_prolongation_spec.rb
│ │ └── withdrawal_spec.rb
│ ├── operations/
│ │ └── ops/
│ │ └── admin/
│ │ └── user/
│ │ ├── base_spec.rb
│ │ └── create_spec.rb
│ ├── rails_helper.rb
│ ├── serializers/
│ │ ├── admin/
│ │ │ └── users_serializer_spec.rb
│ │ └── api/
│ │ └── connection_serializer_spec.rb
│ ├── services/
│ │ ├── dto/
│ │ │ └── admin/
│ │ │ ├── dashboard_spec.rb
│ │ │ └── discrete_base_spec.rb
│ │ ├── forced_disconnect_spec.rb
│ │ ├── newsletter_manager_spec.rb
│ │ ├── option/
│ │ │ ├── activation_price_calc_spec.rb
│ │ │ ├── activator_spec.rb
│ │ │ └── deactivator_spec.rb
│ │ ├── proxy/
│ │ │ ├── fetchers/
│ │ │ │ └── base_spec.rb
│ │ │ ├── rater_spec.rb
│ │ │ ├── repository_spec.rb
│ │ │ └── updater_spec.rb
│ │ ├── referrer/
│ │ │ ├── reward_calculator_spec.rb
│ │ │ └── rewarder_spec.rb
│ │ ├── server_config_builder_spec.rb
│ │ ├── unpaid_users_notificator_spec.rb
│ │ ├── withdrawal_amount_calculator_spec.rb
│ │ └── withdrawer_spec.rb
│ ├── shared_examples/
│ │ ├── admin_controller_access_spec_shared.rb
│ │ ├── api_call_controller_validation_shared.rb
│ │ ├── dashboard_total_statistics_shared.rb
│ │ ├── has_success_and_fail_responders_shared.rb
│ │ ├── last_days_filterable_shared.rb
│ │ ├── payment_submit_spec_shared.rb
│ │ └── validates_paysystem_enabled_shared.rb
│ ├── spec_helper.rb
│ ├── support/
│ │ ├── capybara_helper.rb
│ │ ├── controller_macros.rb
│ │ ├── json_helpers.rb
│ │ └── matchers/
│ │ └── json_matchers.rb
│ └── workers/
│ ├── create_user_mail_worker_spec.rb
│ ├── refresh_proxy_list_worker_spec.rb
│ ├── update_cources_worker_spec.rb
│ └── withdrawals_worker_spec.rb
└── vendor/
└── assets/
├── javascripts/
│ └── .keep
└── stylesheets/
└── .keep
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
.git
config/database.yml
.envrc
.env
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: Mehonoshin
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Server (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
Issue #ID
### Description
Explain what is the purpose of this PR
### Testing steps
Explain how to test your PR manually
* Step 1
* Step 2
* Step 3
### Checklist
Make sure that all steps a checked before the merge
- [ ] RSpec tests are passing on CI
- [ ] `bin/cop -a` does not return any warnings
- [ ] Tested manually
### Screenshots
Provide screenshots of implemented functionality
================================================
FILE: .gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/**
/tmp/*
.rvmrc
.powrc
.DS_Store
coverage/*
config/settings.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
.envrc
public/uploads/*
config/database.yml
.ruby-version
.ruby-gemset
.vagrant/
sandi_meter/**/*
.env
.idea/
dump.rdb
================================================
FILE: .hound.yml
================================================
scss:
enabled: false
haml:
enabled: false
rubocop:
config_file: .rubocop.yml
================================================
FILE: .irbrc
================================================
# frozen_string_literal: true
require 'awesome_print'
AwesomePrint.irb!
================================================
FILE: .rspec
================================================
--color
/*--profile*/
================================================
FILE: .rubocop.yml
================================================
# These are all the cops that are enabled in the default configuration.
#################### Bundler ###############################
AllCops:
Exclude:
- db/**
Bundler/DuplicatedGem:
Description: 'Checks for duplicate gem entries in Gemfile.'
Enabled: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Bundler/InsecureProtocolSource:
Description: >-
The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
because HTTP requests are insecure. Please change your source to
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Enabled: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Bundler/OrderedGems:
Description: >-
Gems within groups in the Gemfile should be alphabetically sorted.
Enabled: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
#################### Gemspec ###############################
Gemspec/DuplicatedAssignment:
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
Enabled: true
Include:
- '**/*.gemspec'
Gemspec/OrderedDependencies:
Description: >-
Dependencies in the gemspec should be alphabetically sorted.
Enabled: true
Include:
- '**/*.gemspec'
Gemspec/RequiredRubyVersion:
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
Enabled: true
Include:
- '**/*.gemspec'
#################### Layout ###############################
Layout/AccessModifierIndentation:
Description: Check indentation of private/protected visibility modifiers.
StyleGuide: '#indent-public-private-protected'
Enabled: true
Layout/AlignArray:
Description: >-
Align the elements of an array literal if they span more than
one line.
StyleGuide: '#align-multiline-arrays'
Enabled: true
Layout/AlignHash:
Description: >-
Align the elements of a hash literal if they span more than
one line.
Enabled: true
Layout/AlignParameters:
Description: >-
Align the parameters of a method call if they span more
than one line.
StyleGuide: '#no-double-indent'
Enabled: true
Layout/BlockAlignment:
Description: 'Align block ends correctly.'
Enabled: true
Layout/BlockEndNewline:
Description: 'Put end statement of multiline block on its own line.'
Enabled: true
Layout/CaseIndentation:
Description: 'Indentation of when in a case/when/[else/]end.'
StyleGuide: '#indent-when-to-case'
Enabled: true
Layout/ClosingParenthesisIndentation:
Description: 'Checks the indentation of hanging closing parentheses.'
Enabled: true
Layout/CommentIndentation:
Description: 'Indentation of comments.'
Enabled: true
Layout/ConditionPosition:
Description: >-
Checks for condition placed in a confusing position relative to
the keyword.
StyleGuide: '#same-line-condition'
Enabled: true
Layout/DefEndAlignment:
Description: 'Align ends corresponding to defs correctly.'
Enabled: true
Layout/DotPosition:
Description: 'Checks the position of the dot in multi-line method calls.'
StyleGuide: '#consistent-multi-line-chains'
Enabled: true
Layout/ElseAlignment:
Description: 'Align elses and elsifs correctly.'
Enabled: true
Layout/EmptyComment:
Description: 'Checks empty comment.'
Enabled: true
Layout/EmptyLineAfterMagicComment:
Description: 'Add an empty line after magic comments to separate them from code.'
StyleGuide: '#separate-magic-comments-from-code'
Enabled: true
Layout/EmptyLineBetweenDefs:
Description: 'Use empty lines between defs.'
StyleGuide: '#empty-lines-between-methods'
Enabled: true
Layout/EmptyLines:
Description: "Don't use several empty lines in a row."
StyleGuide: '#two-or-more-empty-lines'
Enabled: true
Layout/EmptyLinesAroundAccessModifier:
Description: "Keep blank lines around access modifiers."
StyleGuide: '#empty-lines-around-access-modifier'
Enabled: true
Layout/EmptyLinesAroundArguments:
Description: "Keeps track of empty lines around method arguments."
Enabled: true
Layout/EmptyLinesAroundBeginBody:
Description: "Keeps track of empty lines around begin-end bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EmptyLinesAroundBlockBody:
Description: "Keeps track of empty lines around block bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EmptyLinesAroundClassBody:
Description: "Keeps track of empty lines around class bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Description: "Keeps track of empty lines around exception handling keywords."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EmptyLinesAroundMethodBody:
Description: "Keeps track of empty lines around method bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EmptyLinesAroundModuleBody:
Description: "Keeps track of empty lines around module bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
Layout/EndAlignment:
Description: 'Align ends correctly.'
Enabled: true
Layout/EndOfLine:
Description: 'Use Unix-style line endings.'
StyleGuide: '#crlf'
Enabled: true
Layout/ExtraSpacing:
Description: 'Do not use unnecessary spacing.'
Enabled: true
Layout/FirstParameterIndentation:
Description: 'Checks the indentation of the first parameter in a method call.'
Enabled: true
Layout/IndentArray:
Description: >-
Checks the indentation of the first element in an array
literal.
Enabled: true
Layout/IndentAssignment:
Description: >-
Checks the indentation of the first line of the
right-hand-side of a multi-line assignment.
Enabled: true
Layout/IndentHash:
Description: 'Checks the indentation of the first key in a hash literal.'
Enabled: true
Layout/IndentHeredoc:
Description: 'This cops checks the indentation of the here document bodies.'
StyleGuide: '#squiggly-heredocs'
Enabled: true
Layout/IndentationConsistency:
Description: 'Keep indentation straight.'
StyleGuide: '#spaces-indentation'
Enabled: true
Layout/IndentationWidth:
Description: 'Use 2 spaces for indentation.'
StyleGuide: '#spaces-indentation'
Enabled: true
Layout/InitialIndentation:
Description: >-
Checks the indentation of the first non-blank non-comment line in a file.
Enabled: true
Layout/LeadingCommentSpace:
Description: 'Comments should start with a space.'
StyleGuide: '#hash-space'
Enabled: true
Layout/MultilineArrayBraceLayout:
Description: >-
Checks that the closing brace in an array literal is
either on the same line as the last array element, or
a new line.
Enabled: true
Layout/MultilineBlockLayout:
Description: 'Ensures newlines after multiline block do statements.'
Enabled: true
Layout/MultilineHashBraceLayout:
Description: >-
Checks that the closing brace in a hash literal is
either on the same line as the last hash element, or
a new line.
Enabled: true
Layout/MultilineMethodCallBraceLayout:
Description: >-
Checks that the closing brace in a method call is
either on the same line as the last method argument, or
a new line.
Enabled: true
Layout/MultilineMethodCallIndentation:
Description: >-
Checks indentation of method calls with the dot operator
that span more than one line.
Enabled: true
Layout/MultilineMethodDefinitionBraceLayout:
Description: >-
Checks that the closing brace in a method definition is
either on the same line as the last method parameter, or
a new line.
Enabled: true
Layout/MultilineOperationIndentation:
Description: >-
Checks indentation of binary operations that span more than
one line.
Enabled: true
Layout/RescueEnsureAlignment:
Description: 'Align rescues and ensures correctly.'
Enabled: true
Layout/SpaceAfterColon:
Description: 'Use spaces after colons.'
StyleGuide: '#spaces-operators'
Enabled: true
Layout/SpaceAfterComma:
Description: 'Use spaces after commas.'
StyleGuide: '#spaces-operators'
Enabled: true
Layout/SpaceAfterMethodName:
Description: >-
Do not put a space between a method name and the opening
parenthesis in a method definition.
StyleGuide: '#parens-no-spaces'
Enabled: true
Layout/SpaceAfterNot:
Description: Tracks redundant space after the ! operator.
StyleGuide: '#no-space-bang'
Enabled: true
Layout/SpaceAfterSemicolon:
Description: 'Use spaces after semicolons.'
StyleGuide: '#spaces-operators'
Enabled: true
Layout/SpaceAroundBlockParameters:
Description: 'Checks the spacing inside and after block parameters pipes.'
Enabled: true
Layout/SpaceAroundEqualsInParameterDefault:
Description: >-
Checks that the equals signs in parameter default assignments
have or don't have surrounding space depending on
configuration.
StyleGuide: '#spaces-around-equals'
Enabled: true
Layout/SpaceAroundKeyword:
Description: 'Use a space around keywords if appropriate.'
Enabled: true
Layout/SpaceAroundOperators:
Description: 'Use a single space around operators.'
StyleGuide: '#spaces-operators'
Enabled: true
Layout/SpaceBeforeBlockBraces:
Description: >-
Checks that the left block brace has or doesn't have space
before it.
Enabled: true
Layout/SpaceBeforeComma:
Description: 'No spaces before commas.'
Enabled: true
Layout/SpaceBeforeComment:
Description: >-
Checks for missing space between code and a comment on the
same line.
Enabled: true
Layout/SpaceBeforeFirstArg:
Description: >-
Checks that exactly one space is used between a method name
and the first argument for method calls without parentheses.
Enabled: true
Layout/SpaceBeforeSemicolon:
Description: 'No spaces before semicolons.'
Enabled: true
Layout/SpaceInLambdaLiteral:
Description: 'Checks for spaces in lambda literals.'
Enabled: true
Layout/SpaceInsideArrayLiteralBrackets:
Description: 'Checks the spacing inside array literal brackets.'
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
Enabled: true
Layout/SpaceInsideBlockBraces:
Description: >-
Checks that block braces have or don't have surrounding space.
For blocks taking parameters, checks that the left brace has
or doesn't have trailing space.
Enabled: true
Layout/SpaceInsideHashLiteralBraces:
Description: "Use spaces inside hash literal braces - or don't."
StyleGuide: '#spaces-operators'
Enabled: true
Layout/SpaceInsideParens:
Description: 'No spaces after ( or before ).'
StyleGuide: '#spaces-braces'
Enabled: true
Layout/SpaceInsidePercentLiteralDelimiters:
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
Enabled: true
Layout/SpaceInsideRangeLiteral:
Description: 'No spaces inside range literals.'
StyleGuide: '#no-space-inside-range-literals'
Enabled: true
Layout/SpaceInsideReferenceBrackets:
Description: 'Checks the spacing inside referential brackets.'
Enabled: true
Layout/SpaceInsideStringInterpolation:
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
StyleGuide: '#string-interpolation'
Enabled: true
Layout/Tab:
Description: 'No hard tabs.'
StyleGuide: '#spaces-indentation'
Enabled: true
Layout/TrailingBlankLines:
Description: 'Checks trailing blank lines and final newline.'
StyleGuide: '#newline-eof'
Enabled: true
Layout/TrailingWhitespace:
Description: 'Avoid trailing whitespace.'
StyleGuide: '#no-trailing-whitespace'
Enabled: true
#################### Lint ##################################
### Warnings
Lint/AmbiguousBlockAssociation:
Description: >-
Checks for ambiguous block association with method when param passed without
parentheses.
StyleGuide: '#syntax'
Enabled: true
Lint/AmbiguousOperator:
Description: >-
Checks for ambiguous operators in the first argument of a
method invocation without parentheses.
StyleGuide: '#method-invocation-parens'
Enabled: true
Lint/AmbiguousRegexpLiteral:
Description: >-
Checks for ambiguous regexp literals in the first argument of
a method invocation without parentheses.
Enabled: true
Lint/AssignmentInCondition:
Description: "Don't use assignment in conditions."
StyleGuide: '#safe-assignment-in-condition'
Enabled: true
Lint/BigDecimalNew:
Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
Enabled: true
Lint/BooleanSymbol:
Description: 'Check for `:true` and `:false` symbols.'
Enabled: true
Lint/CircularArgumentReference:
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
Enabled: true
Lint/Debugger:
Description: 'Check for debugger calls.'
Enabled: true
Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.'
Enabled: true
Lint/DuplicateCaseCondition:
Description: 'Do not repeat values in case conditionals.'
Enabled: true
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
Lint/DuplicatedKey:
Description: 'Check for duplicate keys in hash literals.'
Enabled: true
Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.'
Enabled: true
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
Lint/EmptyEnsure:
Description: 'Checks for empty ensure block.'
Enabled: true
AutoCorrect: false
Lint/EmptyExpression:
Description: 'Checks for empty expressions.'
Enabled: true
Lint/EmptyInterpolation:
Description: 'Checks for empty string interpolation.'
Enabled: true
Lint/EmptyWhen:
Description: 'Checks for `when` branches with empty bodies.'
Enabled: true
Lint/EndInMethod:
Description: 'END blocks should not be placed inside method definitions.'
Enabled: true
Lint/EnsureReturn:
Description: 'Do not use return in an ensure block.'
StyleGuide: '#no-return-ensure'
Enabled: true
Lint/FloatOutOfRange:
Description: >-
Catches floating-point literals too large or small for Ruby to
represent.
Enabled: true
Lint/FormatParameterMismatch:
Description: 'The number of parameters to format/sprint must match the fields.'
Enabled: true
Lint/HandleExceptions:
Description: "Don't suppress exception."
StyleGuide: '#dont-hide-exceptions'
Enabled: true
Lint/ImplicitStringConcatenation:
Description: >-
Checks for adjacent string literals on the same line, which
could better be represented as a single string literal.
Enabled: true
Lint/IneffectiveAccessModifier:
Description: >-
Checks for attempts to use `private` or `protected` to set
the visibility of a class method, which does not work.
Enabled: true
Lint/InheritException:
Description: 'Avoid inheriting from the `Exception` class.'
Enabled: true
Lint/InterpolationCheck:
Description: 'Raise warning for interpolation in single q strs'
Enabled: true
Lint/LiteralAsCondition:
Description: 'Checks of literals used in conditions.'
Enabled: true
Lint/LiteralInInterpolation:
Description: 'Checks for literals used in interpolation.'
Enabled: true
Lint/Loop:
Description: >-
Use Kernel#loop with break rather than begin/end/until or
begin/end/while for post-loop tests.
StyleGuide: '#loop-with-break'
Enabled: true
Lint/MissingCopEnableDirective:
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
Enabled: true
Lint/MultipleCompare:
Description: "Use `&&` operator to compare multiple value."
Enabled: true
Lint/NestedMethodDefinition:
Description: 'Do not use nested method definitions.'
StyleGuide: '#no-nested-methods'
Enabled: true
Lint/NestedPercentLiteral:
Description: 'Checks for nested percent literals.'
Enabled: true
Lint/NextWithoutAccumulator:
Description: >-
Do not omit the accumulator when calling `next`
in a `reduce`/`inject` block.
Enabled: true
Lint/NonLocalExitFromIterator:
Description: 'Do not use return in iterator to cause non-local exit.'
Enabled: true
Lint/OrderedMagicComments:
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
Enabled: true
Lint/ParenthesesAsGroupedExpression:
Description: >-
Checks for method calls with a space before the opening
parenthesis.
StyleGuide: '#parens-no-spaces'
Enabled: true
Lint/PercentStringArray:
Description: >-
Checks for unwanted commas and quotes in %w/%W literals.
Enabled: true
Lint/PercentSymbolArray:
Description: >-
Checks for unwanted commas and colons in %i/%I literals.
Enabled: true
Lint/RandOne:
Description: >-
Checks for `rand(1)` calls. Such calls always return `0`
and most likely a mistake.
Enabled: true
Lint/RedundantWithIndex:
Description: 'Checks for redundant `with_index`.'
Enabled: true
Lint/RedundantWithObject:
Description: 'Checks for redundant `with_object`.'
Enabled: true
Lint/RegexpAsCondition:
Description: >-
Do not use regexp literal as a condition.
The regexp literal matches `$_` implicitly.
Enabled: true
Lint/RequireParentheses:
Description: >-
Use parentheses in the method call to avoid confusion
about precedence.
Enabled: true
Lint/RescueException:
Description: 'Avoid rescuing the Exception class.'
StyleGuide: '#no-blind-rescues'
Enabled: true
Lint/RescueType:
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
Enabled: true
Lint/ReturnInVoidContext:
Description: 'Checks for return in void context.'
Enabled: true
Lint/SafeNavigationChain:
Description: 'Do not chain ordinary method call after safe navigation operator.'
Enabled: true
Lint/ScriptPermission:
Description: 'Grant script file execute permission.'
Enabled: true
Lint/ShadowedArgument:
Description: 'Avoid reassigning arguments before they were used.'
Enabled: true
Lint/ShadowedException:
Description: >-
Avoid rescuing a higher level exception
before a lower level exception.
Enabled: true
Lint/ShadowingOuterLocalVariable:
Description: >-
Do not use the same name as outer local variable
for block arguments or block local variables.
Enabled: true
Lint/StringConversionInInterpolation:
Description: 'Checks for Object#to_s usage in string interpolation.'
StyleGuide: '#no-to-s'
Enabled: true
Lint/Syntax:
Description: 'Checks syntax error'
Enabled: true
Lint/UnderscorePrefixedVariableName:
Description: 'Do not use prefix `_` for a variable that is used.'
Enabled: true
Lint/UnifiedInteger:
Description: 'Use Integer instead of Fixnum or Bignum'
Enabled: true
Lint/UnneededCopDisableDirective:
Description: >-
Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops.
It must be explicitly disabled.
Enabled: true
Lint/UnneededCopEnableDirective:
Description: Checks for rubocop:enable comments that can be removed.
Enabled: true
Lint/UnneededRequireStatement:
Description: 'Checks for unnecessary `require` statement.'
Enabled: true
Lint/UnneededSplatExpansion:
Description: 'Checks for splat unnecessarily being called on literals'
Enabled: true
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true
Lint/UnusedBlockArgument:
Description: 'Checks for unused block arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
Lint/UriEscapeUnescape:
Description: >-
`URI.escape` method is obsolete and should not be used. Instead, use
`CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
depending on your specific use case.
Also `URI.unescape` method is obsolete and should not be used. Instead, use
`CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
depending on your specific use case.
Enabled: true
Lint/UriRegexp:
Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
Enabled: true
Lint/UselessAccessModifier:
Description: 'Checks for useless access modifiers.'
Enabled: true
ContextCreatingMethods: []
MethodCreatingMethods: []
Lint/UselessAssignment:
Description: 'Checks for useless assignment to a local variable.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
Lint/UselessComparison:
Description: 'Checks for comparison of something with itself.'
Enabled: true
Lint/UselessElseWithoutRescue:
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
Enabled: true
Lint/UselessSetterCall:
Description: 'Checks for useless setter call to a local variable.'
Enabled: true
Lint/Void:
Description: 'Possible use of operator/literal/variable in void context.'
Enabled: true
#################### Metrics ###############################
Metrics/AbcSize:
Description: >-
A calculated magnitude based on number of assignments,
branches, and conditions.
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
Enabled: true
Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: true
Exclude:
- '**/*_spec.rb'
- 'db/schema.rb'
- 'config/routes.rb'
- 'spec/factories/**/*.rb'
- 'config/initializers/*.rb'
- 'config/environments/*.rb'
- 'Vagrantfile'
Metrics/BlockNesting:
Description: 'Avoid excessive block nesting'
StyleGuide: '#three-is-the-number-thou-shalt-count'
Enabled: true
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: true
Metrics/CyclomaticComplexity:
Description: >-
A complexity metric that is strongly correlated to the number
of test cases needed to validate a method.
Enabled: true
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: '#80-character-limits'
Enabled: true
Max: 120
Exclude:
- 'db/seeds.rb'
- 'config/initializers/*.rb'
Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.'
StyleGuide: '#short-methods'
Enabled: true
Metrics/ModuleLength:
Description: 'Avoid modules longer than 100 lines of code.'
Enabled: true
Metrics/ParameterLists:
Description: 'Avoid parameter lists longer than three or four parameters.'
StyleGuide: '#too-many-params'
Enabled: true
Metrics/PerceivedComplexity:
Description: >-
A complexity metric geared towards measuring complexity for a
human reader.
Enabled: true
#################### Naming ##############################
Naming/AccessorMethodName:
Description: Check the naming of accessor methods for get_/set_.
StyleGuide: '#accessor_mutator_method_names'
Enabled: true
Naming/AsciiIdentifiers:
Description: 'Use only ascii symbols in identifiers.'
StyleGuide: '#english-identifiers'
Enabled: true
Naming/BinaryOperatorParameterName:
Description: 'When defining binary operators, name the argument other.'
StyleGuide: '#other-arg'
Enabled: true
Naming/ClassAndModuleCamelCase:
Description: 'Use CamelCase for classes and modules.'
StyleGuide: '#camelcase-classes'
Enabled: true
Naming/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: '#screaming-snake-case'
Enabled: true
Naming/FileName:
Description: 'Use snake_case for source file names.'
StyleGuide: '#snake-case-files'
Enabled: true
Naming/HeredocDelimiterCase:
Description: 'Use configured case for heredoc delimiters.'
StyleGuide: '#heredoc-delimiters'
Enabled: true
Naming/HeredocDelimiterNaming:
Description: 'Use descriptive heredoc delimiters.'
StyleGuide: '#heredoc-delimiters'
Enabled: true
Naming/MemoizedInstanceVariableName:
Description: >-
Memoized method name should match memo instance variable name.
Enabled: true
Naming/MethodName:
Description: 'Use the configured style when naming methods.'
StyleGuide: '#snake-case-symbols-methods-vars'
Enabled: true
Naming/PredicateName:
Description: 'Check the names of predicate methods.'
StyleGuide: '#bool-methods-qmark'
Enabled: true
Naming/UncommunicativeBlockParamName:
Description: >-
Checks for block parameter names that contain capital letters,
end in numbers, or do not meet a minimal length.
Enabled: true
Naming/UncommunicativeMethodParamName:
Description: >-
Checks for method parameter names that contain capital letters,
end in numbers, or do not meet a minimal length.
Enabled: true
Naming/VariableName:
Description: 'Use the configured style when naming variables.'
StyleGuide: '#snake-case-symbols-methods-vars'
Enabled: true
Naming/VariableNumber:
Description: 'Use the configured style when numbering variables.'
Enabled: true
#################### Performance ###########################
Performance/Caller:
Description: >-
Use `caller(n..n)` instead of `caller`.
Enabled: true
Performance/CaseWhenSplat:
Description: >-
Place `when` conditions that use splat at the end
of the list of `when` branches.
Enabled: true
Performance/Casecmp:
Description: >-
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
Enabled: true
Performance/CompareWithBlock:
Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
Enabled: true
Performance/Count:
Description: >-
Use `count` instead of `select...size`, `reject...size`,
`select...count`, `reject...count`, `select...length`,
and `reject...length`.
# This cop has known compatibility issues with `ActiveRecord` and other
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
# For more information, see the documentation in the cop itself.
# If you understand the known risk, you can disable `SafeMode`.
SafeMode: true
Enabled: true
Performance/Detect:
Description: >-
Use `detect` instead of `select.first`, `find_all.first`,
`select.last`, and `find_all.last`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
# This cop has known compatibility issues with `ActiveRecord` and other
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
# has its own meaning. Correcting `ActiveRecord` methods with this cop
# should be considered unsafe.
SafeMode: true
Enabled: true
Performance/DoubleStartEndWith:
Description: >-
Use `str.{start,end}_with?(x, ..., y, ...)`
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Enabled: true
Performance/EndWith:
Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
AutoCorrect: false
Enabled: true
Performance/FixedSize:
Description: 'Do not compute the size of statically sized objects except in constants'
Enabled: true
Performance/FlatMap:
Description: >-
Use `Enumerable#flat_map`
instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)`
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
Enabled: true
EnabledForFlattenWithoutParams: false
# If enabled, this cop will warn about usages of
# `flatten` being called without any parameters.
# This can be dangerous since `flat_map` will only flatten 1 level, and
# `flatten` without any parameters can flatten multiple levels.
Performance/LstripRstrip:
Description: 'Use `strip` instead of `lstrip.rstrip`.'
Enabled: true
Performance/RangeInclude:
Description: 'Use `Range#cover?` instead of `Range#include?`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
Enabled: true
Performance/RedundantBlockCall:
Description: 'Use `yield` instead of `block.call`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode'
Enabled: true
Performance/RedundantMatch:
Description: >-
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
returned `MatchData` is not needed.
Enabled: true
Performance/RedundantMerge:
Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
Enabled: true
Performance/RedundantSortBy:
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
Enabled: true
Performance/RegexpMatch:
Description: >-
Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
`Regexp#===`, or `=~` when `MatchData` is not used.
Enabled: true
Performance/ReverseEach:
Description: 'Use `reverse_each` instead of `reverse.each`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
Enabled: true
Performance/Sample:
Description: >-
Use `sample` instead of `shuffle.first`,
`shuffle.last`, and `shuffle[Integer]`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
Enabled: true
Performance/Size:
Description: >-
Use `size` instead of `count` for counting
the number of elements in `Array` and `Hash`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code'
Enabled: true
Performance/StartWith:
Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
AutoCorrect: false
Enabled: true
Performance/StringReplacement:
Description: >-
Use `tr` instead of `gsub` when you are replacing the same
number of characters. Use `delete` instead of `gsub` when
you are deleting characters.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
Enabled: true
Performance/TimesMap:
Description: 'Checks for .times.map calls.'
AutoCorrect: false
Enabled: true
Performance/UnfreezeString:
Description: 'Use unary plus to get an unfrozen string literal.'
Enabled: true
Performance/UriDefaultParser:
Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
Enabled: true
#################### Rails #################################
Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.'
Enabled: true
Rails/ActiveRecordAliases:
Description: >-
Avoid Active Record aliases:
Use `update` instead of `update_attributes`.
Use `update!` instead of `update_attributes!`.
Enabled: true
Rails/ActiveSupportAliases:
Description: >-
Avoid ActiveSupport aliases of standard ruby methods:
`String#starts_with?`, `String#ends_with?`,
`Array#append`, `Array#prepend`.
Enabled: true
Rails/ApplicationJob:
Description: 'Check that jobs subclass ApplicationJob.'
Enabled: true
Rails/ApplicationRecord:
Description: 'Check that models subclass ApplicationRecord.'
Enabled: true
Rails/Blank:
Description: 'Enforce using `blank?` and `present?`.'
Enabled: true
# Convert checks for `nil` or `empty?` to `blank?`
NilOrEmpty: true
# Convert usages of not `present?` to `blank?`
NotPresent: true
# Convert usages of `unless` `present?` to `if` `blank?`
UnlessPresent: true
Rails/CreateTableWithTimestamps:
Description: >-
Checks the migration for which timestamps are not included
when creating a new table.
Enabled: true
Rails/Date:
Description: >-
Checks the correct usage of date aware methods,
such as Date.today, Date.current etc.
Enabled: true
Rails/Delegate:
Description: 'Prefer delegate method for delegations.'
Enabled: true
Rails/DelegateAllowBlank:
Description: 'Do not use allow_blank as an option to delegate.'
Enabled: true
Rails/DynamicFindBy:
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
Enabled: true
Rails/EnumUniqueness:
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
Enabled: true
Rails/EnvironmentComparison:
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
Enabled: true
Rails/Exit:
Description: >-
Favor `fail`, `break`, `return`, etc. over `exit` in
application or library code outside of Rake files to avoid
exits during unit testing or running in production.
Enabled: true
Rails/FilePath:
Description: 'Use `Rails.root.join` for file path joining.'
Enabled: true
Rails/FindBy:
Description: 'Prefer find_by over where.first.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
Enabled: true
Rails/FindEach:
Description: 'Prefer all.find_each over all.find.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
Enabled: true
Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
Enabled: true
Rails/HasManyOrHasOneDependent:
Description: 'Define the dependent option to the has_many and has_one associations.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has_many-has_one-dependent-option'
Enabled: true
Rails/HttpPositionalArguments:
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
Enabled: true
Include:
- 'spec/**/*'
- 'test/**/*'
Rails/HttpStatus:
Description: 'Enforces use of symbolic or numeric value to define HTTP status.'
Enabled: true
Rails/InverseOf:
Description: 'Checks for associations where the inverse cannot be determined automatically.'
Enabled: true
Rails/LexicallyScopedActionFilter:
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#lexically-scoped-action-filter'
Enabled: true
Rails/NotNullColumn:
Description: 'Do not add a NOT NULL column without a default value'
Enabled: true
Rails/Output:
Description: 'Checks for calls to puts, print, etc.'
Enabled: true
Rails/OutputSafety:
Description: 'The use of `html_safe` or `raw` may be a security risk.'
Enabled: true
Rails/PluralizationGrammar:
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
Enabled: true
Rails/Presence:
Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
Enabled: true
Rails/Present:
Description: 'Enforce using `blank?` and `present?`.'
Enabled: true
NotNilAndNotEmpty: true
# Convert checks for not `nil` and not `empty?` to `present?`
NotBlank: true
# Convert usages of not `blank?` to `present?`
UnlessBlank: true
# Convert usages of `unless` `blank?` to `if` `present?`
Rails/ReadWriteAttribute:
Description: >-
Checks for read_attribute(:attr) and
write_attribute(:attr, val).
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
Enabled: true
Rails/RedundantReceiverInWithOptions:
Description: 'Checks for redundant receiver in `with_options`.'
Enabled: true
Rails/RelativeDateConstant:
Description: 'Do not assign relative date to constants.'
Enabled: true
Rails/RequestReferer:
Description: 'Use consistent syntax for request.referer.'
Enabled: true
Rails/ReversibleMigration:
Description: 'Checks whether the change method of the migration file is reversible.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#reversible-migration'
Reference: 'http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
Enabled: true
Rails/SafeNavigation:
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
Enabled: true
Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Enabled: true
Rails/SkipsModelValidations:
Description: >-
Use methods that skips model validations with caution.
See reference for more information.
Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
Enabled: true
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.'
Enabled: true
Rails/UnknownEnv:
Description: 'Use correct environment name.'
Enabled: true
Rails/Validation:
Description: 'Use validates :attribute, hash of validations.'
Enabled: true
#################### Security ##############################
Security/Eval:
Description: 'The use of eval represents a serious security risk.'
Enabled: true
Security/JSONLoad:
Description: >-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
security issues. See reference for more information.
Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
Enabled: true
# Autocorrect here will change to a method that may cause crashes depending
# on the value of the argument.
AutoCorrect: false
Security/MarshalLoad:
Description: >-
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
security issues. See reference for more information.
Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
Enabled: true
Security/Open:
Description: 'The use of Kernel#open represents a serious security risk.'
Enabled: true
Security/YAMLLoad:
Description: >-
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
Enabled: true
#################### Style ###############################
Style/Alias:
Description: 'Use alias instead of alias_method.'
StyleGuide: '#alias-method'
Enabled: true
Style/AndOr:
Description: 'Use &&/|| instead of and/or.'
StyleGuide: '#no-and-or-or'
Enabled: true
Style/ArrayJoin:
Description: 'Use Array#join instead of Array#*.'
StyleGuide: '#array-join'
Enabled: true
Style/AsciiComments:
Description: 'Use only ascii symbols in comments.'
StyleGuide: '#english-comments'
Enabled: true
Style/Attr:
Description: 'Checks for uses of Module#attr.'
StyleGuide: '#attr'
Enabled: true
Style/BarePercentLiterals:
Description: 'Checks if usage of %() or %Q() matches configuration.'
StyleGuide: '#percent-q-shorthand'
Enabled: true
Style/BeginBlock:
Description: 'Avoid the use of BEGIN blocks.'
StyleGuide: '#no-BEGIN-blocks'
Enabled: true
Style/BlockComments:
Description: 'Do not use block comments.'
StyleGuide: '#no-block-comments'
Enabled: true
Style/BlockDelimiters:
Description: >-
Avoid using {...} for multi-line blocks (multiline chaining is
always ugly).
Prefer {...} over do...end for single-line blocks.
StyleGuide: '#single-line-blocks'
Enabled: true
Style/BracesAroundHashParameters:
Description: 'Enforce braces style around hash parameters.'
Enabled: true
Style/CaseEquality:
Description: 'Avoid explicit use of the case equality operator(===).'
StyleGuide: '#no-case-equality'
Enabled: true
Style/CharacterLiteral:
Description: 'Checks for uses of character literals.'
StyleGuide: '#no-character-literals'
Enabled: true
Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
StyleGuide: '#namespace-definition'
# Moving from compact to nested children requires knowledge of whether the
# outer parent is a module or a class. Moving from nested to compact requires
# verification that the outer parent is defined elsewhere. Rubocop does not
# have the knowledge to perform either operation safely and thus requires
# manual oversight.
AutoCorrect: false
Enabled: true
Style/ClassCheck:
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
Enabled: true
Style/ClassMethods:
Description: 'Use self when defining module/class methods.'
StyleGuide: '#def-self-class-methods'
Enabled: true
Style/ClassVars:
Description: 'Avoid the use of class variables.'
StyleGuide: '#no-class-vars'
Enabled: true
Style/ColonMethodCall:
Description: 'Do not use :: for method call.'
StyleGuide: '#double-colons'
Enabled: true
Style/ColonMethodDefinition:
Description: 'Do not use :: for defining class methods.'
StyleGuide: '#colon-method-definition'
Enabled: true
Style/CommandLiteral:
Description: 'Use `` or %x around command literals.'
StyleGuide: '#percent-x'
Enabled: true
Style/CommentAnnotation:
Description: >-
Checks formatting of special comments
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
StyleGuide: '#annotate-keywords'
Enabled: true
Style/CommentedKeyword:
Description: 'Do not place comments on the same line as certain keywords.'
Enabled: true
Style/ConditionalAssignment:
Description: >-
Use the return value of `if` and `case` statements for
assignment to a variable and variable comparison instead
of assigning that variable inside of each branch.
Enabled: true
Style/DateTime:
Description: 'Use Date or Time over DateTime.'
StyleGuide: '#date--time'
Enabled: true
Style/DefWithParentheses:
Description: 'Use def with parentheses when there are arguments.'
StyleGuide: '#method-parens'
Enabled: true
Style/Dir:
Description: >-
Use the `__dir__` method to retrieve the canonicalized
absolute path to the current file.
Enabled: true
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'db/**/*'
- 'config/**/*'
Style/DoubleNegation:
Description: 'Checks for uses of double negation (!!).'
StyleGuide: '#no-bang-bang'
Enabled: true
Style/EachForSimpleLoop:
Description: >-
Use `Integer#times` for a simple loop which iterates a fixed
number of times.
Enabled: true
Style/EachWithObject:
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
Enabled: true
Style/EmptyBlockParameter:
Description: 'Omit pipes for empty block parameters.'
Enabled: true
Style/EmptyCaseCondition:
Description: 'Avoid empty condition in case statements.'
Enabled: true
Style/EmptyElse:
Description: 'Avoid empty else-clauses.'
Enabled: true
Style/EmptyLambdaParameter:
Description: 'Omit parens for empty lambda parameters.'
Enabled: true
Style/EmptyLiteral:
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
StyleGuide: '#literal-array-hash'
Enabled: true
Style/EmptyMethod:
Description: 'Checks the formatting of empty method definitions.'
StyleGuide: '#no-single-line-methods'
Enabled: true
Style/Encoding:
Description: 'Use UTF-8 as the source file encoding.'
StyleGuide: '#utf-8'
Enabled: true
Style/EndBlock:
Description: 'Avoid the use of END blocks.'
StyleGuide: '#no-END-blocks'
Enabled: true
Style/EvalWithLocation:
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
Enabled: true
Style/EvenOdd:
Description: 'Favor the use of Integer#even? && Integer#odd?'
StyleGuide: '#predicate-methods'
Enabled: true
Style/ExpandPathArguments:
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
Enabled: true
Style/FlipFlop:
Description: 'Checks for flip flops'
StyleGuide: '#no-flip-flops'
Enabled: true
Style/For:
Description: 'Checks use of for or each in multiline loops.'
StyleGuide: '#no-for-loops'
Enabled: true
Style/FormatString:
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
StyleGuide: '#sprintf'
Enabled: true
Style/FormatStringToken:
Description: 'Use a consistent style for format string tokens.'
Enabled: true
Style/FrozenStringLiteralComment:
Description: >-
Add the frozen_string_literal comment to the top of files
to help transition from Ruby 2.3.0 to Ruby 3.0.
Enabled: true
Exclude:
- 'db/**/*'
Style/GlobalVars:
Description: 'Do not introduce global variables.'
StyleGuide: '#instance-vars'
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
Enabled: true
Style/GuardClause:
Description: 'Check for conditionals that can be replaced with guard clauses'
StyleGuide: '#no-nested-conditionals'
Enabled: true
Style/HashSyntax:
Description: >-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
StyleGuide: '#hash-literals'
Enabled: true
Style/IdenticalConditionalBranches:
Description: >-
Checks that conditional statements do not have an identical
line at the end of each branch, which can validly be moved
out of the conditional.
Enabled: true
Style/IfInsideElse:
Description: 'Finds if nodes inside else, which can be converted to elsif.'
Enabled: true
Style/IfUnlessModifier:
Description: >-
Favor modifier if/unless usage when you have a
single-line body.
StyleGuide: '#if-as-a-modifier'
Enabled: true
Style/IfUnlessModifierOfIfUnless:
Description: >-
Avoid modifier if/unless usage on conditionals.
Enabled: true
Style/IfWithSemicolon:
Description: 'Do not use if x; .... Use the ternary operator instead.'
StyleGuide: '#no-semicolon-ifs'
Enabled: true
Style/InfiniteLoop:
Description: 'Use Kernel#loop for infinite loops.'
StyleGuide: '#infinite-loop'
Enabled: true
Style/InverseMethods:
Description: >-
Use the inverse method instead of `!.method`
if an inverse method is defined.
Enabled: true
Style/Lambda:
Description: 'Use the new lambda literal syntax for single-line blocks.'
StyleGuide: '#lambda-multi-line'
Enabled: true
Style/LambdaCall:
Description: 'Use lambda.call(...) instead of lambda.(...).'
StyleGuide: '#proc-call'
Enabled: true
Style/LineEndConcatenation:
Description: >-
Use \ instead of + or << to concatenate two string literals at
line end.
Enabled: true
Style/MethodCallWithoutArgsParentheses:
Description: 'Do not use parentheses for method calls with no arguments.'
StyleGuide: '#method-invocation-parens'
Enabled: true
Style/MethodDefParentheses:
Description: >-
Checks if the method definitions have or don't have
parentheses.
StyleGuide: '#method-parens'
Enabled: true
Style/MethodMissingSuper:
Description: 'Avoid using `method_missing`.'
StyleGuide: '#no-method-missing'
Enabled: true
Style/MinMax:
Description: >-
Use `Enumerable#minmax` instead of `Enumerable#min`
and `Enumerable#max` in conjunction.'
Enabled: true
Style/MixinGrouping:
Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
StyleGuide: '#mixin-grouping'
Enabled: true
Style/MixinUsage:
Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
Enabled: true
Style/ModuleFunction:
Description: 'Checks for usage of `extend self` in modules.'
StyleGuide: '#module-function'
Enabled: true
Style/MultilineBlockChain:
Description: 'Avoid multi-line chains of blocks.'
StyleGuide: '#single-line-blocks'
Enabled: true
Style/MultilineIfModifier:
Description: 'Only use if/unless modifiers on single line statements.'
StyleGuide: '#no-multiline-if-modifiers'
Enabled: true
Style/MultilineIfThen:
Description: 'Do not use then for multi-line if/unless.'
StyleGuide: '#no-then'
Enabled: true
Style/MultilineMemoization:
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
Enabled: true
Style/MultilineTernaryOperator:
Description: >-
Avoid multi-line ?: (the ternary operator);
use if/unless instead.
StyleGuide: '#no-multiline-ternary'
Enabled: true
Style/MultipleComparison:
Description: >-
Avoid comparing a variable with multiple items in a conditional,
use Array#include? instead.
Enabled: true
Style/MutableConstant:
Description: 'Do not assign mutable objects to constants.'
Enabled: true
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions
(or control flow or).
StyleGuide: '#unless-for-negatives'
Enabled: true
Style/NegatedWhile:
Description: 'Favor until over while for negative conditions.'
StyleGuide: '#until-for-negatives'
Enabled: true
Style/NestedModifier:
Description: 'Avoid using nested modifiers.'
StyleGuide: '#no-nested-modifiers'
Enabled: true
Style/NestedParenthesizedCalls:
Description: >-
Parenthesize method calls which are nested inside the
argument list of another parenthesized method call.
Enabled: true
Style/NestedTernaryOperator:
Description: 'Use one expression per branch in a ternary operator.'
StyleGuide: '#no-nested-ternary'
Enabled: true
Style/Next:
Description: 'Use `next` to skip iteration instead of a condition at the end.'
StyleGuide: '#no-nested-conditionals'
Enabled: true
Style/NilComparison:
Description: 'Prefer x.nil? to x == nil.'
StyleGuide: '#predicate-methods'
Enabled: true
Style/NonNilCheck:
Description: 'Checks for redundant nil checks.'
StyleGuide: '#no-non-nil-checks'
Enabled: true
Style/Not:
Description: 'Use ! instead of not.'
StyleGuide: '#bang-not-not'
Enabled: true
Style/NumericLiteralPrefix:
Description: 'Use smallcase prefixes for numeric literals.'
StyleGuide: '#numeric-literal-prefixes'
Enabled: true
Style/NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
readability.
StyleGuide: '#underscores-in-numerics'
Enabled: true
Exclude:
- 'db/**/*'
Style/NumericPredicate:
Description: >-
Checks for the use of predicate- or comparison methods for
numeric comparisons.
StyleGuide: '#predicate-methods'
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
AutoCorrect: false
Enabled: true
Style/OneLineConditional:
Description: >-
Favor the ternary operator(?:) over
if/then/else/end constructs.
StyleGuide: '#ternary-operator'
Enabled: true
Style/OptionalArguments:
Description: >-
Checks for optional arguments that do not appear at the end
of the argument list
StyleGuide: '#optional-arguments'
Enabled: true
Style/OrAssignment:
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
StyleGuide: '#double-pipe-for-uninit'
Enabled: true
Style/ParallelAssignment:
Description: >-
Check for simple usages of parallel assignment.
It will only warn when the number of variables
matches on both sides of the assignment.
StyleGuide: '#parallel-assignment'
Enabled: true
Style/ParenthesesAroundCondition:
Description: >-
Don't use parentheses around the condition of an
if/unless/while.
StyleGuide: '#no-parens-around-condition'
Enabled: true
Style/PercentLiteralDelimiters:
Description: 'Use `%`-literal delimiters consistently'
StyleGuide: '#percent-literal-braces'
Enabled: true
Style/PercentQLiterals:
Description: 'Checks if uses of %Q/%q match the configured preference.'
Enabled: true
Style/PerlBackrefs:
Description: 'Avoid Perl-style regex back references.'
StyleGuide: '#no-perl-regexp-last-matchers'
Enabled: true
Style/PreferredHashMethods:
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
StyleGuide: '#hash-key'
Enabled: true
Style/Proc:
Description: 'Use proc instead of Proc.new.'
StyleGuide: '#proc'
Enabled: true
Style/RaiseArgs:
Description: 'Checks the arguments passed to raise/fail.'
StyleGuide: '#exception-class-messages'
Enabled: true
Style/RandomWithOffset:
Description: >-
Prefer to use ranges when generating random numbers instead of
integers with offsets.
StyleGuide: '#random-numbers'
Enabled: true
Style/RedundantBegin:
Description: "Don't use begin blocks when they are not needed."
StyleGuide: '#begin-implicit'
Enabled: true
Style/RedundantConditional:
Description: "Don't return true/false from a conditional."
Enabled: true
Style/RedundantException:
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
StyleGuide: '#no-explicit-runtimeerror'
Enabled: true
Style/RedundantFreeze:
Description: "Checks usages of Object#freeze on immutable objects."
Enabled: true
Style/RedundantParentheses:
Description: "Checks for parentheses that seem not to serve any purpose."
Enabled: true
Style/RedundantReturn:
Description: "Don't use return where it's not required."
StyleGuide: '#no-explicit-return'
Enabled: true
Style/RedundantSelf:
Description: "Don't use self where it's not needed."
StyleGuide: '#no-self-unless-required'
Enabled: true
Style/RegexpLiteral:
Description: 'Use / or %r around regular expressions.'
StyleGuide: '#percent-r'
Enabled: true
Style/RescueModifier:
Description: 'Avoid using rescue in its modifier form.'
StyleGuide: '#no-rescue-modifiers'
Enabled: true
Style/RescueStandardError:
Description: 'Avoid rescuing without specifying an error class.'
Enabled: true
Style/SafeNavigation:
Description: >-
This cop transforms usages of a method call safeguarded by
a check for the existence of the object to
safe navigation (`&.`).
Enabled: true
Style/SelfAssignment:
Description: >-
Checks for places where self-assignment shorthand should have
been used.
StyleGuide: '#self-assignment'
Enabled: true
Style/Semicolon:
Description: "Don't use semicolons to terminate expressions."
StyleGuide: '#no-semicolon'
Enabled: true
Style/SignalException:
Description: 'Checks for proper usage of fail and raise.'
StyleGuide: '#prefer-raise-over-fail'
Enabled: true
Style/SingleLineMethods:
Description: 'Avoid single-line methods.'
StyleGuide: '#no-single-line-methods'
Enabled: true
Style/SpecialGlobalVars:
Description: 'Avoid Perl-style global variables.'
StyleGuide: '#no-cryptic-perlisms'
Enabled: true
Style/StabbyLambdaParentheses:
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
StyleGuide: '#stabby-lambda-with-args'
Enabled: true
Style/StderrPuts:
Description: 'Use `warn` instead of `$stderr.puts`.'
StyleGuide: '#warn'
Enabled: true
Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.'
StyleGuide: '#consistent-string-literals'
Enabled: true
Exclude:
- "db/schema.rb"
Style/StringLiteralsInInterpolation:
Description: >-
Checks if uses of quotes inside expressions in interpolated
strings match the configured preference.
Enabled: true
Style/StructInheritance:
Description: 'Checks for inheritance from Struct.new.'
StyleGuide: '#no-extend-struct-new'
Enabled: true
Style/SymbolArray:
Description: 'Use %i or %I for arrays of symbols.'
StyleGuide: '#percent-i'
Enabled: true
Style/SymbolLiteral:
Description: 'Use plain symbols instead of string symbols when possible.'
Enabled: true
Style/SymbolProc:
Description: 'Use symbols as procs instead of blocks when possible.'
Enabled: true
Style/TernaryParentheses:
Description: 'Checks for use of parentheses around ternary conditions.'
Enabled: true
Style/TrailingBodyOnClass:
Description: 'Class body goes below class statement.'
Enabled: true
Style/TrailingBodyOnMethodDefinition:
Description: 'Method body goes below definition.'
Enabled: true
Style/TrailingBodyOnModule:
Description: 'Module body goes below module statement.'
Enabled: true
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: '#no-trailing-params-comma'
Enabled: true
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
StyleGuide: '#no-trailing-array-commas'
Enabled: true
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
Enabled: true
Style/TrailingMethodEndStatement:
Description: 'Checks for trailing end statement on line of method body.'
Enabled: true
Style/TrailingUnderscoreVariable:
Description: >-
Checks for the usage of unneeded trailing underscores at the
end of parallel variable assignment.
AllowNamedUnderscoreVariables: true
Enabled: true
Style/TrivialAccessors:
Description: 'Prefer attr_* methods to trivial readers/writers.'
StyleGuide: '#attr_family'
Enabled: true
Style/UnlessElse:
Description: >-
Do not use unless with else. Rewrite these with the positive
case first.
StyleGuide: '#no-else-with-unless'
Enabled: true
Style/UnneededCapitalW:
Description: 'Checks for %W when interpolation is not needed.'
Enabled: true
Style/UnneededInterpolation:
Description: 'Checks for strings that are just an interpolated expression.'
Enabled: true
Style/UnneededPercentQ:
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
StyleGuide: '#percent-q'
Enabled: true
Style/UnpackFirst:
Description: >-
Checks for accessing the first element of `String#unpack`
instead of using `unpack1`
Enabled: true
Style/VariableInterpolation:
Description: >-
Don't interpolate global, instance and class variables
directly in strings.
StyleGuide: '#curlies-interpolate'
Enabled: true
Style/WhenThen:
Description: 'Use when x then ... for one-line cases.'
StyleGuide: '#one-line-cases'
Enabled: true
Style/WhileUntilDo:
Description: 'Checks for redundant do after while or until.'
StyleGuide: '#no-multiline-while-do'
Enabled: true
Style/WhileUntilModifier:
Description: >-
Favor modifier while/until usage when you have a
single-line body.
StyleGuide: '#while-as-a-modifier'
Enabled: true
Style/WordArray:
Description: 'Use %w or %W for arrays of words.'
StyleGuide: '#percent-w'
Enabled: true
Style/YodaCondition:
Description: 'Do not use literals as the first operand of a comparison.'
Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
Enabled: true
Style/ZeroLengthPredicate:
Description: 'Use #empty? when testing for objects of length 0.'
Enabled: true
================================================
FILE: .travis.yml
================================================
dist: xenial
language: ruby
sudo: true
cache: bundler
git:
depth: 50
rvm:
- 2.5.3
services:
- postgresql
- redis-server
matrix:
include:
- rvm: 2.5.3
name: 'RuboCop (for changed files)'
if: branch != master
script:
- echo "$(git --no-pager diff --name-only $TRAVIS_COMMIT_RANGE)" | xargs bundle exec rubocop "$@"
- rvm: 2.5.3
name: 'Perform DB setup (with seeds)'
before_script:
- cp config/database.yml.sample config/database.yml
script:
- bundle exec rake db:setup
- rvm: 2.5.3
name: 'Tests'
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
before_install:
- sudo apt-get update
- sudo apt-get install chromium-chromedriver
before_script:
- export PATH=$PATH:/usr/lib/chromium-browser/
- cp config/database.yml.sample config/database.yml
- cp .env.test .env
- bundle exec rake db:create
- bundle exec rake db:schema:load
script:
- bundle exec rspec
================================================
FILE: Dockerfile
================================================
FROM ruby:2.5
LABEL Stanislav Mekhonoshin <ejabberd@gmail.com>
ARG secret_token
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get update && apt-get install -y --no-install-recommends \
nodejs \
netcat
WORKDIR /app
COPY ./ .
ENV RAILS_ENV production
ENV SECRET_TOKEN=$secret_token
RUN gem install foreman
RUN bundle install
RUN cp config/database.yml.sample config/database.yml
RUN rake assets:precompile
CMD rm -f /app/tmp/pids/server.pid && rails db:migrate && foreman start -f Procfile
================================================
FILE: Dockerfile.dev
================================================
FROM ruby:2.5
LABEL Stanislav Mekhonoshin <ejabberd@gmail.com>
ARG secret_token
ENV SECRET_TOKEN=$secret_token
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
xvfb \
libxi6 \
libgconf-2-4 \
netcat \
wget \
gcc \
g++ \
make \
unzip \
nodejs \
openjdk-8-jre-headless
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get -y update \
&& apt-get -y install google-chrome-stable \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN wget -N http://chromedriver.storage.googleapis.com/$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip -P ~/ \
&& unzip ~/chromedriver_linux64.zip -d ~/ \
&& rm ~/chromedriver_linux64.zip \
&& mv -f ~/chromedriver /usr/local/bin/chromedriver \
&& chown root:root /usr/local/bin/chromedriver \
&& chmod 0755 /usr/local/bin/chromedriver
RUN wget -N http://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.0.jar -P ~/ \
&& mv -f ~/selenium-server-standalone-3.9.0.jar /usr/local/bin/selenium-server-standalone.jar \
&& chown root:root /usr/local/bin/selenium-server-standalone.jar \
&& chmod 0755 /usr/local/bin/selenium-server-standalone.jar
WORKDIR /app
COPY ./ .
RUN cp config/database.yml.sample config/database.yml
RUN gem install foreman
RUN bundle install -j 4
RUN rake assets:precompile
================================================
FILE: Gemfile
================================================
# frozen_string_literal: true
source 'http://rubygems.org'
# TODO: temporary disable http, until ruby upgrade with new openssl
# source 'https://rubygems.org'
gem 'rails', '4.2.11'
gem 'pg', '~> 0.15.1'
gem 'pghero'
gem 'thin'
gem 'chartkick'
gem 'aasm'
gem 'activemerchant', '~> 1.32.1'
gem 'bootstrap', '~> 4.2.1'
gem 'cancan'
gem 'clockwork'
gem 'devise', '4.5.0'
gem 'devise-i18n', '~> 0.10.3'
gem 'font-awesome-sass', '~> 5.6.1'
gem 'kaminari'
gem 'rails-i18n'
gem 'simple_form'
gem 'slim'
# Temporary broken with rails 4.2
gem 'active_model_serializers' # , github: 'rails-api/active_model_serializers', branch: '0-9-stable'
gem 'ransack', '1.5.1'
# TODO: switch to stable version
gem 'carrierwave'
gem 'draper', '1.4.0'
gem 'gibbon'
gem 'mechanize'
gem 'rails_config'
gem 'russian_central_bank'
gem 'show_for', github: 'plataformatec/show_for'
gem 'whenever', '0.9.0', require: false
gem 'sidekiq'
gem 'sinatra', require: false
gem 'rollbar'
# TODO: make it optional via ENV flag
gem 'newrelic_rpm'
gem 'json', '~> 1.8'
gem 'thread_safe', '0.3.6'
group :assets do
gem 'coffee-rails', '~> 4.1.0'
gem 'sass-rails'
gem 'uglifier'
end
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'ffi', '>= 1.9.24'
gem 'jbuilder', '~> 1.0.1'
group :development do
gem 'better_errors'
gem 'foreman'
gem 'letter_opener'
gem 'migration_opener'
gem 'rubocop', require: false
gem 'sandi_meter', require: false
gem 'web-console', '~> 2.0'
end
group :test, :development do
gem 'capybara'
gem 'database_cleaner', '1.0.0.RC1'
gem 'dotenv-rails'
gem 'factory_girl_rails', '~> 4.0'
gem 'faker'
gem 'i18n-tasks', '~> 0.9.28'
gem 'pry-rails'
gem 'rspec-its'
gem 'rspec-rails', '~> 3.8'
gem 'shoulda-matchers', '4.0.0.rc1'
gem 'vcr'
# TODO: switch to stable version
gem 'selenium-webdriver'
gem 'timecop'
end
group :test do
gem 'simplecov', require: false
# TODO: switch to webmock since fakeweb is not supported anymore
gem 'capybara-email'
gem 'clockwork-test'
gem 'fakeweb', github: 'chrisk/fakeweb'
gem 'zonebie'
end
================================================
FILE: LICENSE
================================================
Copyright (c) 2015 SmartVPN.biz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Procfile
================================================
web: bundle exec rails s -p 3000 -b 0.0.0.0
worker: bundle exec sidekiq -q high -q default -q mailers
clockwork: clockwork config/clock.rb
================================================
FILE: README.md
================================================
# SmartVPN Billing
[](https://travis-ci.org/Mehonoshin/smartvpn-billing)
[](https://hub.docker.com/r/mexx/smartvpn-billing)
[](http://inch-ci.org/github/Mehonoshin/smartvpn-billing)
<a href="https://imgbb.com/"><img src="https://image.ibb.co/gEVXM9/Screen-Shot-2018-10-14-at-18-34-17.png" alt="smartvpn-billing" border="0"></a>
## About
This repo contains just billing system for SmartVPN project.
All further documentation in this repo relates only to billing system.
If you are looking for general documentation about the whole SmartVPN please visit [Mehonoshin/smartvpn](https://github.com/Mehonoshin/smartvpn) repo.
## Docker image
The docker image is built automatically on every merge to master. You can always pull the latest version of the image from Docker Hub.
```
docker pull mexx/smartvpn-billing
```
For more information about the builds visit docker hub page [mexx/smartvpn-billing](https://hub.docker.com/r/mexx/smartvpn-billing)
## Contribution guidelines
TBD
### Development setup
#### Set Up and Running app locally
1. Clone repo `git clone git@github.com:Mehonoshin/smartvpn-billing.git`
2. `cd smartvpn-billing`
3. `cp config/database.yml.sample config/database.yml` and enter the username and password for access to your database.
4. `cp .env.sample .env`
5. The file `.env` contains all the env variables used in the application.
6. `bundle install`
7. `rake db:setup`
8. `rails server`
#### Start Up and Developing with Docker
1. Clone repo `git clone git@github.com:Mehonoshin/smartvpn-billing.git`
2. `cd smartvpn-billing`
3. `docker-compose -f docker-compose.development.yml up`
4. `cp .env.sample .env`
5. Edit your `SECRET_TOKEN` in `.env`
6. Go to http://lvh.me:3000
*How to run usual RoR command into docker*
1. `docker-compose -f docker-compose.development.yml up`
2. `docker-compose exec app bash` - connect to running container as named app
3. `RAILS_ENV=test ./bin/rake db:setup` - setup test database
4. `./bin/rails console` - run rails console
5. `RAILS_ENV=test bundle exec rspec spec` - start rspec tests
How it works :)
https://www.youtube.com/watch?v=VFRKPO5LHDg
### Admin access
* To get admin access you can go to [http://localhost:3000/admins/sign_in](http://localhost:3000/admins/sign_in)
* Email: `admin@smartvpn.biz`
* Password: `1234567`
Other accounts created during seeding can be found at:
* [Admins](https://github.com/Mehonoshin/smartvpn-billing/blob/master/db/seeds/06_admin.rb)
* [Users](https://github.com/Mehonoshin/smartvpn-billing/blob/master/db/seeds/04_default_user.rb#L8)
================================================
FILE: Rakefile
================================================
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('config/application', __dir__)
Smartvpn::Application.load_tasks
================================================
FILE: Vagrantfile
================================================
# frozen_string_literal: true
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'date'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
DEFAULT_BOX = 'Sgoettschkes/debian7'
SUBNET = '192.168.33'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = DEFAULT_BOX
config.vm.define 'dev', primary: true do |dev|
dev.vm.network :private_network, ip: "#{SUBNET}.10"
dev.vm.network :forwarded_port, guest: 5432, host: 5432 # pq
dev.vm.network :forwarded_port, guest: 6379, host: 6379 # redis
script = <<~SCRIPT
date --set #{DateTime.now.strftime('%Y-%m-%d')}
date --set #{DateTime.now.strftime('%H:%M')}
set -e
DEBIAN_FRONTEND=noninteractive
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
apt-get -qqy update
PG_PKG=postgresql
PG_INSTALLED=$(dpkg -l | grep -q ${PG_PKG} || echo "NOT")
if [ "x${PG_INSTALLED}" = "xNOT" ] ; then
echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list
wget https://www.postgresql.org/media/keys/ACCC4CF8.asc --no-check-certificate
apt-key add ACCC4CF8.asc
apt-get update
echo 'Name: libraries/restart-without-asking
Template: libraries/restart-without-asking
Value: true
Owners: libssl1.0.0
Flags: seen' >> /var/cache/debconf/config.dat
apt-get -qyf install postgresql-10 postgresql-contrib-10 postgresql postgresql-contrib
sed -i "s|#listen_addresses.*$|listen_addresses = '*' |g" /etc/postgresql/9.3/main/postgresql.conf
echo "host all all all trust" > /etc/postgresql/9.3/main/pg_hba.conf
/etc/init.d/postgresql restart
fi
REDIS_PKG=redis-server
REDIS_INSTALLED=$(dpkg -l | grep -q ${REDIS_PKG} || echo "NOT")
if [ "x${REDIS_INSTALLED}" = "xNOT" ] ; then
apt-get -qy install $REDIS_PKG
sed -i "s|bind 127.0.0.1|#bind = 127.0.0.1|g" /etc/redis/redis.conf
/etc/init.d/redis-server restart
fi
echo DONE
SCRIPT
dev.vm.provision :shell, inline: script
end
config.vm.define 'stage' do |stage|
stage.vm.network :private_network, ip: "#{SUBNET}.11"
end
config.vm.define 'node' do |node|
node.vm.network :private_network, ip: "#{SUBNET}.12"
end
end
================================================
FILE: app/assets/images/README.txt
================================================
----------------------------
IMAGE DIRECTORY (/img)
----------------------------
This directory should contain all images used throughout the site.
Images within the root are used by css as background images.
----------------------------
SUB DIRECTORIES
----------------------------
All other images to within sub-directories related to the section of the site they appear in. Maintaining this structure is optionally but recommended.
/blog - all blog related photos
/customers - customer/client logos
/features - app feature screenshots
/slides - slide images used on homepage banner
/team - team member photos used in the about section
/misc - random images
----------------------------
IMAGE & PHOTO CREDITS
----------------------------
* Slideshow graphics: http://medialoot.com & http://www.premiumpixels.com/
* Team photos: http://www.flickr.com/photos/vectorportal/sets/72157622868867274/
* Blog photos: http://www.flickr.com/photos/xjrlokix/ (Ben Fredericson)
* Patterns: http://subtlepatterns.com/
================================================
FILE: app/assets/images/invoice/license.txt
================================================
These icons were gathered from: iconfinder.com
================================================
FILE: app/assets/javascripts/admin.js.coffee
================================================
#= require jquery
#= require jquery_ujs
#= require jquery3
#= require popper
#= require bootstrap-sprockets
#= require Chart.bundle
#= require chartkick
================================================
FILE: app/assets/javascripts/application.js.coffee
================================================
#= require jquery
#= require jquery_ujs
#= require ./theme/bootstrap-transition
#= require ./theme/bootstrap-alert
#= require ./theme/bootstrap-affix
#= require ./theme/bootstrap-modal
#= require ./theme/bootstrap-dropdown
#= require ./theme/bootstrap-scrollspy
#= require ./theme/bootstrap-tab
#= require ./theme/bootstrap-tooltip
#= require ./theme/bootstrap-popover
#= require ./theme/bootstrap-button
#= require ./theme/bootstrap-collapse
#= require ./theme/bootstrap-carousel
#= require ./theme/bootstrap-typeahead
#= require ./theme/jquery.quicksand
#= require ./theme/jquery.flexslider-min
#= require ./theme/script
#= require jquery.ui.all
#= require main
#= require options
#= require jquery3
#= require popper
#= require bootstrap-sprockets
================================================
FILE: app/assets/javascripts/main.js.coffee
================================================
$ ->
credentialsToggler = $('.collapsable-credentials .toggler')
vpnCredentials = $('.collapsable-credentials .vpn-credential')
credentialsToggler.click (e) ->
e.preventDefault()
vpnCredentials.toggle()
$("input.datepicker").each (i) ->
$(this).datepicker
altFormat: "mm-dd-yy"
dateFormat: "mm-dd-yy"
altField: $(this).next()
================================================
FILE: app/assets/javascripts/options.js.coffee
================================================
class @Options
constructor: (scope) ->
@option = $(scope)
@bind()
bind: ->
@option.find('select').on 'change', @update
update: (ev) ->
$(ev.target).closest('form').submit()
$ ->
$("tr.option").each ->
new Options(this)
================================================
FILE: app/assets/javascripts/theme/bootstrap-affix.js
================================================
/* ==========================================================
* bootstrap-affix.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#affix
* ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* AFFIX CLASS DEFINITION
* ====================== */
var Affix = function (element, options) {
this.options = $.extend({}, $.fn.affix.defaults, options)
this.$window = $(window)
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
this.$element = $(element)
this.checkPosition()
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height()
, scrollTop = this.$window.scrollTop()
, position = this.$element.offset()
, offset = this.options.offset
, offsetBottom = offset.bottom
, offsetTop = offset.top
, reset = 'affix affix-top affix-bottom'
, affix
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top()
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
'top' : false
if (this.affixed === affix) return
this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
}
/* AFFIX PLUGIN DEFINITION
* ======================= */
var old = $.fn.affix
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('affix')
, options = typeof option == 'object' && option
if (!data) $this.data('affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.affix.Constructor = Affix
$.fn.affix.defaults = {
offset: 0
}
/* AFFIX NO CONFLICT
* ================= */
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
/* AFFIX DATA-API
* ============== */
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
, data = $spy.data()
data.offset = data.offset || {}
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
data.offsetTop && (data.offset.top = data.offsetTop)
$spy.affix(data)
})
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-alert.js
================================================
/* ==========================================================
* bootstrap-alert.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* ALERT CLASS DEFINITION
* ====================== */
var dismiss = '[data-dismiss="alert"]'
, Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.prototype.close = function (e) {
var $this = $(this)
, selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)
e && e.preventDefault()
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
$parent.trigger(e = $.Event('close'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
$parent
.trigger('closed')
.remove()
}
$.support.transition && $parent.hasClass('fade') ?
$parent.on($.support.transition.end, removeElement) :
removeElement()
}
/* ALERT PLUGIN DEFINITION
* ======================= */
var old = $.fn.alert
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
if (!data) $this.data('alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.alert.Constructor = Alert
/* ALERT NO CONFLICT
* ================= */
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
/* ALERT DATA-API
* ============== */
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-button.js
================================================
/* ============================================================
* bootstrap-button.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function ($) {
"use strict"; // jshint ;_;
/* BUTTON PUBLIC CLASS DEFINITION
* ============================== */
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.button.defaults, options)
}
Button.prototype.setState = function (state) {
var d = 'disabled'
, $el = this.$element
, data = $el.data()
, val = $el.is('input') ? 'val' : 'html'
state = state + 'Text'
data.resetText || $el.data('resetText', $el[val]())
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit
setTimeout(function () {
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}
Button.prototype.toggle = function () {
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
$parent && $parent
.find('.active')
.removeClass('active')
this.$element.toggleClass('active')
}
/* BUTTON PLUGIN DEFINITION
* ======================== */
var old = $.fn.button
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('button')
, options = typeof option == 'object' && option
if (!data) $this.data('button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
$.fn.button.defaults = {
loadingText: 'loading...'
}
$.fn.button.Constructor = Button
/* BUTTON NO CONFLICT
* ================== */
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
/* BUTTON DATA-API
* =============== */
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-carousel.js
================================================
/* ==========================================================
* bootstrap-carousel.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#carousel
* ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* CAROUSEL CLASS DEFINITION
* ========================= */
var Carousel = function (element, options) {
this.$element = $(element)
this.options = options
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}
Carousel.prototype = {
cycle: function (e) {
if (!e) this.paused = false
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
, to: function (pos) {
var $active = this.$element.find('.item.active')
, children = $active.parent().children()
, activePos = children.index($active)
, that = this
if (pos > (children.length - 1) || pos < 0) return
if (this.sliding) {
return this.$element.one('slid', function () {
that.to(pos)
})
}
if (activePos == pos) {
return this.pause().cycle()
}
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
}
, pause: function (e) {
if (!e) this.paused = true
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
this.$element.trigger($.support.transition.end)
this.cycle()
}
clearInterval(this.interval)
this.interval = null
return this
}
, next: function () {
if (this.sliding) return
return this.slide('next')
}
, prev: function () {
if (this.sliding) return
return this.slide('prev')
}
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
, e
this.sliding = true
isCycling && this.pause()
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
e = $.Event('slide', {
relatedTarget: $next[0]
})
if ($next.hasClass('active')) return
if ($.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
this.$element.one($.support.transition.end, function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
})
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
}
isCycling && this.cycle()
return this
}
}
/* CAROUSEL PLUGIN DEFINITION
* ========================== */
var old = $.fn.carousel
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('carousel')
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
, action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.cycle()
})
}
$.fn.carousel.defaults = {
interval: 5000
, pause: 'hover'
}
$.fn.carousel.Constructor = Carousel
/* CAROUSEL NO CONFLICT
* ==================== */
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
/* CAROUSEL DATA-API
* ================= */
$(document).on('click.carousel.data-api', '[data-slide]', function (e) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data())
$target.carousel(options)
e.preventDefault()
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-collapse.js
================================================
/* =============================================================
* bootstrap-collapse.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function ($) {
"use strict"; // jshint ;_;
/* COLLAPSE PUBLIC CLASS DEFINITION
* ================================ */
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.collapse.defaults, options)
if (this.options.parent) {
this.$parent = $(this.options.parent)
}
this.options.toggle && this.toggle()
}
Collapse.prototype = {
constructor: Collapse
, dimension: function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
, show: function () {
var dimension
, scroll
, actives
, hasData
if (this.transitioning) return
dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
if (actives && actives.length) {
hasData = actives.data('collapse')
if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('collapse', null)
}
this.$element[dimension](0)
this.transition('addClass', $.Event('show'), 'shown')
$.support.transition && this.$element[dimension](this.$element[0][scroll])
}
, hide: function () {
var dimension
if (this.transitioning) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', $.Event('hide'), 'hidden')
this.$element[dimension](0)
}
, reset: function (size) {
var dimension = this.dimension()
this.$element
.removeClass('collapse')
[dimension](size || 'auto')
[0].offsetWidth
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
return this
}
, transition: function (method, startEvent, completeEvent) {
var that = this
, complete = function () {
if (startEvent.type == 'show') that.reset()
that.transitioning = 0
that.$element.trigger(completeEvent)
}
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
this.transitioning = 1
this.$element[method]('in')
$.support.transition && this.$element.hasClass('collapse') ?
this.$element.one($.support.transition.end, complete) :
complete()
}
, toggle: function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
}
/* COLLAPSE PLUGIN DEFINITION
* ========================== */
var old = $.fn.collapse
$.fn.collapse = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('collapse')
, options = typeof option == 'object' && option
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.collapse.defaults = {
toggle: true
}
$.fn.collapse.Constructor = Collapse
/* COLLAPSE NO CONFLICT
* ==================== */
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
/* COLLAPSE DATA-API
* ================= */
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
var $this = $(this), href
, target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
, option = $(target).data('collapse') ? 'toggle' : $this.data()
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
$(target).collapse(option)
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-dropdown.js
================================================
/* ============================================================
* bootstrap-dropdown.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function ($) {
"use strict"; // jshint ;_;
/* DROPDOWN CLASS DEFINITION
* ========================= */
var toggle = '[data-toggle=dropdown]'
, Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () {
$el.parent().removeClass('open')
})
}
Dropdown.prototype = {
constructor: Dropdown
, toggle: function (e) {
var $this = $(this)
, $parent
, isActive
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
$parent.toggleClass('open')
}
$this.focus()
return false
}
, keydown: function (e) {
var $this
, $items
, $active
, $parent
, isActive
, index
if (!/(38|40|27)/.test(e.keyCode)) return
$this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
$items = $('[role=menu] li:not(.divider):visible a', $parent)
if (!$items.length) return
index = $items.index($items.filter(':focus'))
if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items
.eq(index)
.focus()
}
}
function clearMenus() {
$(toggle).each(function () {
getParent($(this)).removeClass('open')
})
}
function getParent($this) {
var selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = $(selector)
$parent.length || ($parent = $this.parent())
return $parent
}
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
var old = $.fn.dropdown
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('dropdown')
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.dropdown.Constructor = Dropdown
/* DROPDOWN NO CONFLICT
* ==================== */
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
$(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-modal.js
================================================
/* =========================================================
* bootstrap-modal.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function ($) {
"use strict"; // jshint ;_;
/* MODAL CLASS DEFINITION
* ====================== */
var Modal = function (element, options) {
this.options = options
this.$element = $(element)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
}
Modal.prototype = {
constructor: Modal
, toggle: function () {
return this[!this.isShown ? 'show' : 'hide']()
}
, show: function () {
var that = this
, e = $.Event('show')
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.escape()
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(document.body) //don't move modals dom position
}
that.$element
.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
transition ?
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
that.$element.focus().trigger('shown')
})
}
, hide: function (e) {
e && e.preventDefault()
var that = this
e = $.Event('hide')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(document).off('focusin.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
$.support.transition && this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.hideModal()
}
, enforceFocus: function () {
var that = this
$(document).on('focusin.modal', function (e) {
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}
, escape: function () {
var that = this
if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.modal', function ( e ) {
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
this.$element.off('keyup.dismiss.modal')
}
}
, hideWithTransition: function () {
var that = this
, timeout = setTimeout(function () {
that.$element.off($.support.transition.end)
that.hideModal()
}, 500)
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
that.hideModal()
})
}
, hideModal: function (that) {
this.$element
.hide()
.trigger('hidden')
this.backdrop()
}
, removeBackdrop: function () {
this.$backdrop.remove()
this.$backdrop = null
}
, backdrop: function (callback) {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.click(
this.options.backdrop == 'static' ?
$.proxy(this.$element[0].focus, this.$element[0])
: $.proxy(this.hide, this)
)
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
this.removeBackdrop()
} else if (callback) {
callback()
}
}
}
/* MODAL PLUGIN DEFINITION
* ======================= */
var old = $.fn.modal
$.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
else if (options.show) data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
, show: true
}
$.fn.modal.Constructor = Modal
/* MODAL NO CONFLICT
* ================= */
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
/* MODAL DATA-API
* ============== */
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
, href = $this.attr('href')
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
$target
.modal(option)
.one('hide', function () {
$this.focus()
})
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-popover.js
================================================
/* ===========================================================
* bootstrap-popover.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#popovers
* ===========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* POPOVER PUBLIC CLASS DEFINITION
* =============================== */
var Popover = function (element, options) {
this.init('popover', element, options)
}
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
========================================== */
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
constructor: Popover
, setContent: function () {
var $tip = this.tip()
, title = this.getTitle()
, content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.removeClass('fade top bottom left right in')
}
, hasContent: function () {
return this.getTitle() || this.getContent()
}
, getContent: function () {
var content
, $e = this.$element
, o = this.options
content = $e.attr('data-content')
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
return content
}
, tip: function () {
if (!this.$tip) {
this.$tip = $(this.options.template)
}
return this.$tip
}
, destroy: function () {
this.hide().$element.off('.' + this.type).removeData(this.type)
}
})
/* POPOVER PLUGIN DEFINITION
* ======================= */
var old = $.fn.popover
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('popover')
, options = typeof option == 'object' && option
if (!data) $this.data('popover', (data = new Popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.popover.Constructor = Popover
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
placement: 'right'
, trigger: 'click'
, content: ''
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
})
/* POPOVER NO CONFLICT
* =================== */
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-scrollspy.js
================================================
/* =============================================================
* bootstrap-scrollspy.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* SCROLLSPY CLASS DEFINITION
* ========================== */
function ScrollSpy(element, options) {
var process = $.proxy(this.process, this)
, $element = $(element).is('body') ? $(window) : $(element)
, href
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.$body = $('body')
this.refresh()
this.process()
}
ScrollSpy.prototype = {
constructor: ScrollSpy
, refresh: function () {
var self = this
, $targets
this.offsets = $([])
this.targets = $([])
$targets = this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
, href = $el.data('target') || $el.attr('href')
, $href = /^#\w/.test(href) && $(href)
return ( $href
&& $href.length
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
, process: function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
, maxScroll = scrollHeight - this.$scrollElement.height()
, offsets = this.offsets
, targets = this.targets
, activeTarget = this.activeTarget
, i
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets.last()[0])
&& this.activate ( i )
}
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activate( targets[i] )
}
}
, activate: function (target) {
var active
, selector
this.activeTarget = target
$(this.selector)
.parent('.active')
.removeClass('active')
selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'
active = $(selector)
.parent('li')
.addClass('active')
if (active.parent('.dropdown-menu').length) {
active = active.closest('li.dropdown').addClass('active')
}
active.trigger('activate')
}
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('scrollspy')
, options = typeof option == 'object' && option
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.scrollspy.Constructor = ScrollSpy
$.fn.scrollspy.defaults = {
offset: 10
}
/* SCROLLSPY NO CONFLICT
* ===================== */
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
/* SCROLLSPY DATA-API
* ================== */
$(window).on('load', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
$spy.scrollspy($spy.data())
})
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-tab.js
================================================
/* ========================================================
* bootstrap-tab.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* TAB CLASS DEFINITION
* ==================== */
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype = {
constructor: Tab
, show: function () {
var $this = this.element
, $ul = $this.closest('ul:not(.dropdown-menu)')
, selector = $this.attr('data-target')
, previous
, $target
, e
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ( $this.parent('li').hasClass('active') ) return
previous = $ul.find('.active:last a')[0]
e = $.Event('show', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
$target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
, activate: function ( element, container, callback) {
var $active = container.find('> .active')
, transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active.one($.support.transition.end, next) :
next()
$active.removeClass('in')
}
}
/* TAB PLUGIN DEFINITION
* ===================== */
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('tab')
if (!data) $this.data('tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
/* TAB NO CONFLICT
* =============== */
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
/* TAB DATA-API
* ============ */
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-tooltip.js
================================================
/* ===========================================================
* bootstrap-tooltip.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* TOOLTIP PUBLIC CLASS DEFINITION
* =============================== */
var Tooltip = function (element, options) {
this.init('tooltip', element, options)
}
Tooltip.prototype = {
constructor: Tooltip
, init: function (type, element, options) {
var eventIn
, eventOut
this.type = type
this.$element = $(element)
this.options = this.getOptions(options)
this.enabled = true
if (this.options.trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (this.options.trigger != 'manual') {
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
, getOptions: function (options) {
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay
, hide: options.delay
}
}
return options
}
, enter: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
if (!self.options.delay || !self.options.delay.show) return self.show()
clearTimeout(this.timeout)
self.hoverState = 'in'
this.timeout = setTimeout(function() {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
, leave: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
if (this.timeout) clearTimeout(this.timeout)
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.hoverState = 'out'
this.timeout = setTimeout(function() {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
, show: function () {
var $tip
, inside
, pos
, actualWidth
, actualHeight
, placement
, tp
if (this.hasContent() && this.enabled) {
$tip = this.tip()
this.setContent()
if (this.options.animation) {
$tip.addClass('fade')
}
placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
inside = /in/.test(placement)
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.insertAfter(this.$element)
pos = this.getPosition(inside)
actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight
switch (inside ? placement.split(' ')[1] : placement) {
case 'bottom':
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'top':
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'left':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
break
case 'right':
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
break
}
$tip
.offset(tp)
.addClass(placement)
.addClass('in')
}
}
, setContent: function () {
var $tip = this.tip()
, title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
, hide: function () {
var that = this
, $tip = this.tip()
$tip.removeClass('in')
function removeWithAnimation() {
var timeout = setTimeout(function () {
$tip.off($.support.transition.end).detach()
}, 500)
$tip.one($.support.transition.end, function () {
clearTimeout(timeout)
$tip.detach()
})
}
$.support.transition && this.$tip.hasClass('fade') ?
removeWithAnimation() :
$tip.detach()
return this
}
, fixTitle: function () {
var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
}
}
, hasContent: function () {
return this.getTitle()
}
, getPosition: function (inside) {
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
width: this.$element[0].offsetWidth
, height: this.$element[0].offsetHeight
})
}
, getTitle: function () {
var title
, $e = this.$element
, o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
, tip: function () {
return this.$tip = this.$tip || $(this.options.template)
}
, validate: function () {
if (!this.$element[0].parentNode) {
this.hide()
this.$element = null
this.options = null
}
}
, enable: function () {
this.enabled = true
}
, disable: function () {
this.enabled = false
}
, toggleEnabled: function () {
this.enabled = !this.enabled
}
, toggle: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
self[self.tip().hasClass('in') ? 'hide' : 'show']()
}
, destroy: function () {
this.hide().$element.off('.' + this.type).removeData(this.type)
}
}
/* TOOLTIP PLUGIN DEFINITION
* ========================= */
var old = $.fn.tooltip
$.fn.tooltip = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('tooltip')
, options = typeof option == 'object' && option
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tooltip.Constructor = Tooltip
$.fn.tooltip.defaults = {
animation: true
, placement: 'top'
, selector: false
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
, trigger: 'hover'
, title: ''
, delay: 0
, html: false
}
/* TOOLTIP NO CONFLICT
* =================== */
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-transition.js
================================================
/* ===================================================
* bootstrap-transition.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
* ======================================================= */
$(function () {
$.support.transition = (function () {
var transitionEnd = (function () {
var el = document.createElement('bootstrap')
, transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd'
, 'MozTransition' : 'transitionend'
, 'OTransition' : 'oTransitionEnd otransitionend'
, 'transition' : 'transitionend'
}
, name
for (name in transEndEventNames){
if (el.style[name] !== undefined) {
return transEndEventNames[name]
}
}
}())
return transitionEnd && {
end: transitionEnd
}
})()
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/bootstrap-typeahead.js
================================================
/* =============================================================
* bootstrap-typeahead.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function($){
"use strict"; // jshint ;_;
/* TYPEAHEAD PUBLIC CLASS DEFINITION
* ================================= */
var Typeahead = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, $.fn.typeahead.defaults, options)
this.matcher = this.options.matcher || this.matcher
this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter
this.updater = this.options.updater || this.updater
this.source = this.options.source
this.$menu = $(this.options.menu)
this.shown = false
this.listen()
}
Typeahead.prototype = {
constructor: Typeahead
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element
.val(this.updater(val))
.change()
return this.hide()
}
, updater: function (item) {
return item
}
, show: function () {
var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
})
this.$menu
.insertAfter(this.$element)
.css({
top: pos.top + pos.height
, left: pos.left
})
.show()
this.shown = true
return this
}
, hide: function () {
this.$menu.hide()
this.shown = false
return this
}
, lookup: function (event) {
var items
this.query = this.$element.val()
if (!this.query || this.query.length < this.options.minLength) {
return this.shown ? this.hide() : this
}
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
return items ? this.process(items) : this
}
, process: function (items) {
var that = this
items = $.grep(items, function (item) {
return that.matcher(item)
})
items = this.sorter(items)
if (!items.length) {
return this.shown ? this.hide() : this
}
return this.render(items.slice(0, this.options.items)).show()
}
, matcher: function (item) {
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
}
, sorter: function (items) {
var beginswith = []
, caseSensitive = []
, caseInsensitive = []
, item
while (item = items.shift()) {
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
else if (~item.indexOf(this.query)) caseSensitive.push(item)
else caseInsensitive.push(item)
}
return beginswith.concat(caseSensitive, caseInsensitive)
}
, highlighter: function (item) {
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>'
})
}
, render: function (items) {
var that = this
items = $(items).map(function (i, item) {
i = $(that.options.item).attr('data-value', item)
i.find('a').html(that.highlighter(item))
return i[0]
})
items.first().addClass('active')
this.$menu.html(items)
return this
}
, next: function (event) {
var active = this.$menu.find('.active').removeClass('active')
, next = active.next()
if (!next.length) {
next = $(this.$menu.find('li')[0])
}
next.addClass('active')
}
, prev: function (event) {
var active = this.$menu.find('.active').removeClass('active')
, prev = active.prev()
if (!prev.length) {
prev = this.$menu.find('li').last()
}
prev.addClass('active')
}
, listen: function () {
this.$element
.on('blur', $.proxy(this.blur, this))
.on('keypress', $.proxy(this.keypress, this))
.on('keyup', $.proxy(this.keyup, this))
if (this.eventSupported('keydown')) {
this.$element.on('keydown', $.proxy(this.keydown, this))
}
this.$menu
.on('click', $.proxy(this.click, this))
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
}
, eventSupported: function(eventName) {
var isSupported = eventName in this.$element
if (!isSupported) {
this.$element.setAttribute(eventName, 'return;')
isSupported = typeof this.$element[eventName] === 'function'
}
return isSupported
}
, move: function (e) {
if (!this.shown) return
switch(e.keyCode) {
case 9: // tab
case 13: // enter
case 27: // escape
e.preventDefault()
break
case 38: // up arrow
e.preventDefault()
this.prev()
break
case 40: // down arrow
e.preventDefault()
this.next()
break
}
e.stopPropagation()
}
, keydown: function (e) {
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
this.move(e)
}
, keypress: function (e) {
if (this.suppressKeyPressRepeat) return
this.move(e)
}
, keyup: function (e) {
switch(e.keyCode) {
case 40: // down arrow
case 38: // up arrow
case 16: // shift
case 17: // ctrl
case 18: // alt
break
case 9: // tab
case 13: // enter
if (!this.shown) return
this.select()
break
case 27: // escape
if (!this.shown) return
this.hide()
break
default:
this.lookup()
}
e.stopPropagation()
e.preventDefault()
}
, blur: function (e) {
var that = this
setTimeout(function () { that.hide() }, 150)
}
, click: function (e) {
e.stopPropagation()
e.preventDefault()
this.select()
}
, mouseenter: function (e) {
this.$menu.find('.active').removeClass('active')
$(e.currentTarget).addClass('active')
}
}
/* TYPEAHEAD PLUGIN DEFINITION
* =========================== */
var old = $.fn.typeahead
$.fn.typeahead = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('typeahead')
, options = typeof option == 'object' && option
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.typeahead.defaults = {
source: []
, items: 8
, menu: '<ul class="typeahead dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
, minLength: 1
}
$.fn.typeahead.Constructor = Typeahead
/* TYPEAHEAD NO CONFLICT
* =================== */
$.fn.typeahead.noConflict = function () {
$.fn.typeahead = old
return this
}
/* TYPEAHEAD DATA-API
* ================== */
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
var $this = $(this)
if ($this.data('typeahead')) return
e.preventDefault()
$this.typeahead($this.data())
})
}(window.jQuery);
================================================
FILE: app/assets/javascripts/theme/html5shim.js
================================================
/*! HTML5 Shiv vpre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
Uncompressed source: https://github.com/aFarkas/html5shiv */
(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){if(!l.shivMethods)return c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="<xyz></xyz>",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b)})(this,document)
================================================
FILE: app/assets/javascripts/theme/jquery.flexslider-min.js
================================================
/*
* jQuery FlexSlider v2.1
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/
;(function(d){d.flexslider=function(i,k){var a=d(i),c=d.extend({},d.flexslider.defaults,k),e=c.namespace,p="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,t=p?"touchend":"click",l="vertical"===c.direction,m=c.reverse,h=0<c.itemWidth,r="fade"===c.animation,s=""!==c.asNavFor,f={};d.data(i,"flexslider",a);f={init:function(){a.animating=!1;a.currentSlide=c.startAt;a.animatingTo=a.currentSlide;a.atEnd=0===a.currentSlide||a.currentSlide===a.last;a.containerSelector=c.selector.substr(0,
c.selector.search(" "));a.slides=d(c.selector,a);a.container=d(a.containerSelector,a);a.count=a.slides.length;a.syncExists=0<d(c.sync).length;"slide"===c.animation&&(c.animation="swing");a.prop=l?"top":"marginLeft";a.args={};a.manualPause=!1;var b=a,g;if(g=!c.video)if(g=!r)if(g=c.useCSS)a:{g=document.createElement("div");var n=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],e;for(e in n)if(void 0!==g.style[n[e]]){a.pfx=n[e].replace("Perspective","").toLowerCase();
a.prop="-"+a.pfx+"-transform";g=!0;break a}g=!1}b.transitions=g;""!==c.controlsContainer&&(a.controlsContainer=0<d(c.controlsContainer).length&&d(c.controlsContainer));""!==c.manualControls&&(a.manualControls=0<d(c.manualControls).length&&d(c.manualControls));c.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-0.5}),a.container.empty().append(a.slides));a.doMath();s&&f.asNav.setup();a.setup("init");c.controlNav&&f.controlNav.setup();c.directionNav&&f.directionNav.setup();c.keyboard&&
(1===d(a.containerSelector).length||c.multipleKeyboard)&&d(document).bind("keyup",function(b){b=b.keyCode;if(!a.animating&&(39===b||37===b))b=39===b?a.getTarget("next"):37===b?a.getTarget("prev"):!1,a.flexAnimate(b,c.pauseOnAction)});c.mousewheel&&a.bind("mousewheel",function(b,g){b.preventDefault();var d=0>g?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},
function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<c.initDelay?setTimeout(a.play,c.initDelay):a.play());p&&c.touch&&f.touch();(!r||r&&c.smoothHeight)&&d(window).bind("resize focus",f.resize);setTimeout(function(){c.start(a)},200)},asNav:{setup:function(){a.asNav=!0;a.animatingTo=Math.floor(a.currentSlide/a.move);a.currentItem=a.currentSlide;a.slides.removeClass(e+"active-slide").eq(a.currentItem).addClass(e+"active-slide");a.slides.click(function(b){b.preventDefault();var b=d(this),g=b.index();
!d(c.asNavFor).data("flexslider").animating&&!b.hasClass("active")&&(a.direction=a.currentItem<g?"next":"prev",a.flexAnimate(g,c.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var b=1,g;a.controlNavScaffold=d('<ol class="'+e+"control-nav "+e+("thumbnails"===c.controlNav?"control-thumbs":"control-paging")+'"></ol>');if(1<a.pagingCount)for(var n=0;n<a.pagingCount;n++)g="thumbnails"===c.controlNav?
'<img src="'+a.slides.eq(n).attr("data-thumb")+'"/>':"<a>"+b+"</a>",a.controlNavScaffold.append("<li>"+g+"</li>"),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",t,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});p&&a.controlNavScaffold.delegate("a",
"click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(t,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});p&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),
a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1<a.pagingCount&&"add"===b?a.controlNavScaffold.append(d("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(c,b):f.controlNav.active()}},directionNav:{setup:function(){var b=d('<ul class="'+
e+'direction-nav"><li><a class="'+e+'prev" href="#">'+c.prevText+'</a></li><li><a class="'+e+'next" href="#">'+c.nextText+"</a></li></ul>");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(t,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});
p&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('<div class="'+e+'pauseplay"><a></a></div>');a.controlsContainer?
(a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(t,function(b){b.preventDefault();d(this).hasClass(e+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())});p&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+
"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){j=l?d-b.touches[0].pageY:d-b.touches[0].pageX;p=l?Math.abs(j)<Math.abs(b.touches[0].pageX-e):Math.abs(j)<Math.abs(b.touches[0].pageY-e);if(!p||500<Number(new Date)-k)b.preventDefault(),!r&&a.transitions&&(c.animationLoop||(j/=0===a.currentSlide&&0>j||a.currentSlide===a.last&&0<j?Math.abs(j)/q+2:1),a.setProps(f+j,"setTouch"))}function g(){i.removeEventListener("touchmove",
b,!1);if(a.animatingTo===a.currentSlide&&!p&&null!==j){var h=m?-j:j,l=0<h?a.getTarget("next"):a.getTarget("prev");a.canAdvance(l)&&(550>Number(new Date)-k&&50<Math.abs(h)||Math.abs(h)>q/2)?a.flexAnimate(l,c.pauseOnAction):r||a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}i.removeEventListener("touchend",g,!1);f=j=e=d=null}var d,e,f,q,j,k,p=!1;i.addEventListener("touchstart",function(j){a.animating?j.preventDefault():1===j.touches.length&&(a.pause(),q=l?a.h:a.w,k=Number(new Date),f=h&&m&&a.animatingTo===
a.last?0:h&&m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:m?(a.last-a.currentSlide+a.cloneOffset)*q:(a.currentSlide+a.cloneOffset)*q,d=l?j.touches[0].pageY:j.touches[0].pageX,e=l?j.touches[0].pageX:j.touches[0].pageY,i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),r?f.smoothHeight():h?(a.slides.width(a.computedW),
a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!l||r){var c=r?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&
!g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,n,i,k){s&&1===a.pagingCount&&(a.direction=a.currentItem<b?"next":"prev");if(!a.animating&&(a.canAdvance(b,k)||n)&&a.is(":visible")){if(s&&i)if(n=d(c.asNavFor).data("flexslider"),a.atEnd=0===b||b===a.count-1,n.flexAnimate(b,!0,!1,!0,k),a.direction=a.currentItem<b?"next":"prev",n.direction=a.direction,Math.ceil((b+1)/a.visible)-1!==a.currentSlide&&0!==b)a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+
"active-slide"),b=Math.floor(b/a.visible);else return a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),!1;a.animating=!0;a.animatingTo=b;c.before(a);g&&a.pause();a.syncExists&&!k&&f.sync("animate");c.controlNav&&f.controlNav.active();h||a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide");a.atEnd=0===b||b===a.last;c.directionNav&&f.directionNav.update();b===a.last&&(c.end(a),c.animationLoop||a.pause());if(r)p?(a.slides.eq(a.currentSlide).css({opacity:0,
zIndex:1}),a.slides.eq(b).css({opacity:1,zIndex:2}),a.slides.unbind("webkitTransitionEnd transitionend"),a.slides.eq(a.currentSlide).bind("webkitTransitionEnd transitionend",function(){c.after(a)}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed,c.easing),a.slides.eq(b).fadeIn(c.animationSpeed,c.easing,a.wrapup));else{var q=l?a.slides.filter(":first").height():a.computedW;h?(b=c.itemWidth>a.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,
b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?m?(a.count+a.cloneOffset)*q:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?m?0:(a.count+1)*q:m?(a.count-1-b+a.cloneOffset)*q:(b+a.cloneOffset)*q;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",
function(){a.wrapup(q)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(q)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!r&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=
function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=s?a.pagingCount-1:a.last;return g?!0:s&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:s&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&
!s?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:m&&a.animatingTo===a.last?0:m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===
a.last?a.limit:f;switch(g){case "setTotal":return m?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return m?b:a.count*b;case "jumpStart":return m?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=l?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(r)a.slides.css({width:"100%",
"float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(p?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+c.animationSpeed/1E3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing)),c.smoothHeight&&f.smoothHeight();else{var g,n;"init"===b&&(a.viewport=d('<div class="'+e+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=
0,m&&(n=d.makeArray(a.slides).reverse(),a.slides=d(n),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=m?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;l&&!h?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),
setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),
d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxW<a.w?(a.w-d*f)/f:c.itemWidth>a.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0<c.move&&c.move<a.visible?c.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:c.itemWidth>a.w?(a.itemW+2*d)*a.count-a.w-
d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(b<a.currentSlide?a.currentSlide+=1:b<=a.currentSlide&&0!==b&&(a.currentSlide-=1),a.animatingTo=a.currentSlide);if(c.controlNav&&!a.manualControls)if("add"===d&&!h||a.pagingCount>a.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCount<a.controlNav.length)h&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),
f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;l&&m?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():l&&m?a.slides.eq(a.last).remove():
a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",
keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(i){void 0===i&&(i={});if("object"===typeof i)return this.each(function(){var a=d(this),c=a.find(i.selector?i.selector:".slides > li");1===c.length?(c.fadeIn(400),
i.start&&i.start(a)):void 0==a.data("flexslider")&&new d.flexslider(this,i)});var k=d(this).data("flexslider");switch(i){case "play":k.play();break;case "pause":k.pause();break;case "next":k.flexAnimate(k.getTarget("next"),!0);break;case "prev":case "previous":k.flexAnimate(k.getTarget("prev"),!0);break;default:"number"===typeof i&&k.flexAnimate(i,!0)}}})(jQuery);
================================================
FILE: app/assets/javascripts/theme/jquery.quicksand.js
================================================
/*
Quicksand 1.2.2
Reorder and filter items with a nice shuffling animation.
Copyright (c) 2010 Jacek Galanciak (razorjack.net) and agilope.com
Big thanks for Piotr Petrus (riddle.pl) for deep code review and wonderful docs & demos.
Dual licensed under the MIT and GPL version 2 licenses.
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
http://github.com/jquery/jquery/blob/master/GPL-LICENSE.txt
Project site: http://razorjack.net/quicksand
Github site: http://github.com/razorjack/quicksand
*/
(function ($) {
$.fn.quicksand = function (collection, customOptions) {
var options = {
duration: 750,
easing: 'swing',
attribute: 'data-id', // attribute to recognize same items within source and dest
adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
useScaling: true, // disable it if you're not using scaling effect or want to improve performance
enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
selector: '> *',
dx: 0,
dy: 0
};
$.extend(options, customOptions);
if ($.browser.msie || (typeof($.fn.scale) == 'undefined')) {
// Got IE and want scaling effect? Kiss my ass.
options.useScaling = false;
}
var callbackFunction;
if (typeof(arguments[1]) == 'function') {
var callbackFunction = arguments[1];
} else if (typeof(arguments[2] == 'function')) {
var callbackFunction = arguments[2];
}
return this.each(function (i) {
var val;
var animationQueue = []; // used to store all the animation params before starting the animation; solves initial animation slowdowns
var $collection = $(collection).clone(); // destination (target) collection
var $sourceParent = $(this); // source, the visible container of source collection
var sourceHeight = $(this).css('height'); // used to keep height and document flow during the animation
var destHeight;
var adjustHeightOnCallback = false;
var offset = $($sourceParent).offset(); // offset of visible container, used in animation calculations
var offsets = []; // coordinates of every source collection item
var $source = $(this).find(options.selector); // source collection items
// Replace the collection and quit if IE6
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
$sourceParent.html('').append($collection);
return;
}
// Gets called when any animation is finished
var postCallbackPerformed = 0; // prevents the function from being called more than one time
var postCallback = function () {
if (!postCallbackPerformed) {
postCallbackPerformed = 1;
// hack:
// used to be: $sourceParent.html($dest.html()); // put target HTML into visible source container
// but new webkit builds cause flickering when replacing the collections
$toDelete = $sourceParent.find('> *');
$sourceParent.prepend($dest.find('> *'));
$toDelete.remove();
if (adjustHeightOnCallback) {
$sourceParent.css('height', destHeight);
}
options.enhancement($sourceParent); // Perform custom visual enhancements on a newly replaced collection
if (typeof callbackFunction == 'function') {
callbackFunction.call(this);
}
}
};
// Position: relative situations
var $correctionParent = $sourceParent.offsetParent();
var correctionOffset = $correctionParent.offset();
if ($correctionParent.css('position') == 'relative') {
if ($correctionParent.get(0).nodeName.toLowerCase() == 'body') {
} else {
correctionOffset.top += (parseFloat($correctionParent.css('border-top-width')) || 0);
correctionOffset.left +=( parseFloat($correctionParent.css('border-left-width')) || 0);
}
} else {
correctionOffset.top -= (parseFloat($correctionParent.css('border-top-width')) || 0);
correctionOffset.left -= (parseFloat($correctionParent.css('border-left-width')) || 0);
correctionOffset.top -= (parseFloat($correctionParent.css('margin-top')) || 0);
correctionOffset.left -= (parseFloat($correctionParent.css('margin-left')) || 0);
}
// perform custom corrections from options (use when Quicksand fails to detect proper correction)
if (isNaN(correctionOffset.left)) {
correctionOffset.left = 0;
}
if (isNaN(correctionOffset.top)) {
correctionOffset.top = 0;
}
correctionOffset.left -= options.dx;
correctionOffset.top -= options.dy;
// keeps nodes after source container, holding their position
$sourceParent.css('height', $(this).height());
// get positions of source collections
$source.each(function (i) {
offsets[i] = $(this).offset();
});
// stops previous animations on source container
$(this).stop();
var dx = 0; var dy = 0;
$source.each(function (i) {
$(this).stop(); // stop animation of collection items
var rawObj = $(this).get(0);
if (rawObj.style.position == 'absolute') {
dx = -options.dx;
dy = -options.dy;
} else {
dx = options.dx;
dy = options.dy;
}
rawObj.style.position = 'absolute';
rawObj.style.margin = '0';
rawObj.style.top = (offsets[i].top - parseFloat(rawObj.style.marginTop) - correctionOffset.top + dy) + 'px';
rawObj.style.left = (offsets[i].left - parseFloat(rawObj.style.marginLeft) - correctionOffset.left + dx) + 'px';
});
// create temporary container with destination collection
var $dest = $($sourceParent).clone();
var rawDest = $dest.get(0);
rawDest.innerHTML = '';
rawDest.setAttribute('id', '');
rawDest.style.height = 'auto';
rawDest.style.width = $sourceParent.width() + 'px';
$dest.append($collection);
// insert node into HTML
// Note that the node is under visible source container in the exactly same position
// The browser render all the items without showing them (opacity: 0.0)
// No offset calculations are needed, the browser just extracts position from underlayered destination items
// and sets animation to destination positions.
$dest.insertBefore($sourceParent);
$dest.css('opacity', 0.0);
rawDest.style.zIndex = -1;
rawDest.style.margin = '0';
rawDest.style.position = 'absolute';
rawDest.style.top = offset.top - correctionOffset.top + 'px';
rawDest.style.left = offset.left - correctionOffset.left + 'px';
if (options.adjustHeight === 'dynamic') {
// If destination container has different height than source container
// the height can be animated, adjusting it to destination height
$sourceParent.animate({height: $dest.height()}, options.duration, options.easing);
} else if (options.adjustHeight === 'auto') {
destHeight = $dest.height();
if (parseFloat(sourceHeight) < parseFloat(destHeight)) {
// Adjust the height now so that the items don't move out of the container
$sourceParent.css('height', destHeight);
} else {
// Adjust later, on callback
adjustHeightOnCallback = true;
}
}
// Now it's time to do shuffling animation
// First of all, we need to identify same elements within source and destination collections
$source.each(function (i) {
var destElement = [];
if (typeof(options.attribute) == 'function') {
val = options.attribute($(this));
$collection.each(function() {
if (options.attribute(this) == val) {
destElement = $(this);
return false;
}
});
} else {
destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
}
if (destElement.length) {
// The item is both in source and destination collections
// It it's under different position, let's move it
if (!options.useScaling) {
animationQueue.push(
{
element: $(this),
animation:
{top: destElement.offset().top - correctionOffset.top,
left: destElement.offset().left - correctionOffset.left,
opacity: 1.0
}
});
} else {
animationQueue.push({
element: $(this),
animation: {top: destElement.offset().top - correctionOffset.top,
left: destElement.offset().left - correctionOffset.left,
opacity: 1.0,
scale: '1.0'
}
});
}
} else {
// The item from source collection is not present in destination collections
// Let's remove it
if (!options.useScaling) {
animationQueue.push({element: $(this),
animation: {opacity: '0.0'}});
} else {
animationQueue.push({element: $(this), animation: {opacity: '0.0',
scale: '0.0'}});
}
}
});
$collection.each(function (i) {
// Grab all items from target collection not present in visible source collection
var sourceElement = [];
var destElement = [];
if (typeof(options.attribute) == 'function') {
val = options.attribute($(this));
$source.each(function() {
if (options.attribute(this) == val) {
sourceElement = $(this);
return false;
}
});
$collection.each(function() {
if (options.attribute(this) == val) {
destElement = $(this);
return false;
}
});
} else {
sourceElement = $source.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
}
var animationOptions;
if (sourceElement.length === 0) {
// No such element in source collection...
if (!options.useScaling) {
animationOptions = {
opacity: '1.0'
};
} else {
animationOptions = {
opacity: '1.0',
scale: '1.0'
};
}
// Let's create it
d = destElement.clone();
var rawDestElement = d.get(0);
rawDestElement.style.position = 'absolute';
rawDestElement.style.margin = '0';
rawDestElement.style.top = destElement.offset().top - correctionOffset.top + 'px';
rawDestElement.style.left = destElement.offset().left - correctionOffset.left + 'px';
d.css('opacity', 0.0); // IE
if (options.useScaling) {
d.css('transform', 'scale(0.0)');
}
d.appendTo($sourceParent);
animationQueue.push({element: $(d),
animation: animationOptions});
}
});
$dest.remove();
options.enhancement($sourceParent); // Perform custom visual enhancements during the animation
for (i = 0; i < animationQueue.length; i++) {
animationQueue[i].element.animate(animationQueue[i].animation, options.duration, options.easing, postCallback);
}
});
};
})(jQuery);
================================================
FILE: app/assets/javascripts/theme/script.js
================================================
/********************************************************
*
* Custom Javascript code for Enkel Bootstrap theme
* Written by Themelize.me (http://themelize.me)
*
*******************************************************/
$(document).ready(function() {
var defaultColour = 'green';
//Bootstrap tooltip
// invoke by adding _tooltip to a tags (this makes it validate)
$('body').tooltip({
selector: "a[class*=_tooltip]"
});
//Bootstrap popover
// invoke by adding _popover to a tags (this makes it validate)
$('body').popover({
selector: "a[class*=_popover]",
trigger: "hover"
});
//show hide elements
$('.show-hide').each(function() {
$(this).click(function() {
var state = 'open'; //assume target is closed & needs opening
var target = $(this).attr('data-target');
var targetState = $(this).attr('data-target-state');
//allows trigger link to say target is open & should be closed
if (typeof targetState !== 'undefined' && targetState !== false) {
state = targetState;
}
if (state == 'undefined') {
state = 'open';
}
$(target).toggleClass('show-hide-'+ state);
$(this).toggleClass(state);
});
});
//colour switch
$('.colour-switcher a').click(function() {
var c = $(this).attr('href').replace('#','');
$('.colour-switcher a').removeClass('active');
$('.colour-switcher a.'+ c).addClass('active');
if (c != defaultColour) {
$('#colour-scheme').attr('href','css/colour-'+ c +'.css');
}
else {
$('#colour-scheme').attr('href', '#');
}
});
//flexslider
$('.flexslider').each(function() {
var sliderSettings = {
animation: $(this).attr('data-transition'),
selector: ".slides > .slide",
controlNav: true,
smoothHeight: true
};
var sliderNav = $(this).attr('data-slidernav');
if (sliderNav != 'auto') {
sliderSettings = $.extend({}, sliderSettings, {
manualControls: sliderNav +' li a',
controlsContainer: '.flexslider-wrapper'
});
}
$(this).flexslider(sliderSettings);
});
//jQuery Quicksand plugin
//@based on: http://www.evoluted.net/thinktank/web-development/jquery-quicksand-tutorial-filtering
var $filters = $('#quicksand-categories');
var $filterType = $filters.find('li.active a').attr('class');
var $holder = $('ul#quicksand');
var $data = $holder.clone();
// react to filters being used
$filters.find('li a').click(function(e) {
$filters.find('li').removeClass('active');
var $filterType = $(this).attr('class');
$(this).parent().addClass('active');
if ($filterType == 'all') {
var $filteredData = $data.find('li');
}
else {
var $filteredData = $data.find('li[data-type=' + $filterType + ']');
}
// call quicksand and assign transition parameters
$holder.quicksand($filteredData, {
duration: 800,
});
e.preventDefault();
});
});
================================================
FILE: app/assets/stylesheets/admin.scss
================================================
@import "bootstrap";
@import "font-awesome-sprockets";
@import "font-awesome";
@import "main-admin";
================================================
FILE: app/assets/stylesheets/application.scss
================================================
@import "main";
@import "theme/bootstrap.css.scss";
@import "theme/custom-colour";
@import "theme/responsive";
@import "theme/flexslider";
@import "theme/theme-style";
@import "jquery.ui.all";
================================================
FILE: app/assets/stylesheets/main-admin.scss
================================================
html,
body {
height: 100%;
}
================================================
FILE: app/assets/stylesheets/main.scss
================================================
// Place all the styles related to the Main controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
html {
height: 100%;
}
body {
height: 100%;
}
ul.nav.nav-tabs {
li > a {
color: #00adbb;
}
li > a:hover {
color: #00adbb;
}
}
.navbar .nav {
float: none;
}
.green, .active, .enabled {
color: green;
}
.red, .disabled {
color: red;
}
.pending {
color: yellow;
}
.orange {
color: orange;
}
.bold, .state {
font-weight: bold;
}
.content {
margin-bottom: 20px;
min-height: 1000px;
height: 100%;
}
.notifications {
margin-top: 20px;
}
#footer {
position: fixed;
bottom: 0px;
width: 100%;
}
.container {
.info {
line-height: 0.7;
}
}
form.button_to {
margin: 0px;
}
.collapsable-credentials {
float: right;
position: relative;
top: -110px;
min-height: 20px;
max-width: 400px;
padding: 10px;
.vpn-credential {
display: none;
}
}
input.reflink-input {
width: 500px;
}
================================================
FILE: app/assets/stylesheets/shared.css.scss
================================================
.state {
font-weight: bold;
&.disabled {
color: red;
}
&.enabled, &.active {
color: green;
}
&.pending {
color: yellow;
}
}
================================================
FILE: app/assets/stylesheets/theme/bootstrap.css.scss
================================================
/*!
* Bootstrap v2.2.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
display: block;
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) {
display: none;
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
a:hover,
a:active {
outline: 0;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
/* Responsive images (ensure images don't scale beyond their parents) */
max-width: 100%;
/* Part 1: Set a maxium relative to the parent */
width: auto\9;
/* IE7-8 need help adjusting responsive images */
height: auto;
/* Part 2: Scale the height according to the width, otherwise you get stretching */
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
#map_canvas img,
.google-maps img {
max-width: none;
}
button,
input,
select,
textarea {
margin: 0;
font-size: 100%;
vertical-align: middle;
}
button,
input {
*overflow: visible;
line-height: normal;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
label,
select,
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
input[type="radio"],
input[type="checkbox"] {
cursor: pointer;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
textarea {
overflow: auto;
vertical-align: top;
}
@media print {
* {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page {
margin: 0.5cm;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
line-height: 0;
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 0;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333333;
background-color: #fcfcfc;
}
a {
color: #55a79a;
text-decoration: none;
}
a:hover {
color: #44857b;
text-decoration: underline;
}
.img-rounded {
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.img-polaroid {
padding: 4px;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.img-circle {
-webkit-border-radius: 500px;
-moz-border-radius: 500px;
border-radius: 500px;
}
.row {
margin-left: -20px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
content: "";
line-height: 0;
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 20px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.span12 {
width: 940px;
}
.span11 {
width: 860px;
}
.span10 {
width: 780px;
}
.span9 {
width: 700px;
}
.span8 {
width: 620px;
}
.span7 {
width: 540px;
}
.span6 {
width: 460px;
}
.span5 {
width: 380px;
}
.span4 {
width: 300px;
}
.span3 {
width: 220px;
}
.span2 {
width: 140px;
}
.span1 {
width: 60px;
}
.offset12 {
margin-left: 980px;
}
.offset11 {
margin-left: 900px;
}
.offset10 {
margin-left: 820px;
}
.offset9 {
margin-left: 740px;
}
.offset8 {
margin-left: 660px;
}
.offset7 {
margin-left: 580px;
}
.offset6 {
margin-left: 500px;
}
.offset5 {
margin-left: 420px;
}
.offset4 {
margin-left: 340px;
}
.offset3 {
margin-left: 260px;
}
.offset2 {
margin-left: 180px;
}
.offset1 {
margin-left: 100px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
content: "";
line-height: 0;
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
float: left;
margin-left: 2.127659574468085%;
*margin-left: 2.074468085106383%;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .controls-row [class*="span"] + [class*="span"] {
margin-left: 2.127659574468085%;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.48936170212765%;
*width: 91.43617021276594%;
}
.row-fluid .span10 {
width: 82.97872340425532%;
*width: 82.92553191489361%;
}
.row-fluid .span9 {
width: 74.46808510638297%;
*width: 74.41489361702126%;
}
.row-fluid .span8 {
width: 65.95744680851064%;
*width: 65.90425531914893%;
}
.row-fluid .span7 {
width: 57.44680851063829%;
*width: 57.39361702127659%;
}
.row-fluid .span6 {
width: 48.93617021276595%;
*width: 48.88297872340425%;
}
.row-fluid .span5 {
width: 40.42553191489362%;
*width: 40.37234042553192%;
}
.row-fluid .span4 {
width: 31.914893617021278%;
*width: 31.861702127659576%;
}
.row-fluid .span3 {
width: 23.404255319148934%;
*width: 23.351063829787233%;
}
.row-fluid .span2 {
width: 14.893617021276595%;
*width: 14.840425531914894%;
}
.row-fluid .span1 {
width: 6.382978723404255%;
*width: 6.329787234042553%;
}
.row-fluid .offset12 {
margin-left: 104.25531914893617%;
*margin-left: 104.14893617021275%;
}
.row-fluid .offset12:first-child {
margin-left: 102.12765957446808%;
*margin-left: 102.02127659574467%;
}
.row-fluid .offset11 {
margin-left: 95.74468085106382%;
*margin-left: 95.6382978723404%;
}
.row-fluid .offset11:first-child {
margin-left: 93.61702127659574%;
*margin-left: 93.51063829787232%;
}
.row-fluid .offset10 {
margin-left: 87.23404255319149%;
*margin-left: 87.12765957446807%;
}
.row-fluid .offset10:first-child {
margin-left: 85.1063829787234%;
*margin-left: 84.99999999999999%;
}
.row-fluid .offset9 {
margin-left: 78.72340425531914%;
*margin-left: 78.61702127659572%;
}
.row-fluid .offset9:first-child {
margin-left: 76.59574468085106%;
*margin-left: 76.48936170212764%;
}
.row-fluid .offset8 {
margin-left: 70.2127659574468%;
*margin-left: 70.10638297872339%;
}
.row-fluid .offset8:first-child {
margin-left: 68.08510638297872%;
*margin-left: 67.9787234042553%;
}
.row-fluid .offset7 {
margin-left: 61.70212765957446%;
*margin-left: 61.59574468085106%;
}
.row-fluid .offset7:first-child {
margin-left: 59.574468085106375%;
*margin-left: 59.46808510638297%;
}
.row-fluid .offset6 {
margin-left: 53.191489361702125%;
*margin-left: 53.085106382978715%;
}
.row-fluid .offset6:first-child {
margin-left: 51.063829787234035%;
*margin-left: 50.95744680851063%;
}
.row-fluid .offset5 {
margin-left: 44.68085106382979%;
*margin-left: 44.57446808510638%;
}
.row-fluid .offset5:first-child {
margin-left: 42.5531914893617%;
*margin-left: 42.4468085106383%;
}
.row-fluid .offset4 {
margin-left: 36.170212765957444%;
*margin-left: 36.06382978723405%;
}
.row-fluid .offset4:first-child {
margin-left: 34.04255319148936%;
*margin-left: 33.93617021276596%;
}
.row-fluid .offset3 {
margin-left: 27.659574468085104%;
*margin-left: 27.5531914893617%;
}
.row-fluid .offset3:first-child {
margin-left: 25.53191489361702%;
*margin-left: 25.425531914893618%;
}
.row-fluid .offset2 {
margin-left: 19.148936170212764%;
*margin-left: 19.04255319148936%;
}
.row-fluid .offset2:first-child {
margin-left: 17.02127659574468%;
*margin-left: 16.914893617021278%;
}
.row-fluid .offset1 {
margin-left: 10.638297872340425%;
*margin-left: 10.53191489361702%;
}
.row-fluid .offset1:first-child {
margin-left: 8.51063829787234%;
*margin-left: 8.404255319148938%;
}
[class*="span"].hide,
.row-fluid [class*="span"].hide {
display: none;
}
[class*="span"].pull-right,
.row-fluid [class*="span"].pull-right {
float: right;
}
.container {
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
.container:before,
.container:after {
display: table;
content: "";
line-height: 0;
}
.container:after {
clear: both;
}
.container-fluid {
padding-right: 20px;
padding-left: 20px;
*zoom: 1;
}
.container-fluid:before,
.container-fluid:after {
display: table;
content: "";
line-height: 0;
}
.container-fluid:after {
clear: both;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 21px;
font-weight: 200;
line-height: 30px;
}
small {
font-size: 85%;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
cite {
font-style: normal;
}
.muted {
color: rgba(36, 36, 36, 0.8);
}
a.muted:hover {
color: rgba(10, 10, 10, 0.8);
}
.text-warning {
color: #c09853;
}
a.text-warning:hover {
color: #a47e3c;
}
.text-error {
color: #b94a48;
}
a.text-error:hover {
color: #953b39;
}
.text-info {
color: #3a87ad;
}
a.text-info:hover {
color: #2d6987;
}
.text-success {
color: #468847;
}
a.text-success:hover {
color: #356635;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 10px 0;
font-family: inherit;
font-weight: bold;
line-height: 20px;
color: inherit;
text-rendering: optimizelegibility;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
font-weight: normal;
line-height: 1;
color: rgba(36, 36, 36, 0.8);
}
h1,
h2,
h3 {
line-height: 40px;
}
h1 {
font-size: 38.5px;
}
h2 {
font-size: 31.5px;
}
h3 {
font-size: 24.5px;
}
h4 {
font-size: 17.5px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 11.9px;
}
h1 small {
font-size: 24.5px;
}
h2 small {
font-size: 17.5px;
}
h3 small {
font-size: 14px;
}
h4 small {
font-size: 14px;
}
.page-header {
padding-bottom: 9px;
margin: 20px 0 30px;
border-bottom: 1px solid #e6e6e6;
}
ul,
ol {
padding: 0;
margin: 0 0 10px 25px;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin-bottom: 0;
}
li {
line-height: 20px;
}
ul.unstyled,
ol.unstyled {
margin-left: 0;
list-style: none;
}
ul.inline,
ol.inline {
margin-left: 0;
list-style: none;
}
ul.inline > li,
ol.inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
dl {
margin-bottom: 20px;
}
dt,
dd {
line-height: 20px;
}
dt {
font-weight: bold;
}
dd {
margin-left: 10px;
}
.dl-horizontal {
*zoom: 1;
}
.dl-horizontal:before,
.dl-horizontal:after {
display: table;
content: "";
line-height: 0;
}
.dl-horizontal:after {
clear: both;
}
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
hr {
margin: 20px 0;
border: 0;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #ffffff;
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted rgba(36, 36, 36, 0.8);
}
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 20px;
border-left: 5px solid #e6e6e6;
}
blockquote p {
margin-bottom: 0;
font-size: 16px;
font-weight: 300;
line-height: 25px;
}
blockquote small {
display: block;
line-height: 20px;
color: rgba(36, 36, 36, 0.8);
}
blockquote small:before {
content: '\2014 \00A0';
}
blockquote.pull-right {
float: right;
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #e6e6e6;
border-left: 0;
}
blockquote.pull-right p,
blockquote.pull-right small {
text-align: right;
}
blockquote.pull-right small:before {
content: '';
}
blockquote.pull-right small:after {
content: '\00A0 \2014';
}
q:before,
q:after,
blockquote:before,
blockquote:after {
content: "";
}
address {
display: block;
margin-bottom: 20px;
font-style: normal;
line-height: 20px;
}
code,
pre {
padding: 0 3px 2px;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 12px;
color: #333333;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
white-space: nowrap;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
pre.prettyprint {
margin-bottom: 20px;
}
pre code {
padding: 0;
color: inherit;
white-space: pre;
white-space: pre-wrap;
background-color: transparent;
border: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
form {
margin: 0 0 20px;
}
fieldset {
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: 40px;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
legend small {
font-size: 15px;
color: rgba(36, 36, 36, 0.8);
}
label,
input,
button,
select,
textarea {
font-size: 14px;
font-weight: normal;
line-height: 20px;
}
input,
button,
select,
textarea {
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
label {
display: block;
margin-bottom: 5px;
}
select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
display: inline-block;
height: 20px;
padding: 4px 6px;
margin-bottom: 10px;
font-size: 14px;
line-height: 20px;
color: #242424;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
vertical-align: middle;
}
input,
textarea,
.uneditable-input {
width: 206px;
}
textarea {
height: auto;
}
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
background-color: #ffffff;
border: 1px solid #cccccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
/* IE6-9 */
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
*margin-top: 0;
/* IE7 */
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
width: auto;
}
select,
input[type="file"] {
height: 30px;
/* In IE7, the height of the select element cannot be changed by height, only font-size */
*margin-top: 4px;
/* For IE7, add top margin to align select with labels */
line-height: 30px;
}
select {
width: 220px;
border: 1px solid #cccccc;
background-color: #ffffff;
}
select[multiple],
select[size] {
height: auto;
}
select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.uneditable-input,
.uneditable-textarea {
color: rgba(36, 36, 36, 0.8);
background-color: #fcfcfc;
border-color: #cccccc;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
cursor: not-allowed;
}
.uneditable-input {
overflow: hidden;
white-space: nowrap;
}
.uneditable-textarea {
width: auto;
height: auto;
}
input:-moz-placeholder,
textarea:-moz-placeholder {
color: rgba(36, 36, 36, 0.8);
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: rgba(36, 36, 36, 0.8);
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: rgba(36, 36, 36, 0.8);
}
.radio,
.checkbox {
min-height: 20px;
padding-left: 20px;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.controls > .radio:first-child,
.controls > .checkbox:first-child {
padding-top: 5px;
}
.radio.inline,
.checkbox.inline {
display: inline-block;
padding-top: 5px;
margin-bottom: 0;
vertical-align: middle;
}
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
margin-left: 10px;
}
.input-mini {
width: 60px;
}
.input-small {
width: 90px;
}
.input-medium {
width: 150px;
}
.input-large {
width: 210px;
}
.i
gitextract_v37n_0v_/
├── .dockerignore
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .hound.yml
├── .irbrc
├── .rspec
├── .rubocop.yml
├── .travis.yml
├── Dockerfile
├── Dockerfile.dev
├── Gemfile
├── LICENSE
├── Procfile
├── README.md
├── Rakefile
├── Vagrantfile
├── app/
│ ├── assets/
│ │ ├── fonts/
│ │ │ └── FontAwesome.otf
│ │ ├── images/
│ │ │ ├── README.txt
│ │ │ └── invoice/
│ │ │ └── license.txt
│ │ ├── javascripts/
│ │ │ ├── admin.js.coffee
│ │ │ ├── application.js.coffee
│ │ │ ├── main.js.coffee
│ │ │ ├── options.js.coffee
│ │ │ └── theme/
│ │ │ ├── bootstrap-affix.js
│ │ │ ├── bootstrap-alert.js
│ │ │ ├── bootstrap-button.js
│ │ │ ├── bootstrap-carousel.js
│ │ │ ├── bootstrap-collapse.js
│ │ │ ├── bootstrap-dropdown.js
│ │ │ ├── bootstrap-modal.js
│ │ │ ├── bootstrap-popover.js
│ │ │ ├── bootstrap-scrollspy.js
│ │ │ ├── bootstrap-tab.js
│ │ │ ├── bootstrap-tooltip.js
│ │ │ ├── bootstrap-transition.js
│ │ │ ├── bootstrap-typeahead.js
│ │ │ ├── html5shim.js
│ │ │ ├── jquery.flexslider-min.js
│ │ │ ├── jquery.quicksand.js
│ │ │ └── script.js
│ │ └── stylesheets/
│ │ ├── admin.scss
│ │ ├── application.scss
│ │ ├── main-admin.scss
│ │ ├── main.scss
│ │ ├── shared.css.scss
│ │ └── theme/
│ │ ├── bootstrap.css.scss
│ │ ├── custom-colour.css
│ │ ├── flexslider.css
│ │ ├── responsive.css
│ │ └── theme-style.css
│ ├── cells/
│ │ └── web/
│ │ ├── admin/
│ │ │ └── change_locale_link_cell.rb
│ │ └── base_cell.rb
│ ├── controllers/
│ │ ├── admin/
│ │ │ ├── base_controller.rb
│ │ │ ├── change_languages_controller.rb
│ │ │ ├── connections_controller.rb
│ │ │ ├── home_controller.rb
│ │ │ ├── options_controller.rb
│ │ │ ├── pay_systems_controller.rb
│ │ │ ├── plans_controller.rb
│ │ │ ├── profiles_controller.rb
│ │ │ ├── promos_controller.rb
│ │ │ ├── referrers_controller.rb
│ │ │ ├── servers_controller.rb
│ │ │ ├── traffic_reports_controller.rb
│ │ │ ├── transactions_controller.rb
│ │ │ └── users_controller.rb
│ │ ├── admins/
│ │ │ └── sessions_controller.rb
│ │ ├── api/
│ │ │ ├── authentication_controller.rb
│ │ │ ├── base_controller.rb
│ │ │ ├── connection_controller.rb
│ │ │ └── servers_controller.rb
│ │ ├── application_controller.rb
│ │ ├── billing/
│ │ │ ├── base_controller.rb
│ │ │ ├── home_controller.rb
│ │ │ ├── merchant_controller.rb
│ │ │ ├── options_controller.rb
│ │ │ ├── payments_controller.rb
│ │ │ ├── paypal_controller.rb
│ │ │ ├── promotions_controller.rb
│ │ │ ├── referrers_controller.rb
│ │ │ ├── robokassa_controller.rb
│ │ │ ├── servers_controller.rb
│ │ │ └── webmoney_controller.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── main_controller.rb
│ │ ├── referrers_controller.rb
│ │ └── users/
│ │ ├── passwords_controller.rb
│ │ ├── registrations_controller.rb
│ │ └── sessions_controller.rb
│ ├── decorators/
│ │ ├── admin/
│ │ │ └── options_decorator.rb
│ │ ├── option_attribute_decorator.rb
│ │ ├── pay_system_decorator.rb
│ │ ├── promo_decorator.rb
│ │ ├── transaction_decorator.rb
│ │ └── user_decorator.rb
│ ├── exceptions/
│ │ └── api_exception.rb
│ ├── helpers/
│ │ ├── admin_helper.rb
│ │ ├── application_helper.rb
│ │ ├── main_helper.rb
│ │ ├── options_helper.rb
│ │ ├── promos_helper.rb
│ │ └── servers_helper.rb
│ ├── inputs/
│ │ └── datepicker_input.rb
│ ├── mailers/
│ │ ├── user_connection_config_mailer.rb
│ │ └── user_mailer.rb
│ ├── models/
│ │ ├── ability.rb
│ │ ├── admin.rb
│ │ ├── authenticator.rb
│ │ ├── concerns/
│ │ │ ├── .keep
│ │ │ └── last_days_filterable.rb
│ │ ├── connection.rb
│ │ ├── connections/
│ │ │ ├── connect.rb
│ │ │ └── disconnect.rb
│ │ ├── connector.rb
│ │ ├── option.rb
│ │ ├── options/
│ │ │ ├── attributes/
│ │ │ │ └── proxy.rb
│ │ │ └── hooks/
│ │ │ └── proxy.rb
│ │ ├── pay_system.rb
│ │ ├── payment.rb
│ │ ├── plan.rb
│ │ ├── plan_has_server.rb
│ │ ├── promo.rb
│ │ ├── promoter.rb
│ │ ├── promoters/
│ │ │ └── discount_promoter.rb
│ │ ├── promoters_repository.rb
│ │ ├── promotion.rb
│ │ ├── proxy/
│ │ │ ├── connect.rb
│ │ │ └── node.rb
│ │ ├── proxy.rb
│ │ ├── referrer/
│ │ │ ├── account.rb
│ │ │ └── reward.rb
│ │ ├── referrer.rb
│ │ ├── server/
│ │ │ └── signature.rb
│ │ ├── server.rb
│ │ ├── server_config.rb
│ │ ├── test_period.rb
│ │ ├── traffic_report.rb
│ │ ├── traffic_reports/
│ │ │ ├── date_traffic_report.rb
│ │ │ ├── server_traffic_report.rb
│ │ │ └── user_traffic_report.rb
│ │ ├── transaction.rb
│ │ ├── user.rb
│ │ ├── user_option.rb
│ │ ├── withdrawal.rb
│ │ └── withdrawal_prolongation.rb
│ ├── operations/
│ │ └── ops/
│ │ └── admin/
│ │ └── user/
│ │ ├── base.rb
│ │ └── create.rb
│ ├── ransackers/
│ │ ├── base_ransacker.rb
│ │ └── never_paid_users_ransacker.rb
│ ├── serializers/
│ │ ├── admin/
│ │ │ └── users_serializer.rb
│ │ └── api/
│ │ ├── connect_serializer.rb
│ │ ├── connection_serializer.rb
│ │ └── disconnect_serializer.rb
│ ├── services/
│ │ ├── dto/
│ │ │ ├── admin/
│ │ │ │ ├── dashboard.rb
│ │ │ │ ├── discrete_base.rb
│ │ │ │ ├── discrete_customers_registrations.rb
│ │ │ │ ├── discrete_payments.rb
│ │ │ │ └── discrete_traffic.rb
│ │ │ └── base.rb
│ │ ├── forced_disconnect.rb
│ │ ├── newsletter_manager.rb
│ │ ├── option/
│ │ │ ├── activation_price_calc.rb
│ │ │ ├── activator.rb
│ │ │ └── deactivator.rb
│ │ ├── proxy/
│ │ │ ├── fetchers/
│ │ │ │ ├── base.rb
│ │ │ │ ├── free_proxy_list_net/
│ │ │ │ │ ├── row_parser.rb
│ │ │ │ │ └── web_parser.rb
│ │ │ │ └── free_proxy_lists/
│ │ │ │ ├── row_parser.rb
│ │ │ │ └── web_parser.rb
│ │ │ ├── proxy_dto.rb
│ │ │ ├── rater.rb
│ │ │ ├── repository.rb
│ │ │ └── updater.rb
│ │ ├── referrer/
│ │ │ ├── reward_calculator.rb
│ │ │ └── rewarder.rb
│ │ ├── server_config_builder.rb
│ │ ├── unpaid_users_notificator.rb
│ │ ├── withdrawal_amount_calculator.rb
│ │ └── withdrawer.rb
│ ├── uploaders/
│ │ └── config_uploader.rb
│ ├── views/
│ │ ├── admin/
│ │ │ ├── connections/
│ │ │ │ ├── _filter.html.slim
│ │ │ │ ├── active.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── home/
│ │ │ │ └── index.html.slim
│ │ │ ├── options/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── pay_systems/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── new.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── plans/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── profiles/
│ │ │ │ └── edit.html.slim
│ │ │ ├── promos/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── referrers/
│ │ │ │ ├── _referrals.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── servers/
│ │ │ │ ├── _form.html.slim
│ │ │ │ ├── edit.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── new.html.slim
│ │ │ │ └── show.html.slim
│ │ │ ├── shared/
│ │ │ │ ├── _menu.html.slim
│ │ │ │ └── _paginate.html.slim
│ │ │ ├── traffic_reports/
│ │ │ │ ├── _filter.html.slim
│ │ │ │ ├── _submenu.html.slim
│ │ │ │ ├── date.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── servers.html.slim
│ │ │ │ └── users.html.slim
│ │ │ ├── transactions/
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── payments.html.slim
│ │ │ │ └── withdrawals.html.slim
│ │ │ └── users/
│ │ │ ├── _filter.html.slim
│ │ │ ├── _payment.html.slim
│ │ │ ├── _prolongation.html.slim
│ │ │ ├── _submenu.html.slim
│ │ │ ├── _table.html.slim
│ │ │ ├── _test_period.html.slim
│ │ │ ├── edit.html.slim
│ │ │ ├── index.html.slim
│ │ │ ├── new.html.slim
│ │ │ ├── payers.html.slim
│ │ │ ├── show.html.slim
│ │ │ └── this_month_payers.html.slim
│ │ ├── admins/
│ │ │ ├── confirmations/
│ │ │ │ └── new.html.erb
│ │ │ ├── mailer/
│ │ │ │ ├── confirmation_instructions.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.slim
│ │ │ ├── shared/
│ │ │ │ └── _links.erb
│ │ │ └── unlocks/
│ │ │ └── new.html.erb
│ │ ├── application/
│ │ │ └── _notifications.html.slim
│ │ ├── billing/
│ │ │ ├── home/
│ │ │ │ ├── _account_info.html.slim
│ │ │ │ ├── _current_connection.html.slim
│ │ │ │ ├── _last_transactions.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── options/
│ │ │ │ ├── _subscribed_options.html.slim
│ │ │ │ ├── _unsubscribed_options.html.slim
│ │ │ │ └── index.html.slim
│ │ │ ├── payments/
│ │ │ │ ├── forms/
│ │ │ │ │ ├── _cc.html.slim
│ │ │ │ │ ├── _paypal.html.erb
│ │ │ │ │ ├── _wmr.html.slim
│ │ │ │ │ ├── _wmz.html.slim
│ │ │ │ │ └── _yandex.html.slim
│ │ │ │ ├── index.html.slim
│ │ │ │ ├── merchant.html.slim
│ │ │ │ └── new.html.slim
│ │ │ ├── referrers/
│ │ │ │ ├── _operations.html.slim
│ │ │ │ ├── _referrals.html.slim
│ │ │ │ └── index.html.slim
│ │ │ └── servers/
│ │ │ └── index.html.slim
│ │ ├── kaminari/
│ │ │ ├── _first_page.html.erb
│ │ │ ├── _gap.html.erb
│ │ │ ├── _last_page.html.erb
│ │ │ ├── _next_page.html.erb
│ │ │ ├── _page.html.erb
│ │ │ ├── _paginator.html.erb
│ │ │ └── _prev_page.html.erb
│ │ ├── layouts/
│ │ │ ├── admin.html.slim
│ │ │ ├── application.html.slim
│ │ │ ├── billing.html.slim
│ │ │ └── blank.html.slim
│ │ ├── mailers/
│ │ │ ├── _signature.html.slim
│ │ │ ├── user_connection_config_mailer/
│ │ │ │ └── notify.html.slim
│ │ │ └── user_mailer/
│ │ │ ├── balance_withdrawal.html.slim
│ │ │ ├── could_not_withdraw_funds.html.slim
│ │ │ ├── funds_recieved.html.slim
│ │ │ ├── test_period_enabled.html.slim
│ │ │ └── unpaid_user_notification.html.slim
│ │ ├── main/
│ │ │ ├── auth.html.slim
│ │ │ └── index.html.slim
│ │ ├── shared/
│ │ │ ├── _footer.html.slim
│ │ │ ├── _rollbar_js.html.erb
│ │ │ ├── _yandex_metrika.html.erb
│ │ │ └── _zendesk.html.erb
│ │ └── users/
│ │ ├── confirmations/
│ │ │ └── new.html.erb
│ │ ├── mailer/
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── reset_password_instructions.html.erb
│ │ │ └── unlock_instructions.html.erb
│ │ ├── passwords/
│ │ │ ├── edit.html.slim
│ │ │ └── new.html.slim
│ │ ├── registrations/
│ │ │ ├── _promo.html.slim
│ │ │ ├── edit.html.slim
│ │ │ └── new.html.slim
│ │ ├── sessions/
│ │ │ └── new.html.slim
│ │ ├── shared/
│ │ │ └── _links.erb
│ │ └── unlocks/
│ │ └── new.html.erb
│ └── workers/
│ ├── add_user_to_newsletter_worker.rb
│ ├── can_not_withdraw_notification_worker.rb
│ ├── create_user_mail_worker.rb
│ ├── decrease_balance_mail_worker.rb
│ ├── increase_balance_mail_worker.rb
│ ├── refresh_proxy_list_worker.rb
│ ├── unpaid_user_notification_worker.rb
│ ├── update_courses_worker.rb
│ └── withdrawals_worker.rb
├── bin/
│ ├── build-image
│ ├── bundle
│ ├── cop
│ ├── rails
│ ├── rake
│ └── setup
├── config/
│ ├── application.rb
│ ├── boot.rb
│ ├── clock.rb
│ ├── countries.json
│ ├── database.yml.sample
│ ├── environment.rb
│ ├── environments/
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── i18n-tasks.yml
│ ├── initializers/
│ │ ├── active_merchant.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── devise.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── kaminari_config.rb
│ │ ├── mime_types.rb
│ │ ├── rails_config.rb
│ │ ├── rollbar.rb
│ │ ├── secret_token.rb
│ │ ├── session_store.rb
│ │ ├── show_for.rb
│ │ ├── simple_form.rb
│ │ ├── simple_form_bootstrap.rb
│ │ └── wrap_parameters.rb
│ ├── locales/
│ │ ├── admin/
│ │ │ ├── en.yml
│ │ │ └── ru.yml
│ │ ├── billing/
│ │ │ ├── en.yml
│ │ │ └── ru.yml
│ │ ├── devise.en.yml
│ │ ├── devise.ru.yml
│ │ ├── en.yml
│ │ ├── kaminari.en.yml
│ │ ├── kaminari.ru.yml
│ │ ├── ru.yml
│ │ ├── show_for.en.yml
│ │ ├── show_for.ru.yml
│ │ ├── simple_form.en.yml
│ │ ├── simple_form.ru.yml
│ │ └── site/
│ │ ├── en.yml
│ │ └── ru.yml
│ ├── newrelic.yml
│ ├── routes.rb
│ ├── sample.server.ovpn.erb
│ ├── settings/
│ │ ├── development.yml
│ │ ├── production.yml
│ │ └── test.yml
│ └── settings.yml
├── config.ru
├── db/
│ ├── migrate/
│ │ ├── 20130409190444_create_posts.rb
│ │ ├── 20130421110154_devise_create_users.rb
│ │ ├── 20130421110911_create_admins.rb
│ │ ├── 20130501081828_add_fields_to_user.rb
│ │ ├── 20130501083417_create_plans.rb
│ │ ├── 20130504105921_create_payments.rb
│ │ ├── 20130504144707_create_pay_systems.rb
│ │ ├── 20130504150703_add_description_to_pay_system.rb
│ │ ├── 20130505183444_create_withdrawals.rb
│ │ ├── 20130810125453_create_servers.rb
│ │ ├── 20130925101441_add_vpn_login_and_vpn_password_to_user.rb
│ │ ├── 20131005133458_create_connections.rb
│ │ ├── 20131013140201_add_state_to_user.rb
│ │ ├── 20140105134117_add_special_and_disabled_to_plan.rb
│ │ ├── 20140112113325_create_plan_has_servers.rb
│ │ ├── 20140112123216_remove_plan_id_from_server.rb
│ │ ├── 20140112180259_add_tunnelblick_bundle_and_ios_bundle_and_linux_bundle_to_server.rb
│ │ ├── 20140116192804_add_cant_withdraw_counter_to_user.rb
│ │ ├── 20140125084325_replace_configs_by_one_universal.rb
│ │ ├── 20140202164317_create_promos.rb
│ │ ├── 20140202164614_create_promotions.rb
│ │ ├── 20140202175203_add_attributes_to_promo.rb
│ │ ├── 20140203184711_add_state_to_promo.rb
│ │ ├── 20140207114415_add_promo_id_user_id_uniqueness_index_to_promo.rb
│ │ ├── 20140227113644_add_state_to_pay_system.rb
│ │ ├── 20140301125212_add_currency_to_pay_system.rb
│ │ ├── 20140301130258_add_usd_amount_to_payment.rb
│ │ ├── 20140506135933_create_withdrawal_prolongations.rb
│ │ ├── 20140507085918_add_manual_payment_to_payment.rb
│ │ ├── 20140518132954_create_options.rb
│ │ ├── 20140518133314_create_plan_option_table.rb
│ │ ├── 20140518134712_add_state_to_option.rb
│ │ ├── 20140525091015_add_option_prices_to_plan.rb
│ │ ├── 20140525103921_create_options_users.rb
│ │ ├── 20140727094748_add_reflink_to_user.rb
│ │ ├── 20140728204118_add_referrer_id_to_user.rb
│ │ ├── 20140801123341_create_referrer_rewards.rb
│ │ ├── 20140805112916_generate_reflink_to_old_users.rb
│ │ ├── 20140817131003_create_proxy_nodes.rb
│ │ ├── 20140819160419_remove_options_users_table.rb
│ │ ├── 20140819160716_create_user_options.rb
│ │ ├── 20140823162252_create_proxy_connects.rb
│ │ ├── 20140823164144_add_option_attributes_to_connect.rb
│ │ ├── 20150104180714_add_state_to_user_option.rb
│ │ ├── 20150109161843_add_protocol_to_server.rb
│ │ ├── 20150109164839_add_port_to_server.rb
│ │ ├── 20150110141211_add_country_code_to_server.rb
│ │ ├── 20150125133216_add_test_period_enabled_to_user.rb
│ │ ├── 20150125141501_add_test_period_started_at_to_user.rb
│ │ ├── 20181014150549_add_default_user.rb
│ │ └── 20190122184018_add_pki_to_server.rb
│ ├── schema.rb
│ ├── seeds/
│ │ ├── 01_options.rb
│ │ ├── 02_plans.rb
│ │ ├── 03_pay_systems.rb
│ │ ├── 04_default_user.rb
│ │ ├── 05_default_user_referrals.rb
│ │ ├── 06_admin.rb
│ │ ├── 07_servers.rb
│ │ └── 08_default_user_connects.rb
│ └── seeds.rb
├── docker-compose.development.yml
├── lib/
│ ├── assets/
│ │ └── .keep
│ ├── bytes_converter.rb
│ ├── currencies/
│ │ ├── course.rb
│ │ └── course_converter.rb
│ ├── exceptions/
│ │ ├── admin_access_denied_exception.rb
│ │ ├── api_exception.rb
│ │ ├── billing_exception.rb
│ │ ├── dto_exception.rb
│ │ ├── not_implemented_exception.rb
│ │ ├── smartvpn_exception.rb
│ │ ├── unauthorized_exception.rb
│ │ └── withdrawer_exception.rb
│ ├── random_string.rb
│ ├── signer.rb
│ ├── tasks/
│ │ ├── .keep
│ │ ├── assets.rake
│ │ └── seed_initial_data.rake
│ └── templates/
│ └── erb/
│ └── scaffold/
│ ├── _form.html.erb
│ └── show.html.erb
├── public/
│ ├── 404.html
│ ├── 500.html
│ ├── css/
│ │ ├── bootstrap.css
│ │ ├── colour-blue.css
│ │ ├── colour-red.css
│ │ ├── custom-colour.css
│ │ ├── custom-style.css
│ │ ├── flexslider.css
│ │ ├── font/
│ │ │ └── FontAwesome.otf
│ │ ├── responsive.css
│ │ └── theme-style.css
│ ├── img/
│ │ └── README.txt
│ └── index.html
├── spec/
│ ├── cells/
│ │ └── web/
│ │ └── admin/
│ │ └── change_locale_link_cell_spec.rb
│ ├── config/
│ │ └── clock_spec.rb
│ ├── controllers/
│ │ ├── admin/
│ │ │ ├── change_languages_controller_spec.rb
│ │ │ ├── connections_controller_spec.rb
│ │ │ ├── options_controller_spec.rb
│ │ │ ├── pay_systems_controller_spec.rb
│ │ │ ├── plans_controller_spec.rb
│ │ │ ├── profiles_controller_spec.rb
│ │ │ ├── promos_controller_spec.rb
│ │ │ ├── referrers_controller_spec.rb
│ │ │ ├── servers_controller_spec.rb
│ │ │ ├── traffic_reports_controller_spec.rb
│ │ │ ├── transactions_controller_spec.rb
│ │ │ └── users_controller_spec.rb
│ │ ├── api/
│ │ │ ├── authentication_controller_spec.rb
│ │ │ ├── connection_controller_spec.rb
│ │ │ └── servers_controller_spec.rb
│ │ ├── application_controller_spec.rb
│ │ ├── billing/
│ │ │ ├── options_controller_spec.rb
│ │ │ ├── payments_controller_spec.rb
│ │ │ ├── paypal_controller_spec.rb
│ │ │ ├── promotions_controller_spec.rb
│ │ │ ├── referrers_controller_spec.rb
│ │ │ ├── robokassa_controller_spec.rb
│ │ │ ├── servers_controller_spec.rb
│ │ │ └── webmoney_controller_spec.rb
│ │ ├── referrers_controller_spec.rb
│ │ └── users/
│ │ └── registrations_controller_spec.rb
│ ├── decorators/
│ │ ├── admin/
│ │ │ └── options_decorator_spec.rb
│ │ ├── option_attribute_decorator_spec.rb
│ │ ├── pay_system_decorator_spec.rb
│ │ ├── promo_decorator_spec.rb
│ │ ├── transaction_decorator_spec.rb
│ │ └── user_decorator_spec.rb
│ ├── factories.rb
│ ├── features/
│ │ ├── admin/
│ │ │ ├── plans/
│ │ │ │ ├── plans_option_prices_spec.rb
│ │ │ │ └── update_plan_servers_spec.rb
│ │ │ ├── referrers/
│ │ │ │ └── referrals_list_toggle_spec.rb
│ │ │ ├── servers/
│ │ │ │ └── update_server_plans_spec.rb
│ │ │ └── users/
│ │ │ ├── manual_payment_spec.rb
│ │ │ ├── user_profile_page_spec.rb
│ │ │ └── withdrawal_prolongation_spec.rb
│ │ └── billing/
│ │ ├── discount_promotion_applying_spec.rb
│ │ ├── options_page_spec.rb
│ │ ├── payments_page_spec.rb
│ │ ├── referrers_page_spec.rb
│ │ ├── servers_page_spec.rb
│ │ ├── settings_page_spec.rb
│ │ ├── test_period_at_user_dashboard_spec.rb
│ │ ├── user_password_reset_spec.rb
│ │ ├── user_sign_in_spec.rb
│ │ └── user_sign_up_spec.rb
│ ├── helpers/
│ │ ├── admin_helper_spec.rb
│ │ └── application_helper_spec.rb
│ ├── i18n_spec.rb
│ ├── lib/
│ │ ├── bytes_converter_spec.rb
│ │ ├── currencies/
│ │ │ ├── course_converter_spec.rb
│ │ │ └── course_spec.rb
│ │ ├── random_string_spec.rb
│ │ └── signer_spec.rb
│ ├── mailers/
│ │ └── user_connection_config_mailer_spec.rb
│ ├── models/
│ │ ├── authenticator_spec.rb
│ │ ├── connect_spec.rb
│ │ ├── connection_spec.rb
│ │ ├── connector_spec.rb
│ │ ├── disconnect_spec.rb
│ │ ├── option_spec.rb
│ │ ├── options/
│ │ │ └── hooks/
│ │ │ └── proxy_spec.rb
│ │ ├── pay_system_spec.rb
│ │ ├── payment_spec.rb
│ │ ├── plan_has_server_spec.rb
│ │ ├── plan_spec.rb
│ │ ├── promo_spec.rb
│ │ ├── promoters/
│ │ │ └── discount_promoter_spec.rb
│ │ ├── promoters_repository_spec.rb
│ │ ├── promotion_spec.rb
│ │ ├── proxy/
│ │ │ ├── connect_spec.rb
│ │ │ └── node_spec.rb
│ │ ├── referrer/
│ │ │ ├── account_spec.rb
│ │ │ └── reward_spec.rb
│ │ ├── server/
│ │ │ └── signature_spec.rb
│ │ ├── server_config_spec.rb
│ │ ├── server_spec.rb
│ │ ├── test_period_spec.rb
│ │ ├── traffic_report_spec.rb
│ │ ├── traffic_reports/
│ │ │ ├── date_traffic_report_spec.rb
│ │ │ ├── server_traffic_report_spec.rb
│ │ │ └── user_traffic_report_spec.rb
│ │ ├── transaction_spec.rb
│ │ ├── user_option_spec.rb
│ │ ├── user_spec.rb
│ │ ├── withdrawal_prolongation_spec.rb
│ │ └── withdrawal_spec.rb
│ ├── operations/
│ │ └── ops/
│ │ └── admin/
│ │ └── user/
│ │ ├── base_spec.rb
│ │ └── create_spec.rb
│ ├── rails_helper.rb
│ ├── serializers/
│ │ ├── admin/
│ │ │ └── users_serializer_spec.rb
│ │ └── api/
│ │ └── connection_serializer_spec.rb
│ ├── services/
│ │ ├── dto/
│ │ │ └── admin/
│ │ │ ├── dashboard_spec.rb
│ │ │ └── discrete_base_spec.rb
│ │ ├── forced_disconnect_spec.rb
│ │ ├── newsletter_manager_spec.rb
│ │ ├── option/
│ │ │ ├── activation_price_calc_spec.rb
│ │ │ ├── activator_spec.rb
│ │ │ └── deactivator_spec.rb
│ │ ├── proxy/
│ │ │ ├── fetchers/
│ │ │ │ └── base_spec.rb
│ │ │ ├── rater_spec.rb
│ │ │ ├── repository_spec.rb
│ │ │ └── updater_spec.rb
│ │ ├── referrer/
│ │ │ ├── reward_calculator_spec.rb
│ │ │ └── rewarder_spec.rb
│ │ ├── server_config_builder_spec.rb
│ │ ├── unpaid_users_notificator_spec.rb
│ │ ├── withdrawal_amount_calculator_spec.rb
│ │ └── withdrawer_spec.rb
│ ├── shared_examples/
│ │ ├── admin_controller_access_spec_shared.rb
│ │ ├── api_call_controller_validation_shared.rb
│ │ ├── dashboard_total_statistics_shared.rb
│ │ ├── has_success_and_fail_responders_shared.rb
│ │ ├── last_days_filterable_shared.rb
│ │ ├── payment_submit_spec_shared.rb
│ │ └── validates_paysystem_enabled_shared.rb
│ ├── spec_helper.rb
│ ├── support/
│ │ ├── capybara_helper.rb
│ │ ├── controller_macros.rb
│ │ ├── json_helpers.rb
│ │ └── matchers/
│ │ └── json_matchers.rb
│ └── workers/
│ ├── create_user_mail_worker_spec.rb
│ ├── refresh_proxy_list_worker_spec.rb
│ ├── update_cources_worker_spec.rb
│ └── withdrawals_worker_spec.rb
└── vendor/
└── assets/
├── javascripts/
│ └── .keep
└── stylesheets/
└── .keep
SYMBOL INDEX (857 symbols across 218 files)
FILE: app/assets/javascripts/theme/bootstrap-alert.js
function removeElement (line 56) | function removeElement() {
FILE: app/assets/javascripts/theme/bootstrap-dropdown.js
function clearMenus (line 103) | function clearMenus() {
function getParent (line 109) | function getParent($this) {
FILE: app/assets/javascripts/theme/bootstrap-scrollspy.js
function ScrollSpy (line 29) | function ScrollSpy(element, options) {
FILE: app/assets/javascripts/theme/bootstrap-tab.js
function next (line 79) | function next() {
FILE: app/assets/javascripts/theme/bootstrap-tooltip.js
function removeWithAnimation (line 167) | function removeWithAnimation() {
FILE: app/assets/javascripts/theme/html5shim.js
function h (line 3) | function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("hea...
function i (line 3) | function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}
function j (line 3) | function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f(...
function k (line 3) | function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"...
FILE: app/assets/javascripts/theme/jquery.flexslider-min.js
function b (line 18) | function b(b){j=l?d-b.touches[0].pageY:d-b.touches[0].pageX;p=l?Math.abs...
function g (line 18) | function g(){i.removeEventListener("touchmove",
FILE: app/cells/web/admin/change_locale_link_cell.rb
type Web (line 3) | module Web
type Admin (line 4) | module Admin
class ChangeLocaleLinkCell (line 6) | class ChangeLocaleLinkCell < BaseCell
method render (line 7) | def render
method name_link (line 15) | def name_link
method locale_ru? (line 21) | def locale_ru?
method url (line 25) | def url
FILE: app/cells/web/base_cell.rb
type Web (line 3) | module Web
class BaseCell (line 5) | class BaseCell
FILE: app/controllers/admin/base_controller.rb
class Admin (line 3) | class Admin
class BaseController (line 4) | class BaseController < ApplicationController
method allow_only_admin (line 10) | def allow_only_admin
method set_locale (line 14) | def set_locale
method current_locale (line 18) | def current_locale
FILE: app/controllers/admin/change_languages_controller.rb
class Admin (line 3) | class Admin
class ChangeLanguagesController (line 4) | class ChangeLanguagesController < Admin::BaseController
method update (line 5) | def update
method set_session_and_redirect (line 11) | def set_session_and_redirect
FILE: app/controllers/admin/connections_controller.rb
class Admin::ConnectionsController (line 3) | class Admin::ConnectionsController < Admin::BaseController
method index (line 4) | def index
method active (line 8) | def active
method show (line 12) | def show
method connections (line 18) | def connections
method search (line 22) | def search
FILE: app/controllers/admin/home_controller.rb
class Admin::HomeController (line 3) | class Admin::HomeController < Admin::BaseController
method index (line 4) | def index
FILE: app/controllers/admin/options_controller.rb
class Admin (line 3) | class Admin
class OptionsController (line 4) | class OptionsController < Admin::BaseController
method index (line 6) | def index
method new (line 10) | def new
method create (line 14) | def create
method edit (line 23) | def edit; end
method update (line 25) | def update
method find_option (line 35) | def find_option
method resource_params (line 39) | def resource_params
FILE: app/controllers/admin/pay_systems_controller.rb
class Admin::PaySystemsController (line 3) | class Admin::PaySystemsController < Admin::BaseController
method index (line 6) | def index
method show (line 10) | def show; end
method new (line 12) | def new
method create (line 16) | def create
method edit (line 25) | def edit; end
method update (line 27) | def update
method load_resource (line 37) | def load_resource
method resource_params (line 41) | def resource_params
FILE: app/controllers/admin/plans_controller.rb
class Admin (line 3) | class Admin
class PlansController (line 4) | class PlansController < Admin::BaseController
method index (line 6) | def index
method new (line 10) | def new
method create (line 14) | def create
method edit (line 23) | def edit; end
method update (line 25) | def update
method destroy (line 33) | def destroy
method find_plan (line 40) | def find_plan
method resource_params (line 44) | def resource_params
method option_prices_params (line 50) | def option_prices_params
FILE: app/controllers/admin/profiles_controller.rb
class Admin (line 3) | class Admin
class ProfilesController (line 4) | class ProfilesController < Admin::BaseController
method edit (line 7) | def edit; end
method update (line 9) | def update
method find_admin (line 20) | def find_admin
method admin_params (line 24) | def admin_params
FILE: app/controllers/admin/promos_controller.rb
class Admin (line 3) | class Admin
class PromosController (line 4) | class PromosController < Admin::BaseController
method index (line 7) | def index
method new (line 11) | def new
method create (line 15) | def create
method edit (line 24) | def edit; end
method update (line 26) | def update
method find_promo (line 36) | def find_promo
method resource_params (line 40) | def resource_params
method all_promoters_attributes (line 45) | def all_promoters_attributes
FILE: app/controllers/admin/referrers_controller.rb
class Admin::ReferrersController (line 3) | class Admin::ReferrersController < Admin::BaseController
method index (line 4) | def index
FILE: app/controllers/admin/servers_controller.rb
class Admin (line 3) | class Admin
class ServersController (line 4) | class ServersController < Admin::BaseController
method index (line 7) | def index
method show (line 11) | def show; end
method new (line 13) | def new
method create (line 17) | def create
method edit (line 26) | def edit; end
method update (line 28) | def update
method destroy (line 36) | def destroy
method generate_config (line 41) | def generate_config
method load_resource (line 49) | def load_resource
method resource_params (line 53) | def resource_params
FILE: app/controllers/admin/traffic_reports_controller.rb
class Admin::TrafficReportsController (line 3) | class Admin::TrafficReportsController < Admin::BaseController
method index (line 4) | def index; end
method users (line 6) | def users; end
method date (line 8) | def date; end
method servers (line 10) | def servers; end
method traffic_reports (line 14) | def traffic_reports
method report (line 19) | def report
FILE: app/controllers/admin/transactions_controller.rb
class Admin::TransactionsController (line 3) | class Admin::TransactionsController < Admin::BaseController
method index (line 4) | def index
method payments (line 8) | def payments
method withdrawals (line 12) | def withdrawals
method transactions (line 18) | def transactions
FILE: app/controllers/admin/users_controller.rb
class Admin (line 3) | class Admin
class UsersController (line 4) | class UsersController < Admin::BaseController
method index (line 10) | def index
method payers (line 14) | def payers
method this_month_payers (line 18) | def this_month_payers
method show (line 22) | def show; end
method new (line 24) | def new
method create (line 28) | def create
method edit (line 38) | def edit; end
method update (line 40) | def update
method withdraw (line 48) | def withdraw
method prolongate (line 53) | def prolongate
method payment (line 58) | def payment
method emails_export (line 64) | def emails_export
method enable_test_period (line 69) | def enable_test_period
method disable_test_period (line 75) | def disable_test_period
method force_disconnect (line 80) | def force_disconnect
method find_user (line 87) | def find_user
method users (line 91) | def users
method search (line 95) | def search
method search_params (line 100) | def search_params
method payment_params (line 109) | def payment_params
method resource_params (line 113) | def resource_params
method days_number_prolongate (line 119) | def days_number_prolongate
FILE: app/controllers/admins/sessions_controller.rb
class Admins::SessionsController (line 3) | class Admins::SessionsController < Devise::SessionsController
method after_sign_out_path_for (line 6) | def after_sign_out_path_for(_resource)
method after_sign_in_path_for (line 10) | def after_sign_in_path_for(_resource)
method resource_params (line 14) | def resource_params
FILE: app/controllers/api/authentication_controller.rb
type Api (line 3) | module Api
class AuthenticationController (line 10) | class AuthenticationController < Api::BaseController
method auth (line 13) | def auth
FILE: app/controllers/api/base_controller.rb
type Api (line 3) | module Api
class BaseController (line 4) | class BaseController < ApplicationController
method valid_api_call? (line 9) | def valid_api_call?
method server (line 15) | def server
method request_ip (line 19) | def request_ip
method valid_signature? (line 23) | def valid_signature?
method signature (line 27) | def signature
FILE: app/controllers/api/connection_controller.rb
type Api (line 3) | module Api
class ConnectionController (line 6) | class ConnectionController < Api::BaseController
method connect (line 9) | def connect
method disconnect (line 17) | def disconnect
method connector (line 25) | def connector
method action_params (line 29) | def action_params
FILE: app/controllers/api/servers_controller.rb
type Api (line 3) | module Api
class ServersController (line 8) | class ServersController < Api::BaseController
method activate (line 10) | def activate
method initialization_params (line 21) | def initialization_params
FILE: app/controllers/application_controller.rb
class ApplicationController (line 3) | class ApplicationController < ActionController::Base
FILE: app/controllers/billing/base_controller.rb
class Billing::BaseController (line 3) | class Billing::BaseController < ApplicationController
method check_authorization (line 10) | def check_authorization
FILE: app/controllers/billing/home_controller.rb
class Billing::HomeController (line 3) | class Billing::HomeController < Billing::BaseController
method index (line 4) | def index
method transactions (line 12) | def transactions
FILE: app/controllers/billing/merchant_controller.rb
class Billing::MerchantController (line 3) | class Billing::MerchantController < Billing::BaseController
method success (line 7) | def success
method fail (line 11) | def fail
method check_if_pay_system_is_enabled (line 17) | def check_if_pay_system_is_enabled
method payment (line 21) | def payment
FILE: app/controllers/billing/options_controller.rb
class Billing::OptionsController (line 3) | class Billing::OptionsController < Billing::BaseController
method index (line 4) | def index
method create (line 9) | def create
method destroy (line 17) | def destroy
method update (line 22) | def update
method toggle (line 28) | def toggle
FILE: app/controllers/billing/payments_controller.rb
class Billing::PaymentsController (line 3) | class Billing::PaymentsController < Billing::BaseController
method index (line 4) | def index
method new (line 8) | def new
method create (line 13) | def create
method merchant (line 18) | def merchant
method default_price (line 25) | def default_price
method payment_params (line 32) | def payment_params
FILE: app/controllers/billing/paypal_controller.rb
class Billing::PaypalController (line 3) | class Billing::PaypalController < Billing::MerchantController
method result (line 6) | def result
method notitication (line 19) | def notitication
method payment_id (line 27) | def payment_id
FILE: app/controllers/billing/promotions_controller.rb
class Billing::PromotionsController (line 3) | class Billing::PromotionsController < Billing::BaseController
method create (line 4) | def create
method create_promotion (line 15) | def create_promotion
FILE: app/controllers/billing/referrers_controller.rb
class Billing::ReferrersController (line 3) | class Billing::ReferrersController < Billing::BaseController
method index (line 4) | def index
FILE: app/controllers/billing/robokassa_controller.rb
class Billing::RobokassaController (line 5) | class Billing::RobokassaController < Billing::MerchantController
method result (line 10) | def result
method create_notification (line 21) | def create_notification
method payment_id (line 25) | def payment_id
FILE: app/controllers/billing/servers_controller.rb
type Billing (line 3) | module Billing
class ServersController (line 4) | class ServersController < Billing::BaseController
method index (line 5) | def index
method download_config (line 9) | def download_config
method servers (line 18) | def servers
FILE: app/controllers/billing/webmoney_controller.rb
class Billing::WebmoneyController (line 5) | class Billing::WebmoneyController < Billing::MerchantController
method result (line 10) | def result
method create_notification (line 27) | def create_notification
method payment_id (line 31) | def payment_id
FILE: app/controllers/main_controller.rb
class MainController (line 3) | class MainController < ApplicationController
method index (line 4) | def index
FILE: app/controllers/referrers_controller.rb
class ReferrersController (line 3) | class ReferrersController < ApplicationController
method set_referrer (line 4) | def set_referrer
method reflink (line 11) | def reflink
FILE: app/controllers/users/passwords_controller.rb
class Users::PasswordsController (line 3) | class Users::PasswordsController < Devise::PasswordsController
method after_sign_in_path_for (line 6) | def after_sign_in_path_for(_resource)
method after_sending_reset_password_instructions_path_for (line 10) | def after_sending_reset_password_instructions_path_for(_resource_name)
FILE: app/controllers/users/registrations_controller.rb
class Users::RegistrationsController (line 3) | class Users::RegistrationsController < Devise::RegistrationsController
method after_sign_up_path_for (line 8) | def after_sign_up_path_for(_resource)
method after_sign_out_path_for (line 12) | def after_sign_out_path_for(_resource)
method after_inactive_sign_up_path_for (line 16) | def after_inactive_sign_up_path_for(_resource)
method set_additional_permitted_params (line 22) | def set_additional_permitted_params
method resolve_layout (line 29) | def resolve_layout
method current_referrer (line 37) | def current_referrer
method add_referrer_id_to_params (line 41) | def add_referrer_id_to_params
FILE: app/controllers/users/sessions_controller.rb
class Users::SessionsController (line 3) | class Users::SessionsController < Devise::SessionsController
method after_sign_out_path_for (line 6) | def after_sign_out_path_for(_resource)
method after_sign_in_path_for (line 10) | def after_sign_in_path_for(_resource)
method resource_params (line 15) | def resource_params
FILE: app/decorators/admin/options_decorator.rb
class Admin::OptionsDecorator (line 3) | class Admin::OptionsDecorator < Draper::Decorator
method state (line 6) | def state
method object_classes (line 14) | def object_classes
method active? (line 20) | def active?
FILE: app/decorators/option_attribute_decorator.rb
class OptionAttributeDecorator (line 3) | class OptionAttributeDecorator < Draper::Decorator
method initialize (line 6) | def initialize(name, values, current_value)
method render (line 12) | def render
method data_for_select (line 18) | def data_for_select
FILE: app/decorators/pay_system_decorator.rb
class PaySystemDecorator (line 3) | class PaySystemDecorator < Draper::Decorator
method title (line 6) | def title
method human_state (line 10) | def human_state
FILE: app/decorators/promo_decorator.rb
class PromoDecorator (line 3) | class PromoDecorator < Draper::Decorator
method period (line 6) | def period
method type (line 10) | def type
method promoter_type (line 14) | def promoter_type
method state (line 18) | def state
method state_class (line 26) | def state_class
FILE: app/decorators/transaction_decorator.rb
class TransactionDecorator (line 3) | class TransactionDecorator < Draper::Decorator
method amount (line 6) | def amount
method date (line 10) | def date
method description (line 14) | def description
method user (line 22) | def user
method amount_with_sign (line 28) | def amount_with_sign
method payment? (line 38) | def payment?
method withdrawal? (line 42) | def withdrawal?
method free_payment? (line 46) | def free_payment?
method positive_amount (line 50) | def positive_amount
method negative_amount (line 56) | def negative_amount
method amount_with_currency (line 62) | def amount_with_currency
method free_amount (line 66) | def free_amount
method transaction_user (line 72) | def transaction_user
FILE: app/decorators/user_decorator.rb
class UserDecorator (line 3) | class UserDecorator < Draper::Decorator
method connection_status (line 6) | def connection_status
method current_interval_payment_status (line 14) | def current_interval_payment_status
method options (line 22) | def options
method promotions (line 26) | def promotions
method last_connect_details (line 32) | def last_connect_details
FILE: app/exceptions/api_exception.rb
class ApiException (line 3) | class ApiException < RuntimeError; end
FILE: app/helpers/admin_helper.rb
type AdminHelper (line 3) | module AdminHelper
function menu_item (line 4) | def menu_item(title, path, fa_icon)
function menu_item_with_sub (line 13) | def menu_item_with_sub(title, path, fa_icon)
function sub_menu_item (line 27) | def sub_menu_item(title, path)
function page_title (line 33) | def page_title(section, icon, path, &block)
function sub_page_title (line 42) | def sub_page_title(title)
function human_connection (line 46) | def human_connection(type)
function human_traffic (line 58) | def human_traffic(traffic)
function bytes_to_gigabytes (line 62) | def bytes_to_gigabytes(traffic)
function descrete_statistic_values (line 66) | def descrete_statistic_values(sequence)
function human_course (line 70) | def human_course(course)
function can_be_prolongated? (line 74) | def can_be_prolongated?(user)
function object_states_select_collection (line 78) | def object_states_select_collection(class_name)
function background_highlight (line 84) | def background_highlight(user)
function check_box_search (line 88) | def check_box_search(name)
function change_locale_link (line 96) | def change_locale_link
FILE: app/helpers/application_helper.rb
type ApplicationHelper (line 3) | module ApplicationHelper
function human_date (line 4) | def human_date(date, options = { time: true })
function human_price (line 9) | def human_price(price)
function human_usd_amount (line 13) | def human_usd_amount(price)
function prettify_number (line 17) | def prettify_number(number)
FILE: app/helpers/main_helper.rb
type MainHelper (line 3) | module MainHelper
function was_connected? (line 4) | def was_connected?
function enabled_options (line 8) | def enabled_options
FILE: app/helpers/options_helper.rb
type OptionsHelper (line 3) | module OptionsHelper
function plans_option_price (line 7) | def plans_option_price(plan, option_code)
function subscribe_option_button (line 11) | def subscribe_option_button(option)
function unsubscribe_option_button (line 18) | def unsubscribe_option_button(option)
function option_toggle_button (line 25) | def option_toggle_button(option)
function toggle_state_title (line 29) | def toggle_state_title(option)
function enabled_option? (line 33) | def enabled_option?(option)
function option_attribute (line 37) | def option_attribute(name, attribute_hash, current_value)
function option_button_to (line 41) | def option_button_to(_option, url, method, options = {})
function option_settings (line 47) | def option_settings(option)
function current_attribute_value (line 55) | def current_attribute_value(option, name)
FILE: app/helpers/promos_helper.rb
type PromosHelper (line 3) | module PromosHelper
function promo_types (line 4) | def promo_types
function promoter_types (line 10) | def promoter_types
function select_options (line 16) | def select_options(options)
FILE: app/helpers/servers_helper.rb
type ServersHelper (line 3) | module ServersHelper
function server_country_name (line 4) | def server_country_name(server)
function countries_for_select (line 8) | def countries_for_select
FILE: app/inputs/datepicker_input.rb
class DatepickerInput (line 3) | class DatepickerInput < SimpleForm::Inputs::Base
method input (line 4) | def input
FILE: app/mailers/user_connection_config_mailer.rb
class UserConnectionConfigMailer (line 3) | class UserConnectionConfigMailer < ActionMailer::Base
method notify (line 6) | def notify(user:)
method server_config (line 14) | def server_config
method server (line 18) | def server
FILE: app/mailers/user_mailer.rb
class UserMailer (line 3) | class UserMailer < ActionMailer::Base
method funds_recieved (line 7) | def funds_recieved(user, amount)
method balance_withdrawal (line 13) | def balance_withdrawal(user, amount)
method could_not_withdraw_funds (line 19) | def could_not_withdraw_funds(user, amount)
method test_period_enabled (line 25) | def test_period_enabled(user)
method unpaid_user_notification (line 32) | def unpaid_user_notification(user)
FILE: app/models/ability.rb
class Ability (line 3) | class Ability
method initialize (line 6) | def initialize(user)
FILE: app/models/admin.rb
class Admin (line 3) | class Admin < ActiveRecord::Base
FILE: app/models/authenticator.rb
class Authenticator (line 3) | class Authenticator
method initialize (line 4) | def initialize(login, password, hostname)
method valid_credentials? (line 12) | def valid_credentials?
method find_user (line 18) | def find_user
method user_active? (line 22) | def user_active?
method vpn_enabled? (line 26) | def vpn_enabled?
method test_period_active? (line 30) | def test_period_active?
method valid_password? (line 34) | def valid_password?
method billing_credentials_valid? (line 38) | def billing_credentials_valid?
method vpn_credentials_valid? (line 42) | def vpn_credentials_valid?
method not_connected_yet? (line 46) | def not_connected_yet?
method server_belongs_to_users_plan? (line 50) | def server_belongs_to_users_plan?
FILE: app/models/concerns/last_days_filterable.rb
type LastDaysFilterable (line 3) | module LastDaysFilterable
function in_days (line 7) | def self.in_days(number_of_days)
FILE: app/models/connection.rb
class Connection (line 3) | class Connection < ActiveRecord::Base
method active (line 9) | def self.active
FILE: app/models/connections/connect.rb
class Connect (line 3) | class Connect < Connection
FILE: app/models/connections/disconnect.rb
class Disconnect (line 3) | class Disconnect < Connection
FILE: app/models/connector.rb
class Connector (line 3) | class Connector
method connected? (line 6) | def self.connected?(user)
method first_time_connected? (line 10) | def self.first_time_connected?(user)
method has_previous_connects? (line 14) | def self.has_previous_connects?(user)
method connected_now? (line 18) | def self.connected_now?(user)
method initialize (line 22) | def initialize(opts)
method invoke (line 31) | def invoke
method find_user (line 41) | def find_user
method connect? (line 45) | def connect?
method connect! (line 51) | def connect!
method disconnect! (line 60) | def disconnect!
FILE: app/models/option.rb
class Option (line 3) | class Option < ActiveRecord::Base
method tunable_attributes (line 27) | def tunable_attributes
method default_attributes (line 34) | def default_attributes
method hook (line 41) | def hook(user)
FILE: app/models/options/attributes/proxy.rb
type Options (line 3) | module Options
type Attributes (line 4) | module Attributes
class Proxy (line 5) | class Proxy
method initialize (line 6) | def initialize
method attributes (line 10) | def attributes
method default (line 16) | def default
FILE: app/models/options/hooks/proxy.rb
type Options (line 3) | module Options
type Hooks (line 4) | module Hooks
class Proxy (line 5) | class Proxy
method initialize (line 8) | def initialize(user, option)
method connect (line 13) | def connect
method disconnect (line 19) | def disconnect
FILE: app/models/pay_system.rb
class PaySystem (line 3) | class PaySystem < ActiveRecord::Base
FILE: app/models/payment.rb
class Payment (line 3) | class Payment < ActiveRecord::Base
method convert_and_save_usd_amount (line 28) | def convert_and_save_usd_amount
method increase_balance (line 35) | def increase_balance
method try_to_withdraw_funds (line 39) | def try_to_withdraw_funds
FILE: app/models/plan.rb
class Plan (line 3) | class Plan < ActiveRecord::Base
method regular? (line 14) | def regular?
method to_s (line 18) | def to_s
method option_price (line 22) | def option_price(option_code)
FILE: app/models/plan_has_server.rb
class PlanHasServer (line 3) | class PlanHasServer < ActiveRecord::Base
FILE: app/models/promo.rb
class Promo (line 3) | class Promo < ActiveRecord::Base
method promoter (line 29) | def promoter
FILE: app/models/promoter.rb
class Promoter (line 3) | class Promoter
method type (line 5) | def type
method apply (line 9) | def apply(_promo, _base_value)
method attributes (line 13) | def attributes
FILE: app/models/promoters/discount_promoter.rb
class DiscountPromoter (line 3) | class DiscountPromoter < Promoter
method type (line 5) | def type
method apply (line 9) | def apply(promo, base_value)
method attributes (line 20) | def attributes
FILE: app/models/promoters_repository.rb
class PromotersRepository (line 3) | class PromotersRepository
method clean (line 5) | def clean
method all (line 9) | def all
method types (line 13) | def types
method persist (line 17) | def persist(promoter)
method find_by_type (line 21) | def find_by_type(type_name)
method index (line 27) | def index
FILE: app/models/promotion.rb
class Promotion (line 3) | class Promotion < ActiveRecord::Base
method apply (line 13) | def apply(amount)
FILE: app/models/proxy.rb
type Proxy (line 3) | module Proxy
function table_name_prefix (line 4) | def self.table_name_prefix
FILE: app/models/proxy/connect.rb
class Proxy::Connect (line 3) | class Proxy::Connect < ActiveRecord::Base
FILE: app/models/proxy/node.rb
class Proxy::Node (line 3) | class Proxy::Node < ActiveRecord::Base
FILE: app/models/referrer.rb
type Referrer (line 3) | module Referrer
function table_name_prefix (line 4) | def self.table_name_prefix
FILE: app/models/referrer/account.rb
type Referrer (line 3) | module Referrer
class Account (line 4) | class Account
method initialize (line 5) | def initialize(referrer_id)
method balance (line 10) | def balance
method operations (line 14) | def operations
method referrals_total_amount (line 19) | def referrals_total_amount
FILE: app/models/referrer/reward.rb
class Referrer::Reward (line 3) | class Referrer::Reward < ActiveRecord::Base
FILE: app/models/server.rb
class Server (line 3) | class Server < ActiveRecord::Base
method to_s (line 33) | def to_s
method generate_auth_key (line 39) | def generate_auth_key
FILE: app/models/server/signature.rb
class Server (line 10) | class Server
class Signature (line 11) | class Signature
method initialize (line 16) | def initialize(server, request_params)
method valid? (line 21) | def valid?
method signature (line 31) | def signature
method clean_params (line 35) | def clean_params
FILE: app/models/server_config.rb
class ServerConfig (line 5) | class ServerConfig
method initialize (line 8) | def initialize
method append_line (line 12) | def append_line(line)
method to_text (line 16) | def to_text
FILE: app/models/test_period.rb
class TestPeriod (line 3) | class TestPeriod
method initialize (line 4) | def initialize(user)
method enable! (line 8) | def enable!
method disable! (line 12) | def disable!
method enabled? (line 16) | def enabled?
method test_period_until (line 20) | def test_period_until
method length (line 26) | def length
FILE: app/models/traffic_report.rb
class TrafficReport (line 3) | class TrafficReport
method initialize (line 10) | def initialize(attributes = {})
method result (line 16) | def result
method date_from (line 20) | def date_from
method date_to (line 24) | def date_to
method persisted? (line 29) | def persisted?
FILE: app/models/traffic_reports/date_traffic_report.rb
class DateTrafficReport (line 3) | class DateTrafficReport < TrafficReport
method build_report (line 6) | def build_report
FILE: app/models/traffic_reports/server_traffic_report.rb
class ServerTrafficReport (line 3) | class ServerTrafficReport < TrafficReport
method build_report (line 6) | def build_report
FILE: app/models/traffic_reports/user_traffic_report.rb
class UserTrafficReport (line 3) | class UserTrafficReport < TrafficReport
method build_report (line 6) | def build_report
FILE: app/models/transaction.rb
class Transaction (line 3) | class Transaction
method all (line 8) | def all
method user_transactions (line 12) | def user_transactions(user)
method cast_collection_to_transactions (line 18) | def cast_collection_to_transactions(payments, withdrawals)
method initialize (line 27) | def initialize(id, object)
method amount (line 32) | def amount
FILE: app/models/user.rb
class User (line 3) | class User < ActiveRecord::Base
method to_s (line 62) | def to_s
method referrer_account (line 66) | def referrer_account
method test_period (line 70) | def test_period
method connected? (line 74) | def connected?
method paid? (line 78) | def paid?
method current_billing_interval_length (line 82) | def current_billing_interval_length
method last_connect (line 86) | def last_connect
method last_connect_date (line 90) | def last_connect_date
method last_withdrawal (line 94) | def last_withdrawal
method last_withdrawal_date (line 98) | def last_withdrawal_date
method next_withdrawal_date (line 102) | def next_withdrawal_date
method increase_balance (line 106) | def increase_balance(amount)
method decrease_balance (line 111) | def decrease_balance(amount)
method service_enabled? (line 116) | def service_enabled?
method total_amount (line 120) | def total_amount
method interval_prolongation (line 126) | def interval_prolongation
method selected_plan_is_regular (line 130) | def selected_plan_is_regular
method generate_reflink (line 134) | def generate_reflink
method generate_vpn_credentials (line 138) | def generate_vpn_credentials
method add_to_newsletter (line 143) | def add_to_newsletter
FILE: app/models/user_option.rb
class UserOption (line 3) | class UserOption < ActiveRecord::Base
method toggle! (line 27) | def toggle!
FILE: app/models/withdrawal.rb
class Withdrawal (line 3) | class Withdrawal < ActiveRecord::Base
method prolongation_days (line 16) | def prolongation_days
method decrease_user_balance (line 22) | def decrease_user_balance
method balance_greater_than_amount (line 26) | def balance_greater_than_amount
FILE: app/models/withdrawal_prolongation.rb
class WithdrawalProlongation (line 3) | class WithdrawalProlongation < ActiveRecord::Base
FILE: app/operations/ops/admin/user/base.rb
type Ops (line 4) | module Ops
type Admin (line 5) | module Admin
type User (line 6) | module User
class Base (line 7) | class Base
method initialize (line 10) | def initialize(params:)
method call (line 14) | def call
FILE: app/operations/ops/admin/user/create.rb
type Ops (line 3) | module Ops
type Admin (line 4) | module Admin
type User (line 5) | module User
class Create (line 7) | class Create < Base
method call (line 8) | def call
method build_created_user! (line 18) | def build_created_user!
method user (line 23) | def user
method error_result (line 27) | def error_result
method success_result (line 31) | def success_result
FILE: app/ransackers/base_ransacker.rb
class BaseRansacker (line 3) | class BaseRansacker
method initialize (line 7) | def initialize(table)
method call (line 11) | def self.call(parent)
FILE: app/ransackers/never_paid_users_ransacker.rb
class NeverPaidUsersRansacker (line 3) | class NeverPaidUsersRansacker < BaseRansacker
method eq (line 6) | def eq(value)
method unpaid_user_ids (line 10) | def unpaid_user_ids
method apply_ransacker? (line 14) | def apply_ransacker?(value)
FILE: app/serializers/admin/users_serializer.rb
class Admin::UsersSerializer (line 3) | class Admin::UsersSerializer
method initialize (line 6) | def initialize(collection, format)
method emails (line 11) | def emails
method csv? (line 17) | def csv?
FILE: app/serializers/api/connect_serializer.rb
class Api::ConnectSerializer (line 3) | class Api::ConnectSerializer < Api::ConnectionSerializer
FILE: app/serializers/api/connection_serializer.rb
class Api::ConnectionSerializer (line 3) | class Api::ConnectionSerializer < ActiveModel::Serializer
method options (line 7) | def options
method option_attributes (line 11) | def option_attributes
method common_name (line 15) | def common_name
FILE: app/serializers/api/disconnect_serializer.rb
class Api::DisconnectSerializer (line 3) | class Api::DisconnectSerializer < Api::ConnectionSerializer
FILE: app/services/dto/admin/dashboard.rb
type Dto (line 3) | module Dto
type Admin (line 4) | module Admin
class Dashboard (line 7) | class Dashboard < Dto::Base
method collect_data (line 13) | def collect_data
method fetch_courses (line 20) | def fetch_courses
method fetch_income (line 28) | def fetch_income
method fetch_customers (line 35) | def fetch_customers
method fetch_traffic (line 42) | def fetch_traffic
method fetch_course (line 49) | def fetch_course(from_currency, for_currency)
method courses_updated_at (line 53) | def courses_updated_at
method converted_discrete_traffic (line 57) | def converted_discrete_traffic
method bytes_converter (line 64) | def bytes_converter(value)
method discrete_payments (line 68) | def discrete_payments
method discrete_traffic (line 72) | def discrete_traffic
method discrete_customers (line 76) | def discrete_customers
FILE: app/services/dto/admin/discrete_base.rb
type Dto (line 3) | module Dto
type Admin (line 4) | module Admin
class DiscreteBase (line 6) | class DiscreteBase < Dto::Base
method initialize (line 7) | def initialize(number_of_days:)
method amounts (line 11) | def amounts
method add_zero_amounts_for_dates (line 18) | def add_zero_amounts_for_dates
method date_by_number_days_ago (line 25) | def date_by_number_days_ago(number)
method values_by_days (line 29) | def values_by_days
FILE: app/services/dto/admin/discrete_customers_registrations.rb
type Dto (line 3) | module Dto
type Admin (line 4) | module Admin
class DiscreteCustomersRegistrations (line 6) | class DiscreteCustomersRegistrations < Dto::Admin::DiscreteBase
method values_by_days (line 9) | def values_by_days
FILE: app/services/dto/admin/discrete_payments.rb
type Dto (line 3) | module Dto
type Admin (line 4) | module Admin
class DiscretePayments (line 6) | class DiscretePayments < Dto::Admin::DiscreteBase
method values_by_days (line 9) | def values_by_days
FILE: app/services/dto/admin/discrete_traffic.rb
type Dto (line 3) | module Dto
type Admin (line 4) | module Admin
class DiscreteTraffic (line 6) | class DiscreteTraffic < Dto::Admin::DiscreteBase
method values_by_days (line 9) | def values_by_days
FILE: app/services/dto/base.rb
type Dto (line 3) | module Dto
class Base (line 5) | class Base
method initialize (line 6) | def initialize
method collect_data (line 12) | def collect_data
FILE: app/services/forced_disconnect.rb
class ForcedDisconnect (line 3) | class ForcedDisconnect
method initialize (line 4) | def initialize(user)
method invoke (line 8) | def invoke
method disconnect! (line 14) | def disconnect!
method connected? (line 18) | def connected?
method server (line 22) | def server
FILE: app/services/newsletter_manager.rb
class NewsletterManager (line 3) | class NewsletterManager
method initialize (line 6) | def initialize
method add_to_list (line 10) | def add_to_list(email, list_name)
method list_id (line 16) | def list_id(list_name)
method list_ids_mapping (line 20) | def list_ids_mapping
method all_clients_list_id (line 26) | def all_clients_list_id
FILE: app/services/option/activation_price_calc.rb
class Option::ActivationPriceCalc (line 3) | class Option::ActivationPriceCalc
method activation_price (line 5) | def activation_price(user, option)
method billing_interval_percent_left (line 9) | def billing_interval_percent_left(user)
method days_left_to_withdrawal (line 15) | def days_left_to_withdrawal(days_passed)
FILE: app/services/option/activator.rb
class Option::Activator (line 3) | class Option::Activator
method run (line 6) | def self.run(user, option_code)
method initialize (line 11) | def initialize(user, option_code)
method activate_option (line 16) | def activate_option
method activation_price (line 28) | def activation_price
method enable_option (line 32) | def enable_option
method withdraw_funds_for_option (line 38) | def withdraw_funds_for_option
FILE: app/services/option/deactivator.rb
class Option::Deactivator (line 3) | class Option::Deactivator
method run (line 4) | def self.run(user, option_id)
FILE: app/services/proxy/fetchers/base.rb
type Proxy (line 3) | module Proxy
type Fetchers (line 4) | module Fetchers
class Base (line 5) | class Base
method fetch (line 6) | def self.fetch
method fetch_proxy_list (line 11) | def fetch_proxy_list
FILE: app/services/proxy/fetchers/free_proxy_list_net/row_parser.rb
type Proxy (line 3) | module Proxy
type Fetchers (line 4) | module Fetchers
type FreeProxyListNet (line 5) | module FreeProxyListNet
class RowParser (line 6) | class RowParser
method initialize (line 7) | def initialize(row)
method to_proxy (line 11) | def to_proxy
method host (line 17) | def host
method port (line 21) | def port
method country (line 25) | def country
method protocol (line 29) | def protocol
method anonymity (line 33) | def anonymity
method location (line 37) | def location; end
method bandwidth (line 39) | def bandwidth; end
method ping (line 41) | def ping; end
FILE: app/services/proxy/fetchers/free_proxy_list_net/web_parser.rb
type Proxy (line 6) | module Proxy
type Fetchers (line 7) | module Fetchers
type FreeProxyListNet (line 8) | module FreeProxyListNet
class WebParser (line 9) | class WebParser < ::Proxy::Fetchers::Base
method initialize (line 13) | def initialize
method fetch_proxy_list (line 18) | def fetch_proxy_list
method fetch_proxies (line 24) | def fetch_proxies
method parse_proxies_from (line 31) | def parse_proxies_from(page)
method parse (line 39) | def parse(row)
FILE: app/services/proxy/fetchers/free_proxy_lists/row_parser.rb
type Proxy (line 3) | module Proxy
type Fetchers (line 4) | module Fetchers
type FreeProxyLists (line 5) | module FreeProxyLists
class RowParser (line 6) | class RowParser
method initialize (line 7) | def initialize(row)
method to_proxy (line 11) | def to_proxy
method host (line 17) | def host
method port (line 28) | def port
method country (line 32) | def country
method protocol (line 36) | def protocol
method anonymity (line 40) | def anonymity
method location (line 44) | def location
method bandwidth (line 48) | def bandwidth
method ping (line 52) | def ping
FILE: app/services/proxy/fetchers/free_proxy_lists/web_parser.rb
type Proxy (line 6) | module Proxy
type Fetchers (line 7) | module Fetchers
type FreeProxyLists (line 8) | module FreeProxyLists
class WebParser (line 9) | class WebParser < ::Proxy::Fetchers::Base
method initialize (line 13) | def initialize
method fetch_proxy_list (line 18) | def fetch_proxy_list
method fetch_proxies (line 24) | def fetch_proxies
method parse_proxies_from (line 31) | def parse_proxies_from(page)
method parse (line 39) | def parse(row, _proxies)
FILE: app/services/proxy/proxy_dto.rb
type Proxy (line 3) | module Proxy
class ProxyDto (line 4) | class ProxyDto
method initialize (line 7) | def initialize(host, port, country, protocol = nil, bandwidth = nil,...
method to_hash (line 16) | def to_hash
FILE: app/services/proxy/rater.rb
type Proxy (line 3) | module Proxy
class Rater (line 4) | class Rater
method initialize (line 7) | def initialize(user, option)
method find_best (line 12) | def find_best
FILE: app/services/proxy/repository.rb
type Proxy (line 3) | module Proxy
class Repository (line 4) | class Repository
method persist (line 5) | def self.persist(proxies)
method build_node (line 14) | def self.build_node(proxy)
method clear_nodes (line 18) | def self.clear_nodes
FILE: app/services/proxy/updater.rb
class Proxy::Updater (line 3) | class Proxy::Updater
method update (line 4) | def self.update(fetcher_class)
FILE: app/services/referrer/reward_calculator.rb
type Referrer (line 3) | module Referrer
class RewardCalculator (line 4) | class RewardCalculator
method initialize (line 5) | def initialize(payment)
method amount (line 9) | def amount
method percent (line 15) | def percent
FILE: app/services/referrer/rewarder.rb
type Referrer (line 3) | module Referrer
class Rewarder (line 4) | class Rewarder
method add_funds (line 5) | def self.add_funds(withdrawal, amount)
method initialize (line 10) | def initialize(withdrawal, amount)
method create_reward (line 15) | def create_reward
method referrer (line 27) | def referrer
method referrer? (line 31) | def referrer?
FILE: app/services/server_config_builder.rb
class ServerConfigBuilder (line 4) | class ServerConfigBuilder
method initialize (line 7) | def initialize(server:)
method to_text (line 11) | def to_text
method client_crt (line 17) | def client_crt
method server_crt (line 22) | def server_crt
method client_key (line 26) | def client_key
method erb_render_sample_config (line 30) | def erb_render_sample_config
method sample_config (line 34) | def sample_config
method sample_config_path (line 38) | def sample_config_path
FILE: app/services/unpaid_users_notificator.rb
class UnpaidUsersNotificator (line 3) | class UnpaidUsersNotificator
method notify_all (line 6) | def notify_all
method users_to_notify (line 14) | def users_to_notify
method notify (line 18) | def notify(user)
FILE: app/services/withdrawal_amount_calculator.rb
class WithdrawalAmountCalculator (line 3) | class WithdrawalAmountCalculator
method initialize (line 6) | def initialize(user)
method amount_to_withdraw (line 10) | def amount_to_withdraw
method total_amount (line 18) | def total_amount
method base_amount (line 22) | def base_amount
method options_amount (line 26) | def options_amount
FILE: app/services/withdrawer.rb
class Withdrawer (line 3) | class Withdrawer
method mass_withdrawal (line 7) | def mass_withdrawal
method single_withdraw (line 15) | def single_withdraw(user)
method try_to_withdraw (line 26) | def try_to_withdraw
method withdraw_funds (line 37) | def withdraw_funds
method add_funds_to_referrer (line 45) | def add_funds_to_referrer
method increment_or_reset_counter (line 50) | def increment_or_reset_counter
method notify_user_if_needed (line 58) | def notify_user_if_needed
method can_not_withdraw (line 62) | def can_not_withdraw
method successful_withdrawal? (line 66) | def successful_withdrawal?
method first_notification? (line 70) | def first_notification?
FILE: app/uploaders/config_uploader.rb
class ConfigUploader (line 3) | class ConfigUploader < CarrierWave::Uploader::Base
method store_dir (line 18) | def store_dir
FILE: app/workers/add_user_to_newsletter_worker.rb
class AddUserToNewsletterWorker (line 3) | class AddUserToNewsletterWorker
method perform (line 7) | def perform(email, list_name)
FILE: app/workers/can_not_withdraw_notification_worker.rb
class CanNotWithdrawNotificationWorker (line 3) | class CanNotWithdrawNotificationWorker
method perform (line 7) | def perform(user_id, amount)
FILE: app/workers/create_user_mail_worker.rb
class CreateUserMailWorker (line 3) | class CreateUserMailWorker
method perform (line 7) | def perform(user_id)
FILE: app/workers/decrease_balance_mail_worker.rb
class DecreaseBalanceMailWorker (line 3) | class DecreaseBalanceMailWorker
method perform (line 7) | def perform(amount, user_id)
FILE: app/workers/increase_balance_mail_worker.rb
class IncreaseBalanceMailWorker (line 3) | class IncreaseBalanceMailWorker
method perform (line 7) | def perform(amount, user_id)
FILE: app/workers/refresh_proxy_list_worker.rb
class RefreshProxyListWorker (line 3) | class RefreshProxyListWorker
method perform (line 6) | def perform
FILE: app/workers/unpaid_user_notification_worker.rb
class UnpaidUserNotificationWorker (line 3) | class UnpaidUserNotificationWorker
method perform (line 7) | def perform(user_id)
FILE: app/workers/update_courses_worker.rb
class UpdateCoursesWorker (line 3) | class UpdateCoursesWorker
method perform (line 6) | def perform
FILE: app/workers/withdrawals_worker.rb
class WithdrawalsWorker (line 3) | class WithdrawalsWorker
method perform (line 6) | def perform
FILE: config/application.rb
type Smartvpn (line 10) | module Smartvpn
class Application (line 11) | class Application < Rails::Application
FILE: config/clock.rb
type Clockwork (line 12) | module Clockwork
FILE: db/migrate/20130409190444_create_posts.rb
class CreatePosts (line 1) | class CreatePosts < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130421110154_devise_create_users.rb
class DeviseCreateUsers (line 1) | class DeviseCreateUsers < ActiveRecord::Migration
method up (line 2) | def self.up
method down (line 42) | def self.down
FILE: db/migrate/20130421110911_create_admins.rb
class CreateAdmins (line 1) | class CreateAdmins < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130501081828_add_fields_to_user.rb
class AddFieldsToUser (line 1) | class AddFieldsToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130501083417_create_plans.rb
class CreatePlans (line 1) | class CreatePlans < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130504105921_create_payments.rb
class CreatePayments (line 1) | class CreatePayments < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130504144707_create_pay_systems.rb
class CreatePaySystems (line 1) | class CreatePaySystems < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130504150703_add_description_to_pay_system.rb
class AddDescriptionToPaySystem (line 1) | class AddDescriptionToPaySystem < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130505183444_create_withdrawals.rb
class CreateWithdrawals (line 1) | class CreateWithdrawals < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130810125453_create_servers.rb
class CreateServers (line 1) | class CreateServers < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20130925101441_add_vpn_login_and_vpn_password_to_user.rb
class AddVpnLoginAndVpnPasswordToUser (line 1) | class AddVpnLoginAndVpnPasswordToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20131005133458_create_connections.rb
class CreateConnections (line 1) | class CreateConnections < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20131013140201_add_state_to_user.rb
class AddStateToUser (line 1) | class AddStateToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140105134117_add_special_and_disabled_to_plan.rb
class AddSpecialAndDisabledToPlan (line 1) | class AddSpecialAndDisabledToPlan < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140112113325_create_plan_has_servers.rb
class CreatePlanHasServers (line 1) | class CreatePlanHasServers < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140112123216_remove_plan_id_from_server.rb
class RemovePlanIdFromServer (line 1) | class RemovePlanIdFromServer < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140112180259_add_tunnelblick_bundle_and_ios_bundle_and_linux_bundle_to_server.rb
class AddTunnelblickBundleAndIosBundleAndLinuxBundleToServer (line 1) | class AddTunnelblickBundleAndIosBundleAndLinuxBundleToServer < ActiveRec...
method change (line 2) | def change
FILE: db/migrate/20140116192804_add_cant_withdraw_counter_to_user.rb
class AddCantWithdrawCounterToUser (line 1) | class AddCantWithdrawCounterToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140125084325_replace_configs_by_one_universal.rb
class ReplaceConfigsByOneUniversal (line 1) | class ReplaceConfigsByOneUniversal < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140202164317_create_promos.rb
class CreatePromos (line 1) | class CreatePromos < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140202164614_create_promotions.rb
class CreatePromotions (line 1) | class CreatePromotions < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140202175203_add_attributes_to_promo.rb
class AddAttributesToPromo (line 1) | class AddAttributesToPromo < ActiveRecord::Migration
method up (line 2) | def up
method down (line 7) | def down
FILE: db/migrate/20140203184711_add_state_to_promo.rb
class AddStateToPromo (line 1) | class AddStateToPromo < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140207114415_add_promo_id_user_id_uniqueness_index_to_promo.rb
class AddPromoIdUserIdUniquenessIndexToPromo (line 1) | class AddPromoIdUserIdUniquenessIndexToPromo < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140227113644_add_state_to_pay_system.rb
class AddStateToPaySystem (line 1) | class AddStateToPaySystem < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140301125212_add_currency_to_pay_system.rb
class AddCurrencyToPaySystem (line 1) | class AddCurrencyToPaySystem < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140301130258_add_usd_amount_to_payment.rb
class AddUsdAmountToPayment (line 1) | class AddUsdAmountToPayment < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140506135933_create_withdrawal_prolongations.rb
class CreateWithdrawalProlongations (line 1) | class CreateWithdrawalProlongations < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140507085918_add_manual_payment_to_payment.rb
class AddManualPaymentToPayment (line 1) | class AddManualPaymentToPayment < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140518132954_create_options.rb
class CreateOptions (line 1) | class CreateOptions < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140518133314_create_plan_option_table.rb
class CreatePlanOptionTable (line 1) | class CreatePlanOptionTable < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140518134712_add_state_to_option.rb
class AddStateToOption (line 1) | class AddStateToOption < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140525091015_add_option_prices_to_plan.rb
class AddOptionPricesToPlan (line 1) | class AddOptionPricesToPlan < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140525103921_create_options_users.rb
class CreateOptionsUsers (line 1) | class CreateOptionsUsers < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140727094748_add_reflink_to_user.rb
class AddReflinkToUser (line 1) | class AddReflinkToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140728204118_add_referrer_id_to_user.rb
class AddReferrerIdToUser (line 1) | class AddReferrerIdToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140801123341_create_referrer_rewards.rb
class CreateReferrerRewards (line 1) | class CreateReferrerRewards < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140805112916_generate_reflink_to_old_users.rb
class GenerateReflinkToOldUsers (line 1) | class GenerateReflinkToOldUsers < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140817131003_create_proxy_nodes.rb
class CreateProxyNodes (line 1) | class CreateProxyNodes < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140819160419_remove_options_users_table.rb
class RemoveOptionsUsersTable (line 1) | class RemoveOptionsUsersTable < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140819160716_create_user_options.rb
class CreateUserOptions (line 1) | class CreateUserOptions < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140823162252_create_proxy_connects.rb
class CreateProxyConnects (line 1) | class CreateProxyConnects < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20140823164144_add_option_attributes_to_connect.rb
class AddOptionAttributesToConnect (line 1) | class AddOptionAttributesToConnect < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150104180714_add_state_to_user_option.rb
class AddStateToUserOption (line 1) | class AddStateToUserOption < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150109161843_add_protocol_to_server.rb
class AddProtocolToServer (line 1) | class AddProtocolToServer < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150109164839_add_port_to_server.rb
class AddPortToServer (line 1) | class AddPortToServer < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150110141211_add_country_code_to_server.rb
class AddCountryCodeToServer (line 1) | class AddCountryCodeToServer < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150125133216_add_test_period_enabled_to_user.rb
class AddTestPeriodEnabledToUser (line 1) | class AddTestPeriodEnabledToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20150125141501_add_test_period_started_at_to_user.rb
class AddTestPeriodStartedAtToUser (line 1) | class AddTestPeriodStartedAtToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20181014150549_add_default_user.rb
class AddDefaultUser (line 1) | class AddDefaultUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20190122184018_add_pki_to_server.rb
class AddPkiToServer (line 1) | class AddPkiToServer < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/seeds/01_options.rb
function i2p (line 5) | def i2p
function proxy (line 14) | def proxy
FILE: db/seeds/02_plans.rb
function plan_params (line 5) | def plan_params(merge_params)
function standard_plan (line 9) | def standard_plan
FILE: db/seeds/04_default_user.rb
function user (line 5) | def user
FILE: db/seeds/07_servers.rb
function main_server (line 17) | def main_server
FILE: lib/bytes_converter.rb
class BytesConverter (line 3) | class BytesConverter
method bytes_to_kilobytes (line 5) | def bytes_to_kilobytes(bytes)
method kilobytes_to_megabytes (line 9) | def kilobytes_to_megabytes(kbytes)
method megabytes_to_gigabytes (line 13) | def megabytes_to_gigabytes(mbytes)
method bytes_to_gigabytes (line 17) | def bytes_to_gigabytes(bytes)
method prettify_float (line 21) | def prettify_float(number)
FILE: lib/currencies/course.rb
type Currencies (line 6) | module Currencies
class Course (line 7) | class Course
method update_courses (line 14) | def update_courses
method fetch_course_from_web (line 22) | def fetch_course_from_web(from, to)
method save_course (line 28) | def save_course(from, to, course)
method persist_update_date (line 32) | def persist_update_date
method updated_at (line 36) | def updated_at
method redis (line 40) | def redis
method initialize (line 45) | def initialize(from_currency, to_currency)
method get (line 50) | def get
method fetch_from_redis (line 60) | def fetch_from_redis
method parse_from_web (line 65) | def parse_from_web
FILE: lib/currencies/course_converter.rb
type Currencies (line 3) | module Currencies
class CourseConverter (line 4) | class CourseConverter
method initialize (line 5) | def initialize(options)
method convert_amount (line 11) | def convert_amount
method course (line 15) | def course
FILE: lib/exceptions/admin_access_denied_exception.rb
class AdminAccessDeniedException (line 3) | class AdminAccessDeniedException < SmartvpnException; end
FILE: lib/exceptions/api_exception.rb
class ApiException (line 3) | class ApiException < SmartvpnException; end
FILE: lib/exceptions/billing_exception.rb
class BillingException (line 3) | class BillingException < SmartvpnException; end
FILE: lib/exceptions/dto_exception.rb
class DtoException (line 3) | class DtoException < SmartvpnException; end
FILE: lib/exceptions/not_implemented_exception.rb
class NotImplementedException (line 3) | class NotImplementedException < SmartvpnException; end
FILE: lib/exceptions/smartvpn_exception.rb
class SmartvpnException (line 3) | class SmartvpnException < StandardError; end
FILE: lib/exceptions/unauthorized_exception.rb
class UnauthorizedException (line 3) | class UnauthorizedException < SmartvpnException; end
FILE: lib/exceptions/withdrawer_exception.rb
class WithdrawerException (line 3) | class WithdrawerException < SmartvpnException; end
FILE: lib/random_string.rb
class RandomString (line 3) | class RandomString
method generate (line 6) | def self.generate(length = DEFAULT_LENGTH)
FILE: lib/signer.rb
class Signer (line 5) | class Signer
method sign_hash (line 6) | def self.sign_hash(hash, key)
method hashify_string (line 10) | def self.hashify_string(string)
FILE: spec/controllers/application_controller_spec.rb
function index (line 7) | def index
FILE: spec/support/capybara_helper.rb
function visit_sign_in_page (line 3) | def visit_sign_in_page
function sign_in (line 7) | def sign_in(user = nil, password = nil)
function last_email (line 19) | def last_email
function extract_token_from_email (line 23) | def extract_token_from_email(token_name, current_email)
function sign_in_admin (line 28) | def sign_in_admin
FILE: spec/support/controller_macros.rb
type Requests (line 3) | module Requests
type ControllerMacros (line 4) | module ControllerMacros
function login_admin (line 5) | def login_admin
function login_user (line 12) | def login_user
FILE: spec/support/json_helpers.rb
type Requests (line 3) | module Requests
type JsonHelpers (line 4) | module JsonHelpers
function json (line 5) | def json
Condensed preview — 593 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,316K chars).
[
{
"path": ".dockerignore",
"chars": 37,
"preview": ".git\nconfig/database.yml\n.envrc\n.env\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 847,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: \"[BUG]\"\nlabels: bug\nassignees: Mehonoshin\n\n---\n\n**"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 604,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: enhancement\nassignees: ''\n\n---\n\n**Is"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 394,
"preview": "Issue #ID\n\n### Description\n\nExplain what is the purpose of this PR\n\n### Testing steps\n\nExplain how to test your PR manua"
},
{
"path": ".gitignore",
"chars": 698,
"preview": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n#\n# If you find yourself ignoring temporary fi"
},
{
"path": ".hound.yml",
"chars": 85,
"preview": "scss:\n enabled: false\n\nhaml:\n enabled: false\n\nrubocop:\n config_file: .rubocop.yml\n"
},
{
"path": ".irbrc",
"chars": 73,
"preview": "# frozen_string_literal: true\n\nrequire 'awesome_print'\nAwesomePrint.irb!\n"
},
{
"path": ".rspec",
"chars": 22,
"preview": "--color\n/*--profile*/\n"
},
{
"path": ".rubocop.yml",
"chars": 59528,
"preview": "# These are all the cops that are enabled in the default configuration.\n\n#################### Bundler ##################"
},
{
"path": ".travis.yml",
"chars": 1107,
"preview": "dist: xenial\nlanguage: ruby\nsudo: true\ncache: bundler\n\ngit:\n depth: 50\n\nrvm:\n - 2.5.3\n\nservices:\n - postgresql\n - re"
},
{
"path": "Dockerfile",
"chars": 520,
"preview": "FROM ruby:2.5\nLABEL Stanislav Mekhonoshin <ejabberd@gmail.com>\n\nARG secret_token\n\nRUN curl -sL https://deb.nodesource.co"
},
{
"path": "Dockerfile.dev",
"chars": 1587,
"preview": "FROM ruby:2.5\nLABEL Stanislav Mekhonoshin <ejabberd@gmail.com>\n\nARG secret_token\nENV SECRET_TOKEN=$secret_token\n\nRUN cur"
},
{
"path": "Gemfile",
"chars": 2070,
"preview": "# frozen_string_literal: true\n\nsource 'http://rubygems.org'\n# TODO: temporary disable http, until ruby upgrade with new "
},
{
"path": "LICENSE",
"chars": 1055,
"preview": "Copyright (c) 2015 SmartVPN.biz\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this so"
},
{
"path": "Procfile",
"chars": 139,
"preview": "web: bundle exec rails s -p 3000 -b 0.0.0.0\nworker: bundle exec sidekiq -q high -q default -q mailers\nclockwork: clockwo"
},
{
"path": "README.md",
"chars": 2803,
"preview": "# SmartVPN Billing\n\n[](https://travi"
},
{
"path": "Rakefile",
"chars": 280,
"preview": "# frozen_string_literal: true\n\n# Add your own tasks in files placed in lib/tasks ending in .rake,\n# for example lib/task"
},
{
"path": "Vagrantfile",
"chars": 2767,
"preview": "# frozen_string_literal: true\n\n# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\nrequire 'date'\n\n# Vagrantfile API/syntax versio"
},
{
"path": "app/assets/images/README.txt",
"chars": 1012,
"preview": "----------------------------\nIMAGE DIRECTORY (/img)\n----------------------------\n\nThis directory should contain all imag"
},
{
"path": "app/assets/images/invoice/license.txt",
"chars": 50,
"preview": "These icons were gathered from: iconfinder.com\r\n\r\n"
},
{
"path": "app/assets/javascripts/admin.js.coffee",
"chars": 153,
"preview": "#= require jquery\n#= require jquery_ujs\n#= require jquery3\n#= require popper\n#= require bootstrap-sprockets\n#= require C"
},
{
"path": "app/assets/javascripts/application.js.coffee",
"chars": 753,
"preview": "#= require jquery\n#= require jquery_ujs\n#= require ./theme/bootstrap-transition\n#= require ./theme/bootstrap-alert\n#= re"
},
{
"path": "app/assets/javascripts/main.js.coffee",
"chars": 366,
"preview": "$ ->\n credentialsToggler = $('.collapsable-credentials .toggler')\n vpnCredentials = $('.collapsable-credentials .vpn-c"
},
{
"path": "app/assets/javascripts/options.js.coffee",
"chars": 252,
"preview": "class @Options\n constructor: (scope) ->\n @option = $(scope)\n @bind()\n\n bind: ->\n @option.find('select').on 'c"
},
{
"path": "app/assets/javascripts/theme/bootstrap-affix.js",
"chars": 3483,
"preview": "/* ==========================================================\n * bootstrap-affix.js v2.2.2\n * http://twitter.github.com/"
},
{
"path": "app/assets/javascripts/theme/bootstrap-alert.js",
"chars": 2524,
"preview": "/* ==========================================================\n * bootstrap-alert.js v2.2.2\n * http://twitter.github.com/"
},
{
"path": "app/assets/javascripts/theme/bootstrap-button.js",
"chars": 2841,
"preview": "/* ============================================================\n * bootstrap-button.js v2.2.2\n * http://twitter.github.c"
},
{
"path": "app/assets/javascripts/theme/bootstrap-carousel.js",
"chars": 5320,
"preview": "/* ==========================================================\n * bootstrap-carousel.js v2.2.2\n * http://twitter.github.c"
},
{
"path": "app/assets/javascripts/theme/bootstrap-collapse.js",
"chars": 4618,
"preview": "/* =============================================================\n * bootstrap-collapse.js v2.2.2\n * http://twitter.githu"
},
{
"path": "app/assets/javascripts/theme/bootstrap-dropdown.js",
"chars": 4236,
"preview": "/* ============================================================\n * bootstrap-dropdown.js v2.2.2\n * http://twitter.github"
},
{
"path": "app/assets/javascripts/theme/bootstrap-modal.js",
"chars": 6579,
"preview": "/* =========================================================\n * bootstrap-modal.js v2.2.2\n * http://twitter.github.com/b"
},
{
"path": "app/assets/javascripts/theme/bootstrap-popover.js",
"chars": 3147,
"preview": "/* ===========================================================\n * bootstrap-popover.js v2.2.2\n * http://twitter.github.c"
},
{
"path": "app/assets/javascripts/theme/bootstrap-scrollspy.js",
"chars": 4610,
"preview": "/* =============================================================\n * bootstrap-scrollspy.js v2.2.2\n * http://twitter.gith"
},
{
"path": "app/assets/javascripts/theme/bootstrap-tab.js",
"chars": 3496,
"preview": "/* ========================================================\n * bootstrap-tab.js v2.2.2\n * http://twitter.github.com/boot"
},
{
"path": "app/assets/javascripts/theme/bootstrap-tooltip.js",
"chars": 7921,
"preview": "/* ===========================================================\n * bootstrap-tooltip.js v2.2.2\n * http://twitter.github.c"
},
{
"path": "app/assets/javascripts/theme/bootstrap-transition.js",
"chars": 1756,
"preview": "/* ===================================================\n * bootstrap-transition.js v2.2.2\n * http://twitter.github.com/bo"
},
{
"path": "app/assets/javascripts/theme/bootstrap-typeahead.js",
"chars": 7985,
"preview": "/* =============================================================\n * bootstrap-typeahead.js v2.2.2\n * http://twitter.gith"
},
{
"path": "app/assets/javascripts/theme/html5shim.js",
"chars": 2394,
"preview": "/*! HTML5 Shiv vpre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed\n Uncompressed source: https://github.com/"
},
{
"path": "app/assets/javascripts/theme/jquery.flexslider-min.js",
"chars": 16808,
"preview": "/*\n * jQuery FlexSlider v2.1\n * Copyright 2012 WooThemes\n * Contributing Author: Tyler Smith\n */\n ;(function(d){d.flexsl"
},
{
"path": "app/assets/javascripts/theme/jquery.quicksand.js",
"chars": 14697,
"preview": "/*\n\nQuicksand 1.2.2\n\nReorder and filter items with a nice shuffling animation.\n\nCopyright (c) 2010 Jacek Galanciak (razo"
},
{
"path": "app/assets/javascripts/theme/script.js",
"chars": 3132,
"preview": "/********************************************************\r\n *\r\n * Custom Javascript code for Enkel Bootstrap theme\r\n * W"
},
{
"path": "app/assets/stylesheets/admin.scss",
"chars": 102,
"preview": "@import \"bootstrap\";\n@import \"font-awesome-sprockets\";\n@import \"font-awesome\";\n@import \"main-admin\";\n\n"
},
{
"path": "app/assets/stylesheets/application.scss",
"chars": 193,
"preview": "@import \"main\";\n@import \"theme/bootstrap.css.scss\";\n@import \"theme/custom-colour\";\n@import \"theme/responsive\";\n@import \""
},
{
"path": "app/assets/stylesheets/main-admin.scss",
"chars": 31,
"preview": "html,\nbody {\n height: 100%;\n}\n"
},
{
"path": "app/assets/stylesheets/main.scss",
"chars": 1028,
"preview": "// Place all the styles related to the Main controller here.\n\n// They will automatically be included in application.css."
},
{
"path": "app/assets/stylesheets/shared.css.scss",
"chars": 153,
"preview": ".state {\n font-weight: bold;\n\n &.disabled {\n color: red;\n }\n\n &.enabled, &.active {\n color: green;\n }\n\n &.pe"
},
{
"path": "app/assets/stylesheets/theme/bootstrap.css.scss",
"chars": 132125,
"preview": "/*!\n * Bootstrap v2.2.2\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache"
},
{
"path": "app/assets/stylesheets/theme/custom-colour.css",
"chars": 18535,
"preview": "/*/////////////////////////////////////////////////////////////////////\n // \n // Custom theme code styles\n // Written by"
},
{
"path": "app/assets/stylesheets/theme/flexslider.css",
"chars": 3844,
"preview": "/*\n * jQuery FlexSlider v2.0\n * http://www.woothemes.com/flexslider/\n *\n * Copyright 2012 WooThemes\n * Free to use under"
},
{
"path": "app/assets/stylesheets/theme/responsive.css",
"chars": 21525,
"preview": "/*!\n * Bootstrap Responsive v2.2.2\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http:/"
},
{
"path": "app/assets/stylesheets/theme/theme-style.css",
"chars": 68506,
"preview": "/*******************************************************\n *\n * Custom theme code styles\n * Written by Themelize.me (http"
},
{
"path": "app/cells/web/admin/change_locale_link_cell.rb",
"chars": 629,
"preview": "# frozen_string_literal: true\n\nmodule Web\n module Admin\n # This is cell returns actual link for change current local"
},
{
"path": "app/cells/web/base_cell.rb",
"chars": 278,
"preview": "# frozen_string_literal: true\n\nmodule Web\n # This base class includes view helpers\n class BaseCell\n include Rails.a"
},
{
"path": "app/controllers/admin/base_controller.rb",
"chars": 454,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class BaseController < ApplicationController\n before_action :allow_only_"
},
{
"path": "app/controllers/admin/change_languages_controller.rb",
"chars": 281,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class ChangeLanguagesController < Admin::BaseController\n def update\n "
},
{
"path": "app/controllers/admin/connections_controller.rb",
"chars": 470,
"preview": "# frozen_string_literal: true\n\nclass Admin::ConnectionsController < Admin::BaseController\n def index\n @connections ="
},
{
"path": "app/controllers/admin/home_controller.rb",
"chars": 148,
"preview": "# frozen_string_literal: true\n\nclass Admin::HomeController < Admin::BaseController\n def index\n @dashboard = Dto::Adm"
},
{
"path": "app/controllers/admin/options_controller.rb",
"chars": 912,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class OptionsController < Admin::BaseController\n before_action :find_opt"
},
{
"path": "app/controllers/admin/pay_systems_controller.rb",
"chars": 906,
"preview": "# frozen_string_literal: true\n\nclass Admin::PaySystemsController < Admin::BaseController\n before_action :load_resource,"
},
{
"path": "app/controllers/admin/plans_controller.rb",
"chars": 1255,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class PlansController < Admin::BaseController\n before_action :find_plan,"
},
{
"path": "app/controllers/admin/profiles_controller.rb",
"chars": 602,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class ProfilesController < Admin::BaseController\n before_action :find_ad"
},
{
"path": "app/controllers/admin/promos_controller.rb",
"chars": 1165,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class PromosController < Admin::BaseController\n before_action :find_prom"
},
{
"path": "app/controllers/admin/referrers_controller.rb",
"chars": 149,
"preview": "# frozen_string_literal: true\n\nclass Admin::ReferrersController < Admin::BaseController\n def index\n @referrers = Use"
},
{
"path": "app/controllers/admin/servers_controller.rb",
"chars": 1367,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class ServersController < Admin::BaseController\n before_action :load_res"
},
{
"path": "app/controllers/admin/traffic_reports_controller.rb",
"chars": 402,
"preview": "# frozen_string_literal: true\n\nclass Admin::TrafficReportsController < Admin::BaseController\n def index; end\n\n def use"
},
{
"path": "app/controllers/admin/transactions_controller.rb",
"chars": 466,
"preview": "# frozen_string_literal: true\n\nclass Admin::TransactionsController < Admin::BaseController\n def index\n @transactions"
},
{
"path": "app/controllers/admin/users_controller.rb",
"chars": 3164,
"preview": "# frozen_string_literal: true\n\nclass Admin\n class UsersController < Admin::BaseController\n before_action :find_user,"
},
{
"path": "app/controllers/admins/sessions_controller.rb",
"chars": 387,
"preview": "# frozen_string_literal: true\n\nclass Admins::SessionsController < Devise::SessionsController\n layout 'blank'\n\n def aft"
},
{
"path": "app/controllers/api/authentication_controller.rb",
"chars": 731,
"preview": "# frozen_string_literal: true\n\nmodule Api\n # Provides endpoint for authentication API calls.\n # Whenever server gets i"
},
{
"path": "app/controllers/api/base_controller.rb",
"chars": 693,
"preview": "# frozen_string_literal: true\n\nmodule Api\n class BaseController < ApplicationController\n skip_before_action :verify_"
},
{
"path": "app/controllers/api/connection_controller.rb",
"chars": 1189,
"preview": "# frozen_string_literal: true\n\nmodule Api\n # Provides an endpoint, that tracks all initiated connections to the server."
},
{
"path": "app/controllers/api/servers_controller.rb",
"chars": 1027,
"preview": "# frozen_string_literal: true\n\nmodule Api\n # Provides an API endpoint for server activation.\n # Whenever a new server "
},
{
"path": "app/controllers/application_controller.rb",
"chars": 577,
"preview": "# frozen_string_literal: true\n\nclass ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising "
},
{
"path": "app/controllers/billing/base_controller.rb",
"chars": 277,
"preview": "# frozen_string_literal: true\n\nclass Billing::BaseController < ApplicationController\n layout 'billing'\n\n before_action"
},
{
"path": "app/controllers/billing/home_controller.rb",
"chars": 468,
"preview": "# frozen_string_literal: true\n\nclass Billing::HomeController < Billing::BaseController\n def index\n @transactions = t"
},
{
"path": "app/controllers/billing/merchant_controller.rb",
"chars": 644,
"preview": "# frozen_string_literal: true\n\nclass Billing::MerchantController < Billing::BaseController\n skip_before_filter :check_a"
},
{
"path": "app/controllers/billing/options_controller.rb",
"chars": 1098,
"preview": "# frozen_string_literal: true\n\nclass Billing::OptionsController < Billing::BaseController\n def index\n @subscribed_us"
},
{
"path": "app/controllers/billing/payments_controller.rb",
"chars": 873,
"preview": "# frozen_string_literal: true\n\nclass Billing::PaymentsController < Billing::BaseController\n def index\n @pay_systems "
},
{
"path": "app/controllers/billing/paypal_controller.rb",
"chars": 690,
"preview": "# frozen_string_literal: true\n\nclass Billing::PaypalController < Billing::MerchantController\n include ActiveMerchant::B"
},
{
"path": "app/controllers/billing/promotions_controller.rb",
"chars": 717,
"preview": "# frozen_string_literal: true\n\nclass Billing::PromotionsController < Billing::BaseController\n def create\n @promo = P"
},
{
"path": "app/controllers/billing/referrers_controller.rb",
"chars": 237,
"preview": "# frozen_string_literal: true\n\nclass Billing::ReferrersController < Billing::BaseController\n def index\n @referrals ="
},
{
"path": "app/controllers/billing/robokassa_controller.rb",
"chars": 664,
"preview": "# frozen_string_literal: true\n\n# This controller contains endpoints for Robokassa paysystem HTTP callbacks,\n# that notif"
},
{
"path": "app/controllers/billing/servers_controller.rb",
"chars": 466,
"preview": "# frozen_string_literal: true\n\nmodule Billing\n class ServersController < Billing::BaseController\n def index\n @s"
},
{
"path": "app/controllers/billing/webmoney_controller.rb",
"chars": 862,
"preview": "# frozen_string_literal: true\n\n# This controller contains endpoints for Webmoney paysystem HTTP callbacks,\n# that notifi"
},
{
"path": "app/controllers/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/controllers/main_controller.rb",
"chars": 225,
"preview": "# frozen_string_literal: true\n\nclass MainController < ApplicationController\n def index\n if signed_in? && current_use"
},
{
"path": "app/controllers/referrers_controller.rb",
"chars": 218,
"preview": "# frozen_string_literal: true\n\nclass ReferrersController < ApplicationController\n def set_referrer\n cookies[:reflink"
},
{
"path": "app/controllers/users/passwords_controller.rb",
"chars": 290,
"preview": "# frozen_string_literal: true\n\nclass Users::PasswordsController < Devise::PasswordsController\n layout 'blank'\n\n def af"
},
{
"path": "app/controllers/users/registrations_controller.rb",
"chars": 1037,
"preview": "# frozen_string_literal: true\n\nclass Users::RegistrationsController < Devise::RegistrationsController\n before_action :a"
},
{
"path": "app/controllers/users/sessions_controller.rb",
"chars": 477,
"preview": "# frozen_string_literal: true\n\nclass Users::SessionsController < Devise::SessionsController\n layout 'blank'\n\n def afte"
},
{
"path": "app/decorators/admin/options_decorator.rb",
"chars": 366,
"preview": "# frozen_string_literal: true\n\nclass Admin::OptionsDecorator < Draper::Decorator\n delegate_all\n\n def state\n h.conte"
},
{
"path": "app/decorators/option_attribute_decorator.rb",
"chars": 468,
"preview": "# frozen_string_literal: true\n\nclass OptionAttributeDecorator < Draper::Decorator\n attr_accessor :name, :current_value\n"
},
{
"path": "app/decorators/pay_system_decorator.rb",
"chars": 255,
"preview": "# frozen_string_literal: true\n\nclass PaySystemDecorator < Draper::Decorator\n delegate_all\n\n def title\n h.link_to mo"
},
{
"path": "app/decorators/promo_decorator.rb",
"chars": 608,
"preview": "# frozen_string_literal: true\n\nclass PromoDecorator < Draper::Decorator\n delegate_all\n\n def period\n \"#{h.human_date"
},
{
"path": "app/decorators/transaction_decorator.rb",
"chars": 1349,
"preview": "# frozen_string_literal: true\n\nclass TransactionDecorator < Draper::Decorator\n delegate :id\n\n def amount\n amount_wi"
},
{
"path": "app/decorators/user_decorator.rb",
"chars": 811,
"preview": "# frozen_string_literal: true\n\nclass UserDecorator < Draper::Decorator\n delegate_all\n\n def connection_status\n if mo"
},
{
"path": "app/exceptions/api_exception.rb",
"chars": 70,
"preview": "# frozen_string_literal: true\n\nclass ApiException < RuntimeError; end\n"
},
{
"path": "app/helpers/admin_helper.rb",
"chars": 2560,
"preview": "# frozen_string_literal: true\n\nmodule AdminHelper\n def menu_item(title, path, fa_icon)\n content_tag :li, class: 'nav"
},
{
"path": "app/helpers/application_helper.rb",
"chars": 488,
"preview": "# frozen_string_literal: true\n\nmodule ApplicationHelper\n def human_date(date, options = { time: true })\n format = op"
},
{
"path": "app/helpers/main_helper.rb",
"chars": 237,
"preview": "# frozen_string_literal: true\n\nmodule MainHelper\n def was_connected?\n current_user.last_connect\n end\n\n def enabled"
},
{
"path": "app/helpers/options_helper.rb",
"chars": 2116,
"preview": "# frozen_string_literal: true\n\nmodule OptionsHelper\n # TODO:\n # refactor this helper to decorator\n\n def plans_option_"
},
{
"path": "app/helpers/promos_helper.rb",
"chars": 459,
"preview": "# frozen_string_literal: true\n\nmodule PromosHelper\n def promo_types\n select_options(Promo::TYPES.map do |type|\n "
},
{
"path": "app/helpers/servers_helper.rb",
"chars": 258,
"preview": "# frozen_string_literal: true\n\nmodule ServersHelper\n def server_country_name(server)\n server.country_code\n end\n\n d"
},
{
"path": "app/inputs/datepicker_input.rb",
"chars": 247,
"preview": "# frozen_string_literal: true\n\nclass DatepickerInput < SimpleForm::Inputs::Base\n def input\n @builder.text_field(attr"
},
{
"path": "app/mailers/user_connection_config_mailer.rb",
"chars": 482,
"preview": "# frozen_string_literal: true\n\nclass UserConnectionConfigMailer < ActionMailer::Base\n default from: ENV['EMAIL_FROM']\n\n"
},
{
"path": "app/mailers/user_mailer.rb",
"chars": 1028,
"preview": "# frozen_string_literal: true\n\nclass UserMailer < ActionMailer::Base\n add_template_helper(ApplicationHelper)\n default "
},
{
"path": "app/models/ability.rb",
"chars": 234,
"preview": "# frozen_string_literal: true\n\nclass Ability\n include CanCan::Ability\n\n def initialize(user)\n user ||= User.new\n\n "
},
{
"path": "app/models/admin.rb",
"chars": 399,
"preview": "# frozen_string_literal: true\n\nclass Admin < ActiveRecord::Base\n devise :database_authenticatable, :timeoutable, :valid"
},
{
"path": "app/models/authenticator.rb",
"chars": 1117,
"preview": "# frozen_string_literal: true\n\nclass Authenticator\n def initialize(login, password, hostname)\n @login = login\n @p"
},
{
"path": "app/models/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/models/concerns/last_days_filterable.rb",
"chars": 306,
"preview": "# frozen_string_literal: true\n\nmodule LastDaysFilterable\n extend ActiveSupport::Concern\n\n included do\n def self.in_"
},
{
"path": "app/models/connection.rb",
"chars": 830,
"preview": "# frozen_string_literal: true\n\nclass Connection < ActiveRecord::Base\n belongs_to :user\n belongs_to :server\n\n delegate"
},
{
"path": "app/models/connections/connect.rb",
"chars": 344,
"preview": "# frozen_string_literal: true\n\nclass Connect < Connection\nend\n\n# == Schema Information\n#\n# Table name: connections\n#\n# "
},
{
"path": "app/models/connections/disconnect.rb",
"chars": 431,
"preview": "# frozen_string_literal: true\n\nclass Disconnect < Connection\n include LastDaysFilterable\n\n validates :traffic_in, :tra"
},
{
"path": "app/models/connector.rb",
"chars": 1680,
"preview": "# frozen_string_literal: true\n\nclass Connector\n attr_reader :user, :server\n\n def self.connected?(user)\n (has_previo"
},
{
"path": "app/models/option.rb",
"chars": 950,
"preview": "# frozen_string_literal: true\n\nclass Option < ActiveRecord::Base\n include AASM\n\n validates :name, :code, presence: tru"
},
{
"path": "app/models/options/attributes/proxy.rb",
"chars": 400,
"preview": "# frozen_string_literal: true\n\nmodule Options\n module Attributes\n class Proxy\n def initialize\n @countrie"
},
{
"path": "app/models/options/hooks/proxy.rb",
"chars": 611,
"preview": "# frozen_string_literal: true\n\nmodule Options\n module Hooks\n class Proxy\n attr_accessor :user, :option\n\n d"
},
{
"path": "app/models/pay_system.rb",
"chars": 795,
"preview": "# frozen_string_literal: true\n\nclass PaySystem < ActiveRecord::Base\n include AASM\n\n CURRENCIES = %w[usd rub eur].freez"
},
{
"path": "app/models/payment.rb",
"chars": 1370,
"preview": "# frozen_string_literal: true\n\nclass Payment < ActiveRecord::Base\n include AASM\n include LastDaysFilterable\n\n belongs"
},
{
"path": "app/models/plan.rb",
"chars": 881,
"preview": "# frozen_string_literal: true\n\nclass Plan < ActiveRecord::Base\n validates :price, :name, :code, :description, presence:"
},
{
"path": "app/models/plan_has_server.rb",
"chars": 326,
"preview": "# frozen_string_literal: true\n\nclass PlanHasServer < ActiveRecord::Base\n belongs_to :plan\n belongs_to :server\nend\n\n# ="
},
{
"path": "app/models/promo.rb",
"chars": 1089,
"preview": "# frozen_string_literal: true\n\nclass Promo < ActiveRecord::Base\n include AASM\n\n TYPES = ['withdrawal'].freeze\n self.i"
},
{
"path": "app/models/promoter.rb",
"chars": 258,
"preview": "# frozen_string_literal: true\n\nclass Promoter\n class << self\n def type\n raise 'Implement it in child class'\n "
},
{
"path": "app/models/promoters/discount_promoter.rb",
"chars": 589,
"preview": "# frozen_string_literal: true\n\nclass DiscountPromoter < Promoter\n class << self\n def type\n 'discount'\n end\n\n"
},
{
"path": "app/models/promoters_repository.rb",
"chars": 448,
"preview": "# frozen_string_literal: true\n\nclass PromotersRepository\n class << self\n def clean\n @index = nil\n end\n\n d"
},
{
"path": "app/models/promotion.rb",
"chars": 546,
"preview": "# frozen_string_literal: true\n\nclass Promotion < ActiveRecord::Base\n attr_accessor :promo_code\n\n belongs_to :user\n be"
},
{
"path": "app/models/proxy/connect.rb",
"chars": 346,
"preview": "# frozen_string_literal: true\n\nclass Proxy::Connect < ActiveRecord::Base\n include AASM\n\n belongs_to :proxy, class_name"
},
{
"path": "app/models/proxy/node.rb",
"chars": 201,
"preview": "# frozen_string_literal: true\n\nclass Proxy::Node < ActiveRecord::Base\n validates :host, :port, :country, presence: true"
},
{
"path": "app/models/proxy.rb",
"chars": 96,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n def self.table_name_prefix\n 'proxy_'\n end\nend\n"
},
{
"path": "app/models/referrer/account.rb",
"chars": 505,
"preview": "# frozen_string_literal: true\n\nmodule Referrer\n class Account\n def initialize(referrer_id)\n @referrer_id = refe"
},
{
"path": "app/models/referrer/reward.rb",
"chars": 223,
"preview": "# frozen_string_literal: true\n\nclass Referrer::Reward < ActiveRecord::Base\n validates :referrer_id, :operation_id, :amo"
},
{
"path": "app/models/referrer.rb",
"chars": 102,
"preview": "# frozen_string_literal: true\n\nmodule Referrer\n def self.table_name_prefix\n 'referrer_'\n end\nend\n"
},
{
"path": "app/models/server/signature.rb",
"chars": 1184,
"preview": "# frozen_string_literal: true\n\n# Allows to check if the request from the server is valid.\n# Server may be nil, which mea"
},
{
"path": "app/models/server.rb",
"chars": 1139,
"preview": "# frozen_string_literal: true\n\nclass Server < ActiveRecord::Base\n include AASM\n\n PROTOCOLS = %w[udp tcp].freeze\n\n has"
},
{
"path": "app/models/server_config.rb",
"chars": 309,
"preview": "# frozen_string_literal: true\n\n# TODO: delete\n# This model for parse server config, storage array strings\nclass ServerCo"
},
{
"path": "app/models/test_period.rb",
"chars": 474,
"preview": "# frozen_string_literal: true\n\nclass TestPeriod\n def initialize(user)\n @user = user\n end\n\n def enable!\n @user.u"
},
{
"path": "app/models/traffic_report.rb",
"chars": 636,
"preview": "# frozen_string_literal: true\n\nclass TrafficReport\n include ActiveModel::Validations\n include ActiveModel::Conversion\n"
},
{
"path": "app/models/traffic_reports/date_traffic_report.rb",
"chars": 575,
"preview": "# frozen_string_literal: true\n\nclass DateTrafficReport < TrafficReport\n private\n\n def build_report\n # TODO:\n # I"
},
{
"path": "app/models/traffic_reports/server_traffic_report.rb",
"chars": 333,
"preview": "# frozen_string_literal: true\n\nclass ServerTrafficReport < TrafficReport\n private\n\n def build_report\n Disconnect.gr"
},
{
"path": "app/models/traffic_reports/user_traffic_report.rb",
"chars": 325,
"preview": "# frozen_string_literal: true\n\nclass UserTrafficReport < TrafficReport\n private\n\n def build_report\n Disconnect.grou"
},
{
"path": "app/models/transaction.rb",
"chars": 894,
"preview": "# frozen_string_literal: true\n\nclass Transaction\n attr_accessor :object, :id\n delegate :created_at, to: :object\n\n cla"
},
{
"path": "app/models/user.rb",
"chars": 4881,
"preview": "# frozen_string_literal: true\n\nclass User < ActiveRecord::Base\n include AASM\n include LastDaysFilterable\n\n BILLING_IN"
},
{
"path": "app/models/user_option.rb",
"chars": 556,
"preview": "# frozen_string_literal: true\n\nclass UserOption < ActiveRecord::Base\n # NOTICE:\n # bad name - UserOption.\n # better v"
},
{
"path": "app/models/withdrawal.rb",
"chars": 1034,
"preview": "# frozen_string_literal: true\n\nclass Withdrawal < ActiveRecord::Base\n belongs_to :user\n belongs_to :plan\n\n has_many :"
},
{
"path": "app/models/withdrawal_prolongation.rb",
"chars": 168,
"preview": "# frozen_string_literal: true\n\nclass WithdrawalProlongation < ActiveRecord::Base\n belongs_to :withdrawal\n\n validates :"
},
{
"path": "app/operations/ops/admin/user/base.rb",
"chars": 322,
"preview": "# frozen_string_literal: true\n\n# This base class for user operations\nmodule Ops\n module Admin\n module User\n cla"
},
{
"path": "app/operations/ops/admin/user/create.rb",
"chars": 761,
"preview": "# frozen_string_literal: true\n\nmodule Ops\n module Admin\n module User\n # This class create new user and send ema"
},
{
"path": "app/ransackers/base_ransacker.rb",
"chars": 210,
"preview": "# frozen_string_literal: true\n\nclass BaseRansacker\n attr_reader :table\n\n # @param [Arel::Table] table\n def initialize"
},
{
"path": "app/ransackers/never_paid_users_ransacker.rb",
"chars": 326,
"preview": "# frozen_string_literal: true\n\nclass NeverPaidUsersRansacker < BaseRansacker\n TRUE_VALUES = ['1', 1].freeze\n\n def eq(v"
},
{
"path": "app/serializers/admin/users_serializer.rb",
"chars": 313,
"preview": "# frozen_string_literal: true\n\nclass Admin::UsersSerializer\n attr_accessor :collection, :format\n\n def initialize(colle"
},
{
"path": "app/serializers/api/connect_serializer.rb",
"chars": 92,
"preview": "# frozen_string_literal: true\n\nclass Api::ConnectSerializer < Api::ConnectionSerializer\nend\n"
},
{
"path": "app/serializers/api/connection_serializer.rb",
"chars": 339,
"preview": "# frozen_string_literal: true\n\nclass Api::ConnectionSerializer < ActiveModel::Serializer\n self.root = false\n attribute"
},
{
"path": "app/serializers/api/disconnect_serializer.rb",
"chars": 95,
"preview": "# frozen_string_literal: true\n\nclass Api::DisconnectSerializer < Api::ConnectionSerializer\nend\n"
},
{
"path": "app/services/dto/admin/dashboard.rb",
"chars": 2084,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n module Admin\n # Collects statistic about traffic, income and customers.\n "
},
{
"path": "app/services/dto/admin/discrete_base.rb",
"chars": 772,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n module Admin\n # This class replace nil value to zero for each dates and r"
},
{
"path": "app/services/dto/admin/discrete_customers_registrations.rb",
"chars": 408,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n module Admin\n # Returns statistics by customers\n class DiscreteCustome"
},
{
"path": "app/services/dto/admin/discrete_payments.rb",
"chars": 403,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n module Admin\n # Returns statistics by payments\n class DiscretePayments"
},
{
"path": "app/services/dto/admin/discrete_traffic.rb",
"chars": 408,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n module Admin\n # Returns statistics by traffic\n class DiscreteTraffic <"
},
{
"path": "app/services/dto/base.rb",
"chars": 250,
"preview": "# frozen_string_literal: true\n\nmodule Dto\n # This base class for Dto Admin dashboard\n class Base\n def initialize\n "
},
{
"path": "app/services/forced_disconnect.rb",
"chars": 369,
"preview": "# frozen_string_literal: true\n\nclass ForcedDisconnect\n def initialize(user)\n @user = user\n end\n\n def invoke\n di"
},
{
"path": "app/services/newsletter_manager.rb",
"chars": 561,
"preview": "# frozen_string_literal: true\n\nclass NewsletterManager\n attr_reader :api\n\n def initialize\n @api = ::Gibbon::API.new"
},
{
"path": "app/services/option/activation_price_calc.rb",
"chars": 641,
"preview": "# frozen_string_literal: true\n\nclass Option::ActivationPriceCalc\n class << self\n def activation_price(user, option)\n"
},
{
"path": "app/services/option/activator.rb",
"chars": 870,
"preview": "# frozen_string_literal: true\n\nclass Option::Activator\n attr_accessor :user, :option\n\n def self.run(user, option_code)"
},
{
"path": "app/services/option/deactivator.rb",
"chars": 174,
"preview": "# frozen_string_literal: true\n\nclass Option::Deactivator\n def self.run(user, option_id)\n option = Option.active.find"
},
{
"path": "app/services/proxy/fetchers/base.rb",
"chars": 292,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n module Fetchers\n class Base\n def self.fetch\n fetcher = new\n"
},
{
"path": "app/services/proxy/fetchers/free_proxy_list_net/row_parser.rb",
"chars": 715,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n module Fetchers\n module FreeProxyListNet\n class RowParser\n "
},
{
"path": "app/services/proxy/fetchers/free_proxy_list_net/web_parser.rb",
"chars": 1083,
"preview": "# frozen_string_literal: true\n\nrequire 'mechanize'\n\n# Implements parser for http://www.freeproxylists.net/ website\nmodul"
},
{
"path": "app/services/proxy/fetchers/free_proxy_lists/row_parser.rb",
"chars": 1094,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n module Fetchers\n module FreeProxyLists\n class RowParser\n de"
},
{
"path": "app/services/proxy/fetchers/free_proxy_lists/web_parser.rb",
"chars": 1182,
"preview": "# frozen_string_literal: true\n\nrequire 'mechanize'\n\n# Implements parser for http://www.freeproxylists.net/ website\nmodul"
},
{
"path": "app/services/proxy/proxy_dto.rb",
"chars": 576,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n class ProxyDto\n attr_accessor :host, :port, :country, :protocol, :bandw"
},
{
"path": "app/services/proxy/rater.rb",
"chars": 510,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n class Rater\n attr_accessor :user, :option\n\n def initialize(user, opt"
},
{
"path": "app/services/proxy/repository.rb",
"chars": 425,
"preview": "# frozen_string_literal: true\n\nmodule Proxy\n class Repository\n def self.persist(proxies)\n Proxy::Node.transacti"
},
{
"path": "app/services/proxy/updater.rb",
"chars": 167,
"preview": "# frozen_string_literal: true\n\nclass Proxy::Updater\n def self.update(fetcher_class)\n proxies = fetcher_class.fetch\n "
},
{
"path": "app/services/referrer/reward_calculator.rb",
"chars": 284,
"preview": "# frozen_string_literal: true\n\nmodule Referrer\n class RewardCalculator\n def initialize(payment)\n @payment = pay"
},
{
"path": "app/services/referrer/rewarder.rb",
"chars": 645,
"preview": "# frozen_string_literal: true\n\nmodule Referrer\n class Rewarder\n def self.add_funds(withdrawal, amount)\n rewarde"
},
{
"path": "app/services/server_config_builder.rb",
"chars": 749,
"preview": "# frozen_string_literal: true\n\n# This class created connection vpn config file by server from template\nclass ServerConfi"
},
{
"path": "app/services/unpaid_users_notificator.rb",
"chars": 365,
"preview": "# frozen_string_literal: true\n\nclass UnpaidUsersNotificator\n FAILED_WITHDRAWS = 3\n\n def notify_all\n users_to_notify"
},
{
"path": "app/services/withdrawal_amount_calculator.rb",
"chars": 540,
"preview": "# frozen_string_literal: true\n\nclass WithdrawalAmountCalculator\n attr_accessor :user\n\n def initialize(user)\n @user "
},
{
"path": "app/services/withdrawer.rb",
"chars": 1661,
"preview": "# frozen_string_literal: true\n\nclass Withdrawer\n attr_accessor :withdrawal, :user\n\n class << self\n def mass_withdra"
},
{
"path": "app/uploaders/config_uploader.rb",
"chars": 1653,
"preview": "# frozen_string_literal: true\n\nclass ConfigUploader < CarrierWave::Uploader::Base\n # Include RMagick or MiniMagick supp"
},
{
"path": "app/views/admin/connections/_filter.html.slim",
"chars": 613,
"preview": ".col-md-12.d-flex.justify-content-end\n = search_form_for [:admin, search], class: 'form-inline my-3' do |f|\n .form-g"
},
{
"path": "app/views/admin/connections/active.html.slim",
"chars": 721,
"preview": "= page_title(t('admin.connections.title'), 'bolt', 'connections') do\n = sub_page_title(t('admin.connections.active'))\n\n"
},
{
"path": "app/views/admin/connections/index.html.slim",
"chars": 895,
"preview": "= page_title(t('admin.connections.title'), 'bolt', 'connections')\n\n.row\n = render 'filter'\n .col.my-3\n = link_to t("
},
{
"path": "app/views/admin/connections/show.html.slim",
"chars": 85,
"preview": "| Тут отобразить текущий траффик по коннекту и график по траффику, можно статический\n"
},
{
"path": "app/views/admin/home/index.html.slim",
"chars": 788,
"preview": "= page_title(t('admin.dashboard.title'), 'home', 'root')\n\n.row.mt-5\n .col-md-10.offset-md-1\n ul.list-unstyled.text-c"
},
{
"path": "app/views/admin/options/_form.html.slim",
"chars": 456,
"preview": ".row.my-5\n .col\n = simple_form_for [:admin, @option], html: { class: 'form-horizontal' },wrapper: :horizontal_form d"
},
{
"path": "app/views/admin/options/edit.html.slim",
"chars": 152,
"preview": "= page_title(t('admin.options.title'), 'cogs', 'options') do\n = sub_page_title(\"#{t('admin.options.edit')} #{@option.na"
},
{
"path": "app/views/admin/options/index.html.slim",
"chars": 618,
"preview": "= page_title(t('admin.options.title'), 'cogs', 'options')\n\n.row.my-4\n .col\n = link_to t('admin.links.create'), new_a"
},
{
"path": "app/views/admin/options/new.html.slim",
"chars": 130,
"preview": "= page_title(t('admin.options.title'), 'cogs', 'options') do\n = sub_page_title(t('admin.options.new'))\n\n= render partia"
},
{
"path": "app/views/admin/pay_systems/_form.html.slim",
"chars": 552,
"preview": ".row\n .col.mt-5\n = simple_form_for [:admin, @pay_system], html: { class: 'form-horizontal' },wrapper: :horizontal_fo"
},
{
"path": "app/views/admin/pay_systems/edit.html.slim",
"chars": 170,
"preview": "= page_title(t('admin.pay_systems.title'), 'server', 'pay_systems') do\n = sub_page_title(\"#{t('admin.pay_systems.edit')"
},
{
"path": "app/views/admin/pay_systems/index.html.slim",
"chars": 671,
"preview": "= page_title(t('admin.pay_systems.title'), 'server', 'pay_systems')\n\n.row.my-4\n .col\n = link_to t('admin.links.creat"
},
{
"path": "app/views/admin/pay_systems/new.html.slim",
"chars": 144,
"preview": "= page_title(t('admin.pay_systems.title'), 'server', 'pay_systems') do\n = sub_page_title(t('admin.pay_systems.new'))\n\n="
},
{
"path": "app/views/admin/pay_systems/show.html.slim",
"chars": 455,
"preview": "= page_title(t('admin.pay_systems.title'), 'user', 'pay_systems') do\n = sub_page_title(\"#{t('admin.pay_systems.show')} "
},
{
"path": "app/views/admin/plans/_form.html.slim",
"chars": 1164,
"preview": ".row.mt-5\n .col\n = simple_form_for [:admin, @plan], html: { class: 'form-horizontal' },wrapper: :horizontal_form do "
},
{
"path": "app/views/admin/plans/edit.html.slim",
"chars": 153,
"preview": "= page_title(t('admin.plans.title'), 'shopping-cart', 'plans') do\n = sub_page_title(\"#{t('admin.plans.edit')} #{@plan.n"
},
{
"path": "app/views/admin/plans/index.html.slim",
"chars": 881,
"preview": "= page_title(t('admin.plans.title'), 'shopping-cart', 'plans')\n\n.row.my-4\n .col\n = link_to t('admin.links.create'), "
},
{
"path": "app/views/admin/plans/new.html.slim",
"chars": 133,
"preview": "= page_title(t('admin.plans.title'), 'shopping-cart', 'plans') do\n = sub_page_title(t('admin.plans.new'))\n\n= render par"
},
{
"path": "app/views/admin/profiles/edit.html.slim",
"chars": 361,
"preview": ".row.mt-5.text-center\n .col-md-4.offset-md-4\n h4= t('admin.profile.change_password')\n.row.mt-5\n .col-md-4.offset-md"
}
]
// ... and 393 more files (download for full content)
About this extraction
This page contains the full source code of the smartvpnbiz/smartvpn-billing GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 593 files (1.2 MB), approximately 365.8k tokens, and a symbol index with 857 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.