hasoffersv3 0.2.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +13 -0
- data/README.md +36 -3
- data/hasoffersv3.gemspec +4 -4
- data/lib/hasoffersv3/advertiser.rb +9 -11
- data/lib/hasoffersv3/advertiser_billing.rb +18 -20
- data/lib/hasoffersv3/advertiser_user.rb +2 -4
- data/lib/hasoffersv3/affiliate.rb +21 -23
- data/lib/hasoffersv3/affiliate_billing.rb +19 -21
- data/lib/hasoffersv3/affiliate_offer.rb +27 -27
- data/lib/hasoffersv3/application.rb +2 -4
- data/lib/hasoffersv3/base.rb +53 -38
- data/lib/hasoffersv3/client.rb +1 -1
- data/lib/hasoffersv3/configuration.rb +1 -0
- data/lib/hasoffersv3/conversion.rb +8 -15
- data/lib/hasoffersv3/employee.rb +17 -0
- data/lib/hasoffersv3/offer.rb +52 -54
- data/lib/hasoffersv3/offer_pixel.rb +22 -0
- data/lib/hasoffersv3/raw_log.rb +14 -16
- data/lib/hasoffersv3/report.rb +7 -21
- data/lib/hasoffersv3/version.rb +1 -1
- data/lib/hasoffersv3.rb +8 -3
- data/spec/lib/advertiser_billing_spec.rb +5 -4
- data/spec/lib/advertiser_spec.rb +1 -1
- data/spec/lib/advertiser_user_spec.rb +1 -1
- data/spec/lib/affiliate_billing_spec.rb +1 -1
- data/spec/lib/affiliate_offer_spec.rb +1 -1
- data/spec/lib/affiliate_spec.rb +1 -1
- data/spec/lib/conversion_spec.rb +3 -8
- data/spec/lib/employee_spec.rb +47 -0
- data/spec/lib/hasoffersv3_spec.rb +9 -1
- data/spec/lib/offer_pixel_spec.rb +76 -0
- data/spec/lib/offer_spec.rb +1 -1
- data/spec/lib/raw_log_spec.rb +1 -1
- data/spec/lib/report_spec.rb +5 -15
- metadata +8 -7
- data/.ruby-gemset +0 -1
- data/lib/hasoffersv3/adapter.rb +0 -30
- data/spec/lib/adapter_spec.rb +0 -20
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
hasoffersv3
|
data/lib/hasoffersv3/adapter.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
class HasOffersV3
|
2
|
-
class Adapter
|
3
|
-
attr_reader :configuration
|
4
|
-
|
5
|
-
def initialize(configuration, target)
|
6
|
-
@configuration = configuration
|
7
|
-
@target = target
|
8
|
-
end
|
9
|
-
|
10
|
-
def with_configuration(&block)
|
11
|
-
previous_config = HasOffersV3.configuration
|
12
|
-
HasOffersV3.configuration = @configuration
|
13
|
-
begin
|
14
|
-
yield
|
15
|
-
ensure
|
16
|
-
HasOffersV3.configuration = previous_config
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def method_missing(meth, *args, &block)
|
21
|
-
if @target.respond_to?(meth)
|
22
|
-
with_configuration do
|
23
|
-
@target.send(meth, *args, &block)
|
24
|
-
end
|
25
|
-
else
|
26
|
-
super
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/spec/lib/adapter_spec.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe HasOffersV3::Adapter do
|
4
|
-
|
5
|
-
let(:configuration) { HasOffersV3::Configuration.new(host: 'example.com') }
|
6
|
-
subject { HasOffersV3::Adapter.new(HasOffersV3::Offer, HasOffersV3::Offer) }
|
7
|
-
|
8
|
-
describe '#with_configuration' do
|
9
|
-
it 'should apply for block another config' do
|
10
|
-
default_config = HasOffersV3.configuration
|
11
|
-
expect(HasOffersV3::Offer.client.configuration).to eq(default_config)
|
12
|
-
|
13
|
-
subject.with_configuration do
|
14
|
-
expect(HasOffersV3::Offer.client.configuration).to eq(subject.configuration)
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|