Skip to content

Commit

Permalink
Renames master to main
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 9, 2021
1 parent d12d812 commit 835ea07
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/2.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Ruby 2.4
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
branches:
- '*'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/2.5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Ruby 2.5
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
branches:
- '*'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/2.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Ruby 2.6
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
branches:
- '*'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/2.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Ruby 2.7
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
branches:
- '*'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: JRuby
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
branches:
- '*'
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ gem 'elasticsearch-rails', github: 'elastic/elasticsearch-rails', branch: '5.x'

The libraries are compatible with Ruby 2.4 and higher.

The version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
The version numbers follow the Elasticsearch major versions. The `main` branch is compatible with the latest Elasticsearch stack stable release.

| Rubygem | | Elasticsearch |
|:-------------:|:-:| :-----------: |
| 0.1 || 1.x |
| 2.x || 2.x |
| 5.x || 5.x |
| 6.x || 6.x |
| master || 7.x |
| main || 7.x |

Use a release that matches the major version of Elasticsearch in your stack. Each client version is backwards compatible with all minor versions of the same major version.

Expand All @@ -58,13 +58,13 @@ Check out [Elastic product end of life dates](https://www.elastic.co/support/eol

This project is split into three separate gems:

* [**`elasticsearch-model`**](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model),
* [**`elasticsearch-model`**](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-model),
which contains search integration for Ruby/Rails models such as ActiveRecord::Base and Mongoid,

* [**`elasticsearch-persistence`**](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-persistence),
* [**`elasticsearch-persistence`**](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-persistence),
which provides a standalone persistence layer for Ruby/Rails objects and models

* [**`elasticsearch-rails`**](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails),
* [**`elasticsearch-rails`**](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-rails),
which contains various features for Ruby on Rails applications

Example of a basic integration into an ActiveRecord-based model:
Expand All @@ -87,7 +87,7 @@ Article.import
```

You can generate a simple Ruby on Rails application with a single command
(see the [other available templates](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails#rails-application-templates)). You'll need to have an Elasticsearch cluster running on your system before generating the app. The easiest way of getting this set up is by running it with Docker with this command:
(see the [other available templates](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-rails#rails-application-templates)). You'll need to have an Elasticsearch cluster running on your system before generating the app. The easiest way of getting this set up is by running it with Docker with this command:

```bash
docker run \
Expand All @@ -103,7 +103,7 @@ You can generate a simple Ruby on Rails application with a single command
Once Elasticsearch is running, you can generate the simple app with this command:

```bash
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/01-basic.rb
```

Example of using Elasticsearch as a repository for a Ruby domain object:
Expand All @@ -125,21 +125,21 @@ repository.save Article.new(title: 'Test')

### Model

* [[README]](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-model/README.md)
* [[README]](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-model/README.md)
* [[Documentation]](http://rubydoc.info/gems/elasticsearch-model/)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model/spec/elasticsearch/model)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-model/spec/elasticsearch/model)

### Persistence

* [[README]](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-persistence/README.md)
* [[README]](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-persistence/README.md)
* [[Documentation]](http://rubydoc.info/gems/elasticsearch-persistence/)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-persistence/spec)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-persistence/spec)

### Rails

* [[README]](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/README.md)
* [[README]](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-rails/README.md)
* [[Documentation]](http://rubydoc.info/gems/elasticsearch-rails)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails/spec)
* [[Test Suite]](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-rails/spec)

## Development

Expand Down
12 changes: 6 additions & 6 deletions elasticsearch-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ It aims to simplify integration of Ruby classes ("models"), commonly found e.g.

This library is compatible with Ruby 2.4 and higher.

The library version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
The library version numbers follow the Elasticsearch major versions. The `main` branch is compatible with the latest Elasticsearch stack stable release.

| Rubygem | | Elasticsearch |
|:-------------:|:-:| :-----------: |
| 0.1 || 1.x |
| 2.x || 2.x |
| 5.x || 5.x |
| 6.x || 6.x |
| master || 7.x |
| main || 7.x |

## Installation

Expand Down Expand Up @@ -116,7 +116,7 @@ See the `Elasticsearch::Model` module documentation for technical information.

### The Elasticsearch client

The module will set up a [client](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch),
The module will set up a [client](https://github.com/elastic/elasticsearch-ruby/tree/main/elasticsearch),
connected to `localhost:9200`, by default. You can access and use it as any other `Elasticsearch::Client`:

```ruby
Expand All @@ -139,7 +139,7 @@ Elasticsearch::Model.client = Elasticsearch::Client.new log: true
You might want to do this during your application bootstrap process, e.g. in a Rails initializer.

Please refer to the
[`elasticsearch-transport`](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-transport)
[`elasticsearch-transport`](https://github.com/elastic/elasticsearch-ruby/tree/main/elasticsearch-transport)
library documentation for all the configuration options, and to the
[`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api) library documentation
for information about the Ruby client API.
Expand Down Expand Up @@ -248,7 +248,7 @@ response.records.order(:title).to_a
The `records` method returns the real instances of your model, which is useful when you want to access your
model methods -- at the expense of slowing down your application, of course.
In most cases, working with `results` coming from Elasticsearch is sufficient, and much faster. See the
[`elasticsearch-rails`](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails)
[`elasticsearch-rails`](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-rails)
library for more information about compatibility with the Ruby on Rails framework.

When you want to access both the database `records` and search `results`, use the `each_with_hit`
Expand Down Expand Up @@ -343,7 +343,7 @@ response.results.first.title
# => "Quick brown fox"
```

Also, you can use the [**`elasticsearch-dsl`**](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl) library, which provides a specialized Ruby API for the Elasticsearch Query DSL:
Also, you can use the [**`elasticsearch-dsl`**](https://github.com/elastic/elasticsearch-ruby/tree/main/elasticsearch-dsl) library, which provides a specialized Ruby API for the Elasticsearch Query DSL:

```ruby
require 'elasticsearch/dsl'
Expand Down
4 changes: 2 additions & 2 deletions elasticsearch-persistence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Persistence layer for Ruby domain objects in Elasticsearch, using the Repository

This library is compatible with Ruby 2.4 and higher.

The library version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
The library version numbers follow the Elasticsearch major versions. The `main` branch is compatible with the latest Elasticsearch stack stable release.

| Rubygem | | Elasticsearch |
|:-------------:|:-:| :-----------: |
| 0.1 || 1.x |
| 2.x || 2.x |
| 5.x || 5.x |
| 6.x || 6.x |
| master || 7.x |
| main || 7.x |

## Installation

Expand Down
18 changes: 9 additions & 9 deletions elasticsearch-rails/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Elasticsearch::Rails

The `elasticsearch-rails` library is a companion for the
the [`elasticsearch-model`](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model)
the [`elasticsearch-model`](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-model)
library, providing features suitable for Ruby on Rails applications.

## Compatibility

This library is compatible with Ruby 1.9.3 and higher.

The library version numbers follow the Elasticsearch major versions, and the `master` branch
The library version numbers follow the Elasticsearch major versions, and the `main` branch
is compatible with the Elasticsearch `master` branch, therefore, with the next major version.

| Rubygem | | Elasticsearch |
Expand All @@ -18,7 +18,7 @@ is compatible with the Elasticsearch `master` branch, therefore, with the next m
| 5.x || 5.x |
| 6.x || 6.x |
| 7.x || 7.x |
| master || master |
| main || master |

## Installation

Expand Down Expand Up @@ -101,30 +101,30 @@ You should see the duration of the request to Elasticsearch as part of each log
You can generate a fully working example Ruby on Rails application, with an `Article` model and a search form,
to play with (it generates the application skeleton and leaves you with a _Git_ repository to explore the
steps and the code) with the
[`01-basic.rb`](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/lib/rails/templates/01-basic.rb) template:
[`01-basic.rb`](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-rails/lib/rails/templates/01-basic.rb) template:

```bash
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/01-basic.rb
```

Run the same command again, in the same folder, with the
[`02-pretty`](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/lib/rails/templates/02-pretty.rb)
[`02-pretty`](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-rails/lib/rails/templates/02-pretty.rb)
template to add features such as a custom `Article.search` method, result highlighting and
[_Bootstrap_](http://getbootstrap.com) integration:

```bash
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/02-pretty.rb
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/02-pretty.rb
```

Run the same command with the [`03-expert.rb`](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/lib/rails/templates/03-expert.rb)
Run the same command with the [`03-expert.rb`](https://github.com/elastic/elasticsearch-rails/blob/main/elasticsearch-rails/lib/rails/templates/03-expert.rb)
template to refactor the application into a more complex use case,
with couple of hundreds of The New York Times articles as the example content.
The template will extract the Elasticsearch integration into a `Searchable` "concern" module,
define complex mapping, custom serialization, implement faceted navigation and suggestions as a part of
a complex query, and add a _Sidekiq_-based worker for updating the index in the background.

```bash
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/03-expert.rb
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/03-expert.rb
```

## License
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch-rails/elasticsearch-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.license = 'Apache 2'
s.metadata = {
'homepage_uri' => 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/ruby_on_rails.html',
'changelog_uri' => 'https://github.com/elastic/elasticsearch-rails/blob/master/CHANGELOG.md',
'changelog_uri' => 'https://github.com/elastic/elasticsearch-rails/blob/main/CHANGELOG.md',
'source_code_uri' => 'https://github.com/elastic/elasticsearch-rails/',
'bug_tracker_uri' => 'https://github.com/elastic/elasticsearch-rails/issues'
}
Expand Down
4 changes: 2 additions & 2 deletions elasticsearch-rails/lib/rails/templates/01-basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Usage:
# ------
#
# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb
# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/01-basic.rb
#
# =====================================================================================================

Expand Down Expand Up @@ -112,7 +112,7 @@
search engine with the {Ruby On Rails}[http://rubyonrails.org] web framework.
It has been generated by application templates available at
https://github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-rails/lib/rails/templates.
https://github.com/elasticsearch/elasticsearch-rails/tree/main/elasticsearch-rails/lib/rails/templates.
## [1] Basic
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch-rails/lib/rails/templates/02-pretty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/02-pretty.rb
# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/02-pretty.rb

unless File.read('README.md').include? '## [1] Basic'
say_status "ERROR", "You have to run the 01-basic.rb template first.", :red
Expand Down
Loading

0 comments on commit 835ea07

Please sign in to comment.