Permalink
Browse files

changed 'sources' to 'listeners'

  • Loading branch information...
1 parent 1056ca8 commit 8d7ba939462e4a2d029a0c32a1748a803d7ad281 Dhruv Bansal committed Sep 20, 2013
Showing with 17 additions and 17 deletions.
  1. +6 −6 README.md
  2. +4 −4 lib/wukong-load.rb
  3. +7 −7 lib/wukong-load/sync_all_runner.rb
View
@@ -758,12 +758,12 @@ sources (or just some of them).
Within one of the configuration files in your deploy pack (either
`config/settings.yml` or an environment-specific
-`config/environments/ENVIRONMENT.yml`) create a section for your
-sources as follows:
+`config/environments/ENVIRONMENT.yml`) create a listener for each of
+your souces as follows:
```
---
-sources:
+listeners:
nasa:
ftp:
host: ftp.nasa.gov
@@ -789,7 +789,7 @@ sources:
...
```
-The top-level keys in the `sources` Hash (`nasa`, `usaf`, &c.) are
+The top-level keys in the `listeners` Hash (`nasa`, `usaf`, &c.) are
each the name of a data source. The next-level keys (`ftp`,
`archive`, `s3`) each name a sync type and give the options for that
type. These options are exactly the same as the usual options for
@@ -798,8 +798,8 @@ that sync-type. Options not supplied via the configuration file
directories) are expected to be supplied on the command-line at
runtime.
-With a proper configuration with valid sources, the following commands
-will perform a sync from FTP to S3 of all data sources:
+With a proper configuration with valid listeners, the following
+commands will perform a sync from FTP to S3 of all data sources:
```
$ wu-sync-all ftp --output=/data/incoming
View
@@ -17,10 +17,10 @@ def self.configure settings, program
when 'wu-sync'
settings.define :dry_run, description: "Don't actually do anything, just print what would happen", type: :boolean, default: false
when 'wu-sync-all'
- settings.define :sources, description: "Hash of source names to properties used for syncing", type: Hash, default: {}
- settings.define :only, description: "Comma-separated Array of particular named sources to sync", type: Array
- settings.define :except, description: "Comma-separated Array of particular named sources to not sync", type: Array
- settings.define :dry_run, description: "Don't actually do anything, just print what would happen", type: :boolean, default: false
+ settings.define :listeners, description: "Hash of source names to properties used for syncing", type: Hash, default: {}
+ settings.define :only, description: "Comma-separated Array of particular named listeners to sync", type: Array
+ settings.define :except, description: "Comma-separated Array of particular named listeners to not sync", type: Array
+ settings.define :dry_run, description: "Don't actually do anything, just print what would happen", type: :boolean, default: false
end
end
@@ -18,12 +18,12 @@ class SyncAllRunner < Wukong::Runner
s3
archive
-It works using a --sources Hash. Here's an example of what you might
-put in a configuration file:
+It works using a --listeners Hash. Here's an example of what you
+might put in a configuration file:
---
# in config/settings.yml
- sources:
+ listeners:
nasa:
ftp:
host: ftp.nasa.gov
@@ -42,15 +42,15 @@ class SyncAllRunner < Wukong::Runner
bucket: s3://archive.example.com/usaf
This would let you run the following command to sync both `nasa` and
-`usaf` sources from FTP to local disk at the same time:
+`usaf` listeners from FTP to local disk at the same time:
$ wu-sync-all ftp --output=/data/ftp
Followed by a command to sync this local disk to S3:
$ wu-sync-all s3 --input=/data/ftp --bucket=s3://example.com/ftp
-For any type of sync, you can control which sources are synced using
+For any type of sync, you can control which listeners are synced using
the --only and --except options:
$ wu-sync-all ftp --output=/data/ftp --only=source_1,source_2
@@ -116,11 +116,11 @@ def syncer_klass
# Returns an Array of each syncer used.
#
# Respects the `only` and `except`, allowing for more
- # fine-grained control over which sources are synced.
+ # fine-grained control over which listeners are synced.
#
# @return [Array<Syncer>]
def syncers
- @syncers ||= (settings[:sources] || {}).map do |name, source|
+ @syncers ||= (settings[:listeners] || {}).map do |name, source|
next if settings[:only] && !settings[:only].include?(name.to_s)
next if settings[:except] && settings[:except].include?(name.to_s)
syncer_klass.from_source(settings, source, name)

0 comments on commit 8d7ba93

Please sign in to comment.