Skip to content

Commit 59fa864

Browse files
committed
Rename gem to action_push_native
1 parent 1ba039f commit 59fa864

37 files changed

+160
-160
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
# Specify your gem's dependencies in action_native_push.gemspec.
3+
# Specify your gem's dependencies in action_push_native.gemspec.
44
gemspec
55

66
gem "sqlite3"

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
action_native_push (0.1.0)
4+
action_push_native (0.1.0)
55
activejob (>= 8.0)
66
activerecord (>= 8.0)
77
apnotic (~> 1.7)
@@ -249,7 +249,7 @@ PLATFORMS
249249
x86_64-linux-musl
250250

251251
DEPENDENCIES
252-
action_native_push!
252+
action_push_native!
253253
mocha
254254
rubocop
255255
rubocop-rails-omakase

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Action Native Push
1+
# Action Push Native
22

3-
Action Native Push is a Rails push notification gem for mobile platforms, supporting APNs (Apple) and FCM (Google).
3+
Action Push Native is a Rails push notification gem for mobile platforms, supporting APNs (Apple) and FCM (Google).
44

55
## Installation
66

77
```bash
8-
1. bundle add action_native_push
9-
2. bin/rails g action_native_push:install
10-
3. bin/rails action_native_push:install:migrations
8+
1. bundle add action_push_native
9+
2. bin/rails g action_push_native:install
10+
3. bin/rails action_push_native:install:migrations
1111
4. bin/rails db:migrate
1212
```
1313

@@ -25,7 +25,7 @@ The installation will create:
2525
`app/models/application_push_notification.rb`:
2626

2727
```ruby
28-
class ApplicationPushNotification < ActionNativePush::Notification
28+
class ApplicationPushNotification < ActionPushNative::Notification
2929
# Set a custom job queue_name
3030
queue_as :realtime
3131

@@ -45,7 +45,7 @@ you can change the application defaults by editing it directly.
4545
`app/jobs/application_push_notification_job.rb`:
4646

4747
```ruby
48-
class ApplicationPushNotificationJob < ActionNativePush::NotificationJob
48+
class ApplicationPushNotificationJob < ActionPushNative::NotificationJob
4949
# Enable logging job arguments (default: false)
5050
self.log_arguments = true
5151

@@ -60,9 +60,9 @@ directly in your application.
6060
`app/models/application_push_device.rb`:
6161

6262
```ruby
63-
class ApplicationPushDevice < ActionNativePush::Device
63+
class ApplicationPushDevice < ActionPushNative::Device
6464
# Customize TokenError handling (default: destroy!)
65-
# rescue_from (ActionNativePush::TokenError) { Rails.logger.error("Device #{id} token is invalid") }
65+
# rescue_from (ActionPushNative::TokenError) { Rails.logger.error("Device #{id} token is invalid") }
6666
end
6767
```
6868

@@ -173,7 +173,7 @@ device = ApplicationPushDevice.create! \
173173
174174
notification = ApplicationPushNotification.new \
175175
title: "Hello world!",
176-
body: "Welcome to Action Native Push"
176+
body: "Welcome to Action Push Native"
177177
178178
notification.deliver_later_to(device)
179179
```
@@ -200,7 +200,7 @@ You can pass custom data to the application using the `with_data` method:
200200
```ruby
201201
notification = ApplicationPushNotification
202202
.with_data({ badge: "1" })
203-
.new(title: "Welcome to Action Native Push")
203+
.new(title: "Welcome to Action Push Native")
204204
```
205205

206206
### Custom platform Payload
@@ -223,7 +223,7 @@ default behaviour:
223223
```ruby
224224
notification = ApplicationPushNotification
225225
.with_google(android: { notification: { notification_count: nil } })
226-
.new(title: "Hello world!", body: "Welcome to Action Native Push", badge: 1)
226+
.new(title: "Hello world!", body: "Welcome to Action Push Native", badge: 1)
227227
```
228228

229229
This will unset the default `notification_count` (`badge`) field in the Google payload, while keeping `title`
@@ -293,14 +293,14 @@ class CustomDevice
293293
294294
def push(notification)
295295
notification.token = token
296-
ActionNativePush.service_for(platform, notification).push(notification)
297-
rescue ActionNativePush::TokenError => error
296+
ActionPushNative.service_for(platform, notification).push(notification)
297+
rescue ActionPushNative::TokenError => error
298298
# Custom token error handling
299299
end
300300
end
301301
```
302302

303-
## `ActionNativePush::Notification` attributes
303+
## `ActionPushNative::Notification` attributes
304304

305305
| Name | Description
306306
|------------------|------------
@@ -326,4 +326,4 @@ end
326326

327327
## License
328328

329-
Action Native Push is licensed under MIT.
329+
Action Push Native is licensed under MIT.

action_native_push.gemspec renamed to action_push_native.gemspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# frozen_string_literal: true
22

3-
require_relative "lib/action_native_push/version"
3+
require_relative "lib/action_push_native/version"
44

55
Gem::Specification.new do |spec|
6-
spec.name = "action_native_push"
7-
spec.version = ActionNativePush::VERSION
6+
spec.name = "action_push_native"
7+
spec.version = ActionPushNative::VERSION
88
spec.authors = [ "Jacopo Beschi" ]
99
spec.email = [ "jacopo@37signals.com" ]
1010

1111
spec.summary = "Send push notifications to mobile apps"
1212
spec.description = "Send push notifications to mobile apps"
13-
spec.homepage = "https://github.com/basecamp/action_native_push"
13+
spec.homepage = "https://github.com/basecamp/action_push_native"
1414
spec.license = "MIT"
1515

1616
spec.metadata["homepage_uri"] = spec.homepage

app/jobs/action_native_push/notification_job.rb renamed to app/jobs/action_push_native/notification_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
module ActionNativePush
3+
module ActionPushNative
44
class NotificationJob < ActiveJob::Base
55
self.log_arguments = false
66

app/models/action_native_push/device.rb renamed to app/models/action_push_native/device.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
module ActionNativePush
3+
module ActionPushNative
44
class Device < ApplicationRecord
55
include ActiveSupport::Rescuable
66

@@ -12,7 +12,7 @@ class Device < ApplicationRecord
1212

1313
def push(notification)
1414
notification.token = token
15-
ActionNativePush.service_for(platform, notification).push(notification)
15+
ActionPushNative.service_for(platform, notification).push(notification)
1616
rescue => error
1717
rescue_with_handler(error) || raise
1818
end

bin/rails

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# installed from the root of your application.
44

55
ENGINE_ROOT = File.expand_path("..", __dir__)
6-
ENGINE_PATH = File.expand_path("../lib/action_native_push/engine", __dir__)
6+
ENGINE_PATH = File.expand_path("../lib/action_push_native/engine", __dir__)
77
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
88

99
# Set up gems listed in the Gemfile.

bin/release

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ if [ -z "$VERSION" ]; then
88
exit 1
99
fi
1010

11-
printf "module ActionNativePush\n VERSION = \"$VERSION\"\nend\n" > ./lib/action_native_push/version.rb
11+
printf "module ActionPushNative\n VERSION = \"$VERSION\"\nend\n" > ./lib/action_push_native/version.rb
1212
bundle
13-
git add Gemfile.lock lib/action_native_push/version.rb
13+
git add Gemfile.lock lib/action_push_native/version.rb
1414
git commit -m "Bump version for $VERSION"
1515
git push
1616
git tag v$VERSION
1717
git push --tags
18-
gem build action_native_push
19-
gem push "action_native_push-$VERSION.gem" --host https://rubygems.org
20-
rm "action_native_push-$VERSION.gem"
18+
gem build action_push_native
19+
gem push "action_push_native-$VERSION.gem" --host https://rubygems.org
20+
rm "action_push_native-$VERSION.gem"

db/migrate/20250610075650_create_action_native_push_device.rb renamed to db/migrate/20250610075650_create_action_push_native_device.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
class CreateActionNativePushDevice < ActiveRecord::Migration[8.0]
1+
class CreateActionPushNativeDevice < ActiveRecord::Migration[8.0]
22
def change
3-
create_table :action_native_push_devices do |t|
3+
create_table :action_push_native_devices do |t|
44
t.string :name
55
t.string :platform, null: false
66
t.string :token, null: false

lib/action_native_push.rb renamed to lib/action_push_native.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# frozen_string_literal: true
22

33
require "zeitwerk"
4-
require "action_native_push/engine"
5-
require "action_native_push/errors"
4+
require "action_push_native/engine"
5+
require "action_push_native/errors"
66
require "net/http"
77
require "apnotic"
88
require "googleauth"
99

1010
loader= Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
1111
loader.ignore("#{__dir__}/generators")
12-
loader.ignore("#{__dir__}/action_native_push/errors.rb")
12+
loader.ignore("#{__dir__}/action_push_native/errors.rb")
1313
loader.setup
1414

15-
module ActionNativePush
15+
module ActionPushNative
1616
def self.service_for(platform, notification)
1717
platform_config = config_for(platform, notification)
1818

@@ -22,13 +22,13 @@ def self.service_for(platform, notification)
2222
when :google
2323
Service::Fcm.new(platform_config)
2424
else
25-
raise "ActionNativePush: '#{platform}' platform is unsupported"
25+
raise "ActionPushNative: '#{platform}' platform is unsupported"
2626
end
2727
end
2828

2929
def self.config_for(platform, notification)
3030
platform_config = Rails.application.config_for(:push)[platform.to_sym]
31-
raise "ActionNativePush: '#{platform}' platform is not configured" unless platform_config.present?
31+
raise "ActionPushNative: '#{platform}' platform is not configured" unless platform_config.present?
3232

3333
if notification.application.present?
3434
notification_config = platform_config.fetch(notification.application.to_sym, {})

0 commit comments

Comments
 (0)