commit 5b6fac0dabf2e2e3b242efc640a350b8c6f638a4 Author: Andrey Paderin Date: Sun Jun 2 04:08:03 2019 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..536c4f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ +.ruby-version +.ruby-gemset + +# rspec failure tracking +.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..17b1f43 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,13 @@ +AllCops: + TargetRubyVersion: 2.5 + +Metrics/BlockLength: + Exclude: + - 'spec/**/*.rb' + +Metrics/LineLength: + Max: 100 + +Naming/FileName: + Exclude: + - 'lib/*.rb' diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..88064d4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +--- +sudo: false +language: ruby +cache: bundler +rvm: + - 2.5.3 +before_install: gem install bundler -v 1.17.3 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..8550867 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at andy.paderin@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..fc7f711 --- /dev/null +++ b/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +# Specify your gem's dependencies in yandex-checkout.gemspec +gemspec + +group :development, :test do + gem 'pry', platform: :mri + gem 'pry-byebug', platform: :mri +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..3e0565b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,98 @@ +PATH + remote: . + specs: + yandex-checkout (0.1.0) + evil-client (~> 3.0) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + ast (2.4.0) + byebug (11.0.1) + coderay (1.1.2) + concurrent-ruby (1.1.5) + crack (0.4.3) + safe_yaml (~> 1.0.0) + diff-lcs (1.3) + docile (1.3.1) + dry-initializer (3.0.1) + evil-client (3.0.3) + dry-initializer (>= 2.1, < 4) + mime-types (~> 3.1) + rack (~> 2) + tram-policy (>= 0.3.1, < 2) + hashdiff (0.4.0) + i18n (1.6.0) + concurrent-ruby (~> 1.0) + jaro_winkler (1.5.2) + json (2.2.0) + method_source (0.9.2) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.0331) + parallel (1.17.0) + parser (2.6.3.0) + ast (~> 2.4.0) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-byebug (3.7.0) + byebug (~> 11.0) + pry (~> 0.10) + public_suffix (3.1.0) + rack (2.0.7) + rainbow (3.0.0) + rake (12.3.2) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + rubocop (0.71.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.6) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.7) + ruby-progressbar (1.10.1) + safe_yaml (1.0.5) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + tram-policy (1.0.1) + dry-initializer (> 2, < 4) + i18n (~> 1.0) + unicode-display_width (1.6.0) + webmock (3.5.1) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + +PLATFORMS + ruby + +DEPENDENCIES + pry + pry-byebug + rake (>= 10.0) + rspec (~> 3.5) + rubocop (~> 0.71) + simplecov (~> 0.16) + webmock (~> 3.5) + yandex-checkout! + +BUNDLED WITH + 1.17.3 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..e0b38d6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Andrey Paderin + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1820b56 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Yandex::Checkout + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yandex/checkout`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'yandex-checkout' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install yandex-checkout + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/yandex-checkout. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). + +## Code of Conduct + +Everyone interacting in the Yandex::Checkout project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/yandex-checkout/blob/master/CODE_OF_CONDUCT.md). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b7e9ed5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec diff --git a/lib/yandex-checkout.rb b/lib/yandex-checkout.rb new file mode 100644 index 0000000..bcb80f6 --- /dev/null +++ b/lib/yandex-checkout.rb @@ -0,0 +1,6 @@ +require 'yandex-checkout/version' + +module YandexCheckout + class Error < StandardError; end + # Your code goes here... +end diff --git a/lib/yandex-checkout/version.rb b/lib/yandex-checkout/version.rb new file mode 100644 index 0000000..84351e5 --- /dev/null +++ b/lib/yandex-checkout/version.rb @@ -0,0 +1,3 @@ +module YandexCheckout + VERSION = '0.1.0' +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..a23d861 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,19 @@ +begin + require 'pry' +rescue LoadError + nil +end + +require 'yandex-checkout' +require 'webmock/rspec' + +RSpec.configure do |config| + config.order = :random + config.filter_run focus: true + config.run_all_when_everything_filtered = true + + config.around(:each) do |example| + stub_request(:any, //) + example.run + end +end diff --git a/spec/yandex-checkout_spec.rb b/spec/yandex-checkout_spec.rb new file mode 100644 index 0000000..fbc36d2 --- /dev/null +++ b/spec/yandex-checkout_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe YandexCheckout do + it "has a version number" do + expect(YandexCheckout::VERSION).not_to be nil + end + + it "does something useful" do + expect(false).to eq(true) + end +end diff --git a/yandex-checkout.gemspec b/yandex-checkout.gemspec new file mode 100644 index 0000000..aa56af2 --- /dev/null +++ b/yandex-checkout.gemspec @@ -0,0 +1,31 @@ + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'yandex-checkout/version' + +Gem::Specification.new do |spec| + spec.name = 'yandex-checkout' + spec.version = YandexCheckout::VERSION + spec.authors = 'Andrey Paderin' + spec.email = 'andy.paderin@gmail.com' + + spec.summary = 'This product is used for managing payments under The Yandex.Checkout API For usage by those who implemented Yandex.Checkout using the API method.' + spec.homepage = 'https://github.com/paderinandrey/yandex-checkout' + spec.license = 'MIT' + + spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) + spec.test_files = spec.files.grep(/^spec/) + spec.extra_rdoc_files = Dir['README.md', 'LICENSE', 'CHANGELOG.md'] + + spec.require_paths = ['lib'] + + spec.required_ruby_version = '>= 2.5' + + spec.add_runtime_dependency 'evil-client', '~> 3.0' + + spec.add_development_dependency 'rake', '>= 10.0' + spec.add_development_dependency 'rspec', '~> 3.5' + spec.add_development_dependency 'rubocop', '~> 0.71' + spec.add_development_dependency 'simplecov', '~> 0.16' + spec.add_development_dependency 'webmock', '~> 3.5' +end