url_tracking_api_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +3 -0
- data/.travis.yml +17 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +54 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/url_tracking_api_client.rb +5 -0
- data/lib/url_tracking_api_client/config.rb +11 -0
- data/lib/url_tracking_api_client/tracking.rb +11 -0
- data/lib/url_tracking_api_client/version.rb +3 -0
- data/url_tracking_api_client.gemspec +40 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d355ecc8090482aa65ad8c09100a1908043db846
|
4
|
+
data.tar.gz: 00267b9fccc3865aa1ed7f93d6b3dc15e8aead28
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 06076c9c5e5de8bbd2c6d69545bf8bbce16572c784d9a53c130d3eea1b7ec9545d6cfcdd81cbfe66ecdede80ba2b03c85d67b0f046e78eaca9a7363fc8d61911
|
7
|
+
data.tar.gz: ea52003838bf3cbf11dbbb3f2b62ee916c2336555d75e04ab9d3c28a6e98f2a5435f7308bcea951f3e31fc8d3fd8e857560be726664a5c2a83759ee5d9985789
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 2.4.3
|
5
|
+
|
6
|
+
script:
|
7
|
+
- bundle exec rspec
|
8
|
+
|
9
|
+
deploy:
|
10
|
+
provider: rubygems
|
11
|
+
api_key:
|
12
|
+
secure: NLkVCnre4dZ/AhtJlKyY51Ux9XzA8U4Nx4AJ/mVQp/tfU45XHxY1L+a2+7j5NcpdD9bklaouXPWsQIjWg4ZV28C1pQZH+szji9+C/qweatUch2aeTDhbLzhG1IQE23sOaHPrCrDK32I5IKW+b7kYQzkbHp7KxFm9Uhm5bljDHIUrS38YRIr3RMaIv7UGrmVf8Ff5eC9+nigzQ3aw2Vq9EAzkpJdFKa1dA1ws4SCUNwh6P5KVICgALIioPljV/07BY/wolBQ4PDPyHy5JIKBtBZ3awnOUGNsXHSKBvMO7u4V7Vy4QTHzv4FayKx7v/HBU8Z9HUf5ErCZpYR0q3pKMiDkkvRt7eqr/U/9vQJI+oEtO+OmaP7vjXqmHvFtVVIO4WDIDZzwVSHscn/l4l9WZW74KAoz5RBZtXsEujTfn9Zo+sufrUoatLBBIh+M/CncYy+q1d2Dfjec7XJTxgjDo5zzYqRk+dkdOMfsat97fBBrqJcnEne6qEyqLzy5RKmOWh6mtyeaDD+uLbtUb1ldKjtJTXvfd0YK0nH4IyFkTfpB8RIDqSxVN+IMbLv+2xi4JVIc2Ax2FjIHE0Eva30mPfVByEB67U5MWWimoaIpbdeNcpEKDzLWr6GTze05fyNK2BwwQBgUjl5TbFTvUs4iL39jzwhEInPVvAHE1HrNlr8c=
|
13
|
+
gem: url_tracking_api_client
|
14
|
+
on:
|
15
|
+
tags: true
|
16
|
+
branch: master
|
17
|
+
repo: TINYhr/url_tracking_api_client
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
url_tracking_api_client (0.1.0)
|
5
|
+
tp_client (~> 0.1.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (5.2.3)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 0.7, < 2)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
byebug (11.0.1)
|
16
|
+
concurrent-ruby (1.1.5)
|
17
|
+
curb (0.9.10)
|
18
|
+
diff-lcs (1.3)
|
19
|
+
i18n (1.6.0)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
minitest (5.11.3)
|
22
|
+
rake (10.5.0)
|
23
|
+
rspec (3.8.0)
|
24
|
+
rspec-core (~> 3.8.0)
|
25
|
+
rspec-expectations (~> 3.8.0)
|
26
|
+
rspec-mocks (~> 3.8.0)
|
27
|
+
rspec-core (3.8.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-expectations (3.8.4)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.8.0)
|
32
|
+
rspec-mocks (3.8.0)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.8.0)
|
35
|
+
rspec-support (3.8.2)
|
36
|
+
thread_safe (0.3.6)
|
37
|
+
tp_client (0.1.1)
|
38
|
+
activesupport (>= 4.0, < 6.0)
|
39
|
+
curb (> 0.7.0, < 1.0.0)
|
40
|
+
tzinfo (1.2.5)
|
41
|
+
thread_safe (~> 0.1)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
bundler (~> 2.0)
|
48
|
+
byebug (~> 11.0)
|
49
|
+
rake (~> 10.0)
|
50
|
+
rspec (~> 3.0)
|
51
|
+
url_tracking_api_client!
|
52
|
+
|
53
|
+
BUNDLED WITH
|
54
|
+
2.0.1
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Url Tracking Api Client
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/TINYhr/url_tracking_api_client.svg?branch=master)](https://travis-ci.org/TINYhr/url_tracking_api_client)
|
4
|
+
|
5
|
+
Ruby API Client for [Url Tracking](https://url-tracking.tinypulse.com)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'url_tracking_api_client'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install url_tracking_api_client
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
* Add ENV for api url & Authorization token
|
26
|
+
```bash
|
27
|
+
URL_TRACKING_API_URL='https://url-tracking.tinypulse.com'
|
28
|
+
URL_TRACKING_CLIENT_TOKEN='JWT token generated by our SECRET'
|
29
|
+
```
|
30
|
+
|
31
|
+
* Create a tracking Url
|
32
|
+
```ruby
|
33
|
+
UrlTrackingApiClient::Tracking.create(
|
34
|
+
url: 'https://app.tinypulse.com/',
|
35
|
+
receiver_id: 1,
|
36
|
+
ornigazation_id: 2,
|
37
|
+
tag: 'tracking_tag'
|
38
|
+
)
|
39
|
+
```
|
40
|
+
|
41
|
+
## Development
|
42
|
+
|
43
|
+
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.
|
44
|
+
|
45
|
+
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).
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/tinyhr/url_tracking_api_client.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "url_tracking_api_client"
|
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,11 @@
|
|
1
|
+
require 'tiny_client'
|
2
|
+
|
3
|
+
module UrlTrackingApiClient
|
4
|
+
# Configuration for your API resources check https://github.com/TINYhr/tiny_client/ for more configurations
|
5
|
+
class Config < TinyClient::Configuration
|
6
|
+
def initialize
|
7
|
+
@url = ENV.fetch('URL_TRACKING_API_URL', 'https://url-tracking.tinypulse.com')
|
8
|
+
@headers = { 'Authorization': ENV.fetch('URL_TRACKING_CLIENT_TOKEN', 'token') }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'tiny_client'
|
2
|
+
|
3
|
+
module UrlTrackingApiClient
|
4
|
+
# Tracking resource of Url Tracking
|
5
|
+
# Only allow `create` method for now and return token/url to use for tracking
|
6
|
+
class Tracking < TinyClient::Resource
|
7
|
+
conf Config.instance
|
8
|
+
path 'trackings'
|
9
|
+
fields :id, :url, :receiver_id, :organization_id, :tag
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'url_tracking_api_client/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'url_tracking_api_client'
|
8
|
+
spec.version = UrlTrackingApiClient::VERSION
|
9
|
+
spec.authors = ["TINYpulse Devops"]
|
10
|
+
spec.email = ["devops@tinypulse.com"]
|
11
|
+
|
12
|
+
spec.summary = 'API client for Url Tracking project'
|
13
|
+
spec.description = 'An API Client for Url Tracking built on top of tiny_client'
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata['allowed_push_host'] = 'http://rubygems.com'
|
19
|
+
else
|
20
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
21
|
+
'public gem pushes.'
|
22
|
+
end
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
27
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
end
|
29
|
+
spec.bindir = 'exe'
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ['lib']
|
32
|
+
spec.license = 'MIT'
|
33
|
+
|
34
|
+
spec.add_dependency 'tp_client', '~> 0.1.1'
|
35
|
+
|
36
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
37
|
+
spec.add_development_dependency 'byebug', '~> 11.0.1'
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: url_tracking_api_client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TINYpulse Devops
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-07-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tp_client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 11.0.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 11.0.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
description: An API Client for Url Tracking built on top of tiny_client
|
84
|
+
email:
|
85
|
+
- devops@tinypulse.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- bin/console
|
98
|
+
- bin/setup
|
99
|
+
- lib/url_tracking_api_client.rb
|
100
|
+
- lib/url_tracking_api_client/config.rb
|
101
|
+
- lib/url_tracking_api_client/tracking.rb
|
102
|
+
- lib/url_tracking_api_client/version.rb
|
103
|
+
- url_tracking_api_client.gemspec
|
104
|
+
homepage:
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata:
|
108
|
+
allowed_push_host: http://rubygems.com
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
requirements: []
|
124
|
+
rubyforge_project:
|
125
|
+
rubygems_version: 2.6.14
|
126
|
+
signing_key:
|
127
|
+
specification_version: 4
|
128
|
+
summary: API client for Url Tracking project
|
129
|
+
test_files: []
|