appilix_notifications 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/.github/workflows/main.yml +27 -0
- data/.gitignore +8 -0
- data/.rspec +1 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +82 -0
- data/README.md +127 -0
- data/Rakefile +14 -0
- data/appilix_notifications-0.1.0.gem +0 -0
- data/appilix_notifications.gemspec +38 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/appilix_notifications/version.rb +5 -0
- data/lib/appilix_notifications.rb +71 -0
- data/sig/appilix_notifications.rbs +4 -0
- data/spec/appilix_notifications_spec.rb +35 -0
- data/spec/spec_helper.rb +98 -0
- data/test/appilix_notifications_test.rb +15 -0
- data/test/test_helper.rb +6 -0
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd27db8d08672883c506ed63f2a4558c1ba5e7a6cf6fad9ebd112b36de9f22b3
|
4
|
+
data.tar.gz: 2da58a031ee5afd246f7b5681e44e52274ba89c12152349774f1cee89ed82b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3f940395b95c525891064db8256681ba463eaf969d43727233e7836d4f334fced4ac9f405ee20a717a39b70b7ac1a523af5acb42c64d6221dfc310560f7c947
|
7
|
+
data.tar.gz: 9f227ddd7ba6817cb112fa05b295fbad1b49e9da7c000de4385e0aacfd534cc7def053951bcb9ec9d0ad0d88973c8d529deb6eeb0610715f5a4d9fe155052ec3
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
pull_request:
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby:
|
17
|
+
- '3.3.3'
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Run the default task
|
27
|
+
run: bundle exec rake
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.standard.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
appilix_notifications (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.2)
|
10
|
+
diff-lcs (1.5.1)
|
11
|
+
json (2.9.1)
|
12
|
+
language_server-protocol (3.17.0.3)
|
13
|
+
lint_roller (1.1.0)
|
14
|
+
parallel (1.26.3)
|
15
|
+
parser (3.3.7.0)
|
16
|
+
ast (~> 2.4.1)
|
17
|
+
racc
|
18
|
+
power_assert (2.0.5)
|
19
|
+
racc (1.8.1)
|
20
|
+
rainbow (3.1.1)
|
21
|
+
rake (13.2.1)
|
22
|
+
regexp_parser (2.10.0)
|
23
|
+
rspec (3.13.0)
|
24
|
+
rspec-core (~> 3.13.0)
|
25
|
+
rspec-expectations (~> 3.13.0)
|
26
|
+
rspec-mocks (~> 3.13.0)
|
27
|
+
rspec-core (3.13.2)
|
28
|
+
rspec-support (~> 3.13.0)
|
29
|
+
rspec-expectations (3.13.3)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.13.0)
|
32
|
+
rspec-mocks (3.13.2)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.13.0)
|
35
|
+
rspec-support (3.13.2)
|
36
|
+
rubocop (1.70.0)
|
37
|
+
json (~> 2.3)
|
38
|
+
language_server-protocol (>= 3.17.0)
|
39
|
+
parallel (~> 1.10)
|
40
|
+
parser (>= 3.3.0.2)
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
42
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
43
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
44
|
+
ruby-progressbar (~> 1.7)
|
45
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
46
|
+
rubocop-ast (1.37.0)
|
47
|
+
parser (>= 3.3.1.0)
|
48
|
+
rubocop-performance (1.23.1)
|
49
|
+
rubocop (>= 1.48.1, < 2.0)
|
50
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
51
|
+
ruby-progressbar (1.13.0)
|
52
|
+
standard (1.44.0)
|
53
|
+
language_server-protocol (~> 3.17.0.2)
|
54
|
+
lint_roller (~> 1.0)
|
55
|
+
rubocop (~> 1.70.0)
|
56
|
+
standard-custom (~> 1.0.0)
|
57
|
+
standard-performance (~> 1.6)
|
58
|
+
standard-custom (1.0.2)
|
59
|
+
lint_roller (~> 1.0)
|
60
|
+
rubocop (~> 1.50)
|
61
|
+
standard-performance (1.6.0)
|
62
|
+
lint_roller (~> 1.1)
|
63
|
+
rubocop-performance (~> 1.23.0)
|
64
|
+
test-unit (3.6.7)
|
65
|
+
power_assert
|
66
|
+
unicode-display_width (3.1.4)
|
67
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
68
|
+
unicode-emoji (4.0.4)
|
69
|
+
|
70
|
+
PLATFORMS
|
71
|
+
ruby
|
72
|
+
x86_64-linux
|
73
|
+
|
74
|
+
DEPENDENCIES
|
75
|
+
appilix_notifications!
|
76
|
+
rake (~> 13.0)
|
77
|
+
rspec
|
78
|
+
standard (~> 1.3)
|
79
|
+
test-unit (~> 3.0)
|
80
|
+
|
81
|
+
BUNDLED WITH
|
82
|
+
2.6.2
|
data/README.md
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
# AppilixNotifications
|
2
|
+
|
3
|
+
`AppilixNotifications` is a Ruby gem crafted to streamline the process of sending push notifications and retrieving registered user tokens via the Appilix API. It offers a user-friendly interface to dispatch notifications with customizable parameters such as title, body, user identity, and links, as well as to fetch notification tokens for registered users. This gem leverages the capabilities of Appilix, a platform that enables the transformation of any website into a mobile application without requiring any coding. Developed by Alzahidi-tech, this gem ensures efficient notification management.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'appilix_notifications'
|
11
|
+
```
|
12
|
+
|
13
|
+
Then run:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
### Sending a Notification
|
22
|
+
|
23
|
+
To send a notification, use the `appilix_send_notifications` method:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'appilix_notifications'
|
27
|
+
|
28
|
+
response = AppilixNotifications.appilix_send_notifications(
|
29
|
+
'your_app_key',
|
30
|
+
'your_api_key',
|
31
|
+
'Your Notification Title',
|
32
|
+
'Your Notification Body',
|
33
|
+
'optional_user_identity', # Optional
|
34
|
+
'https://example.com' # Optional
|
35
|
+
)
|
36
|
+
|
37
|
+
puts response
|
38
|
+
```
|
39
|
+
#### Parameters for Sending Notifications
|
40
|
+
|
41
|
+
- `app_key` (String): Your application's key from Appilix.
|
42
|
+
- `api_key` (String): Your API key from Appilix.
|
43
|
+
- `title` (String): The title of the notification.
|
44
|
+
- `body` (String): The body content of the notification.
|
45
|
+
- `user_identity` (String, optional): The user identifier for the notification.
|
46
|
+
- `open_link_url` (String, optional): A URL to open when the notification is clicked.
|
47
|
+
|
48
|
+
|
49
|
+
On success, the method returns a parsed JSON response:
|
50
|
+
|
51
|
+
```json
|
52
|
+
{
|
53
|
+
"status": "success",
|
54
|
+
"message": "Notification sent successfully"
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
On failure, the method returns an error hash:
|
59
|
+
|
60
|
+
```json
|
61
|
+
{
|
62
|
+
"error": "Invalid API key",
|
63
|
+
"code": "401",
|
64
|
+
"body": "The provided API key is incorrect."
|
65
|
+
}
|
66
|
+
```
|
67
|
+
|
68
|
+
If the server response contains invalid JSON, you will receive:
|
69
|
+
|
70
|
+
```json
|
71
|
+
{
|
72
|
+
"error": "Invalid JSON response",
|
73
|
+
"body": "<Raw response body>"
|
74
|
+
}
|
75
|
+
```
|
76
|
+
|
77
|
+
|
78
|
+
### Fetching Registered User Tokens
|
79
|
+
|
80
|
+
To fetch registered user tokens, use the `appilix_get_registered_user` method. The `page` parameter is mandatory:
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
require 'appilix_notifications'
|
84
|
+
|
85
|
+
response = AppilixNotifications.appilix_get_registered_user(
|
86
|
+
'your_app_key',
|
87
|
+
'your_api_key',
|
88
|
+
1 # Page number
|
89
|
+
)
|
90
|
+
|
91
|
+
puts response
|
92
|
+
```
|
93
|
+
|
94
|
+
#### Parameters for Fetching Registered User Tokens
|
95
|
+
|
96
|
+
- `app_key` (String): Your application's key from Appilix.
|
97
|
+
- `api_key` (String): Your API key from Appilix.
|
98
|
+
- `page` (Integer): The page number to fetch tokens from (mandatory).
|
99
|
+
|
100
|
+
|
101
|
+
On success, the method returns a parsed JSON response containing the tokens:
|
102
|
+
|
103
|
+
```json
|
104
|
+
{
|
105
|
+
"tokens": ["token1", "token2", "token3"],
|
106
|
+
"status": "true"
|
107
|
+
}
|
108
|
+
```
|
109
|
+
|
110
|
+
On failure, the method returns an error hash:
|
111
|
+
|
112
|
+
```json
|
113
|
+
{
|
114
|
+
"error": "Invalid API key",
|
115
|
+
"code": "401",
|
116
|
+
"body": "The provided API key is incorrect."
|
117
|
+
}
|
118
|
+
```
|
119
|
+
|
120
|
+
If the server response contains invalid JSON, you will receive:
|
121
|
+
|
122
|
+
```json
|
123
|
+
{
|
124
|
+
"error": "Invalid JSON response",
|
125
|
+
"body": "<Raw response body>"
|
126
|
+
}
|
127
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "standard/rake"
|
13
|
+
|
14
|
+
task default: %i[test standard]
|
Binary file
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#require_relative "lib/appilix_notifications/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "appilix_notifications"
|
7
|
+
#spec.version = AppilixNotifications::VERSION
|
8
|
+
spec.version = "0.1.1"
|
9
|
+
spec.authors = ["RoaaAlqaisi"]
|
10
|
+
spec.email = ["rowaalqaisi@gmail.com"]
|
11
|
+
spec.license = "NGPL"
|
12
|
+
|
13
|
+
spec.summary = "A Ruby gem to send notifications using the appilix API."
|
14
|
+
spec.description = "appilixNotifications is a Ruby gem that simplifies sending push notifications to users of your application via the appilix API. It includes functionality to fetch registered users and send notifications with customizable titles, bodies, and optional user-specific or link-specific parameters."
|
15
|
+
spec.homepage = "https://github.com/RoaaAlqaisi/appilix_notifications"
|
16
|
+
spec.required_ruby_version = ">= 3.0.0"
|
17
|
+
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/RoaaAlqaisi/appilix_notifications"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/RoaaAlqaisi/appilix_notifications/CHANGELOG.md"
|
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 = `git ls-files -z`.split("\x0")
|
27
|
+
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
# Add dependencies for your gem
|
33
|
+
spec.add_dependency "json", "~> 2.0"
|
34
|
+
spec.add_dependency "net-http", ">= 0.1.1"
|
35
|
+
|
36
|
+
# For more information and examples about making a new gem, check out our
|
37
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
38
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "appilix_notifications"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
require "irb"
|
11
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "appilix_notifications/version"
|
4
|
+
|
5
|
+
require 'net/http'
|
6
|
+
require 'uri'
|
7
|
+
require 'json'
|
8
|
+
|
9
|
+
module AppilixNotifications
|
10
|
+
BASE_URL = "https://appilix.com/api"
|
11
|
+
PUSH_NOTIFICATION_URL = "push-notification"
|
12
|
+
TOKEN_LIST_URL = "push_notification_token_list.php"
|
13
|
+
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def appilix_send_notifications(app_key, api_key, title, body, user_identity = nil, open_link_url = nil)
|
17
|
+
uri = URI("#{BASE_URL}/#{PUSH_NOTIFICATION_URL}")
|
18
|
+
uri.query = URI.encode_www_form(
|
19
|
+
'app_key' => app_key,
|
20
|
+
'api_key' => api_key,
|
21
|
+
'notification_title' => title,
|
22
|
+
'notification_body' => body,
|
23
|
+
'user_identity' => user_identity,
|
24
|
+
'open_link_url' => open_link_url
|
25
|
+
)
|
26
|
+
|
27
|
+
request = Net::HTTP::Get.new(uri)
|
28
|
+
|
29
|
+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
30
|
+
http.request(request)
|
31
|
+
end
|
32
|
+
|
33
|
+
handle_response(response)
|
34
|
+
end
|
35
|
+
|
36
|
+
def appilix_get_registered_user(app_key, api_key, page)
|
37
|
+
raise ArgumentError, "Page parameter is mandatory" unless page
|
38
|
+
|
39
|
+
uri = URI("#{BASE_URL}/#{TOKEN_LIST_URL}")
|
40
|
+
uri.query = URI.encode_www_form(
|
41
|
+
'app_key' => app_key,
|
42
|
+
'api_key' => api_key,
|
43
|
+
'page' => page
|
44
|
+
)
|
45
|
+
|
46
|
+
request = Net::HTTP::Get.new(uri)
|
47
|
+
|
48
|
+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
49
|
+
http.request(request)
|
50
|
+
end
|
51
|
+
|
52
|
+
handle_response(response)
|
53
|
+
end
|
54
|
+
|
55
|
+
def handle_response(response)
|
56
|
+
case response
|
57
|
+
when Net::HTTPSuccess
|
58
|
+
JSON.parse(response.body)
|
59
|
+
else
|
60
|
+
{ 'error' => response.message, 'code' => response.code, 'body' => parse_body_safe(response.body) }
|
61
|
+
end
|
62
|
+
rescue JSON::ParserError
|
63
|
+
{ 'error' => 'Invalid JSON response', 'body' => response.body }
|
64
|
+
end
|
65
|
+
|
66
|
+
def parse_body_safe(body)
|
67
|
+
JSON.parse(body)
|
68
|
+
rescue JSON::ParserError
|
69
|
+
body
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative '../lib/appilix_notifications'
|
2
|
+
|
3
|
+
RSpec.describe AppilixNotifications do
|
4
|
+
app_key = "key1"
|
5
|
+
api_key = "apikey1"
|
6
|
+
|
7
|
+
it 'sends a notification successfully using GET' do
|
8
|
+
allow(AppilixNotifications).to receive(:appilix_send_notifications)
|
9
|
+
.with(app_key, api_key, 'Hello', 'This is a test notification', nil, nil).and_return({ 'status' => 'true' })
|
10
|
+
|
11
|
+
response = AppilixNotifications.appilix_send_notifications(
|
12
|
+
app_key, api_key, 'Hello', 'This is a test notification', nil, nil
|
13
|
+
)
|
14
|
+
|
15
|
+
expect(response).to be_a(Hash)
|
16
|
+
expect(response['status']).to eq('true')
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'fetches registered user tokens successfully with a valid page' do
|
20
|
+
allow(AppilixNotifications).to receive(:appilix_get_registered_user)
|
21
|
+
.with(app_key, api_key, 1).and_return({ 'tokens' => ['token1', 'token2'] })
|
22
|
+
|
23
|
+
response = AppilixNotifications.appilix_get_registered_user(app_key, api_key, 1)
|
24
|
+
|
25
|
+
expect(response).to be_a(Hash)
|
26
|
+
expect(response).to have_key('tokens')
|
27
|
+
puts response
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'raises an error when page is missing for registered user tokens' do
|
31
|
+
expect {
|
32
|
+
AppilixNotifications.appilix_get_registered_user(app_key, api_key, nil)
|
33
|
+
}.to raise_error(ArgumentError, 'Page parameter is mandatory')
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
|
+
RSpec.configure do |config|
|
17
|
+
# rspec-expectations config goes here. You can use an alternate
|
18
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
19
|
+
# assertions if you prefer.
|
20
|
+
config.expect_with :rspec do |expectations|
|
21
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
22
|
+
# and `failure_message` of custom matchers include text for helper methods
|
23
|
+
# defined using `chain`, e.g.:
|
24
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
25
|
+
# # => "be bigger than 2 and smaller than 4"
|
26
|
+
# ...rather than:
|
27
|
+
# # => "be bigger than 2"
|
28
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
29
|
+
end
|
30
|
+
|
31
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
32
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
33
|
+
config.mock_with :rspec do |mocks|
|
34
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
35
|
+
# a real object. This is generally recommended, and will default to
|
36
|
+
# `true` in RSpec 4.
|
37
|
+
mocks.verify_partial_doubles = true
|
38
|
+
end
|
39
|
+
|
40
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
41
|
+
# have no way to turn it off -- the option exists only for backwards
|
42
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
43
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
44
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
45
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
46
|
+
|
47
|
+
# The settings below are suggested to provide a good initial experience
|
48
|
+
# with RSpec, but feel free to customize to your heart's content.
|
49
|
+
=begin
|
50
|
+
# This allows you to limit a spec run to individual examples or groups
|
51
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
52
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
53
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
54
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
55
|
+
config.filter_run_when_matching :focus
|
56
|
+
|
57
|
+
# Allows RSpec to persist some state between runs in order to support
|
58
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
59
|
+
# you configure your source control system to ignore this file.
|
60
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
61
|
+
|
62
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
63
|
+
# recommended. For more details, see:
|
64
|
+
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
|
65
|
+
config.disable_monkey_patching!
|
66
|
+
|
67
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
68
|
+
# be too noisy due to issues in dependencies.
|
69
|
+
config.warnings = true
|
70
|
+
|
71
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
72
|
+
# file, and it's useful to allow more verbose output when running an
|
73
|
+
# individual spec file.
|
74
|
+
if config.files_to_run.one?
|
75
|
+
# Use the documentation formatter for detailed output,
|
76
|
+
# unless a formatter has already been configured
|
77
|
+
# (e.g. via a command-line flag).
|
78
|
+
config.default_formatter = "doc"
|
79
|
+
end
|
80
|
+
|
81
|
+
# Print the 10 slowest examples and example groups at the
|
82
|
+
# end of the spec run, to help surface which specs are running
|
83
|
+
# particularly slow.
|
84
|
+
config.profile_examples = 10
|
85
|
+
|
86
|
+
# Run specs in random order to surface order dependencies. If you find an
|
87
|
+
# order dependency and want to debug it, you can fix the order by providing
|
88
|
+
# the seed, which is printed after each run.
|
89
|
+
# --seed 1234
|
90
|
+
config.order = :random
|
91
|
+
|
92
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
93
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
94
|
+
# test failures related to randomization by passing the same `--seed` value
|
95
|
+
# as the one that triggered the failure.
|
96
|
+
Kernel.srand config.seed
|
97
|
+
=end
|
98
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class AppilixNotificationsTest < Test::Unit::TestCase
|
6
|
+
test "VERSION" do
|
7
|
+
assert do
|
8
|
+
::AppilixNotifications.const_defined?(:VERSION)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
test "something useful" do
|
13
|
+
assert_equal("expected", "actual")
|
14
|
+
end
|
15
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appilix_notifications
|
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
|
- RoaaAlqaisi
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-26 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: json
|
@@ -46,7 +46,27 @@ email:
|
|
46
46
|
executables: []
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
|
-
files:
|
49
|
+
files:
|
50
|
+
- ".github/workflows/main.yml"
|
51
|
+
- ".gitignore"
|
52
|
+
- ".rspec"
|
53
|
+
- ".standard.yml"
|
54
|
+
- CHANGELOG.md
|
55
|
+
- Gemfile
|
56
|
+
- Gemfile.lock
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- appilix_notifications-0.1.0.gem
|
60
|
+
- appilix_notifications.gemspec
|
61
|
+
- bin/console
|
62
|
+
- bin/setup
|
63
|
+
- lib/appilix_notifications.rb
|
64
|
+
- lib/appilix_notifications/version.rb
|
65
|
+
- sig/appilix_notifications.rbs
|
66
|
+
- spec/appilix_notifications_spec.rb
|
67
|
+
- spec/spec_helper.rb
|
68
|
+
- test/appilix_notifications_test.rb
|
69
|
+
- test/test_helper.rb
|
50
70
|
homepage: https://github.com/RoaaAlqaisi/appilix_notifications
|
51
71
|
licenses:
|
52
72
|
- NGPL
|