Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zyc9012 committed Oct 20, 2023
1 parent 16b7728 commit 46dd924
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
name: Ruby ${{ matrix.ruby-version }}
strategy:
matrix:
ruby-version: ['1.9', '2.0', '2.6', '2.7', '3.0', '3.1', '3.2']
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

source "https://rubygems.org"

# Specify your gem's dependencies in google_maps_pb_decoder.gemspec
gemspec

gem "rake", "~> 13.0"

gem "minitest", "~> 5.0"
gem "rake"
gem "minitest"
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# google-maps-pb-decoder

[![CI](https://github.com/serpapi/google-maps-pb-decoder/actions/workflows/main.yml/badge.svg)](https://github.com/serpapi/google-maps-pb-decoder/actions/workflows/main.yml)

Decodes the protobuf parameters used in Google Maps into readable JSON for easy inspection and debugging.

## Installation
Expand All @@ -20,15 +22,17 @@ gem install google_maps_pb_decoder

## Usage

google_maps_pb_decoder \<pb_encoded_string\>
```
google_maps_pb_decoder <pb_encoded_string>
```

For example:

```
google_maps_pb_decoder '!3m1!4b1!4m6!3m5!1s0x80dcd7d12b3b5e6b:0x2ef62f8418225cfa!8m2!3d33.8120918!4d-117.9189742!16zL20vMDJmenM'
```

Outputs:
Output:
```
[[true], [["0x80dcd7d12b3b5e6b:0x2ef62f8418225cfa", [33.8120918, -117.9189742], "L20vMDJmenM"]]]
```
Expand Down
10 changes: 7 additions & 3 deletions google_maps_pb_decoder.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require_relative "lib/google_maps_pb_decoder/version"
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "google_maps_pb_decoder/version"

Gem::Specification.new do |spec|
spec.name = "google_maps_pb_decoder"
Expand All @@ -14,8 +15,11 @@ Gem::Specification.new do |spec|
spec.license = "MIT"
spec.required_ruby_version = ">= 1.9"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
if spec.responds_to?(:metadata)
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
end

spec.files = Dir.glob("lib/**/*.rb")
spec.bindir = "exe"
spec.executables = ["google_maps_pb_decoder"]
Expand Down
2 changes: 1 addition & 1 deletion lib/google_maps_pb_decoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.decode(str)

parts.each do |e|
match = e.match(/\d+([a-z])(.*)/)
if match&.size != 3
if match && match.size != 3
raise InvalidParameterError.new
end

Expand Down

0 comments on commit 46dd924

Please sign in to comment.