Skip to content

Commit 4df6d83

Browse files
committed
Separate development guide from README
1 parent 3b9ac4f commit 4df6d83

3 files changed

Lines changed: 32 additions & 145 deletions

File tree

DEVELOPMENT.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Developer Guide
2+
3+
## Key goals
4+
5+
- Brand centric instead of search engine based
6+
- No hard-coded logic per search engine
7+
- Simple HTTP client (lightweight, reduced dependency)
8+
- No magic default values
9+
- Thread safe
10+
- Easy extension
11+
- Defensive code style (raise a custom exception)
12+
- TDD - Test driven development
13+
- Best API coding practice per platform
14+
- KiSS principles
15+
16+
## Inspirations
17+
18+
This project source code and coding style was inspired by the most awesome Ruby Gems:
19+
- [bcrypt](https://github.com/bcrypt-ruby/bcrypt-ruby)
20+
- [Nokogiri](https://nokogiri.org)
21+
- [Cloudfare](https://rubygems.org/gems/cloudflare/versions/2.1.0)
22+
- [rest-client](https://rubygems.org/gems/rest-client)
23+
- [stripe](https://rubygems.org/gems/stripe)
24+
25+
## Code quality expectations
26+
27+
- 0 lint offense: `rake lint`
28+
- 100% tests passing: `rake test`
29+
- 100% code coverage: `rake coverage` (simple-cov)

README.md

Lines changed: 3 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,79 +1097,10 @@ Most notable improvements:
10971097

10981098
Ruby 2.7 and higher is supported.
10991099

1100-
## Developer Guide
1101-
### Key goals
1102-
- Brand centric instead of search engine based
1103-
- No hard-coded logic per search engine
1104-
- Simple HTTP client (lightweight, reduced dependency)
1105-
- No magic default values
1106-
- Thread safe
1107-
- Easy extension
1108-
- Defensive code style (raise a custom exception)
1109-
- TDD - Test driven development
1110-
- Best API coding practice per platform
1111-
- KiSS principles
1112-
1113-
### Inspirations
1114-
This project source code and coding style was inspired by the most awesome Ruby Gems:
1115-
- [bcrypt](https://github.com/bcrypt-ruby/bcrypt-ruby)
1116-
- [Nokogiri](https://nokogiri.org)
1117-
- [Cloudfare](https://rubygems.org/gems/cloudflare/versions/2.1.0)
1118-
- [rest-client](https://rubygems.org/gems/rest-client)
1119-
- [stripe](https://rubygems.org/gems/stripe)
1120-
1121-
### Code quality expectations
1122-
- 0 lint offense: `rake lint`
1123-
- 100% tests passing: `rake test`
1124-
- 100% code coverage: `rake coverage` (simple-cov)
1125-
1126-
# Developer Guide
1127-
## Design : UML diagram
1128-
### Class diagram
1129-
```mermaid
1130-
classDiagram
1131-
Application *-- serpapi
1132-
serpapi *-- Client
1133-
class Client {
1134-
engine String
1135-
api_key String
1136-
params Hash
1137-
search() Hash
1138-
html() String
1139-
location() String
1140-
search_archive() Hash
1141-
account() Hash
1142-
}
1143-
openuri <.. Client
1144-
json <.. Client
1145-
Ruby <.. openuri
1146-
Ruby <.. json
1147-
```
1148-
### search() : Sequence diagram
1149-
```mermaid
1150-
sequenceDiagram
1151-
Client->>SerpApi.com: search() : http request
1152-
SerpApi.com-->>SerpApi.com: query search engine
1153-
SerpApi.com-->>SerpApi.com: parse HTML into JSON
1154-
SerpApi.com-->>Client: JSON string payload
1155-
Client-->>Client: decode JSON into Hash
1156-
```
1157-
where:
1158-
- The end user implements the application.
1159-
- Client refers to SerpApi:Client.
1160-
- SerpApi.com is the backend HTTP / REST service.
1161-
- Engine refers to Google, Baidu, Bing, and more.
1162-
1163-
The SerpApi.com service (backend)
1164-
- executes a scalable search on `engine: "google"` using the search query: `q: "coffee"`.
1165-
- parses the messy HTML responses from Google on the backend.
1166-
- returns a standardized JSON response.
1167-
The class SerpApi::Client (client side / ruby):
1168-
- Format the request to SerpApi.com server.
1169-
- Execute HTTP Get request.
1170-
- Parse JSON into Ruby Hash using a standard JSON library.
1171-
Et voila!
1100+
## Development
11721101

1102+
Contributions are welcome. Make sure to read our [development guide](./DEVELOPMENT.md).
1103+
11731104
## Continuous integration
11741105
We love [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) and [Test-Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) (TDD) at SerpApi.
11751106
We use RSpec and Github Actions to test our infrastructure around the clock, and that includes all changes to our clients.

README.md.erb

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -583,79 +583,6 @@ Ruby 2.7 and higher is supported.
583583
* [2025-07-18] 1.0.1 Add support for old Ruby versions (2.7, 3.0)
584584
* [2025-07-01] 1.0.0 Full API support
585585

586-
## Developer Guide
587-
### Key goals
588-
- Brand centric instead of search engine based
589-
- No hard-coded logic per search engine
590-
- Simple HTTP client (lightweight, reduced dependency)
591-
- No magic default values
592-
- Thread safe
593-
- Easy extension
594-
- Defensive code style (raise a custom exception)
595-
- TDD - Test driven development
596-
- Best API coding practice per platform
597-
- KiSS principles
598-
599-
### Inspirations
600-
This project source code and coding style was inspired by the most awesome Ruby Gems:
601-
- [bcrypt](https://github.com/bcrypt-ruby/bcrypt-ruby)
602-
- [Nokogiri](https://nokogiri.org)
603-
- [Cloudfare](https://rubygems.org/gems/cloudflare/versions/2.1.0)
604-
- [rest-client](https://rubygems.org/gems/rest-client)
605-
- [stripe](https://rubygems.org/gems/stripe)
606-
607-
### Code quality expectations
608-
- 0 lint offense: `rake lint`
609-
- 100% tests passing: `rake test`
610-
- 100% code coverage: `rake coverage` (simple-cov)
611-
612-
# Developer Guide
613-
## Design : UML diagram
614-
### Class diagram
615-
```mermaid
616-
classDiagram
617-
Application *-- serpapi
618-
serpapi *-- Client
619-
class Client {
620-
engine String
621-
api_key String
622-
params Hash
623-
search() Hash
624-
html() String
625-
location() String
626-
search_archive() Hash
627-
account() Hash
628-
}
629-
openuri <.. Client
630-
json <.. Client
631-
Ruby <.. openuri
632-
Ruby <.. json
633-
```
634-
### search() : Sequence diagram
635-
```mermaid
636-
sequenceDiagram
637-
Client->>SerpApi.com: search() : http request
638-
SerpApi.com-->>SerpApi.com: query search engine
639-
SerpApi.com-->>SerpApi.com: parse HTML into JSON
640-
SerpApi.com-->>Client: JSON string payload
641-
Client-->>Client: decode JSON into Hash
642-
```
643-
where:
644-
- The end user implements the application.
645-
- Client refers to SerpApi:Client.
646-
- SerpApi.com is the backend HTTP / REST service.
647-
- Engine refers to Google, Baidu, Bing, and more.
648-
649-
The SerpApi.com service (backend)
650-
- executes a scalable search on `engine: "google"` using the search query: `q: "coffee"`.
651-
- parses the messy HTML responses from Google on the backend.
652-
- returns a standardized JSON response.
653-
The class SerpApi::Client (client side / ruby):
654-
- Format the request to SerpApi.com server.
655-
- Execute HTTP Get request.
656-
- Parse JSON into Ruby Hash using a standard JSON library.
657-
Et voila!
658-
659586
## Continuous integration
660587
We love [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) and [Test-Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) (TDD) at SerpApi.
661588
We use RSpec and Github Actions to test our infrastructure around the clock, and that includes all changes to our clients.

0 commit comments

Comments
 (0)