Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic and stylistic upgrade #10

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.5.8

Gemspec/OrderedDependencies:
Enabled: true

Gemspec/DuplicatedAssignment:
Enabled: true

Gemspec/RubyVersionGlobalsUsage:
Enabled: true

Layout/ArgumentAlignment:
EnforcedStyle: with_first_argument
Enabled: true

Layout/EmptyLineAfterMagicComment:
Enabled: true

Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: false
Enabled: true

Layout/EmptyLines:
Enabled: true

Layout/EmptyLinesAroundBlockBody:
EnforcedStyle: no_empty_lines
Enabled: true

Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: no_empty_lines
Enabled: true

Layout/FirstArgumentIndentation:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Layout/SpaceAroundOperators:
AllowForAlignment: true
EnforcedStyleForExponentOperator: no_space
Enabled: true

Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: space
Enabled: true

Layout/SpaceBeforeFirstArg:
AllowForAlignment: true
Enabled: true

Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
SpaceBeforeBlockParameters: true
Enabled: true

Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: compact
EnforcedStyleForEmptyBraces: no_space
Enabled: true

Layout/TrailingEmptyLines:
EnforcedStyle: final_newline
Enabled: true

Layout/TrailingWhitespace:
AllowInHeredoc: false
Enabled: true

Layout/IndentationWidth:
Enabled: true

Layout/LeadingCommentSpace:
Enabled: true

Layout/LineLength:
Enabled: true
Max: 168

Layout/RescueEnsureAlignment:
Enabled: true

Lint/UnusedBlockArgument:
Enabled: true

Metrics/AbcSize:
Enabled: true
Max: 17

Metrics/BlockLength:
Enabled: true
Max: 272

Naming/AccessorMethodName:
Enabled: false

Style/BlockDelimiters:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: true

Style/Lambda:
EnforcedStyle: line_count_dependent
Enabled: true

Style/StringLiterals:
EnforcedStyle: single_quotes
Enabled: true

Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Enabled: false

Style/RedundantInterpolation:
Enabled: false

Style/RedundantParentheses:
Enabled: true

Style/RedundantPercentQ:
Enabled: true

Style/RedundantReturn:
Enabled: true

Style/RedundantSelf:
Enabled: true

Style/MutableConstant:
EnforcedStyle: literals
Enabled: true

Style/PercentLiteralDelimiters:
Enabled: true

Style/PreferredHashMethods:
EnforcedStyle: short
Enabled: true

Style/RaiseArgs:
Enabled: true
EnforcedStyle: compact

Style/Encoding:
Enabled: true

Style/ExpandPathArguments:
Enabled: true
8 changes: 8 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-06-24 06:31:38 +0300 using RuboCop version 0.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.8
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in beyonic.gemspec
gemspec
gemspec
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require "bundler/gem_tasks"
# frozen_string_literal: true

require 'bundler/gem_tasks'
40 changes: 21 additions & 19 deletions beyonic.gemspec
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'beyonic/version'

Gem::Specification.new do |spec|
spec.name = "beyonic"
spec.name = 'beyonic'
spec.version = Beyonic::VERSION
spec.required_ruby_version = '2.5.8'
spec.authors = ['Oleg German', 'Luke Kyohere']
spec.email = ['oleg.german@gmail.com', 'luke@beyonic.com']
spec.summary = %q{Ruby library for the beyonic.com api}
spec.description = %q{Beyonic.com makes enterprise payments to mobile easy. Details: http://beyonic.com}
spec.homepage = "http://support.beyonic.com/api/"
spec.license = "MIT"
spec.summary = 'Ruby library for the beyonic.com api'
spec.description = 'Beyonic.com makes enterprise payments to mobile easy. Details: http://beyonic.com'
spec.homepage = 'http://support.beyonic.com/api/'
spec.license = 'MIT'

spec.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md"]
spec.files = Dir['{lib}/**/*.rb', 'bin/*', 'LICENSE', '*.md']
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_runtime_dependency "rest-client"
spec.add_runtime_dependency "oj", "~> 2.11"
spec.add_runtime_dependency "addressable"
spec.add_runtime_dependency 'addressable', '~> 2.7'
spec.add_runtime_dependency 'oj', '~> 2.11'
spec.add_runtime_dependency 'rest-client', '~> 2.1.0'

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 12.3.3"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rspec-collection_matchers"
spec.add_development_dependency "webmock"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "vcr"
spec.add_development_dependency 'bundler', '~> 2.1.4'
spec.add_development_dependency 'rake', '~> 13.0.1'
spec.add_development_dependency 'rspec', '~> 3.9'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.2.0'
spec.add_development_dependency 'simplecov', '~> 0.18.5'
spec.add_development_dependency 'vcr', '~> 6.0.0'
spec.add_development_dependency 'webmock', '~> 3.8.3'
end
32 changes: 16 additions & 16 deletions lib/beyonic.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module Beyonic
# frozen_string_literal: true

require "rest-client"
require "oj"
module Beyonic
require 'rest-client'
require 'oj'

# Uncomment this if you are testing on your server and you want to bypass SSL checks.
# OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Expand All @@ -23,19 +24,18 @@ def self.api_version
end

def self.endpoint_base
"https://app.beyonic.us/api/"
'https://app.beyonic.us/api/'
end

end

require "beyonic/version"
require "beyonic/abstract_api"
require "beyonic/payment"
require "beyonic/webhook"
require "beyonic/collection"
require "beyonic/collection_request"
require "beyonic/account"
require "beyonic/contact"
require "beyonic/transaction"
require "beyonic/currency"
require "beyonic/network"
require 'beyonic/version'
require 'beyonic/abstract_api'
require 'beyonic/payment'
require 'beyonic/webhook'
require 'beyonic/collection'
require 'beyonic/collection_request'
require 'beyonic/account'
require 'beyonic/contact'
require 'beyonic/transaction'
require 'beyonic/currency'
require 'beyonic/network'
Loading