rocketfuel_api 0.1.3 → 0.2.0

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
  SHA1:
3
- metadata.gz: 9256bb60b604f83d1c8b805d6a708498f6204410
4
- data.tar.gz: 49f03be88bf6263a5c25fca1a563ea1dd6b21641
3
+ metadata.gz: 456314a06f38776598e2045296edf49106696152
4
+ data.tar.gz: 1b09cc1c114efe792eb5651bd773a026653b5c4d
5
5
  SHA512:
6
- metadata.gz: baf90040ca8b6a8ed70259635a9dc25a7f685cbc71831fe69bf7b80808f37d49934e1f59bb0b8ee687906fa4208b1fffacc3cddb9cac2712c83ca1dec33a0640
7
- data.tar.gz: 561d36eacdca2c975407b2935bd878928b16c3266b71d61b80ed8cd0039391e734e9517961ae859d2c895ef5fe6566f8c9560de5f9f623e13663e496cbf288bc
6
+ metadata.gz: 7532cdeb71ec2ca7caf004ae390cbd1eb5710f2f45192eed8ca0a01f68fa8a470c306cb949a332622dec6cf15036cb92ac65eae3aec0adfbff9d242a68f4c9ea
7
+ data.tar.gz: 9fb527446be72f94f262e4f4de8389b341e4da28acf0ee21d3510891908201e79c8b810f54601ad0a694fa136472a4636a90364e2d653137d695947257ab4d0c
data/.env ADDED
@@ -0,0 +1 @@
1
+ ROCKETFUEL_API_SANDBOX_AUTH_TOKEN: 'rocketfuel-api-sandbox-auth-token'
data/.gitignore CHANGED
@@ -8,5 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
 
11
+ .env.test
12
+
11
13
  # rspec failure tracking
12
14
  .rspec_status
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] (2018-04-05)
10
+ ### Added
11
+ - Reporting API (https://api.rocketfuel.com/doc/2016/index.html?raml=%2F2016%2Freports%2Fdoc)
12
+ ### Internal
13
+ - Add dotenv gem as development dependency
14
+
15
+ ## [0.1.3] (2017-09-13)
16
+ ### Internal
17
+ - Cleanup services and add cache endpoints
18
+
19
+ ## [0.1.2] (2017-09-13)
20
+ ### Internal
21
+ - Yaml file for endpoint configuration and other internal changes
22
+
23
+ ## [0.1.0] (2017-09-11)
24
+ ### Initial release
25
+
26
+ [Unreleased]: https://github.com/ad2games/rocketfuel_api/compare/v0.2.0...HEAD
27
+ [0.2.0]: https://github.com/ad2games/rocketfuel_api/compare/v0.1.3...v0.2.0
28
+ [0.1.3]: https://github.com/ad2games/rocketfuel_api/compare/v0.1.2...v0.1.3
29
+ [0.1.2]: https://github.com/ad2games/rocketfuel_api/compare/v0.1.1...v0.1.2
30
+ [0.1.1]: https://github.com/ad2games/rocketfuel_api/compare/v0.1.0...v0.1.1
31
+ [0.1.0]: https://github.com/ad2games/rocketfuel_api/commits/v0.1.0
data/README.md CHANGED
@@ -28,7 +28,7 @@ connection = RocketfuelApi::Connection.new(
28
28
 
29
29
  # for production
30
30
  connection = RocketfuelApi::Connection.new(
31
- uri: 'https://api.rocketfuel.com/2016'
31
+ uri: 'https://api.rocketfuel.com/2016',
32
32
  auth_token: ENV['ROCKETFUEL_API_AUTH_TOKEN']
33
33
  )
34
34
 
@@ -43,9 +43,12 @@ Note: Only the `Company` Service `GET` requests are tested so far.
43
43
 
44
44
  ## Development
45
45
 
46
- To be able to run the specs, the env var `ROCKETFUEL_API_SANDBOX_AUTH_TOKEN` is needed.
46
+ Run specs with `bundle exec rspec`.
47
47
 
48
- We run rake rubocop to make sure, everything looks good.
48
+ To recreate or create new VCR episodes, a proper value for env var `ROCKETFUEL_API_SANDBOX_AUTH_TOKEN` is needed.
49
+ We recommend that you set it in `.env.test` file.
50
+
51
+ We run `rake rubocop` to make sure, everything looks good.
49
52
 
50
53
  ## License
51
54
 
@@ -17,4 +17,8 @@ class RocketfuelApi::Connection
17
17
  def get(uri_suffix, params = {})
18
18
  @connection.get(uri_suffix, params)
19
19
  end
20
+
21
+ def post(uri_suffix, params = {})
22
+ @connection.post(uri_suffix, params)
23
+ end
20
24
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'yaml'
4
+
3
5
  class RocketfuelApi::Service
4
6
  def initialize(connection)
5
7
  @connection = connection
@@ -20,11 +22,11 @@ class RocketfuelApi::Service
20
22
  end
21
23
 
22
24
  def uri_suffix
23
- @endpoints ||= YAML.load_file(
25
+ @@endpoints ||= YAML.load_file(
24
26
  RocketfuelApi.root.join('lib', 'config', 'endpoints_for_services.yaml')
25
27
  )
26
28
 
27
- endpoint = @endpoints['service'][name]
29
+ endpoint = @@endpoints['service'][name]
28
30
 
29
31
  endpoint || raise(RocketfuelApi::NotImplemented,
30
32
  format('No endpoint for service %s available.', name))
@@ -1,4 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RocketfuelApi::Service::Reporting < RocketfuelApi::Service
4
+ def run(params = {})
5
+ params = {
6
+ use_campaign_currency: 'true',
7
+ use_campaign_time_zone: 'true'
8
+ }.merge(params)
9
+ response = @connection.post(uri_suffix, params)
10
+ parse_response(response.body)
11
+ end
4
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RocketfuelApi
4
- VERSION = '0.1.3'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_development_dependency 'vcr'
34
34
  spec.add_development_dependency 'webmock'
35
+ spec.add_development_dependency 'dotenv'
35
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketfuel_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Greffenius
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-13 00:00:00.000000000 Z
11
+ date: 2018-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: dotenv
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Rocketfuel API Client.
112
126
  email:
113
127
  - stefan.greffenius@ad2games.com
@@ -116,9 +130,11 @@ extensions: []
116
130
  extra_rdoc_files: []
117
131
  files:
118
132
  - ".circleci/config.yml"
133
+ - ".env"
119
134
  - ".gitignore"
120
135
  - ".rspec"
121
136
  - ".travis.yml"
137
+ - CHANGELOG.md
122
138
  - CODE_OF_CONDUCT.md
123
139
  - Gemfile
124
140
  - LICENSE.txt
@@ -187,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
203
  version: '0'
188
204
  requirements: []
189
205
  rubyforge_project:
190
- rubygems_version: 2.6.11
206
+ rubygems_version: 2.6.14
191
207
  signing_key:
192
208
  specification_version: 4
193
209
  summary: Rocketfuel API Client.