squake 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/LICENSE +21 -0
- data/README.md +19 -11
- data/lib/squake/config.rb +3 -1
- data/lib/squake/version.rb +1 -1
- data/lib/squake.rb +4 -1
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00325909416eb7545b395e8a0ffa0ee164b6c9ec125f5f9900c5f3efe7f1e058'
|
4
|
+
data.tar.gz: 003ce1f90f3e379f995169079672319a8a044db9f46684582a59d7c333b082d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '06795250b08b0b20e15d7283c7f29e9761a9f21a3553ed269f4c2b49bffee2afdae3d5143577ded233cafe1b86fde494471ef60363c635c8bcbd7d4cd9e2322c'
|
7
|
+
data.tar.gz: 6eebe00fa09b233feb52fc156e1bd7b922d4831d53e1da6f90381dbc9830d70f14e6ea935801cfc79f4ab328ff034ece20b8fde985433c07c6797d07cfe6fc19
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [0.2.0] - 2023-06-15
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
* request carbon emissions (without price quote)
|
15
|
+
|
16
|
+
## [0.1.0] - 2023-06-14
|
17
|
+
|
18
|
+
Initial release of an MVP/POC library. Only v2 of the SQUAKE API is supported.
|
19
|
+
|
20
|
+
### Added
|
21
|
+
|
22
|
+
* request carbon emission and price quote
|
23
|
+
* make a purchase
|
24
|
+
* retrieve a purchase
|
25
|
+
* cancel a purchase
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 squake-earth
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -4,20 +4,16 @@ Find the documentation here: [docs](https://docs.squake.earth/).
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Via
|
7
|
+
Via rubygems:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
|
11
|
-
|
12
|
-
gem 'squake', git: 'git@github.com:squake-earth/squake-ruby'
|
10
|
+
gem 'squake'
|
13
11
|
```
|
14
12
|
|
15
|
-
Via
|
13
|
+
Via git:
|
16
14
|
|
17
15
|
```ruby
|
18
|
-
|
19
|
-
|
20
|
-
gem 'squake', '~> 0.1.0'
|
16
|
+
gem 'squake', git: 'git@github.com:squake-earth/squake-ruby'
|
21
17
|
```
|
22
18
|
|
23
19
|
## Auth
|
@@ -28,7 +24,7 @@ You need a different API Key for production and sandbox.
|
|
28
24
|
## Functionality
|
29
25
|
|
30
26
|
* compute emission values
|
31
|
-
* request a price quote (with a product id)
|
27
|
+
* request a price quote for your emissions (with a product id)
|
32
28
|
* place a purchase order (with a price quote id)
|
33
29
|
* get a list of all available products (includes price information)
|
34
30
|
|
@@ -129,6 +125,12 @@ Squake::Purchase.cancel(
|
|
129
125
|
)
|
130
126
|
```
|
131
127
|
|
128
|
+
## Contributions
|
129
|
+
|
130
|
+
We welcome contributions from the community. Before starting work on a major feature, please get in touch with us either via email or by opening an issue on GitHub. "Major feature" means anything that changes user-facing features or significant changes to the codebase itself.
|
131
|
+
|
132
|
+
Please commit small and focused PRs with descriptive commit messages. If you are unsure about a PR, please open a draft PR to get early feedback. A PR must have a short description ("what"), a motiviation ("why"), and, if applicable, instructions how to test the changes, measure performance improvements, etc.
|
133
|
+
|
132
134
|
## Publishing a new version
|
133
135
|
|
134
136
|
Have a Rubygems API key in your `~/.gem/credentials` file.
|
@@ -141,6 +143,12 @@ Have a Rubygems API key in your `~/.gem/credentials` file.
|
|
141
143
|
Then run:
|
142
144
|
|
143
145
|
```shell
|
144
|
-
|
145
|
-
gem push squake-0.1.0.gem --key=rubygems_squake
|
146
|
+
bin/release
|
146
147
|
```
|
148
|
+
|
149
|
+
which will guide you through the release process:
|
150
|
+
|
151
|
+
* create a new git tag from current main
|
152
|
+
* create a GitHub release from the tag
|
153
|
+
* build the gem locally
|
154
|
+
* publish the gem to RubyGems
|
data/lib/squake/config.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require 'logger'
|
5
|
+
|
4
6
|
module Squake
|
5
7
|
class Config < T::Struct
|
6
8
|
extend T::Sig
|
@@ -10,7 +12,7 @@ module Squake
|
|
10
12
|
|
11
13
|
const :api_key, String
|
12
14
|
const :keep_alive_timeout, Integer, default: 30
|
13
|
-
const :logger, Logger, factory: -> { Logger.new($stdout) }
|
15
|
+
const :logger, ::Logger, factory: -> { ::Logger.new($stdout) }
|
14
16
|
const :sandbox_mode, T::Boolean, default: true
|
15
17
|
const :enforced_api_base, T.nilable(String)
|
16
18
|
|
data/lib/squake/version.rb
CHANGED
data/lib/squake.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `ActiveSupport::Callbacks`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Callbacks`.
|
6
|
+
|
7
|
+
module ActiveSupport::Callbacks
|
8
|
+
include GeneratedInstanceMethods
|
9
|
+
|
10
|
+
mixes_in_class_methods GeneratedClassMethods
|
11
|
+
|
12
|
+
module GeneratedClassMethods
|
13
|
+
def __callbacks; end
|
14
|
+
def __callbacks=(value); end
|
15
|
+
def __callbacks?; end
|
16
|
+
end
|
17
|
+
|
18
|
+
module GeneratedInstanceMethods
|
19
|
+
def __callbacks; end
|
20
|
+
def __callbacks?; end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- SQUAKE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: net-http
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: oj
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: rubocop-dbl
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,6 +129,8 @@ executables: []
|
|
101
129
|
extensions: []
|
102
130
|
extra_rdoc_files: []
|
103
131
|
files:
|
132
|
+
- CHANGELOG.md
|
133
|
+
- LICENSE
|
104
134
|
- README.md
|
105
135
|
- lib/squake.rb
|
106
136
|
- lib/squake/api_error.rb
|
@@ -121,6 +151,7 @@ files:
|
|
121
151
|
- lib/squake/response.rb
|
122
152
|
- lib/squake/util.rb
|
123
153
|
- lib/squake/version.rb
|
154
|
+
- sorbet/rbi/dsl/active_support/callbacks.rbi
|
124
155
|
homepage: https://github.com/squake-earth/squake-ruby
|
125
156
|
licenses:
|
126
157
|
- MIT
|