share_meow_client 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/.rubocop.yml +7 -0
- data/.travis.yml +4 -0
- data/README.md +25 -8
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/lib/share_meow_client.rb +1 -2
- data/lib/share_meow_client/version.rb +1 -1
- data/share_meow_client.gemspec +13 -12
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee9cb013ebb1b59c5cfcf68cc809f739657c83d
|
4
|
+
data.tar.gz: 2bacaa1fd6156ddee765c6856a3f3937bee84fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae9fecc819c44c7febd163adf2a250619484f4966e0d87bbcea7f19232cbd580aa433130ea5809c2dec9f1cdf879a555c5948202ea944180a9ef30bfd060df43
|
7
|
+
data.tar.gz: fb4e404df6babfc91e9332226a576d1c9db52bf2136ae870e8d9d19652d26e529ea15af2c92347da64e78ba2a028b17ae304b60f8233d1892866a751d8e5dbff
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
# ShareMeowClient
|
1
|
+
# ShareMeowClient :heart_eyes_cat:
|
2
2
|
|
3
|
-
|
3
|
+
Ruby client for easily generating ShareMeow URL's. :star:
|
4
|
+
|
5
|
+
Learn more about [ShareMeow](https://github.com/producthunt/ShareMeow).
|
4
6
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -22,20 +23,36 @@ Or install it yourself as:
|
|
22
23
|
|
23
24
|
## Usage
|
24
25
|
|
25
|
-
|
26
|
+
First, you'll need to set the configuration variables in an initializer.
|
27
|
+
|
28
|
+
```Ruby
|
29
|
+
# config/initializers/share_meow.rb
|
30
|
+
ShareMeowClient.configuration do |config|
|
31
|
+
config.base_url = 'https://your-share-meow.example.com'
|
32
|
+
config.secret_key = 'a_very_long_secret_key'
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
Then, to generate a URL.
|
37
|
+
|
38
|
+
```Ruby
|
39
|
+
image_url = ShareMeowClient.image_url(template: 'HelloWorld', options: { message: 'Hi' })
|
40
|
+
# => "https://your-share-meow.herokuapp.com/v1/eyJ0ZW1wbGF0ZSI6IkhlbGxvV29ybGQiLCJtZXNzYWdlIjoiSGVsbG8ifQ==/-lgitNQmEs9NaiWyOCHeV137D80=/image.jpg"
|
41
|
+
```
|
42
|
+
|
43
|
+
`Template` is the name of your ShareMeow template. And then `options` are the required options for your template.
|
26
44
|
|
27
45
|
## Development
|
28
46
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
47
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
48
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
49
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
32
50
|
|
33
51
|
## Contributing
|
34
52
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/producthunt/ShareMeowCLient. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
54
|
|
37
55
|
|
38
56
|
## License
|
39
57
|
|
40
58
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'share_meow_client'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "share_meow_client"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/lib/share_meow_client.rb
CHANGED
@@ -4,7 +4,6 @@ require 'openssl'
|
|
4
4
|
require 'share_meow_client/version'
|
5
5
|
require 'helpers/configuration'
|
6
6
|
|
7
|
-
|
8
7
|
module ShareMeowClient
|
9
8
|
extend Configuration
|
10
9
|
|
@@ -42,6 +41,6 @@ module ShareMeowClient
|
|
42
41
|
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'.freeze), secret_key, encoded_params)
|
43
42
|
hmac_digest = Base64.urlsafe_encode64([hmac].pack('H*'.freeze))
|
44
43
|
|
45
|
-
"#{
|
44
|
+
"#{base_url}/v1/#{encoded_params}/#{hmac_digest}/image.jpg"
|
46
45
|
end
|
47
46
|
end
|
data/share_meow_client.gemspec
CHANGED
@@ -4,22 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'share_meow_client/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'share_meow_client'
|
8
8
|
spec.version = ShareMeowClient::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Mike Coutermarsh']
|
10
|
+
spec.email = ['coutermarsh.mike@gmail.com']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
12
|
+
spec.summary = 'Ruby client for generating ShareMeow URLs.'
|
13
|
+
spec.description = 'Ruby client for generating ShareMeow URLs (https://github.com/producthunt/ShareMeow) '
|
14
|
+
spec.homepage = 'https://github.com/producthunt/ShareMeowClient'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir =
|
18
|
+
spec.bindir = 'exe'
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.35'
|
25
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share_meow_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Coutermarsh
|
@@ -42,16 +42,30 @@ dependencies:
|
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.4'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.35'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
68
|
+
version: '0.35'
|
55
69
|
description: 'Ruby client for generating ShareMeow URLs (https://github.com/producthunt/ShareMeow) '
|
56
70
|
email:
|
57
71
|
- coutermarsh.mike@gmail.com
|
@@ -61,6 +75,7 @@ extra_rdoc_files: []
|
|
61
75
|
files:
|
62
76
|
- ".gitignore"
|
63
77
|
- ".rspec"
|
78
|
+
- ".rubocop.yml"
|
64
79
|
- ".travis.yml"
|
65
80
|
- CODE_OF_CONDUCT.md
|
66
81
|
- Gemfile
|