appilix_notifications 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecd11d1e6132cec8349f2c25b8591e1ccec77398b2f06887a8d43efe4a9b2739
4
- data.tar.gz: a5ef42effd83291505bd3942932a1408997b6510755881b57ff68b074e58a7c6
3
+ metadata.gz: 993a291ad2f0f97f3de0cd8a6d6f86fcf1e059db62ad03a541bfdf20c2c2f7b5
4
+ data.tar.gz: acfc393b5e518aa54d0b1242bb002f2e3446157a82dffcc5e950e780c79d7b1d
5
5
  SHA512:
6
- metadata.gz: d7c18ee6d91200d0ec0e3f50921a80a91e34ee07919e63253bbfb061c55e4a5f37718c9944965b293992356fcadcc88bd733b1419a0ad65b85c079cc4f10db8b
7
- data.tar.gz: 83bab8a4dd6b2799f5be4d6dc969ac49b61c1b72ca823603c9f28d837b2c06798e1eb875fa2233f3123b8d3107180288f7c3ca52aacf74c8d755a85a05887237
6
+ metadata.gz: 2f5d6d6a14ddcd7de2f784bd962b3544f0b0eb2da99c9ee58fa87d36d340c0c539b9e8579d6554ac37f64936a41f8ce0eb23959fb2eafc20da92d70b089d7638
7
+ data.tar.gz: 5fd69e72ab797f26954440566cac881a4014f68723cc65e7c0dbcf8b62babd27778d3ab9564b0f76e5460b5a18be5b382e5e815aab225baecf9de8fef412618a
@@ -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
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/standardrb/standard
3
+ ruby_version: 3.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-01-20
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in appilix_notifications.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "test-unit", "~> 3.0"
11
+
12
+ gem "standard", "~> 1.3"
13
+
14
+ gem 'rspec'
data/Gemfile.lock ADDED
@@ -0,0 +1,91 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ appilix_notifications (0.1.1)
5
+ json (~> 2.0)
6
+ net-http (>= 0.1.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.2)
12
+ diff-lcs (1.5.1)
13
+ json (2.9.1)
14
+ language_server-protocol (3.17.0.3)
15
+ lint_roller (1.1.0)
16
+ net-http (0.10.0)
17
+ net-protocol (>= 0.3.0)
18
+ uri (>= 0.11.1)
19
+ net-protocol (0.4.0)
20
+ timeout
21
+ parallel (1.26.3)
22
+ parser (3.3.7.0)
23
+ ast (~> 2.4.1)
24
+ racc
25
+ power_assert (2.0.5)
26
+ racc (1.8.1)
27
+ rainbow (3.1.1)
28
+ rake (13.2.1)
29
+ regexp_parser (2.10.0)
30
+ rspec (3.13.0)
31
+ rspec-core (~> 3.13.0)
32
+ rspec-expectations (~> 3.13.0)
33
+ rspec-mocks (~> 3.13.0)
34
+ rspec-core (3.13.2)
35
+ rspec-support (~> 3.13.0)
36
+ rspec-expectations (3.13.3)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.13.0)
39
+ rspec-mocks (3.13.2)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.13.0)
42
+ rspec-support (3.13.2)
43
+ rubocop (1.70.0)
44
+ json (~> 2.3)
45
+ language_server-protocol (>= 3.17.0)
46
+ parallel (~> 1.10)
47
+ parser (>= 3.3.0.2)
48
+ rainbow (>= 2.2.2, < 4.0)
49
+ regexp_parser (>= 2.9.3, < 3.0)
50
+ rubocop-ast (>= 1.36.2, < 2.0)
51
+ ruby-progressbar (~> 1.7)
52
+ unicode-display_width (>= 2.4.0, < 4.0)
53
+ rubocop-ast (1.37.0)
54
+ parser (>= 3.3.1.0)
55
+ rubocop-performance (1.23.1)
56
+ rubocop (>= 1.48.1, < 2.0)
57
+ rubocop-ast (>= 1.31.1, < 2.0)
58
+ ruby-progressbar (1.13.0)
59
+ standard (1.44.0)
60
+ language_server-protocol (~> 3.17.0.2)
61
+ lint_roller (~> 1.0)
62
+ rubocop (~> 1.70.0)
63
+ standard-custom (~> 1.0.0)
64
+ standard-performance (~> 1.6)
65
+ standard-custom (1.0.2)
66
+ lint_roller (~> 1.0)
67
+ rubocop (~> 1.50)
68
+ standard-performance (1.6.0)
69
+ lint_roller (~> 1.1)
70
+ rubocop-performance (~> 1.23.0)
71
+ test-unit (3.6.7)
72
+ power_assert
73
+ timeout (0.6.1)
74
+ unicode-display_width (3.1.4)
75
+ unicode-emoji (~> 4.0, >= 4.0.4)
76
+ unicode-emoji (4.0.4)
77
+ uri (1.1.2)
78
+
79
+ PLATFORMS
80
+ ruby
81
+ x86_64-linux
82
+
83
+ DEPENDENCIES
84
+ appilix_notifications!
85
+ rake (~> 13.0)
86
+ rspec
87
+ standard (~> 1.3)
88
+ test-unit (~> 3.0)
89
+
90
+ BUNDLED WITH
91
+ 2.6.2
data/README.md ADDED
@@ -0,0 +1,151 @@
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; use "user-1::user-2" for multiple users
34
+ 'https://example.com', # Optional
35
+ notification_image: 'https://example.com/banner.png', # Optional; Android only
36
+ secondary_app_key: 'your_ios_app_key', # Optional
37
+ secondary_api_key: 'your_ios_api_key' # Optional
38
+ )
39
+
40
+ puts response
41
+ ```
42
+ #### Parameters for Sending Notifications
43
+
44
+ - `app_key` (String): Your application's key from Appilix.
45
+ - `api_key` (String): Your API key from Appilix.
46
+ - `title` (String): The title of the notification.
47
+ - `body` (String): The body content of the notification.
48
+ - `user_identity` (String, optional): The user identifier for the notification.
49
+ - `open_link_url` (String, optional): A URL to open when the notification is clicked.
50
+ - `notification_image` (String, optional keyword): A public image URL (Android only).
51
+ - `secondary_app_key` (String, optional keyword): The app key for a second app, such as iOS.
52
+ - `secondary_api_key` (String, optional keyword): The API key for the second app.
53
+
54
+ Notifications are submitted as a `POST` form request to the current Appilix push notification endpoint.
55
+
56
+
57
+ On success, the method returns a parsed JSON response:
58
+
59
+ ```json
60
+ {
61
+ "status": "success",
62
+ "message": "Notification sent successfully"
63
+ }
64
+ ```
65
+
66
+ On failure, the method returns an error hash:
67
+
68
+ ```json
69
+ {
70
+ "error": "Invalid API key",
71
+ "code": "401",
72
+ "body": "The provided API key is incorrect."
73
+ }
74
+ ```
75
+
76
+ If the server response contains invalid JSON, you will receive:
77
+
78
+ ```json
79
+ {
80
+ "error": "Invalid JSON response",
81
+ "body": "<Raw response body>"
82
+ }
83
+ ```
84
+
85
+
86
+ ### Fetching Registered User Tokens
87
+
88
+ To fetch registered user tokens, use the `appilix_get_registered_user` method:
89
+
90
+ ```ruby
91
+ require 'appilix_notifications'
92
+
93
+ response = AppilixNotifications.appilix_get_registered_user(
94
+ 'your_app_key',
95
+ 'your_api_key',
96
+ 1, # Optional page number; defaults to 1
97
+ user_identity: 'optional_user_identity',
98
+ items_per_page: 50,
99
+ secondary_app_key: 'your_ios_app_key',
100
+ secondary_api_key: 'your_ios_api_key'
101
+ )
102
+
103
+ puts response
104
+ ```
105
+
106
+ #### Parameters for Fetching Registered User Tokens
107
+
108
+ - `app_key` (String): Your application's key from Appilix.
109
+ - `api_key` (String): Your API key from Appilix.
110
+ - `page` (Integer, optional): The page number, defaulting to `1`.
111
+ - `user_identity` (String, optional keyword): Return tokens for a specific user.
112
+ - `items_per_page` (Integer, optional keyword): Results per page, defaulting to `100`.
113
+ - `secondary_app_key` (String, optional keyword): The app key for a second app.
114
+ - `secondary_api_key` (String, optional keyword): The API key for the second app.
115
+
116
+
117
+ On success, the method returns a parsed JSON response containing the tokens:
118
+
119
+ ```json
120
+ {
121
+ "status": true,
122
+ "current_page": 1,
123
+ "has_next_page": false,
124
+ "tokens": [
125
+ {
126
+ "token": "fcm-device-token-string",
127
+ "user_identity": "user@example.com",
128
+ "modified_at": "2026-05-22 10:30:00"
129
+ }
130
+ ]
131
+ }
132
+ ```
133
+
134
+ On failure, the method returns an error hash:
135
+
136
+ ```json
137
+ {
138
+ "error": "Invalid API key",
139
+ "code": "401",
140
+ "body": "The provided API key is incorrect."
141
+ }
142
+ ```
143
+
144
+ If the server response contains invalid JSON, you will receive:
145
+
146
+ ```json
147
+ {
148
+ "error": "Invalid JSON response",
149
+ "body": "<Raw response body>"
150
+ }
151
+ ```
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.2"
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,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppilixNotifications
4
+ VERSION = "0.1.2"
5
+ end
@@ -0,0 +1,83 @@
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"
13
+
14
+ module_function
15
+
16
+ def appilix_send_notifications(app_key, api_key, title, body, user_identity = nil, open_link_url = nil,
17
+ notification_image: nil, secondary_app_key: nil, secondary_api_key: nil)
18
+ uri = URI("#{BASE_URL}/#{PUSH_NOTIFICATION_URL}")
19
+ form_data = compact_parameters(
20
+ "app_key" => app_key,
21
+ "api_key" => api_key,
22
+ "notification_title" => title,
23
+ "notification_body" => body,
24
+ "user_identity" => user_identity,
25
+ "open_link_url" => open_link_url,
26
+ "notification_image" => notification_image,
27
+ "secondary_app_key" => secondary_app_key,
28
+ "secondary_api_key" => secondary_api_key
29
+ )
30
+
31
+ request = Net::HTTP::Post.new(uri)
32
+ request.set_form_data(form_data)
33
+
34
+ response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
35
+ http.request(request)
36
+ end
37
+
38
+ handle_response(response)
39
+ end
40
+
41
+ def appilix_get_registered_user(app_key, api_key, page = 1, user_identity: nil, items_per_page: 100,
42
+ secondary_app_key: nil, secondary_api_key: nil)
43
+ uri = URI("#{BASE_URL}/#{TOKEN_LIST_URL}")
44
+ uri.query = URI.encode_www_form(compact_parameters(
45
+ "app_key" => app_key,
46
+ "api_key" => api_key,
47
+ "page" => page,
48
+ "items_per_page" => items_per_page,
49
+ "user_identity" => user_identity,
50
+ "secondary_app_key" => secondary_app_key,
51
+ "secondary_api_key" => secondary_api_key
52
+ ))
53
+
54
+ request = Net::HTTP::Get.new(uri)
55
+
56
+ response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
57
+ http.request(request)
58
+ end
59
+
60
+ handle_response(response)
61
+ end
62
+
63
+ def handle_response(response)
64
+ case response
65
+ when Net::HTTPSuccess
66
+ JSON.parse(response.body)
67
+ else
68
+ {"error" => response.message, "code" => response.code, "body" => parse_body_safe(response.body)}
69
+ end
70
+ rescue JSON::ParserError
71
+ {"error" => "Invalid JSON response", "body" => response.body}
72
+ end
73
+
74
+ def parse_body_safe(body)
75
+ JSON.parse(body)
76
+ rescue JSON::ParserError
77
+ body
78
+ end
79
+
80
+ def compact_parameters(parameters)
81
+ parameters.reject { |_key, value| value.nil? }
82
+ end
83
+ end
@@ -0,0 +1,4 @@
1
+ module AppilixNotifications
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,69 @@
1
+ require_relative "../lib/appilix_notifications"
2
+
3
+ RSpec.describe AppilixNotifications do
4
+ let(:app_key) { "key1" }
5
+ let(:api_key) { "apikey1" }
6
+ let(:http) { instance_double(Net::HTTP) }
7
+
8
+ before { allow(Net::HTTP).to receive(:start).and_yield(http) }
9
+
10
+ def successful_response(body)
11
+ response = Net::HTTPOK.new("1.1", "200", "OK")
12
+ allow(response).to receive(:body).and_return(JSON.generate(body))
13
+ response
14
+ end
15
+
16
+ it "sends a notification using a POST form request" do
17
+ allow(http).to receive(:request).and_return(successful_response("status" => true))
18
+
19
+ response = described_class.appilix_send_notifications(
20
+ app_key, api_key, "Hello", "Notification body", "user@example.com", "https://example.com",
21
+ notification_image: "https://example.com/image.png",
22
+ secondary_app_key: "ios-key", secondary_api_key: "ios-api-key"
23
+ )
24
+
25
+ expect(response).to eq("status" => true)
26
+ expect(http).to have_received(:request) do |request|
27
+ expect(request).to be_a(Net::HTTP::Post)
28
+ expect(request.uri.to_s).to eq("https://appilix.com/api/push-notification")
29
+ expect(URI.decode_www_form(request.body).to_h).to eq(
30
+ "app_key" => app_key, "api_key" => api_key,
31
+ "notification_title" => "Hello", "notification_body" => "Notification body",
32
+ "user_identity" => "user@example.com", "open_link_url" => "https://example.com",
33
+ "notification_image" => "https://example.com/image.png",
34
+ "secondary_app_key" => "ios-key", "secondary_api_key" => "ios-api-key"
35
+ )
36
+ end
37
+ end
38
+
39
+ it "fetches FCM tokens from the current endpoint with documented parameters" do
40
+ body = {"status" => true, "current_page" => 2, "has_next_page" => false, "tokens" => []}
41
+ allow(http).to receive(:request).and_return(successful_response(body))
42
+
43
+ response = described_class.appilix_get_registered_user(
44
+ app_key, api_key, 2, user_identity: "user@example.com", items_per_page: 50,
45
+ secondary_app_key: "ios-key", secondary_api_key: "ios-api-key"
46
+ )
47
+
48
+ expect(response).to eq(body)
49
+ expect(http).to have_received(:request) do |request|
50
+ expect(request).to be_a(Net::HTTP::Get)
51
+ expect(request.uri.path).to eq("/api/push-notification-token")
52
+ expect(URI.decode_www_form(request.uri.query).to_h).to eq(
53
+ "app_key" => app_key, "api_key" => api_key, "page" => "2", "items_per_page" => "50",
54
+ "user_identity" => "user@example.com", "secondary_app_key" => "ios-key",
55
+ "secondary_api_key" => "ios-api-key"
56
+ )
57
+ end
58
+ end
59
+
60
+ it "uses the API pagination defaults when token options are omitted" do
61
+ allow(http).to receive(:request).and_return(successful_response("status" => true, "tokens" => []))
62
+
63
+ described_class.appilix_get_registered_user(app_key, api_key)
64
+
65
+ expect(http).to have_received(:request) do |request|
66
+ expect(URI.decode_www_form(request.uri.query).to_h).to include("page" => "1", "items_per_page" => "100")
67
+ end
68
+ end
69
+ end
@@ -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
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
4
+ require "appilix_notifications"
5
+
6
+ require "test-unit"
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.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - RoaaAlqaisi
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 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
@@ -69,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
89
  - !ruby/object:Gem::Version
70
90
  version: '0'
71
91
  requirements: []
72
- rubygems_version: 3.6.3
92
+ rubygems_version: 4.0.10
73
93
  specification_version: 4
74
94
  summary: A Ruby gem to send notifications using the appilix API.
75
95
  test_files: []