vipps 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b0fd118c65893fda07f99b98040f45076de556c7d8de543a96446321f1f1bd82
4
+ data.tar.gz: 689c740c3e4e49be5ae456d555a0b90b95b0617160a33dc99f6ed5ac447153ed
5
+ SHA512:
6
+ metadata.gz: a693d7fb929205c9a3d5fd840eb8e71fa273f5bba5a1360aca3f1e3fd9de217cd94fa936c92e2ca2aa1ee8d7fceee33a6ba865b1212633827952e9f593a1e5be
7
+ data.tar.gz: def4b900f8b2e8db10183896e195ced5c7d45cc89eb5f2aabbcee5370b3aebb6e289dcb06371bdc15374691fc7958bd305e7b6287b42191d0283773d5474080f
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['3.0']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby-version }}
23
+ bundler-cache: true
24
+
25
+ - name: Run tests
26
+ run: bundle exec rake test
27
+
28
+ - name: Run linter
29
+ run: bundle exec rake standard
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in vipps.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "minitest", "~> 5.0"
10
+ gem "standard", "~> 1.3"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Francesco Rodríguez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Vipps ![CI](https://github.com/frodsan/vipps/actions/workflows/ci.yml/badge.svg)
2
+
3
+ Ruby wrapper for the Vipps API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'vipps'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install vipps
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here.
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/frodsan/vipps.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/setup"
2
+ require "bundler/gem_tasks"
3
+ require "rake/testtask"
4
+ require "standard/rake"
5
+
6
+ task default: :test
7
+
8
+ Rake::TestTask.new do |t|
9
+ t.pattern = "test/**/*_test.rb"
10
+ t.warning = true
11
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vipps"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ IFS=$'\n\t'
5
+ set -vx
6
+
7
+ bundle install
8
+
9
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,11 @@
1
+ module Vipps
2
+ class Config
3
+ attr_accessor :api_endpoint
4
+
5
+ attr_accessor :client_id
6
+
7
+ attr_accessor :client_secret
8
+
9
+ attr_accessor :subscription_key
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module Vipps
2
+ VERSION = "0.0.1.pre"
3
+ end
data/lib/vipps.rb ADDED
@@ -0,0 +1,18 @@
1
+ require_relative "vipps/version"
2
+ require_relative "vipps/config"
3
+
4
+ module Vipps
5
+ class << self
6
+ def configure
7
+ yield config
8
+ end
9
+
10
+ def config
11
+ @config ||= Config.new
12
+ end
13
+
14
+ def reset_config # :nodoc:
15
+ @config = nil
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ require "bundler/setup"
2
+ require "minitest/autorun"
3
+ require_relative "../lib/vipps"
@@ -0,0 +1,21 @@
1
+ require_relative "test_helper"
2
+
3
+ class VippsTest < Minitest::Test
4
+ def setup
5
+ Vipps.reset_config
6
+ end
7
+
8
+ def test_configure
9
+ Vipps.configure do |c|
10
+ c.api_endpoint = "https://apitest.vipps.no"
11
+ c.client_id = "client_id"
12
+ c.client_secret = "client_secret"
13
+ c.subscription_key = "subscription_key"
14
+ end
15
+
16
+ assert_equal "https://apitest.vipps.no", Vipps.config.api_endpoint
17
+ assert_equal "client_id", Vipps.config.client_id
18
+ assert_equal "client_secret", Vipps.config.client_secret
19
+ assert_equal "subscription_key", Vipps.config.subscription_key
20
+ end
21
+ end
data/vipps.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ require_relative "lib/vipps/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "vipps"
5
+ spec.version = Vipps::VERSION
6
+ spec.authors = ["Francesco Rodriguez"]
7
+ spec.email = ["frodsan@me.com"]
8
+
9
+ spec.summary = "Ruby wrapper around the Vipps API"
10
+ spec.description = spec.summary
11
+ spec.homepage = "https://github.com/frodsan/vipps"
12
+ spec.license = "MIT"
13
+
14
+ spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata["source_code_uri"] = spec.homepage
16
+ spec.metadata["changelog_uri"] = spec.homepage
17
+
18
+ spec.files = `git ls-files`.split("\n")
19
+ spec.executables = spec.files.grep(%r{^exe/}).map { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
22
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vipps
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre
5
+ platform: ruby
6
+ authors:
7
+ - Francesco Rodriguez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-09-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby wrapper around the Vipps API
14
+ email:
15
+ - frodsan@me.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".github/workflows/ci.yml"
21
+ - ".gitignore"
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - bin/console
27
+ - bin/setup
28
+ - lib/vipps.rb
29
+ - lib/vipps/config.rb
30
+ - lib/vipps/version.rb
31
+ - test/test_helper.rb
32
+ - test/vipps_test.rb
33
+ - vipps.gemspec
34
+ homepage: https://github.com/frodsan/vipps
35
+ licenses:
36
+ - MIT
37
+ metadata:
38
+ homepage_uri: https://github.com/frodsan/vipps
39
+ source_code_uri: https://github.com/frodsan/vipps
40
+ changelog_uri: https://github.com/frodsan/vipps
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.3.1
55
+ requirements: []
56
+ rubygems_version: 3.2.26
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Ruby wrapper around the Vipps API
60
+ test_files:
61
+ - test/test_helper.rb
62
+ - test/vipps_test.rb