binxtils 0.5.2 → 0.6.0
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/README.md +13 -2
- data/lib/binxtils/secure.rb +11 -0
- data/lib/binxtils/version.rb +1 -1
- data/lib/binxtils.rb +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d72b64353d985a2d1473b717fe1adff0e04c89af0d62ef6b5a1a1af9d274509
|
|
4
|
+
data.tar.gz: dc3707cc25fd903d65bddca88af6eeea7ea1e05abad11ae17f9f53b2afacc880
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 965dbfb38c5dc90180f92ebd1ca5a1403d39cc4688183c42ee474d859efc396387453eec0647ec04a67b57df64a10b05bf29b99294a5d72c2f6f4e80b35f1a9f
|
|
7
|
+
data.tar.gz: b3a516d70a73ae33f9d4486f23c292f6f644c4a341e591c07d83d67737813e1cda77b6f3649a268887bd6902e611cbabe83f0ae76c291ab339f825c790e365d4
|
data/README.md
CHANGED
|
@@ -9,6 +9,7 @@ gem "binxtils"
|
|
|
9
9
|
## Modules
|
|
10
10
|
|
|
11
11
|
- **Binxtils::InputNormalizer** - Sanitize and normalize user input strings
|
|
12
|
+
- **Binxtils::Secure** - Constant-time comparison of a value against an expected secret
|
|
12
13
|
- **Binxtils::TimeParser** - Parse fuzzy time/date strings into `Time` objects
|
|
13
14
|
- **Binxtils::TimeZoneParser** - Parse and resolve time zone strings
|
|
14
15
|
|
|
@@ -20,6 +21,7 @@ These modules use [Functionable](https://github.com/sethherr/functionable) and a
|
|
|
20
21
|
Binxtils::TimeParser.parse("next thursday")
|
|
21
22
|
Binxtils::InputNormalizer.string(" Some Input ")
|
|
22
23
|
Binxtils::TimeZoneParser.parse("Eastern Time")
|
|
24
|
+
Binxtils::Secure.compare?(params[:token], ENV["WEBHOOK_TOKEN"])
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
### Rails concerns
|
|
@@ -59,9 +61,18 @@ end
|
|
|
59
61
|
|
|
60
62
|
## npm package
|
|
61
63
|
|
|
62
|
-
This repo also publishes `@bikeindex/time-localizer`, an npm package for localizing time elements in the browser.
|
|
64
|
+
This repo also publishes `@bikeindex/time-localizer`, an npm package for localizing time elements in the browser. It ships two builds of the same source:
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
| Build | Luxon | Use when |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `dist/index.js` (default) | external — install it yourself | You have a bundler. Luxon stays deduped with your own copy, so `Settings.defaultLocale`, `Settings.now` etc. apply to both. |
|
|
69
|
+
| `dist/index.bundle.js` | bundled in | You have no bundler (e.g. importmap-rails). One request, nothing to resolve. |
|
|
70
|
+
|
|
71
|
+
Import the default as `@bikeindex/time-localizer` and the standalone as `@bikeindex/time-localizer/bundle`, or reference either file path directly over a CDN.
|
|
72
|
+
|
|
73
|
+
Don't use the bundled build alongside your own Luxon: you'd ship two copies, and because Luxon's `Settings` are module-scoped, your global config would silently apply to only one of them.
|
|
74
|
+
|
|
75
|
+
To publish a new version: update the version in `package.json`, then run `npm publish` from the repo root (requires npm login with access to the `@bikeindex` scope). The `prepublishOnly` script builds both artifacts before publishing.
|
|
65
76
|
|
|
66
77
|
## Releasing
|
|
67
78
|
|
data/lib/binxtils/version.rb
CHANGED
data/lib/binxtils.rb
CHANGED
|
@@ -4,10 +4,12 @@ require "functionable"
|
|
|
4
4
|
require "active_support"
|
|
5
5
|
require "active_support/core_ext"
|
|
6
6
|
require "active_record"
|
|
7
|
+
require "active_support/security_utils"
|
|
7
8
|
require "loofah"
|
|
8
9
|
require "rails-html-sanitizer"
|
|
9
10
|
|
|
10
11
|
require_relative "binxtils/input_normalizer"
|
|
12
|
+
require_relative "binxtils/secure"
|
|
11
13
|
require_relative "binxtils/time_zone_parser"
|
|
12
14
|
require_relative "binxtils/time_parser"
|
|
13
15
|
require "binxtils/set_period"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: binxtils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bike Index
|
|
@@ -81,6 +81,7 @@ files:
|
|
|
81
81
|
- lib/binxtils.rb
|
|
82
82
|
- lib/binxtils/engine.rb
|
|
83
83
|
- lib/binxtils/input_normalizer.rb
|
|
84
|
+
- lib/binxtils/secure.rb
|
|
84
85
|
- lib/binxtils/time_parser.rb
|
|
85
86
|
- lib/binxtils/time_zone_parser.rb
|
|
86
87
|
- lib/binxtils/version.rb
|