Skip to content

Commit 3c4e511

Browse files
committed
changed the naming in several files
1 parent 48c23b6 commit 3c4e511

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Plugin for Discourse that does a backup to your Google Drive Service Account
44
1. Make sure you have the latest version of Discourse set up properly
55
2. Install the [basic-sync-plugin](https://github.com/berlindiamonds/discourse-sync-base) first
66
3. Clone this repository into your discourse/plugins folder
7-
4. In the browser go to your admin settings and then to plugins. You should see the discourse-googledrive-backup appearing there
7+
4. In the browser go to your admin settings and then to plugins. You should see the discourse-sync-to-googledrive appearing there
88

99
![alt text](https://user-images.githubusercontent.com/15628617/28319104-3839c696-6bcd-11e7-90dc-86513339190d.png)
1010

@@ -20,6 +20,6 @@ A Plugin for Discourse that does a backup to your Google Drive Service Account
2020
7. Open the JSON file and copy its content and paste the whole thing into the textfield in your plugin-settings that is called "discourse backups to drive api key" and save it
2121
8. Backup your files
2222

23-
this plugin was created by Jen and Kaja, in analogy to the [discourse-backup-to-dropbox plugin from Falco](https://github.com/xfalcox/discourse-backups-to-dropbox)
23+
this plugin was created by Jen and Kaja, in analogy to the [discourse-sync-to-dropbox plugin from Falco](https://github.com/xfalcox/discourse-backups-to-dropbox)
2424

2525
For help please go to [Discourse Meta](https://meta.discourse.org/)

app/jobs/regular/sync_backups_to_drive.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class SyncBackupsToDrive < ::Jobs::Base
44
sidekiq_options queue: 'low'
55

66
def execute(arg)
7-
many_backups = Backup.all.take(SiteSetting.discourse_backups_drive_quantity)
7+
many_backups = Backup.all.take(SiteSetting.discourse_sync_to_googledrive_quantity)
88
many_backups.each do|backup|
99
DiscourseBackupToDrive::DriveSynchronizer.new(backup).sync
1010
end

config/locales/server.en.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
en:
22
site_settings:
3-
discourse_backups_drive_enabled: "Enable the drive backups plugin. After enabling this, it will work on your next backup"
4-
discourse_backups_drive_quantity: "How many backups will be kept in Google Drive"
5-
discourse_backups_drive_api_key: "Your Drive Generated Access Token"
3+
discourse_sync_to_googledrive_enabled: "Enable the drive backups plugin. After enabling this, it will work on your next backup"
4+
discourse_sync_to_googledrive_quantity: "How many backups will be kept in Google Drive"
5+
discourse_sync_to_googledrive_api_key: "Your Drive Generated Access Token"

config/settings.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins:
2-
discourse_backups_drive_enabled:
2+
discourse_sync_to_googledrive_enabled:
33
default: false
4-
discourse_backups_drive_quantity:
4+
discourse_sync_to_googledrive_quantity:
55
default: 5
6-
discourse_backups_drive_api_key:
6+
discourse_sync_to_googledrive_api_key:
77
default: ''

lib/drive_synchronizer.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ class DriveSynchronizer < Synchronizer
33

44
def initialize(backup)
55
super(backup)
6-
@api_key = SiteSetting.discourse_backups_drive_api_key
7-
@turned_on = SiteSetting.discourse_backups_drive_enabled
6+
@api_key = SiteSetting.discourse_sync_to_googledrive_api_key
7+
@turned_on = SiteSetting.discourse_sync_to_googledrive_enabled
88
end
99

1010
def session

plugin.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
gem 'google_drive', '2.1.2'
2323
require 'sidekiq'
2424

25-
enabled_site_setting :discourse_backups_drive_enabled
25+
enabled_site_setting :discourse_sync_to_googledrive_enabled
2626

2727
after_initialize do
2828
load File.expand_path("../app/jobs/regular/sync_backups_to_drive.rb", __FILE__)

spec/drive_synchronizer_spec.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@
1212

1313
describe "#can_sync?" do
1414
it "should return false when disabled via site setting" do
15-
SiteSetting.discourse_backups_drive_enabled = false
16-
SiteSetting.discourse_backups_drive_api_key = 'test_key'
15+
SiteSetting.discourse_sync_to_googledrive_enabled = false
16+
SiteSetting.discourse_sync_to_googledrive_api_key = 'test_key'
1717
ds = described_class.new(backup)
1818
expect(ds.can_sync?).to eq(false)
1919
end
2020

2121
it "should return false when the backup is missing" do
22-
SiteSetting.discourse_backups_drive_enabled = true
23-
SiteSetting.discourse_backups_drive_api_key = 'test_key'
22+
SiteSetting.discourse_sync_to_googledrive_enabled = true
23+
SiteSetting.discourse_sync_to_googledrive_api_key = 'test_key'
2424
ds = described_class.new(nil)
2525
expect(ds.can_sync?).to eq(false)
2626
end
2727

2828
it "should return false when the api key is missing" do
29-
SiteSetting.discourse_backups_drive_enabled = true
30-
SiteSetting.discourse_backups_drive_api_key = ''
29+
SiteSetting.discourse_sync_to_googledrive_enabled = true
30+
SiteSetting.discourse_sync_to_googledrive_api_key = ''
3131
ds = described_class.new(backup)
3232
expect(ds.can_sync?).to eq(false)
3333
end
3434

3535
it "should return true when everything is correct" do
36-
SiteSetting.discourse_backups_drive_enabled = true
37-
SiteSetting.discourse_backups_drive_api_key = 'test_key'
36+
SiteSetting.discourse_sync_to_googledrive_enabled = true
37+
SiteSetting.discourse_sync_to_googledrive_api_key = 'test_key'
3838
ds = described_class.new(backup)
3939
expect(ds.can_sync?).to eq(true)
4040
end

0 commit comments

Comments
 (0)