compensated 0.1.0.pre2 → 0.1.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b33e091cd8f3e8e3b36393b3088ab4bb861e99107d2c325432ffa54503df59a9
4
- data.tar.gz: 9edef7647ce0e9877dd2596a44c027bd8769745086fa390106353ddf014b3ad1
3
+ metadata.gz: 223ec3be54d0b75a023875200811eead3fdc7ce5b3435a706e6e6aaa0b832189
4
+ data.tar.gz: 1d905b411d77379a8468d7a121aa95fff7a3fbbe57ce70273ad8811628c1b9c1
5
5
  SHA512:
6
- metadata.gz: c4f58665f50a4d98011780bebbd8facebfbcbd409ade95c4f042a0dbbaa2b22e7e2af40168038316ffc8d24012fa2c47dea6a83d35b0e8155562cf1cec747aeb
7
- data.tar.gz: 94886732c8a725f838c8e9b899146057eff3181f762ac7269c75cd9e87736cb2110080f37dd52e33504edb8789020547d52d8b5e9f805e428ffdd415cef417b0
6
+ metadata.gz: 3c9b15a18e49698e725712bcf6170ba7e9b5ea2176e63bdb52a400663456540d78e8e75993015805c91d467cf3f72afb3284c115d8ca2fe86c3e00cabee0820c
7
+ data.tar.gz: a3eb4e8632d7eda281229524cb6cb595231eea0c7754f2b1a01597b5836dbe2e26f0eb5806d4430b9a37fff6419027329773e866ea8052a5b89706cdf204561b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compensated (0.1.0.pre2)
4
+ compensated (0.1.0.pre3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/compensated.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  # Specify which files should be added to the gem when it is released.
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
30
  spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
31
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
31
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin|examples)/}) }
32
32
  end
33
33
  spec.bindir = "exe"
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -9,15 +9,21 @@ module Compensated
9
9
  end
10
10
 
11
11
  def parse(request)
12
+ if request.body.respond_to?(:read)
13
+ body = request.body.read
14
+ request.body.rewind
15
+ else
16
+ body = request.body
17
+ end
18
+
12
19
  {
13
- raw_body: request.body,
20
+ raw_body: body,
14
21
  raw_event_type: request.data["resource_name"].to_sym,
15
22
  raw_event_id: nil,
16
- payment_processor: :gumroad,
17
-
23
+ payment_processor: :gumroad
18
24
  }
19
25
  end
20
26
  end
21
- Compensated.event_parsers.push(EventParser)
27
+ Compensated.event_parsers.push(Gumroad::EventParser.new)
22
28
  end
23
29
  end
@@ -1,5 +1,6 @@
1
1
  require "compensated/gumroad/csv_emitter"
2
2
  require "compensated/gumroad/event_parser"
3
+
3
4
  module Compensated
4
5
  module Gumroad
5
6
  end
@@ -8,6 +8,7 @@ module Compensated
8
8
  # @param event_request [Request] A rack-compatible HTTP request triggered
9
9
  # by the payment processor
10
10
  def initialize(event_request)
11
+ @event_parser = nil
11
12
  self.event_request = PaymentProcessorEventRequest.new(event_request)
12
13
  end
13
14
 
@@ -1,3 +1,3 @@
1
1
  module Compensated
2
- VERSION = "0.1.0.pre2"
2
+ VERSION = "0.1.0.pre3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compensated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre2
4
+ version: 0.1.0.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-12 00:00:00.000000000 Z
11
+ date: 2019-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,12 +79,7 @@ files:
79
79
  - Gemfile.lock
80
80
  - README.md
81
81
  - Rakefile
82
- - bin/console
83
- - bin/rake
84
- - bin/rspec
85
- - bin/setup
86
82
  - compensated.gemspec
87
- - examples/compensated-rails-5/Gemfile
88
83
  - lib/compensated.rb
89
84
  - lib/compensated/gumroad.rb
90
85
  - lib/compensated/gumroad/csv_emitter.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "compensated"
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/rake DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rake' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("rake", "rake")
data/bin/rspec DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rspec' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
14
-
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
16
-
17
- if File.file?(bundle_binstub)
18
- if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
19
- load(bundle_binstub)
20
- else
21
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
- end
24
- end
25
-
26
- require "rubygems"
27
- require "bundler/setup"
28
-
29
- load Gem.bin_path("rspec-core", "rspec")
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,36 +0,0 @@
1
- source "https://rubygems.org"
2
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
-
4
- ruby "2.6.3"
5
-
6
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
- gem "rails", "~> 5.2.3"
8
- # Use sqlite3 as the database for Active Record
9
- gem "sqlite3"
10
-
11
- # Core compensated library
12
- gem "compensated", "../compensated-ruby"
13
-
14
- # Plugin to provide stripe integration for compensated
15
- gem "compensated-stripe", "../compensated-ruby-stripe"
16
-
17
- # Plugin to provide gumroad integration for compensated
18
- gem "compensated-gumroad", "../compensated-ruby-gumroad"
19
- # Use Puma as the app server
20
- gem "puma", "~> 3.11"
21
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
- gem "jbuilder", "~> 2.5"
23
-
24
- group :development, :test do
25
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
26
- gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
27
- end
28
-
29
- group :development do
30
- # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
31
- gem "web-console", ">= 3.3.0"
32
- gem "listen", ">= 3.0.5", "< 3.2"
33
- end
34
-
35
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
36
- gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]