100% found this document useful (8 votes)
25 views

Full download (Ebook) Learn With: Angular 4: Collected Essays: Angular CLI, Unit Testing, Debugging TypeScript, and Angular Build Processes by Jeffry Houser pdf docx

The document promotes various Angular-related ebooks available for download, including titles on Angular 4, Angular Material, and Progressive Web Apps. It provides links to each ebook along with brief descriptions and author information. Additionally, it includes an overview of the book 'Learn With: Angular 4: Collected Essays' by Jeffry Houser, detailing its content and purpose for developers interested in building Angular applications.

Uploaded by

fidoepicz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (8 votes)
25 views

Full download (Ebook) Learn With: Angular 4: Collected Essays: Angular CLI, Unit Testing, Debugging TypeScript, and Angular Build Processes by Jeffry Houser pdf docx

The document promotes various Angular-related ebooks available for download, including titles on Angular 4, Angular Material, and Progressive Web Apps. It provides links to each ebook along with brief descriptions and author information. Additionally, it includes an overview of the book 'Learn With: Angular 4: Collected Essays' by Jeffry Houser, detailing its content and purpose for developers interested in building Angular applications.

Uploaded by

fidoepicz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download Full Version ebook - Visit ebooknice.

com

(Ebook) Learn With: Angular 4: Collected Essays:


Angular CLI, Unit Testing, Debugging TypeScript,
and Angular Build Processes by Jeffry Houser

https://ebooknice.com/product/learn-with-
angular-4-collected-essays-angular-cli-unit-testing-
debugging-typescript-and-angular-build-processes-6856786

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Angular for Material Design: Leverage Angular


Material and TypeScript to Build a Rich User Interface for
Web Apps by Venkata Keerti Kotaru ISBN 9781484254332,
1484254333
https://ebooknice.com/product/angular-for-material-design-leverage-
angular-material-and-typescript-to-build-a-rich-user-interface-for-
web-apps-52950608
ebooknice.com

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason;


Viles, James ISBN 9781459699816, 9781743365571,
9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Angular Projects : Build modern web apps in


Angular 16 with 10 different projects and cutting-edge
technologies by Aristeidis Bampakos
https://ebooknice.com/product/angular-projects-build-modern-web-apps-
in-angular-16-with-10-different-projects-and-cutting-edge-
technologies-54671880
ebooknice.com

(Ebook) Next-Level UI Development with PrimeNG: Master the


versatile Angular component library to build stunning
Angular applications by Dale Nguyen ISBN 9781803249810,
1803249811
https://ebooknice.com/product/next-level-ui-development-with-primeng-
master-the-versatile-angular-component-library-to-build-stunning-
angular-applications-55945708
ebooknice.com
(Ebook) Angular Development with Typescript - Second
Edition by Yakov Fain; Anton Moiseev ISBN 9781617295348,
1617295345
https://ebooknice.com/product/angular-development-with-typescript-
second-edition-10533080

ebooknice.com

(Ebook) Getting Started with Angular: Create and Deploy


Angular Applications by Victor Hugo Garcia ISBN
9781484292082, 9781484292068, 1484292081, 1484292065
https://ebooknice.com/product/getting-started-with-angular-create-and-
deploy-angular-applications-48081270

ebooknice.com

(Ebook) Progressive Web Apps with Angular: Create


Responsive, Fast and Reliable PWAs Using Angular by Majid
Hajian ISBN 9781484244470, 1484244478
https://ebooknice.com/product/progressive-web-apps-with-angular-
create-responsive-fast-and-reliable-pwas-using-angular-34622900

ebooknice.com

(Ebook) Primary Mathematics 3A by HOERST ISBN


9789810185046, 9810185049

https://ebooknice.com/product/primary-mathematics-3a-33552624

ebooknice.com

(Ebook) Angular: Up and Running: Learning Angular, Step by


Step by Shyam Seshadri ISBN 9781491999837, 1491999837

https://ebooknice.com/product/angular-up-and-running-learning-angular-
step-by-step-7212814

ebooknice.com
LEARN WITH
ANGULAR 4
COLLECTED ESSAYS

By Jeffry Houser
https://www.learn-with.com
https://www.jeffryhouser.com
https://www.dot-com-it.com

Copyright © 2017 by DotComIt, LLC


About the Author
Jeffry Houser is a technical entrepreneur that likes to share cool
stuff with other people.
In the days before business met the Internet, Jeffry obtained a
Computer Science degree. He has solved a problem or two in his
programming career. In 1999, Jeffry started DotComIt; a company
specializing in custom application development.
During the Y2K era, Jeffry wrote three books for Osborne McGraw-
Hill. He is a member of the Apache Flex Project, and created
Flextras; a library of Open Source Flex Components. Jeffry has
spoken all over the US. He has produced hundreds of podcasts,
written over 30 articles, and written a slew of blog posts.
In 2014, Jeffry created Life After Flex; an AngularJS training course
for Flex Developers. In 2016, Jeffry launched the Learn With series
with books focusing on using AngularJS with other technologies.
Jeffry has worked with multiple clients building Angular
applications.
Contents
Learn With Angular 4 Collected Essays
About the Author
Preface
Introduction
What is this Book Series About?
Who Is This Book for?
Common Conventions
Caveats
Want More?
Chapter 1: Dissecting Build Scripts
Build the Application
Code the TypeScript
Create Angular Routes
Configure SystemJS
Write the Main Index Page
What’s Missing?
Install Angular Libraries
Compile TypeScript
Install Dependencies
Create a Gulp Configuration Module
Lint the TypeScript
Compile TypeScript to JavaScript
Review the JavaScript code
Copy Static Assets
Copy the Angular Libraries
Copy JS Libraries
Copy HTML Files
Process CSS Files
Install Plugins
Process Global CSS
Process Angular CSS Files
Run the App
Run Both CSS Processes in One Task
Handle Source Maps
Install Source Map Plugin
Generate TypeScript Source Maps
Generate CSS Source Maps
Minimize JavaScript with UglifyJS
Install gulp-uglify
Modify Gulp Build Script
Review the Minimized Code
Create Different Build Options
Write a Simple Build Task
Delete the Build Directory
Create a Clean Build
Create a Production Build
Watch Directories for Code Changes
Final Thoughts
Chapter 2: Using the Angular CLI
What is Angular CLI?
Install Angular CLI
Setup a Default Project
Install the Seed
Review the Project Seed
Modify Angular Components
Generate Elements Automatically
Generate a Class
Generate a Component
Working with our New Component and Class
Generating Other Things
Install and Use ng-bootstrap
Install Dependencies
Use Bootstrap
Create a Production Build
Covert the Learn With Task Manager to Bootstrap
Setup a New Project
Install Dependencies
Setup Library Assets
Copy Old Source to New Project
Run the Application
Review Other Features
Chapter 3: Debug Applications from Your Browser
Use Outputs and Alerts
Review the Network Tab
Use a Step Debugger
Final Thoughts
Chapter 4: Unit Testing an Angular Application
What is Unit Testing?
Setup a Unit Testing Environment
Review the Technology Requirements
Install Karma, Jasmine, and Utilities
Create Karma Configuration
Run through GulpJS
Configure Tasks for Different Services Integration
Create the Testing Tasks for Alternate Services
The Simplest Test
Test Classes without Angular Dependencies
Review the UserModel
Write the Tests
Your First Angular Tests
Create a Mock Router
Configure the TestBed
Test the AppComponent
Test the Routing Module
Test Events
Review the TaskFilter
Write the Tests
Test a Bootstrap Popup
Review the Code to Create the Popup
Test the Code to Create the Popup
Review the Popup’s Code
Test the Popup’s Code
Testing Services
Review the Mock AuthenticationService
Test the Mock Service
Review the ColdFusion HttpModule Service
Test the ColdFusion HttpModule Service
Review the NodeJS JSONP Service
Test the NodeJS JSONP Service
Debug Your Tests
Hide console.log( ) with Karma Config
Final Thoughts
Afterword
Preface
I was a Flex developer for a long time; however, Adobe’s Flash
Platform is no longer relevant. A smart developer will spend time
educating himself on new technologies to keep up with a changing
market, and to make sure he has healthy job prospects in the
future. While cultivating these new skills, I decided to write about
my experiences. With this series of books, you can leverage my
experience to learn quickly.
This book is about my experiences building Angular applications.
Angular is a JavaScript framework built by Google for building smart
user interfaces. It is built on TypeScript and allows you to build
dynamic views in HTML5. It is fully testable, which is important to
many enterprise-level applications. It has a large developer
community, ready to help with problems. I greatly enjoy building
applications with Angular.
This book contains a series of essays around important parts of the
HTML5 ecosystem that were not covered as part of the main series.
Introduction
What is this Book Series About?
The purpose of this series is to teach by example. The plan is to
build an application using multiple technologies. These books will
document the process, with each book focusing on a specific
technology or framework. This entry is a companion to the Angular
4 books and covers HTML5 development topics that weren’t used in
the main books.
This book covers:
· Creating Your Own Build scripts: Build Scripts are the
compilers of the HTML world. You used one throughout the
main book. This chapter will show you how it was built.
· Using the Angular CLI: The Angular CLI has become the
standard build script library for creating Angular applications.
This chapter will show you how to use it yourself.
· Application debugging: Code isn’t perfect the first time you
write it; and this chapter will show you techniques to debug
your HTML5 application.
· Unit Testing: One of the primary reasons for choosing
Angular is that it creates easily testable code. This chapter
will show you all the details.
These are important topics to add to your development toolbox.
Who Is This Book for?
Want to learn about building HTML5 applications? Are you
interested in Angular or Bootstrap? Do you want to learn new
technologies by following detailed examples with runnable code? If
you answered yes to any of these questions, then this book is for
you!
Here are some topics we’ll touch upon in this book, and what you
should know before continuing:
· TypeScript: This is the language behind Angular. It is a
statically typed language that compiles to JavaScript. The
more you know about it, the better. If you are not familiar
with it yet, check out our tutorial lesson on learning the
basics of TypeScript.
· Angular: If you read the main books of this series, then you
should have more than enough Angular experience to
understand it’s usage here.
· NodeJS: We use these scripts to compile our TypeScript into
JavaScript, process CSS, and copy files. Familiarity with
NodeJS will be beneficial.
· Jasmine: This is a unit testing framework, and the book
assumes you have no experience with it.
· Karma: This is a unit testing test runner. The book assumes
you have no experience with it.
Common Conventions
I use some common conventions in the code behind this book.
· Classes: Class names are in proper case; the first character of
the class in uppercase, and the start of each new compound
word being in uppercase. An example of a class name is
MyClass. When referencing class names in the book text, the
file extension is usually referenced. For TypeScript files that
contain classes the extension will be “ts”. For JavaScript files,
the extension is “js”.
· Variables: Variable names are also in proper case, except the
first letter of the first compound word; it is always lowercase.
This includes class properties, private variables, and method
arguments. A sample property name is myProperty.
· Constants: Constants are in all uppercase, with each word
separated by an underscore. A sample constant may be
MY_CONSTANT.
· Method or Function Names: Method names use the same
convention as property names. When methods are
referenced in text, open and close parentheses are typed
after the name. A sample method name may be
myMethodName().
· Package or Folder Names: The package names—or folders—
are named using proper case again. In this text, package
names are always referenced as if they were a directory
relative to the application root. A sample package name may
be com/dotComIt/learnwith/myPackage.
Caveats
The goal of this book is to help you become productive creating
HTML5 apps with a focus on Angular. It leverages my experience
building business apps, but is not intended to cover everything you
need to know about building HTML5 Applications. This book
purposely focuses on the tool chain. If you want to know more
about Angular explicitly, check out original series. You should
approach this book as part of your learning process and not as the
last thing you’ll ever need to know. Be sure that you keep educating
yourself. I know I will.

Want More?
You should check out this book’s web site at www.learn-with.com
for more information, such as:
· Source Code: You can find links to all the source code for this
book and others.
· Errata: If we make mistakes, we plan on fixing them. You can
always get the most up-to-date content available from the
website. If you find mistakes, please let us know.
· Test the Apps: The web site will have runnable versions of
the app for you to test.
· Bonus Content: You can find more articles and books
expanding on the content of this book.
Chapter 1: Dissecting Build Scripts
The Angular CLI project has become the most common approach for
building Angular 4 applications. When I started writing the Learn
With series on Angular 4, it had not become the standard. As such I
created my own workflow process. I based it around Gulp, which I
used extensively for building AngularJS 1.x applications. I thought it
would be a great learning exercise to explain more details. This
article will dissect the scripts I wrote and explain how to use them.
All the build scripts are in the Learn With application repository,
however if you want the sample application too, get it from this
GitHub repository.

Build the Application


Before we start expanding on the build process, let’s create a super
simple, Hello World, application that uses Angular and TypeScript.
Code the TypeScript
Create an empty project directory, and then create a src folder
inside it. The src directory will contain all the source code. When
building Angular applications, I use a directory structure that mimics
the package structure I used to use when building applications in
other technologies. Classes are put in a directory structure like
‘com/dotComIt/appName/somethingDescriptive’. The ‘appName’
will be a descriptive name for the application. The
‘somethingDescriptive’ relates back to the purpose of the files in the
folder. In some applications; I have named things after their type
such as services, controllers, or views. In others I have named things
after their purpose, such as login or task.
For this sample, I put the main TypeScript file in directory
com/DotComIt/sample/main. The first file is main.ts:
import { platformBrowserDynamic } from
'@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
This file does three things. First, it imports the Angular library,
platform-browser-dynamic, and gives it the name of
platformBrowserDynamic. Then it imports a custom library,
app.module. We’ll create that file next. Then it uses the two
libraries to bootstrap the application, which is Angular magic for
making the app work.
Next, create app.module.ts in the same directory:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-
browser';
import { HashLocationStrategy, LocationStrategy }
from '@angular/common';
import { AppComponent } from './app.component';
import { AppRoutingModule } from
'../nav/routing.module';

@NgModule({
imports: [ BrowserModule, AppRoutingModule
],
declarations: [ AppComponent ],
providers: [{provide: LocationStrategy,
useClass:HashLocationStrategy}],
bootstrap: [ AppComponent ]
})
export class AppModule { }

This file imports four Angular classes from three Angular libraries.
The core library and platform-browser library are used for loading
and running the app. The HashLocationStrategy and
LocationStrategy classes are used for internal navigation. We have
two custom libraries: AppComponent and AppRoutingModule. The
appComponent is the primary component for our application, and
the AppRoutingModule will handle navigation duties. Then the
@ngModule annotation is created. This is metadata that defines
the application. It imports the browserModule and
AppRoutingModule. The imports property is used to load other
modules into this one so it’s functionality, such as components or
providers, can be available. The declarations property is used to
load components as part of this module, and the AppComponent is
loaded here.
The providers property is used to load the hashing strategy. This
controls how the routing module will change the URL as you move
to different screens across the app. The bootstrap property is used
to load the application’s main component, AppComponent. Finally,
The AppModule is exported, which is the code that allows the
main.ts to access the AppModule.
Now, look at the app.component file:
import { Component } from '@angular/core';

@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>
<router-outlet></router-outlet>`,
})
export class AppComponent { name = 'World'; }

This file imports the Component class from the @angular/core


library. It creates the @Component annotation; which defines the
modules main component. The selector refers to the HTML tag that
will be used to access this component. The template defines an in-
line template that will replace the tag after the application is
bootstrapped. The template starts with a simple hello world app,
but also includes a tag called router-outlet, which is a special
component as part of the Angular routing module. Finally, the
AppComponent class is exported. This class defines the name
variable as ‘World’, which is accessed in the view to create the hello
world application.
That completes the TypeScript portion of the application to load the
Angular libraries and an initial component. We’ll still need to create
the routing.module.ts and a couple of routes.
Create Angular Routes
The sample routes will consist of two Angular components, and a
routine module. First, create the routing module file, named
routing.module.ts in the com/dotComIt/learnWith/nav directory.
This app will create an independent module for the purposes of
routing. First import some libraries:
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from
'@angular/router';
import {FirstComponent} from
"../views/first/first.component";
import {SecondComponent} from
"../views/second/second.component";

First, the NgModule is imported from @angular/core. Then the


RouterModule and Routes classes are imported from
@angular/router. Finally, two custom components,
FirstComponent and SecondComponent are imported. We’ll create
those shortly.
Create a constant to define the routing details:
const routes : Routes = [
{ path: 'first', component: FirstComponent },
{ path: 'second', component: SecondComponent
}
{ path: '', redirectTo: 'first', pathMatch:
'full' },
];

The routes constant is of value Routes, which is an array of Route


objects. Each route is a collection of properties that define how
that route will act. The route “first” will load the FirstComponent
and display it where the router-outlet is. The router “second” will
load SecondComponent and display it where the router-outlet is.
The final entry will redirect an empty path to the first path.
Next, create the @NgModule annotation:
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
declarations: [ FirstComponent,
SecondComponent ],
exports: [ RouterModule ]
})

This sets up the RouterModule using the forRoot() method and


passing in the routes constant. It loads the FirstComponent and
SecondComponent using the declaration, and exports the
RouterModule for use by other modules.
Finally, export the main class:
export class AppRoutingModule {}

This is the class that was loaded, and imported, into the main
application module.
Now, create the FirstComponent in the
com/dotComIt/sample/views/first directory. The component will
be comprised of three files: A CSS file, an HTML Template file, and a
TypeScript file. Create the CSS file first, named
first.component.css. This is just a placeholder for future user, but
let’s add something in it for proof of principle:
.no-padding{
padding:0;
}

Now create first.component.html:


<h1>First View</h1>
<a [routerLink]="['/second']">Go to Second
View</a>

This HTML template includes a header, and a link to the second


view. The routerLink property is used, which is Angular magic
behind the scenes for automatically loading a new route when the
anchor is clicked.
Finally, create first.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'first',
templateUrl :
'./com/dotComIt/sample/views/first/first.component.html
styleUrls: [
'./com/dotComIt/sample/views/first/first.component.css
]
})
export class FirstComponent { }

It imports the Component class from @angular/core. The


@Component annotation is used to define the component. We
specify the selector, a templateUrl, and styleUrls. The tempalteUrl
is a location from the main index file—or application root—to the
template. The styleUrls contains an array of paths to style sheets
used in this component. Normally in HTML applications, style
sheets are shared across components, but I’ve found that Angular
uses some magic to limit the style sheets specified in the styleUrls
from affecting other components that do not load it. It is a nice
easy way to avoid conflicts with similarly named styles.
Create the second component in the
com/dotComIt/sample/views/second directory. The file will
consist of three similar files. First, second.component.css:
.genericCenteredText{
text-align:center;
}

This is just some place holder style to test our processing code.
Then the template file, second.component.html:
<h1>Second View</h1>
<a [routerLink]="['/first']">Go to First View</a>

This displays a header for the second view, and a link back to the
first view.
Finally, the second.component.ts file:
import { Component } from '@angular/core';
@Component({
selector: 'second',
templateUrl :
'./com/dotComIt/sample/views/second/second.component.html
styleUrls: [
'./com/dotComIt/sample/views/second/second.component.css
]
})
export class SecondComponent { }

When the app is compiled and then loaded in a browser, we will be


able to navigate between the first and second view using the links.
Configure SystemJS
The Angular TypeScript approach of using imports is not available as
a native JavaScript construct. To get around this, a module loading
system is needed. Angular 2 uses SystemJS. For this to work,
SystemJS must be configured so that it knows where to find the
Angular libraries, and our custom application. Create a file named
systemjs.config.js in the src/js/systemJSConfig directory. When
building applications; I like to keep my custom files separate from
my library files; and the SystemJS configuration should need to be
set up once and will not need to change.
Setup the file with an Immediately Invoked Function Express (IIFE):
(function (global) {
})(this);

This is the JavaScript method to create a self-executing function.


Inside the function, we want to configure SystemJS:
System.config({
});

The config() method is used to configure the SystemJS library. It


takes an object, which is currently empty. Add in a paths
configuration:
paths: {
'js:': 'js/'
},

This configuration object tells the library that the js path will point
to the js directory. When we write build scripts, we’ll put all the
relevant Angular libraries in the js sub-directory of our final build.
Next, create a map configuration property:
map: {
app: 'com',
'@angular/core':
'js:@angular/core/bundles/core.umd.js',
'@angular/common':
'js:@angular/common/bundles/common.umd.js',
'@angular/compiler':
'js:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser':
'js:@angular/platform-
browser/bundles/platform-browser.umd.js',

'@angular/platform-browser-dynamic':
'js:@angular/platform-browser-
dynamic/bundles/platform-browser-dynamic.umd.js',

'@angular/http':
'js:@angular/http/bundles/http.umd.js',
'@angular/router':
'js:@angular/router/bundles/router.umd.js',
'@angular/forms':
'js:@angular/forms/bundles/forms.umd.js',
'rxjs': 'js:rxjs'
},

The map configuration tells the code “when the code imports the
‘property’, go look in the ‘value’ to find the directory for the
library”. The main angular libraries are listed. Explanation of the
Angular libraries is beyond the full scope of this article. The
important things to notice are that the js path is specified in the file
location for most of the libraries. The second thing to notice is that
the app map points to the com directory, where all our custom code
is located.
Next, specify the packages. A package is a collection of files that
have shared functionality:
packages: {
app: {
main: './dotComIt/sample/main/main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}

Two packages are specified. The first is app, which is our main
application and custom code. It defines the main entry point,
main.js—the name of the file that main.ts will be converted too. It
also specifies the default extension of js. The second package
specified is a package used by Angular, rxjs.
This is a lot of setup, but we’re almost done, and we can start
focusing on the build scripts.
Write the Main Index Page
Let’s look at the last bit of our application, the main index.html file.
Create this file in the root of the src directory. It will be the page
that users use to load our application. Start with a basic HTML
page:
<html>
<head>
<title>Angular QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-
width, initial-scale=1">
</head>
<body>
</body>
</html>

First, add a base href tag to the document head:


<script>document.write('<base href="' +
document.location + '" />');</script>
The base tag is required by the Angular router and defines the
current page which will be used as a point of reference when the
router changes the URL. This uses some JavaScript magic to
determine the current location of the page.
Import our application’s main style sheets:
<link rel="stylesheet" href="app.min.css">

Later we’ll use some process to compile all the non-Angular-


Component specific style sheets into one small one.
This is a simple HTML page. Let’s add some JavaScript script tags:
<script src="js/core-js/client/shim.min.js">
</script>
<script src="js/zone.js/dist/zone.js"></script>
<script src="js/reflect-metadata/Reflect.js">
</script>
<script src="js/systemjs/dist/system.src.js">
</script>

The combination of these JavaScript libraries, and the other libraries


specified in the SystemJS config are what make Angular applications
work. A deeper explanation is beyond the scope of this article.
Next, load the systemjs.config.js file:
<script
src="js/systemJSConfig/systemjs.config.js">
</script>

Next, initialize the SystemJS app:


<script>
System.import('app').then(null,
console.error.bind(console));
</script>

This looks into the config file; finds the app, which points to our
custom com directory code; and then starts the code running.
The body needs the main application’s tag:
<my-app>Loading AppComponent content here ...
</my-app>

That completes the HTML portion of the application.


What’s Missing?
We wrote a bunch of code, but we are far from a runnable
application. First, the TypeScript must be compiled into JavaScript.
Second, neither the Angular libraries, nor the JavaScript
dependencies are anywhere yet. We have script tags, but no files to
load. The rest of this article will address those omissions.
Install Angular Libraries
Gulp runs on top of NodeJS. If you don’t already have it installed,
do it now. The formal instructions or getting setup will be more
helpful than anything I’d tell you in this article. After that, we need
to create a package.json in the root directory. Copy and paste this
one:
{
"name": "TypeScriptAngular4Sample",
"version": "0.0.1",
"description": "TypeScript Angular 4 Sample for
Article.",
"author": "Jeffry Houser",
"license": "ISC",
"dependencies": {
"@angular/common": "~4.0.1",
"@angular/compiler": "~4.0.1",
"@angular/core": "~4.0.1",
"@angular/forms": "~4.0.1",
"@angular/http": "~4.0.1",
"@angular/platform-browser": "~4.0.1",
"@angular/platform-browser-dynamic":
"~4.0.1",
"@angular/router": "~4.0.1",
"systemjs": "0.19.40",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.1",
"zone.js": "^0.8.4"
},
"devDependencies": {
"gulp": "^3.9.1",
"typescript": "^2.1.5"
},
"repository": {}
}
This includes all the major Angular 2 libraries and dependencies in
the dependency section. The devDependencies section includes
Gulp and TypeScript. Install all this stuff with one command:
npm install

You’ll see something like this:

This creates a directory named node_modules that includes all the


modules that NodeJS installed for us, along with any related
dependencies. This is a base for creating the build scripts. As we
need additional Gulp plugins, we’ll install them separately.
Compile TypeScript
This section will show you how to compile the TypeScript to
JavaScript. First, it will be run through a Lint process that validates
it for syntactical errors. Then we’ll perform the actual compilation
and then review the finished code.
Install Dependencies
We’ll need to install a few new NodeJS Modules for this section:
· tslint: A TypeScript linter
· gulp-tslint: A Gulp plugin for tslint.
· gulp-typescript: A TypeScript plugin for Gulp
First install tslint and the gulp-tslint plugin:
npm install --save-dev tslint gulp-tslint

You should see results something like this:


Then install gulp-typescript:
npm install --save-dev gulp-typescript

You’ll see results like this:

That installs the dependencies, now it is time to setup the Gulp file.
Create a Gulp Configuration Module
I want to encapsulate all the configuration options, or modifiable
variables, into a separate Node component than the main Gulp file.
Create a file named config.js in the project root. This will be split up
into three separate sections, each one representing an object of
relevant values.
First, create a baseDirs object:
var baseDirs = {
sourceRoot : "src/",
codeRoot : 'com',
destinationPath : 'build',
};
This contains the basic directories structure for finding the source
code root ‘src’, the Angular application root ‘com’, and the
destination path ‘build’. This object will be reused inside this config
module, and as part of our main Gulp script. Now, create a config
object:
var configObject = {
};

This will contain various values that we want to configure, but for
now leave it empty. We’ll populate it throughout this article.
Finally, create a staticConfig value:
var staticConfig = {
};

This will contain values, such as the location of angular modules,


that you probably won’t want to change, but I encapsulated them
just in case. Now, export the config object:
exports.config =
Object.assign(baseDirs,configObject,staticConfig);

The Object.assign() combines all three objects into a new one which
is exported to be used as a module inside a different NodeJS script.
The idea of having a config file separate from the scripts file is so we
can easily make changes to directories without affecting the scripts.
Lint the TypeScript
Create a file named gulpfile.js in the root directory of the project.
Our first task to create is going to lint the TypeScript code. The first
step is to import the config object:
var config = require("./config").config;

This will give us access to all the config values.


Import the gulp and gulp-tslint libraries:
var gulp = require("gulp");
var tslint = require('gulp-tslint');
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of Four Bells: A
Tale of the Caribbean
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Four Bells: A Tale of the Caribbean

Author: Ralph Delahaye Paine

Illustrator: Frank E. Schoonover

Release date: May 19, 2021 [eBook #65385]

Language: English

Credits: Al Haines, John Routh & the online Project Gutenberg


team at https://www.pgdpcanada.net

*** START OF THE PROJECT GUTENBERG EBOOK FOUR BELLS: A


TALE OF THE CARIBBEAN ***
FOUR BELLS
A Tale of the Caribbean

BY

RALPH D. PAINE

Author of “The Call of the Offshore Wind”


“First Down, Kentucky!” “Roads of Adventure,” etc.

WITH A FRONTISPIECE BY
FRANK E. SCHOONOVER

BOSTON AND NEW YORK


HOUGHTON MIFFLIN COMPANY
The Riverside Press Cambridge
COPYRIGHT, 1923, BY STREET & SMITH CORPORATION
COPYRIGHT, 1924, BY RALPH D. PAINE

ALL RIGHTS RESERVED

The Riverside Press


CAMBRIDGE • MASSACHUSETTS
PRINTED IN THE U.S.A.
CONTENTS

I. The Voice of the Spanish Main


II. The Sea Dogs of Devon
III. A Great Galleon
IV. The Anger of Colonel Fajardo
V. Richard Cary Strolls Alone
VI. The Troubled Heart of Teresa
VII. The Man who Lied
VIII. Upon the City Wall
IX. The Good Hermit of La Popa
X. The Great Yellow Tiger
XI. Spanish Treasure!
XII. Ricardo Writes a Letter
XIII. The Master Takes Command
XIV. Shaking a Crew Together
XV. In the House of Mystery
XVI. Blind Roads of Destiny
XVII. Teresa, her Pilgrimage
XVIII. Rubio Sanchez Finds Friends
XIX. The Intruder from Ecuador
XX. Ricardo Plays it Alone
XXI. The Happiness of Papa Bazán
XXII. The Face of the Waters
XXIII. The Castaway
XXIV. A Tranquil Haven
Four Bells: A Tale of the
Caribbean
CHAPTER I
THE VOICE OF THE SPANISH MAIN
The romance of the sea! Damned rubbish, he called it. The trade
of seafaring was one way to earn a living. This was about all you
could say for it. He had been lured into the merchant service as the
aftermath of an enlistment in the Naval Reserve for the duration of
the war. There was a great hurrah, as you will recall, over the mighty
fleet of new cargo ships which were to restore the Stars and Stripes
to blue water—Columbia’s return to the ocean, and all that—a
splendid revival of the days of Yankee ships and sailors of long ago—
a career for ambitious, adventurous American youth.
This was true enough until the bubble broke. The painful malady
of deflation suddenly afflicted the world’s commerce. Much of
Columbia’s mighty fleet rusted at its moorings. Ambitious American
youth walked the streets in quest of jobs afloat or relinquished the
sea to the Briton and the Scandinavian. It could not be said that the
nation was deeply stirred by this calamity. In a manner of speaking,
it had long since turned its back to the coast and could not be
persuaded to face about.
This Richard Cary was one of the young men who had not been
cast high and dry by the ebb tide of maritime affairs. No auspicious
slant of fortune favored him. He earned what came to him in the
way of employment and promotion. All he knew was the hard
schooling of North Atlantic voyages in bull-nosed brutes of war-built
freighters that would neither steam nor steer.
During the period of booming prosperity, the supply of competent
officers fell far short of the demand. Any ancient mariner with a
master’s license and fairly sound legs could get a ship. Foreign
skippers were given “red ink tickets” and shoved aboard big
American steamers.
The iron discipline and austere traditions of the sea were jeered
at by motley crews, alien and native-born, who had easier work and
better treatment than sailormen had ever known. Mutiny ceased to
be sensational. Noisy Slavs preached Bolshevism in the forecastle.
Every dirty loafer had a grievance. Ships limped into port with
drunken stokers who refused to ply shovel and slice-bar unless they
happened to feel like it. Wise gentlemen ashore diagnosed it as the
poison of social unrest.
Amid these turbulent conditions, such an officer as Richard Cary
was worth his weight in gold. For one thing, the Navy had
hammered into his soul certain ideas which he declined to regard as
obsolete. These pertained to order, fidelity, and obedience as
essential to the conduct of a ship. He was a young man unvexed by
complex emotions. Life consisted in doing the day’s work well, and
the Lord help the subordinate who held opinions to the contrary.
It was a doctrine which had vouchsafed its own rewards. At
twenty-five years of age he was chief officer of a ten-thousand-ton
steamer of the Shipping Board fleet. There was something more to
this rapid advancement than the old-fashioned virtues referred to. A
natural aptitude for the sea was a large factor. Linked with this was a
strong serenity of temper that few besetments could ruffle. Chief
Officer Richard Cary moved on his appointed way with a certain
ponderous momentum of mind and body.
He was sprung from that undiluted pioneer stock which is still to
be found in the rural New England that is remote from the wash of
later immigration. It was the English strain, fair-haired and blue of
eye, that throws back to the Saxon blood. There had been men of
rare height and bulk among his ancestors. This was his goodly
inheritance, that his head should brush the ceiling beams of his
cabin on shipboard and his shoulders fill the width of the doorway.
Mutinous or sulky sailors ceased to bluster about their rights when
this imperturbable young man laid hands on them. This was not
often necessary. What he called moral suasion was enough to quell a
very pretty riot. He had this uncommon gift of leadership, of
mastering men and circumstances, when he was compelled to
display it.
There was lacking, however, the driving power of ambition, the
keen-edged ardor that cuts its way through obstacles to reach a
destined goal. This large placidity of outlook betokened a dormant
imagination, a sort of spiritual inertia. There was no riddle of
existence, so far as he was concerned. The romance and mystery of
the sea? Silly yarns written by lubbers for landsmen to read! They
ought to jam across the Western Ocean in the dead of winter with a
doddering old fool of a skipper on the bridge and a crew of rotten
scoundrels who deserved to be hung.
While enthusiastic crusaders were proclaiming the glorious
resurgence of the American merchant marine, surplus tonnage
began to pile up in every port. Richard Cary’s huge scow of a
freighter could find no cargo and was condemned to idleness with a
melancholy squadron of her sister craft. The chief officer decided to
look around a bit before seeking another berth. One or two offers
came from shipping men who knew him by reputation. Already he
stood out from the crowd. Waterfront gossip had passed along
various tales of the reign of law and order upon the decks which big
Dick Cary trod. He was no cursing, bullying bucko mate, mind you.
Six and a half feet of soothing influence is a fairer phrase.
Home he went to the New Hampshire farm for a respite from the
hard toil of the sea. In February it was, and the bleak hills wore their
deep blankets of snow. His younger brother drove him in a pung to
the white house snuggled close to the ground which had sheltered
six generations of Carys. It made his back ache merely to look at the
miles of stone wall which, as a clumsy young giant, he had helped to
keep in repair.
“I guess going to sea is easier than this,” said brother Bill. “You
seem to have done mighty well for yourself, I’ll tell the world. Any
chance for me?”
“Not a chance,” replied the deep, leisurely accents of brother
Dick. “Seafaring is all shot to pieces. You stand by your mother and
look after the farm till you are ready to go to the agricultural college.
I’ll pay for it.”
“Plenty of excitin’ stories to tell us, I s’pose. Your picture was in
the papers, Dick, after your ship came into New York with four men
in irons. It said you subdued ’em. What with, I want to know.”
“I read poetry to ’em, Bill, and distributed bouquets of cut
flowers. They seemed grateful. So mother is as spry as ever and
working her head off because she likes it.”
“Yep, she sure does make me snap out, Dick. And I bet she takes
no back talk from you.”
“I’m scared already,” grinned the herculean mariner. “Watch her
start a rough house if I track in any snow.”
He strode up the path to the granite doorstep and whisked up
the wiry little woman who wore a best black gown and a white
apron. Into the house he carried this trifling burden and set her
down in a rush-bottomed chair by the fireplace.
“Bless me, Richard,” she cried, “that’s a trick you learned from
your father that’s dead and gone! I used to tell him it was dreadful
undignified. Of course he didn’t have your heft, but there was no
ruggeder man in the village. Do you realize it’s been a whole year
since you came home last?”
“Couldn’t break away, mother. A mate has to drive like a nigger
when a ship is in port. Has Bill been taking good care of you? Any
complaints and I’ll wallop the kid.”
“William is a quick and willing boy,” was the maternal verdict
—“not so easy and good-natured as you—more inclined to be fretty
when things go wrong.”
“You always called me lazy,” laughed the elder son, “and a
nuisance under foot.”
“I dunno as I was far wrong, Richard,” was the severe rejoinder,
“but we all have our failings. You have been a generous boy to your
widowed mother. My land, you must have sent me ’most all your
pay. I’ve been as careful as I could with it, and the account in the
savings bank makes me feel real rich. Of course it belongs to you.”
“Forget it,” Richard growled amiably, waving a careless hand of
imposing dimensions. “I’ll eat you out of house and home in the next
fortnight. What about a whole pie right now?”
“Too much pie is bad for you between meals,” she firmly
announced. “I’ll go cut you a reasonable piece. And don’t you let me
hear you make a fuss about it.”
“Not me,” he sighed. “I know better.”
Contentedly he submitted to this fond tyranny. After all, home
was the only place where folks cared whether a man lived or died.
He was in every respect so unlike this high-strung, unflagging wisp
of a mother of his that the contrast amused him. She was a
Chichester and ran true to type. Most of the women wore
themselves out in middle age. Her energy burned like a flame.
Idleness was a sin.
In her turn she was perplexed by this strapping son of hers. He
was rated as a highly successful young man, and yet, in her opinion,
he lacked both zeal and industry—cardinal tenets of her New
England creed. Sprawled upon the cushioned settle, he would
drowsily stare at the fire for hours on end. He read very little and
was not a loquacious person. An excellent listener, however, his
mother’s eager chatter about little things broke against his massive
composure like ripples upon a rock.
Now and then, in oddly silent moments, she studied him intently.
Rugged, like his father, but there resemblance strangely halted.
Matthew Cary’s frame had been gaunt, his features harsh and
shrewd with the enduring imprint of the Puritan tradition. Richard,
the son, might have belonged to another race of men. The fair skin,
the ruddy cheek roughened by strong winds and salt spray, the hair
like minted gold, were unfamiliar among the recent generations of
Carys and Chichesters.
Handsome as a picture and as big as all outdoors, reflected the
canny mother with a thrill of pride, but she actually felt like boxing
his ears to wake him up. There was no soft streak in him, no weak
fiber. This much she knew. His record at sea confirmed it. To call him
hulking was absurd. There was courage in the level, tranquil gaze,
and resolution was conveyed by the firm lips that smiled so readily.
“What in the world do you think about when you sit there like a
bump on a log?” impatiently exclaimed the mother. “Is it a girl?
William has suffered from those moon-struck spells now and then,
but at his age it’s no more serious than chicken-pox.”
“There’s never been a girl that I thought of very long,” dutifully
answered Richard, his pipe between his teeth. “I’m not so anxious to
meet the right one. Going to sea is poor stuff for a married man.
They mean well enough, but I have seen too many lonely skippers
and mates raising hell ashore.”
“Don’t you swear in this house, Richard. And I advise you to
beware of low company. Sailors who have been properly brought up
are true to their sweethearts and wives, like all decent folks.”
“Yes’m,” murmured her worldly young giant. “If Bill ground the
axe, as I told him to, I guess I’ll go and cut two or three cords of
that pine growth. I need to limber up.”
“Then please stop at the gate and get the mail, Richard. It must
be in the box by this time. And don’t you let that axe slip and cut
your foot. I know you’re a wonderful chopper, just like your father,
but I always fret—”
“Aye, mother. You never saw a man so careful of his own skin. At
sea, now, I run no risks at all.”
“Richard, you are joking. Please don’t cross the pond. The ice is
melted thin and rotten with this February thaw. You might fall in and
catch your death o’ cold.”
Chief Officer Cary, veteran of the North Atlantic trade, promised
to avoid getting wet in the pond. Axe on his shoulder, he passed
through the lane to the highway. In the box nailed to a gatepost he
found a letter from a seafaring friend in New York. It appeared to
interest him. After a hasty glance, he read it with more care. What it
said was this:

My Dick:
dear

I don’t know what your plans are. If you have a job


already cinched you are a lucky stiff. You can’t throw a brick
in this port without hitting an idle shipmaster. So far I
haven’t been chucked on the beach. The port captain of the
Union Fruit Company is an old friend of mine. I told him
about you yesterday. He needs a second officer in a
passenger boat, the Tarragona, on the run to Kingston,
Cartagena, and so on. Fine people to work for. None better.
You may turn up your nose at the notion of going second
mate, but they can’t keep a good man down. The
Tarragona sails next Wednesday. Wire me if you care to run
down and size it up. Better come early and avoid the rush.
The Spanish Main ahoy!
Faithfully yours
L. J. P.

Richard Cary let the axe rest against the gate while he pondered
in his deliberate fashion. At first it had annoyed him to think of
stepping down a peg. He had been looking forward to command in
two or three years more. But times were hard and the tenure of
employment in cargo steamers uncertain. He might be shifting
about, from one company to another, and if freight rates dropped
much lower he would be likely to join the luckless mob of stranded
officers.
There was a prospect of advancement in the Union Fruit
Company’s service. A second mate’s pay would meet his modest
needs, with a surplus to send home. An easier life, decent men to
handle, a smart, efficient ship—these were arguments not to be
tossed aside. So much for the practical aspect of it. This was
overshadowed, however, by the desire to make the southern run. It
was more like an urgent impulse. Until now, voyaging in the tropic
zones had never appealed to him. He had a Western Ocean sailor’s
pride in fighting bitter gales and pounding seas.
Rather puzzled by his quick surrender to this summons, he
turned back to the house and forgot to pick up the axe. He walked
briskly, chin up, a man astir and efficient. Queer how a few lines of
that letter had thrilled his matter-of-fact mind! He liked the sound of
Cartagena and the Spanish Main. Where the devil was Cartagena?
He knew there was a port of that name on the coast of Spain. This
other one was somewhere in the Caribbean, down Colombia way, as
he vaguely recalled.
Into the kitchen swung Richard Cary and demanded to know
where the atlas was kept. His mother wiped the flour from her hands
and exclaimed:
“First time I ever saw you in a hurry about anything except your
meals. What under the sun ails you?”
“Outward bound—the night train for New York. I want to find out
where I go from there.” His mellow voice rang through the low-
studded rooms. His mother was dismayed. The sea had called her
towering son and he was a different being. Almost timidly she said:
“But you expected to make a longer visit, Richard. Why, you
aren’t really rested up. You sat around here—”
“And enjoyed every minute of it,” he broke in, with a boyish
laugh. “Now I’m going south in a banana boat, where the flying
fishes play. Do I have to pull this house down to break out the
atlas?”
“Mercy sakes, no! It’s under the Bible on the parlor table where it
has set for years. There’s yellow fever and snakes down there, and
how are you off for summer underwear?”
With his chin in his hand he pored over the map of the Caribbean
and the sailing tracks across that storied sea. Jamaica and the
Isthmus of Panama! Thence his finger moved along the coast to
Cartagena and Santa Marta and La Guayra. His kindled fancy played
around the words. They were like haunting melody. It was an
emotion curiously novel. To find anything like it, he had to hark back
to the fairy tales of childhood.
The feeling passed. His mother’s anxious accents recalled him to
himself.
“But is it necessary, Richard, for you to rush off and take a
second officer’s position? Why don’t you wait for something better?
It’s not a mite like you to fly off at a tangent like this. Common
sense was always your strongest point.”
“This is just the berth I want, I tell you,” said he. “It sounds new
and interesting. Now if you will help me get my dunnage together—
clean clothes and so on—where’s Bill?”
“Gone to the village on an errand, Richard,” was the meek
answer. “He will be back in plenty of time to drive you to the train.
Well, I’ve seen you wake up for once. Is this the way you boss men
around on a ship?”
“For Heaven’s sake, I didn’t mean to sound rough, mother dear. I
can move lively when something has to be done. And I don’t want to
lose the chance of sailing in this Tarragona.”
The details of departure arranged, he resumed his wonted
humor, care-free and easy. His mother wept a little when the sound
of sleigh-bells heralded the approach of William in the pung. There
had been other partings like this, however, and she briskly waved a
handkerchief from a window as he rode away. She still had her
qualms about those outlandish ports, but he had solemnly sworn to
shake the scorpions out of his shoes before putting them on, and
this gave her some small comfort.
Young William fired a volley of questions on the road to the
station, but his big brother had little to say. The spell of the
Caribbean had faded. It was merely another job in a different ship.
This lazy reticence irritated William who burst out:
“Sometimes you act as if you were dead from the neck up, Dick.
You go to sleep in your tracks like a regular dumb-bell. Where’s your
pep and punch if you’re such a blamed good officer? I’m entitled to
talk plain, seeing as it’s all in the family. Don’t you ever get mad?”
“Quite peevish at times, Bill. There was a cabin steward last
voyage who brought me cold water to shave with, two days running.
I hated to do it, but I had to beat him to death with a hairbrush and
throw his body overboard. He left a wife and seven children in
Sweden and begged piteously for his life. Discipline, Bill! You have
simply got to enforce it.”
William snorted with disgust. He was off this big lump of a
brother, he said to himself, who treated him like a silly kid. The train
was late, and while they waited at the station a stray dog wandered
along the platform. It was no vagrant cur, but a handsome collie
which had somehow lost its master and was earnestly trying to find
him. The plight was enough to inspire sympathy in the heart of any
man that loved a good dog.
“Take him home and keep him until you can ’phone around and
stick up a notice in the post-office, Bill,” said Richard Cary.
Before William could catch the collie, the express train came
thundering down. One of the loungers on the platform emitted a
loud guffaw and tossed a bit of stick between the rails of the track.
The collie rushed to retrieve it. Richard Cary cursed the man and
yelled at the dog which bravely snatched the stick and fled to safety,
escaping destruction by no more than the length of its plumed tail. It
stood quivering in every nerve, nuzzling Richard’s hand.
“Put my bags aboard, Bill,” said the mariner. “I have a little
business to attend to. It will take only a minute.”
William concluded to hover within sight and sound. His brother’s
face was white as he moved closer to the man who had attempted
to slay a dog in wanton sport. The offender was heavily built, with a
truculent air, a stranger to the village. His coarse visage reflected
alarm, but before he could fight or retreat his right arm was caught
and twisted back in a grip that made him scream with pain.
A bone snapped. It would be some time before he could throw
sticks with that right arm. Beside himself with rage and anguish, he
bellowed foul abuse.
“Shut your dirty mouth,” commanded Richard Cary. “You are
getting off easy.”
The tortured blackguard was given time to utter one more
obscene insult. An open palm smote his face. It was a buffet so
tremendous that the victim was fairly lifted from his feet. He pitched
into the snow at the edge of the platform and lay huddled without
motion.
“Good God-amighty, Dick, you busted that guy’s neck,” gasped
William as he tugged at his brother’s sleeve. “And all you did was
slap him. If you want to hop this train, you’d better hustle.”
“Broke his neck? No such luck,” growled Richard. “If he wants to
see me again, tell him to wait till I come back. All right, Bill. Let’s
go.”
He stooped to pat the head of the affectionate collie and ran to
swing on board of the moving train. William had a farewell glimpse
of his face at the window. Again it was ruddy and good-humored.
The smile was a little wistful, almost like that of a boy leaving home
for the first time. The younger brother stood staring after the train.
His thoughts were confused. Presently he said to himself:
“Looks to me like there is a good deal for us to learn about Dick.
You don’t catch me sassin’ him again. I certainly did run an awful
risk when I called him a dumb-bell. Come on, pup. He told me to lug
you home and I feel darn particular about obeyin’ orders.”
CHAPTER II
THE SEA DOGS OF DEVON
The Tarragona, of the Union Fruit Company’s fleet, was steaming
to the southward, away from harsh winds and ice-fettered harbors.
It was sheer magic, this sea change that brought the sweet airs of
the tropics to caress the white ship when she was no more than
three days out from Sandy Hook. Passengers whose only business
was to seek amusement loafed on the immaculate decks or
besought the nimble bartender to mix one more round of planter’s
punches. The three-mile limit was another discomfort which had
been left far astern.
To the second officer, Richard Cary, it was like a yachting cruise.
He was adjusting himself to this unfamiliar kind of sailoring. In a
uniform of snowy duck he stood his watches on the bridge or
occupied himself with the tasks of keeping the ship as smart and
clean as eternal vigilance could make her. It resembled dining in a
gayly crowded hotel to take his seat at one of the small tables in the
saloon and listen, with an ingenuous interest, to the chatter of these
voyagers who had embarked for an idle holiday on the blue
Caribbean. Among them were girls, adept at flirtation and not at all
coy, who regarded this big, fair-haired second officer with glances
frankly admiring. He was by all odds the most intriguing young man
aboard the Tarragona.
His lazy indifference was provoking. When asked a question on
deck he replied with a boyish smile and a courteous word or two,
but could not be persuaded to linger. In his own opinion he was not
hired to entertain the passengers. Leave that nonsense to the
skipper. He had all the time in the world and seemed to enjoy
making a favorite of himself.
Captain Jordan Sterry was a man past fifty years old, but
reluctant to admit it. A competent seaman of long service in the
company’s employ, he had a sociable disposition and could tell a
good story. Sturdy and erect, his grayish hair and mustache close-
cropped, he looked the part of the veteran shipmaster. He had one
weakness, not unknown among men of his years. He preferred the
society of women very much younger than himself. This expressed
itself in a manner gallantly attentive to the bored young person who
could find nobody else on board to play with, or to the audacious
flapper who liked them well seasoned by experience and felt
immensely flattered at attracting the notice of the spruce master of
the Tarragona.
His attitude was nicely paternal. He deluded himself into
believing that onlookers accepted it as such. In this respect Captain
Jordan Sterry was not unique.
Richard Cary had an observant eye and a sense of humor. When
he appeared sluggish, it was merely the sensible avoidance of waste
motion of mind and body. He read the philandering skipper through
and through and felt a healthy contempt for the soft streak in him,
harmless enough, perhaps, but proof that there is no fool like an old
fool. The man had been young once. Presumably he had had his
fling. Why try to clutch at something that was gone, that had
vanished as utterly as the froth of a wave? It was more than absurd.
To Richard Cary, secure in the splendid twenties, unable to imagine
himself as ever growing old, the skipper’s rebellion against the
inevitable was almost grotesque.
Professionally no flaws could be found in Captain Sterry’s
conduct. He ruled his ship with a firm hand, dealt justly with his
officers, and was quick to note inefficiency. In all ways the Tarragona
was a crack ship. It was to Richard Cary’s credit that the captain
already approved of him. In fact, he was as cordial as the difference
in rank permitted.
The chief officer was a sun-dried, silent down-easter who had
found it slow climbing the ladder of promotion. He was always
hoping for a command, yet somehow missing it. Dependable,
incredibly industrious, he lacked the spark of initiative, the essential
quality of leadership. Disappointment had soured him. He nursed his
grievances and wished he were fitted for a decent job ashore.
After trying in vain to break through his crust, Richard Cary
sought companionship elsewhere. He found it in the chief engineer,
an extraordinary Englishman named McClement whose cabin was
filled with books: history, philosophy, poetry; fiction translated from
the French and Russian. There he sat and read by the hour, shirt
stripped off, electric fan purring, a cold bottle of beer at his elbow.
Half a dozen assistant engineers stood their watches down where
the oil burners roared in the furnaces and the huge piston rods
whirled the gleaming crank shafts. If anything went wrong, the chief
engineer appeared swiftly, clad in disreputable overalls, and his
speech was rugged Anglo-Saxon, of a quality requiring expurgation.
Now and then he strolled on deck of an evening, a lean,
abstracted figure in spotless white clothes, hands clasped behind
him, eyeing the capers of frivolous humankind with a certain cynical
tolerance. They were as God had made them, but it was a bungled
job. He ate most of his meals in his room, a book propped behind
the tray. In this manner he evaded the affliction of mingling with
tired business men and vivacious ladies eager to visit the engine
room.
Richard Cary drifted into this McClement’s quarters by invitation,
found a chair strong enough to hold him, and filled a blackened pipe
from a jar on the desk. As usual he had not a great deal to say, but
was amiability itself. He was content to sit and smoke and speak
when spoken to. This pleased his host who read aloud choice bits of
things and made pungent comments. The visitor borrowed a book
and came again. They got on famously together because in
temperament they were so curiously unlike.
On a clear day the ship sighted the lofty mountain range of
Jamaica and steered to make her landfall for the harbor of Kingston.
She drew near to the coast in the late afternoon. The breeze
brought the heavy scents of the tropical verdure, of lush mountain
vales, and the wet jungle. Richard Cary was on watch. Instead of
standing at the bridge railing, with his calm and solid composure, he
walked to and fro in a mood oddly restless. Intently he stared at the
lofty slopes all clothed in living green, the tiny waterfalls bedecking
them like flashes of silver lace.
He snuffed the air, so very different from the sea winds. The
tropic island of Jamaica was strange to him, and yet it seemed
vaguely, elusively familiar, as though he had beheld it while asleep
and dreaming. The chief officer relieved him, but he lingered on the
boat deck to see the black pilot come aboard from a dugout canoe.
The steamer forged ahead again and passed into the harbor. The
mountains loomed beyond the huddled roofs of Kingston. On the
starboard side was a low, sandy point upon which were the trim,
red-tiled bungalows of the quarantine station. The Tarragona paused
again, to wait for the British health officer.
McClement, the chief engineer, climbed to the boat deck and
said, as he joined Richard Cary:
“Port Royal yonder! No more than a sandbank now. The old town
was sunk by an earthquake long ago. If you poke about in a small
boat, they say you can see the stone walls of the houses down
under the clear water. It was a famous resort of pirates and such
gentry in the roaring days of the Spanish Main. Rum and loot,
women and sin! All that made life worth living.”
“Port Royal?” exclaimed Cary. “I’m sure I have heard something
about Port Royal. All gone, eh, Mac? Scuppered for their crimes.
Served ’em right. A bad lot.”
“Very rotten, Dick, but they had certain virtues which the modern
buccaneers of industry lack. We have two or three of these aboard.
They never risked their skins to bag their plunder.”
Second Officer Cary muttered something and walked to the edge
of the deck to peer down into the bright green water as if expecting
to see the flickering phantoms of the wild sea rovers of the lost Port
Royal. His blue eyes were bright with an ardent interest. McClement
remarked, with a quizzical grin:
“I haven’t seen you really awake before now. What touched you
off? Pirate yarns you read when you were a kid?”
“Perhaps so, Mac. I had this feeling once before. It was when I
got word from a pal in New York, telling me about this job, that it
was on the run to Cartagena. What is Cartagena like?”
“Wait and see it, my boy. Cartagena is a vision of vanished
adventures, a gorgeous old Spanish treasure town preserved, by a
sort of miracle, through three hundred years. Romance, color,
tradition? It makes the days of the tall galleons and the bold sea
dogs live again.”
“Tell me more about it,” demanded Richard Cary. His voice rolled
out in a deep and masterful note.
“Come down to my room after the ship docks and I’ll give you
some books to read, Kingsley’s ‘Westward Ho,’ Hakluyt’s ‘Voyages,’
and Captain Burney’s ‘History of the Buccaneers of America.’ ”
Some small sound in the engine-room far below them diverted
McClement’s attention. His perception of such things was uncannily
acute. He vanished instantly down the nearest stairway. Richard Cary
also found work to do. This broke the spell of his day-dreaming. It
did not recur to him during the Tarragona’s brief stay at Kingston. In
the evening he was on duty at the cargo hatches while the
passengers swarmed ashore to find entertainment at the excessively
modern and luxurious hotel.
He had leisure to saunter a little way from the wharf, but felt no
desire to explore Kingston. It was quite common-place, the streets
noisy with electric cars and automobiles, the brick and wooden
buildings as cheap and unlovely as those of any American town.
Several charming young passengers failed to persuade him to join a
party at the hotel where an orchestra was jazzing it, and he also
declined, with due caution, the hospitality of thirsty voyagers who
were making a night of it.
Returning to the ship, he went to his room at midnight and
picked up the chief engineer’s books instead of turning in. Presently
he found himself fascinated. For the sake of comfort he shifted into
pajamas and lay stretched in the bunk. The ship’s bell tolled one
half-hour after another and he was still reading. These printed pages
were a key that unlocked the gates of enchantment. Now and then
he lost himself in absorbed reverie.
These chronicles of hazards and escapes and hard fighting in the
waters that washed the Spanish Main had been derived from
documents, from the robust memoirs of men whose bones had
crumbled in a century now dim and dead. The rich ports whose walls
they had stormed with a bravado that defied all odds were no more
than fragments of ruined masonry submerged in the jungle growth,
Nombre de Dios, Porto Bello, and old Panama, names that still
reëcho like the brazen blare of trumpets.
All gone save Cartagena, reflected Richard Cary. Cartagena still
basking by the sea to recall that day when Francis Drake and his
Devon lads had stormed it with the naked sword.
At length this brawny second mate of the Tarragona laid the
books aside. Dawn was brightening the windows of his room. He
thrust his bare feet into straw slippers and went on deck to loaf in
the fresh morning air. His head was buzzing. He felt fatigued,
although as a mariner he was hardened to wakeful nights.
In fancy he had been sailing, fighting, and carousing with those
ferocious freebooters of the Caribbean. They seemed as real to him
as the plodding, slow-spoken farmers of the New Hampshire soil on
which he had been raised. Those clumsy, high-pooped ships with the
bellying sails and gaudy pennants were as clearly etched in his mind
as the stone walls, the square white houses, and the dark
woodlands of his native countryside.
Confound the chief engineer’s books, he said to himself. They
had turned his brain all topsy-turvy.
These impressions slowly faded until the Tarragona had sailed
from Kingston and was steaming across that wide waste of sea that
rolls between Jamaica and the Spanish Main. Strong winds were
almost always blowing there, whistling through a ship’s stays,
whipping the blue surface into foaming surges, with clear skies and
hot sunshine. The Tarragona reeled to the swing of these restless
seas, and the spray pelted her decks in sparkling showers. The
passengers disliked it. Some of them uttered low moans and retired
to their rooms. There were vacant chairs in the dining-saloon,
regrets at having left the dry land of home, no matter how dry it
was.
Richard Cary enjoyed it. He was amazed that he had ever
regarded going to sea as drudgery. This part of the voyage appealed
to him with a peculiar zest. For the first time he loved the ocean.
This boisterous wind that blew beneath a hard bright sky, a cool
tang to it that tempered the tropic heat—he drew it deep into his
lungs, standing with arms folded across his mighty chest.
The astute chief engineer found something to interest him in the
behavior of his herculean young shipmate. They were walking the
deck together when McClement said, with his dry chuckle:
“Until we sighted Jamaica, Dick, you were majestic and quiet, like
the everlasting hills. I welcomed you as a benign influence in a world
of guff and jazz and nervous twitters. Now you fairly talk my head
off. It doesn’t bore me, mind you, but I find myself perplexed to
account for this flow of language. Were you bottled up all those
years, and has the cork just blown out?”
“Something like that, Mac,” rather sheepishly admitted Richard
Cary. “I can’t seem to help talking to you about the Spanish Main
and the hard-boiled lads that put it on the map. You know all that
stuff by heart, and I fairly eat it up.”
“Aye, Dick, you lick your chops over it. You have read every bally
book I could dig up. It is like a craving for strong drink.”
Cary did not appear to be listening. The wind was blowing
against his cheek. The deck was unsteady beneath his feet. Against
the ship’s side the crested waves crashed and broke.
“Can’t you see them, Mac?” was his resonant exclamation.
“Lubberly little vessels, as round as an apple, leaking like baskets,
rotten with fever—wallowing off to leeward when the wind drew
ahead? It was this same wind that blew them across this stretch of
sea to the Isthmus of Darien and Cartagena, that made it possible
for them to fetch the mainland. They had it on the beam, there and
back. It served the Spanish galleons as well as the Englishmen that
hunted them. Why, Mac, old man, the feel of this wind, now don’t
laugh at me, is enough to tell me more stories than I found in all
your musty old books.”
The chief engineer halted in his tracks. With a keener scrutiny
than usual he studied the candid, engaging features of Richard Cary,
the fearless vision, the resolute chin, the ruddy color, and the thatch
of yellow hair. Cary was conscious of this deliberate appraisal. He
flushed under it. McClement took another turn along the deck before
halting to ask a question:
“Do you resemble the rest of the family, Dick?”
“Absolutely not. My dad used to say I was a throwback, and a
long throw at that.”
“Precisely. That is what I am driving at. New England rural stock,
you told me. English on both sides, I presume. Where did your
forbears come from?”
“Devonshire, all of them,” answered Cary. “My mother’s folks
came over from Plymouth a couple of hundred years ago and settled
near where they live now. My father’s ancestors came later, just
before the Revolution. They hailed from a little village near Bideford,
so I used to hear him say.”
“From Devon?” exclaimed McClement, who did not appear greatly
surprised. “The Carys of Devon! And your mother was—”
“A Chichester,” said Richard.
“Carys and Chichesters, of course, Dick. And you are the living
image of Amyas Leigh in ‘Westward Ho’! He must have been about
your build and bulk. The kind of lad they bred in Devon when the
world was young!”
“Carys and Chichesters sailed with Drake and Hawkins,” broke in
Richard, “in these same seas, and they fought the Spanish Armada
along with Walter Raleigh and Martin Frobisher. I found the names in
one of your books.”
“Aye, they did all of that and more too,” agreed the chief
engineer. “I am too hard-headed to take stock in any fantastic theory
of buried memories and such tosh as that. I’ll have to admit, though,
that you are a bit startling, Dick. It’s out of the question, of course,
that certain impressions and associations could have been handed
down through your race, to come to life in you.”
Inherited memories of the Spanish Main? Such a notion had not
occurred to Richard Cary. Fantastic enough, but his quickened
imagination laid hold of it.
“There must have been a Cary in one of the expeditions against
Cartagena, don’t you think, Mac?”
“My word, yes. You can bet your last dollar on that. Those stout
Devon lads were all over the shop, wherever there was a chance to
singe the beard of the king of Spain.”
“Then wouldn’t that account for the queer feeling that I have
been in these waters before? Why, the idea of sailing for Cartagena
made me tingle right down to my heels when I first heard of it.”
“Here, you can’t coax me into discussing anything like that, you
fine big brute,” protested McClement. “It won’t do at all. Do you
think you are a blooming reincarnation? Better come to my room
and have a drink and forget it.”
“Then how do you explain it?” was the stubborn question. “On
the level, I am getting worried about myself.”
“No occasion for it, Dick. You are a coincidence, in a way, and a
vastly interesting one. What ails you, however, is the spirit of
romance and adventure. You didn’t know you had it in you. Youth
often finds it in a first voyage to the tropics. I was that way myself.
And the Spanish Main has a beguiling magic of its own. Most of
these wild tales were fresh to you. Unconsciously you identified
yourself with them because you knew you were bred from that same
strain of Elizabethan seamen.”
“Have it your own way,” rather sulkily agreed Richard Cary, “but
there is more to this than you can figure out, as wise as you are.”
McClement had implanted a suggestion which oddly lingered in
Cary’s thoughts and colored them with strange conjectures. Who or
what was the real Richard Cary? The brawny rover of Devon who
had diced with the devil and the deep sea, or the prosaic son of New
Hampshire farming folk who had viewed seafaring as a means of
earning his bread?
“Two Richard Carys,” reflected this second officer of the
Tarragona. “All my life I may have been a mixture of both and didn’t
know it. When I got sore at something and cleared for action, like
wading into that bunch of fo’castle outlaws on the last Western
Ocean voyage, I must have been the big Dick Cary of Devon that
found his fun in walloping the Spaniards.”
His meditations trailed off into nebulous realms, into a haze of
conjectures and dreams and anticipations. Instead of taking each
day as it came, he found himself looking forward to something. It
seemed to be beckoning him. Somewhere in these romantic seas,
adventure awaited him. The chief engineer read aloud a poem that
matched this new mood. Richard Cary listened with a smile on his
face.
“Could man be drunk forever
With liquor, love or fights,
Lief should I rouse at morning
And lief lie down of nights.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like