plivo 4.35.0 → 4.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/Dockerfile +12 -0
- data/Makefile +7 -0
- data/README.md +21 -1
- data/docker-compose.yml +18 -0
- data/lib/plivo/resources/messages.rb +2 -1
- data/lib/plivo/version.rb +1 -1
- data/setup_sdk.sh +45 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8201cbdabff4391e2817f5f463d0d0e0ea8ce901
|
4
|
+
data.tar.gz: 4eab07c89d90f39d164d37c3b873954f9cbaa201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce66937423df4e70bfb62455c904b818c7882e275a774c2d814881eb6e077ba42ee29d898471e7a1882f2099dbb3fbfdc362dbd141aa9ed087554c2baafb1f86
|
7
|
+
data.tar.gz: 97b29ec6835d373389535e554ff390bd6f0a481a3f53a862a700dbef46400c9ddfe5133507061cb3452f0ee67d3f6d31999638c518be7847797b2d88a125ec9b
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# Change Log
|
2
|
+
|
3
|
+
## [4.36.0](https://github.com/plivo/plivo-ruby/tree/v4.36.0) (2022-01-25)
|
4
|
+
**Adding new attribute - 'requester_ip' in Get Message and List Mssage APIs**
|
5
|
+
- Add `requester_ip` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)
|
6
|
+
|
2
7
|
## [4.35.0](https://github.com/plivo/plivo-ruby/tree/v4.35.0) (2022-01-18)
|
3
8
|
**Adding new attribute - 'message_expiry' in Send Message API**
|
4
9
|
- Added new attribute - message_expiry in Send Message API
|
data/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
FROM ruby:3.0.1-alpine
|
2
|
+
|
3
|
+
RUN apk update && apk add git vim bash make gcc musl-dev
|
4
|
+
|
5
|
+
WORKDIR /usr/src/app
|
6
|
+
RUN gem install json --source 'https://rubygems.org/'
|
7
|
+
|
8
|
+
# Copy setup script
|
9
|
+
COPY setup_sdk.sh /usr/src/app/
|
10
|
+
RUN chmod a+x /usr/src/app/setup_sdk.sh
|
11
|
+
|
12
|
+
ENTRYPOINT [ "/usr/src/app/setup_sdk.sh" ]
|
data/Makefile
ADDED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'plivo', '>= 4.
|
12
|
+
gem 'plivo', '>= 4.36.0'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -173,3 +173,23 @@ More examples are available [here](https://github.com/plivo/plivo-examples-ruby)
|
|
173
173
|
|
174
174
|
## Reporting issues
|
175
175
|
Report any feedback or problems with this version by [opening an issue on Github](https://github.com/plivo/plivo-ruby/issues).
|
176
|
+
|
177
|
+
## Local Development
|
178
|
+
> Note: Requires latest versions of Docker & Docker-Compose. If you're on MacOS, ensure Docker Desktop is running.
|
179
|
+
1. Export the following environment variables in your host machine:
|
180
|
+
```bash
|
181
|
+
export PLIVO_AUTH_ID=<your_auth_id>
|
182
|
+
export PLIVO_AUTH_TOKEN=<your_auth_token>
|
183
|
+
export PLIVO_API_DEV_HOST=<plivoapi_dev_endpoint>
|
184
|
+
export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
|
185
|
+
```
|
186
|
+
2. Run `make build`. This will create a docker container in which the sdk will be setup and dependencies will be installed.
|
187
|
+
> The entrypoint of the docker container will be the `setup_sdk.sh` script. The script will handle all the necessary changes required for local development.
|
188
|
+
3. The above command will print the docker container id (and instructions to connect to it) to stdout.
|
189
|
+
4. The testing code can be added to `<sdk_dir_path>/ruby-sdk-test/test.rb` in host
|
190
|
+
(or `/usr/src/app/ruby-sdk-test/test.rb` in container)
|
191
|
+
5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container.
|
192
|
+
> To use the local code in the test file, import the sdk in test file using:
|
193
|
+
`require "/usr/src/app/lib/plivo.rb"`
|
194
|
+
6. To run unit tests, run `make test CONTAINER=<cont_id>` in host, where `<cont_id>` is the docker container id created in 2.
|
195
|
+
(The docker container should be running)
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
version: '3'
|
2
|
+
|
3
|
+
services:
|
4
|
+
|
5
|
+
rubySDK:
|
6
|
+
build:
|
7
|
+
context: .
|
8
|
+
image: rubysdk
|
9
|
+
container_name: rubySDK
|
10
|
+
environment:
|
11
|
+
- PLIVO_AUTH_ID=${PLIVO_AUTH_ID}
|
12
|
+
- PLIVO_AUTH_TOKEN=${PLIVO_AUTH_TOKEN}
|
13
|
+
- PLIVO_API_DEV_HOST=${PLIVO_API_DEV_HOST}
|
14
|
+
- PLIVO_API_PROD_HOST=${PLIVO_API_PROD_HOST}
|
15
|
+
volumes:
|
16
|
+
- .:/usr/src/app
|
17
|
+
stdin_open: true
|
18
|
+
tty: true
|
data/lib/plivo/version.rb
CHANGED
data/setup_sdk.sh
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
testDir="ruby-sdk-test"
|
5
|
+
GREEN="\033[0;32m"
|
6
|
+
NC="\033[0m"
|
7
|
+
|
8
|
+
if [ ! $PLIVO_API_PROD_HOST ] || [ ! $PLIVO_API_DEV_HOST ] || [ ! $PLIVO_AUTH_ID ] || [ ! $PLIVO_AUTH_TOKEN ]; then
|
9
|
+
echo "Environment variables not properly set! Please refer to Local Development section in README!"
|
10
|
+
exit 126
|
11
|
+
fi
|
12
|
+
|
13
|
+
cd /usr/src/app
|
14
|
+
|
15
|
+
echo "Setting plivo-api endpoint to dev..."
|
16
|
+
find /usr/src/app/lib/ -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/$PLIVO_API_DEV_HOST/g" {} \;
|
17
|
+
|
18
|
+
bundle install
|
19
|
+
|
20
|
+
if [ ! -d $testDir ]; then
|
21
|
+
echo "Creating test dir..."
|
22
|
+
mkdir -p $testDir
|
23
|
+
fi
|
24
|
+
|
25
|
+
if [ ! -f $testDir/test.rb ]; then
|
26
|
+
echo "Creating test file..."
|
27
|
+
cd $testDir
|
28
|
+
echo -e "require \"rubygems\"" > test.rb
|
29
|
+
echo -e "require \"/usr/src/app/lib/plivo.rb\"" >> test.rb
|
30
|
+
echo -e "include Plivo\n" >> test.rb
|
31
|
+
echo -e "api = RestClient.new(ENV[\"PLIVO_AUTH_ID\"], ENV[\"PLIVO_AUTH_TOKEN\"])" >> test.rb
|
32
|
+
cd -
|
33
|
+
fi
|
34
|
+
|
35
|
+
echo -e "\n\nSDK setup complete!"
|
36
|
+
echo "To test your changes:"
|
37
|
+
echo -e "\t1. Add your test code in <path_to_cloned_sdk>/$testDir/test.rb on host (or /usr/src/app/$testDir/test.rb in the container)"
|
38
|
+
echo -e "\t\tNote: To use sdk in test file, import using $GREEN require \"/usr/src/app/lib/plivo.rb\"$NC"
|
39
|
+
echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC"
|
40
|
+
echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC"
|
41
|
+
echo -e "\t4. Run your test file: $GREEN ruby test.rb$NC"
|
42
|
+
echo -e "\t5. For running unit tests, run on host: $GREEN make test CONTAINER=$HOSTNAME$NC"
|
43
|
+
|
44
|
+
# To keep the container running post setup
|
45
|
+
/bin/bash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -157,12 +157,15 @@ files:
|
|
157
157
|
- ".rspec"
|
158
158
|
- AUTHORS.md
|
159
159
|
- CHANGELOG.md
|
160
|
+
- Dockerfile
|
160
161
|
- Gemfile
|
161
162
|
- Jenkinsfile
|
162
163
|
- LICENSE.txt
|
164
|
+
- Makefile
|
163
165
|
- README.md
|
164
166
|
- Rakefile
|
165
167
|
- ci/config.yml
|
168
|
+
- docker-compose.yml
|
166
169
|
- examples/conference_bridge.rb
|
167
170
|
- examples/jwt.rb
|
168
171
|
- examples/lookup.rb
|
@@ -238,6 +241,7 @@ files:
|
|
238
241
|
- lib/plivo/xml/w.rb
|
239
242
|
- lib/plivo/xml/wait.rb
|
240
243
|
- plivo.gemspec
|
244
|
+
- setup_sdk.sh
|
241
245
|
homepage: https://github.com/plivo/plivo-ruby
|
242
246
|
licenses:
|
243
247
|
- MIT
|