ombu_labs-shortener 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +19 -10
- data/lib/ombu_labs/shortener/version.rb +1 -1
- data/lib/ombu_labs/shortener.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0783a590c5d702f09609f84009663cb0c7b731382af63a794137271d8fe89334'
|
4
|
+
data.tar.gz: 7e6bd4b44d362d68381a83e1f5ad9c0e8ac92f6af18435691da234c47b183080
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 777407491cde0678bf15abcba81bc22f8497f8491274904eb96714f83e28dbe47e7f29269939083d536a8e075a13dedcd60497027bbf60ab13aa586fd4d66869
|
7
|
+
data.tar.gz: 74d12d2dba7d0f5e7ec1c9be9ba7db9420fcdd63b1409d6bfa27f71225d045df030d2f59c38f1190cfabcdb664de42f656b386ae359576e951b4ba175a6108f1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
ombu_labs-shortener (0.1.0)
|
5
5
|
rebrandly
|
6
6
|
|
7
7
|
GEM
|
@@ -38,7 +38,7 @@ PLATFORMS
|
|
38
38
|
|
39
39
|
DEPENDENCIES
|
40
40
|
byebug
|
41
|
-
|
41
|
+
ombu_labs-shortener!
|
42
42
|
rake (~> 13.0)
|
43
43
|
rspec (~> 3.0)
|
44
44
|
|
data/README.md
CHANGED
@@ -1,22 +1,31 @@
|
|
1
1
|
# OmbuLabs::Shortener
|
2
2
|
|
3
|
-
|
3
|
+
A short script to shorten links for these domains:
|
4
4
|
|
5
|
-
|
5
|
+
- https://fastruby.io
|
6
|
+
- https://ombulabs.com
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
9
|
-
Install the gem
|
10
|
+
Install the gem:
|
10
11
|
|
11
|
-
|
12
|
+
gem install ombu_labs-shortener
|
12
13
|
|
13
|
-
|
14
|
+
## Usage
|
14
15
|
|
15
|
-
|
16
|
+
You will need to set up your API key in your environment:
|
16
17
|
|
17
|
-
|
18
|
+
```
|
19
|
+
export REBRANDLY_API_KEY=<your api key>
|
20
|
+
```
|
21
|
+
|
22
|
+
Then you can just call the `shorten` command:
|
18
23
|
|
19
|
-
|
24
|
+
```
|
25
|
+
shorten https://www.ombulabs.com\?utm_source\=pepe
|
26
|
+
Shortening: https://www.ombulabs.com?utm_source=pepe
|
27
|
+
Shortened: SHORT: go.ombulabs.com/oxh
|
28
|
+
```
|
20
29
|
|
21
30
|
## Development
|
22
31
|
|
@@ -26,7 +35,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
26
35
|
|
27
36
|
## Contributing
|
28
37
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/fastruby/ombulabs-shortener. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/fastruby/ombulabs-shortener/blob/master/CODE_OF_CONDUCT.md).
|
30
39
|
|
31
40
|
## License
|
32
41
|
|
@@ -34,4 +43,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
34
43
|
|
35
44
|
## Code of Conduct
|
36
45
|
|
37
|
-
Everyone interacting in the
|
46
|
+
Everyone interacting in the OmbuLabs::Shortener project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fastruby/ombulabs-shortener/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/ombu_labs/shortener.rb
CHANGED
@@ -18,7 +18,7 @@ module OmbuLabs
|
|
18
18
|
puts "Shortening: #{@url}"
|
19
19
|
domain = find_domain
|
20
20
|
link = @api.shorten(@url, domain: domain.to_h)
|
21
|
-
puts "Shortened: SHORT:
|
21
|
+
puts "Shortened: SHORT: https://#{link.short_url}"
|
22
22
|
|
23
23
|
rescue Rebrandly::RebrandlyError => err
|
24
24
|
puts "Error: #{err.message}"
|