Skip to content

Commit

Permalink
Add magic annotation (encoding + frozen_string_literal) to each Ruby …
Browse files Browse the repository at this point in the history
…script. (#1101)

* Add magic annotation (encoding + frozen_string_literal) to each Ruby script ❄️

* Fix
  • Loading branch information
yivo authored and calj committed May 15, 2018
1 parent ce5a318 commit 886ad95
Show file tree
Hide file tree
Showing 394 changed files with 1,187 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Gemfile
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo_slug| "https://github.com/#{repo_slug}" }

Expand Down
3 changes: 3 additions & 0 deletions Rakefile
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

#!/usr/bin/env rake
# 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.
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/auth/jwt_authenticator.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Auth
class JWTAuthenticator
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/auth/middleware.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Auth
class Middleware < Grape::Middleware::Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/auth/utils.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Auth
module Utils
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/constraints.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Constraints
class << self
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/cors/middleware.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module CORS
class Middleware < Grape::Middleware::Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/deposits.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_relative 'validations'

module APIv2
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/account.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Account < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/base.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Base < Grape::Entity
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/deposit.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Deposit < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/market.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Market < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/member.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Member < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/order.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Order < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/order_book.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_dependency 'api_v2/entities/order'

module APIv2
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/solvency/partial_tree.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
module Solvency
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/solvency/proof.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
module Solvency
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/trade.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Trade < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/entities/withdraw.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Entities
class Withdraw < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/errors.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2

module ExceptionHandlers
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/fees.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Fees < Grape::API
Fee = Struct.new(:type, :value)
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/helpers.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Helpers
def authenticate!
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/k.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class K < Grape::API
helpers ::APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/markets.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Markets < Grape::API

Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/members.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Members < Grape::API
helpers APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/mount.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_dependency 'api_v2/errors'
require_dependency 'api_v2/validations'
require_dependency 'api_v2/withdraws'
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/named_params.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module NamedParams
extend ::Grape::API::Helpers
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/order_books.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class OrderBook < Struct.new(:asks, :bids); end

Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/orders.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Orders < Grape::API
helpers ::APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/sessions.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Sessions < Grape::API
helpers { include SessionUtils }
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/solvency.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Solvency < Grape::API

Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/tickers.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Tickers < Grape::API
helpers ::APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/tools.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Tools < Grape::API
desc 'Get server current time, in seconds since Unix epoch.'
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/trades.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Trades < Grape::API
helpers ::APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/validations.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
module Validations
class Range < Grape::Validations::Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/websocket_protocol.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class WebSocketProtocol
def initialize(socket, channel, logger)
Expand Down
3 changes: 3 additions & 0 deletions app/api/api_v2/withdraws.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module APIv2
class Withdraws < Grape::API
helpers APIv2::NamedParams
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/accounts.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
class Accounts < Grape::API
desc 'Queries the account balance for the given UID and currency.' do
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/deposits.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
class Deposits < Grape::API

Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/entities/balance.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Entities
class Balance < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/entities/base.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Entities
class Base < Grape::Entity
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/entities/deposit.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Entities
class Deposit < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/entities/withdraw.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Entities
class Withdraw < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/exceptions/authentication.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Exceptions
class Authentication < Base
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/exceptions/base.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Exceptions
class Base < StandardError
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/helpers.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
module Helpers

Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/jwt_authentication_middleware.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require 'stringio'

module ManagementAPIv1
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/mount.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
class Mount < Grape::API
PREFIX = '/management_api'
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/tools.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
class Tools < Grape::API
desc 'Returns server time in seconds since Unix epoch.' do
Expand Down
3 changes: 3 additions & 0 deletions app/api/management_api_v1/withdraws.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module ManagementAPIv1
class Withdraws < Grape::API

Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/base_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module Admin
class BaseController < ::ApplicationController
layout 'admin'
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/currencies_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module Admin
class CurrenciesController < BaseController
load_and_authorize_resource
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/dashboard_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module Admin
class DashboardController < BaseController
skip_load_and_authorize_resource
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/deposits/base_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_dependency 'admin/base_controller'

module Admin
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/deposits/coins_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_dependency 'admin/deposits/base_controller'

module Admin
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/deposits/fiats_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

require_dependency 'admin/deposits/base_controller'

module Admin
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/admin/markets_controller.rb
@@ -1,3 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true

module Admin
class MarketsController < BaseController
load_and_authorize_resource
Expand Down

0 comments on commit 886ad95

Please sign in to comment.