repo
string
pull_number
int64
instance_id
string
issue_numbers
list
base_commit
string
patch
string
test_patch
string
problem_statement
string
hints_text
string
created_at
timestamp[s]
language
string
label
string
prettier/plugin-ruby
802
prettier__plugin-ruby-802
[ "799", "801" ]
c4bf119fb0c3c90771e552b8cc99e89909f53608
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters sh...
diff --git a/test/js/ruby/comments.test.js b/test/js/ruby/comments.test.js --- a/test/js/ruby/comments.test.js +++ b/test/js/ruby/comments.test.js @@ -237,4 +237,15 @@ describe("comments", () => { return expect(content).toMatchFormat(); }); }); + + test("works with multi-byte characters", () => { + c...
TypeError: childNodes.forEach is not a function ## Metadata Prettier 2.2.1, @prettier/plugin-ruby 1.5.0, default options. ## Input ```ruby [ ['先生小'], # ['小'], ] ``` ``` [error] /tmp/foo.rb: TypeError: childNodes.forEach is not a function [error] at getSortedChildNodes (~/.config/yarn/global/n...
``` $ ruby --version ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19] ```
2021-01-26T16:23:32
javascript
Hard
prettier/plugin-ruby
771
prettier__plugin-ruby-771
[ "768", "768" ]
7147ea39fbdd5717daabfa17fd7ccf27c74b4f90
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events. +- [@...
diff --git a/test/js/ruby/nodes/calls.test.js b/test/js/ruby/nodes/calls.test.js --- a/test/js/ruby/nodes/calls.test.js +++ b/test/js/ruby/nodes/calls.test.js @@ -92,10 +92,7 @@ describe("calls", () => { ${item}, ${item}, ${item} - ] - .map(&:foo?) - .bbb - ....
Hash indented twice when method chain continues off the hash ## Metadata * Ruby version: 2.6.5 * `@prettier/plugin-ruby` or `prettier` gem version: 1.2.4 * Options: * [x] `rubyHashLabel` * [x] `rubyModifier` * [x] `rubySingleQuote` * [ ] `rubyToProc` * [ ] `trailingComma`: "none" ## Input ```r...
Oops, sorry, submitted the issue before using a nicer title 😅 Oops, sorry, submitted the issue before using a nicer title 😅
2021-01-05T01:34:15
javascript
Hard
prettier/plugin-ruby
785
prettier__plugin-ruby-785
[ "776", "784" ]
4a2514ff21efe5dce09f8f9e7467a13ce62f91cb
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- [@ianks], [@kddeisz] - Use `netcat` to communicate to a parser server for better performance when formatti...
diff --git a/test/js/ruby/layout.test.js b/test/js/ruby/layout.test.js --- a/test/js/ruby/layout.test.js +++ b/test/js/ruby/layout.test.js @@ -1,3 +1,5 @@ +const { ruby } = require("../utils"); + describe("layout", () => { test("turns multiple blank lines into just one blank line", () => expect("1\n\n\n\n\n2")...
Interpolated expressions inside long strings wrap across multiple lines Wrapping the interpolated ruby expressions (i.e. `#{something}`) in a long string across multiple lines is technically valid ruby but I don't think I've ever seen it in production code. This behavior is also different from the js/ts (see below). ...
Hi @clarkdave! I actually did that out of an abundance of precaution. I just got nervous about changing them in case I would accidentally break them. I'd be fine reversing that decision if you're 100% sure. Feel like making a contribution? I think it should basically just be the opposite of that PR that you link...
2021-01-15T22:21:10
javascript
Hard
prettier/plugin-ruby
837
prettier__plugin-ruby-837
[ "836" ]
da580de30ec55b6a401597a5a46cf92159d3f438
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddeisz - Array splat operator sh...
diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -249,6 +249,8 @@ describe("method", () => { const content = ruby(` foo( # comment + # another comment + ...
Splat operator on literal array with trailing comments can format to broken Ruby code ## Metadata - Ruby version: 2.6.5 - `@prettier/plugin-ruby` or `prettier` gem version: 1.5.3 - Options: - [x] `rubyHashLabel` - [x] `rubyModifier` - [x] `rubySingleQuote` - [ ] `rubyToProc` - [ ] `trailingComma` ...
2021-03-04T15:55:19
javascript
Hard
vercel/nft
37
vercel__nft-37
[ "35" ]
9bc82001c9a9d6b1361892675289e1f5feb45ad3
diff --git a/azure-prepare.js b/azure-prepare.js --- a/azure-prepare.js +++ b/azure-prepare.js @@ -19,4 +19,4 @@ if (process.platform === 'win32') { writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg)); } else { console.log('[azure-prepare] Expected current platform to be win32 but found ' + proce...
diff --git a/test/integration/bull.js b/test/integration/bull.js new file mode 100644 --- /dev/null +++ b/test/integration/bull.js @@ -0,0 +1,11 @@ +const Queue = require('bull'); +// Create free tier on https://redislabs.com and assign redis://:password@hostname:port +const pdfQueue = new Queue('pdf transcoding', proc...
Add support for `bull` Example integration test: ```js const Queue = require('bull'); const host = 'redis123.cloud.redislabs.com'; const port = 10883; const password = 'abc123pswrd'; const pdfQueue = new Queue('pdf transcoding', { redis: { port, host, password }}); pdfQueue.process(function(job, done) { ...
An interesting thing to check with failures like this would be to compare against ncc - will distinguish the easy bugs from the harder ones at least! On Tue, Aug 6, 2019 at 17:53 Steven <notifications@github.com> wrote: > Example integration test: > > const Queue = require('bull');const host = 'redis123.cloud.redisla...
2019-08-07T01:18:12
javascript
Hard
pinojs/pino-pretty
316
pinojs__pino-pretty-316
[ "304" ]
3d471da6a1fce2b68ea212b671c4eb2558076813
diff --git a/index.js b/index.js --- a/index.js +++ b/index.js @@ -4,9 +4,7 @@ const { isColorSupported } = require('colorette') const pump = require('pump') const { Transform } = require('readable-stream') const abstractTransport = require('pino-abstract-transport') -const sonic = require('sonic-boom') const sjs =...
diff --git a/test/lib/utils.public.test.js b/test/lib/utils.public.test.js --- a/test/lib/utils.public.test.js +++ b/test/lib/utils.public.test.js @@ -3,6 +3,9 @@ const tap = require('tap') const getColorizer = require('../../lib/colors') const utils = require('../../lib/utils') +const rimraf = require('rimraf') +co...
Dissapering logs with fatal In this example the fatal log never appear: ```js const pino = require('pino'); const pinoPretty = require('pino-pretty'); const logger = pino( { level: 'info' }, pinoPretty({ levelFirst: true, colorize: true, translateTime: 'yyyy-mm-dd HH:MM:ss', }) ); lo...
Thanks, this is working as expected! However we need to add the following block that's missing: https://github.com/pinojs/pino/blob/f8696ab5fb0e5a819b6255af420b29fb075cbdee/lib/tools.js#L335-L373 hello, I am also facing this issue and I can't get the workaround to work; where exactly do you specify `sync: true`? htt...
2022-03-14T14:21:50
javascript
Hard
pinojs/pino-pretty
434
pinojs__pino-pretty-434
[ "433" ]
bf973c749b8516998e8aeab3dac39591db314586
diff --git a/index.js b/index.js --- a/index.js +++ b/index.js @@ -162,7 +162,7 @@ function prettyFactory (options) { line += ':' } - if (prettifiedMessage) { + if (prettifiedMessage !== undefined) { if (line.length > 0) { line = `${line} ${prettifiedMessage}` } else { @@ -186...
diff --git a/test/basic.test.js b/test/basic.test.js --- a/test/basic.test.js +++ b/test/basic.test.js @@ -118,6 +118,70 @@ test('basic prettifier tests', (t) => { log.info('foo') }) + t.test('can print message key value when its a string', (t) => { + t.plan(1) + const pretty = prettyFactory() + con...
Pino Pretty does not output numbers but only strings. I have a very simple log file with as below `app.log` ``` {"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":77} {"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":"42"} ``` Notice that...
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
2023-06-23T05:01:00
javascript
Easy
prettier/plugin-ruby
1,097
prettier__plugin-ruby-1097
[ "1096" ]
7282507b3a6f44ff4c81b3d1adf4c63e961f1913
diff --git a/src/haml/parser.rb b/src/haml/parser.rb --- a/src/haml/parser.rb +++ b/src/haml/parser.rb @@ -44,6 +44,12 @@ def parse_value(string, level = 0) if hash # Explicitly not using Enumerable#to_h here to support Ruby 2.5 hash.each_with_object({}) do |(key, value), response| + ...
diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts --- a/test/js/haml/tag.test.ts +++ b/test/js/haml/tag.test.ts @@ -103,6 +103,10 @@ describe("tag", () => { expect(content).toChangeFormat(expected); }); + + test("attributes prefixed with @", () => { + expect(haml("%span{'@click': 'o...
HAML attributes starting with `@` are incorrectly formatted ## Metadata - Operating system: MacOS, Ubuntu (in Codespaces) - Ruby version: latest - Node version: latest - `@prettier/plugin-ruby` or `prettier` gem version: latest - Options: - `rubyArrayLiteral` - `true` - `rubyHashLabel` - `true` - `rubyM...
2021-12-28T21:54:12
javascript
Hard
pinojs/pino-pretty
340
pinojs__pino-pretty-340
[ "339" ]
e793e646a0b539b3a9aa8b5ab43e64a8d86b05d6
diff --git a/index.d.ts b/index.d.ts --- a/index.d.ts +++ b/index.d.ts @@ -9,7 +9,7 @@ import { Transform } from 'stream'; import { OnUnknown } from 'pino-abstract-transport'; // @ts-ignore fall back to any if pino is not available, i.e. when running pino tests -import { DestinationStream } from 'pino'; +import { De...
diff --git a/test/types/pino-pretty.test-d.ts b/test/types/pino-pretty.test-d.ts --- a/test/types/pino-pretty.test-d.ts +++ b/test/types/pino-pretty.test-d.ts @@ -21,6 +21,7 @@ const options: PinoPretty.PrettyOptions = { levelFirst: false, messageKey: "msg", timestampKey: "timestamp", + minimumLevel: "trace",...
Typings missing `minimumLevel` `minimumLevel` is a valid option here: https://github.com/pinojs/pino-pretty/blob/e793e646a0b539b3a9aa8b5ab43e64a8d86b05d6/index.js#L57 But it's not available in the typings: ![](https://discord.coffee/29fkYzN.png) Which I assume is because it isn't part of the default options set, so...
Would you be open to send a PR for this? It would also need a tsd test. Yep, just need to know what the default is for proper documentation. Edt: Just seems to be trace. I'll PR this now.
2022-06-03T22:53:19
javascript
Easy
vercel/nft
481
vercel__nft-481
[ "471" ]
a0746bdb71d0a994b54f6fa32e3bfd6378f2412c
diff --git a/package-lock.json b/package-lock.json --- a/package-lock.json +++ b/package-lock.json @@ -79,7 +79,7 @@ "jugglingdb": "^2.0.1", "koa": "^2.7.0", "leveldown": "^5.6.0", - "lighthouse": "^5.1.0", + "lighthouse": "^12.3.0", "loopback": "^3.26.0", "mai...
diff --git a/test/integration/lighthouse.js b/test/integration/lighthouse.js --- a/test/integration/lighthouse.js +++ b/test/integration/lighthouse.js @@ -1 +1 @@ -require('lighthouse'); +require('lighthouse/core/index.cjs')
Bump lighthouse from version 5 to 12 Bump lighthouse from version 5 to 9
2025-02-16T12:55:42
javascript
Hard
vercel/nft
534
vercel__nft-534
[ "531" ]
657e6b0869ba0b29acaab5e6c224bd7da3110baf
diff --git a/src/resolve-dependency.ts b/src/resolve-dependency.ts --- a/src/resolve-dependency.ts +++ b/src/resolve-dependency.ts @@ -1,6 +1,7 @@ import { isAbsolute, resolve, sep } from 'path'; import { builtinModules } from 'module'; import { Job } from './node-file-trace'; +import { getNodeMajorVersion } from '....
diff --git a/test/unit.test.js b/test/unit.test.js --- a/test/unit.test.js +++ b/test/unit.test.js @@ -25,6 +25,8 @@ const skipOnWindows = [ 'require-symlink', ]; const skipOnMac = []; +const skipOnNode20AndBelow = ['module-sync-condition-es']; +const skipOnNode22AndAbove = ['module-sync-condition-es-node20']; if...
Support for "module-sync" exports condition Hello, we are currently using `@vercel/nft` to collect dependencies for our application. Thanks the capabilities it provides, which have saved us a significant amount of server resources and deployment time." But recently we encountered a problem. When a package uses `module...
We currently have thousands of projects depending on it, but most projects are not using Node 22 at runtime, so the issue has not been widely exposed yet. I am concerned that at some point it might have a significant impact. If possible, please provide me with a conclusion as soon as you can, so I can decide on the sub...
2025-07-22T18:04:45
javascript
Hard
prettier/plugin-ruby
813
prettier__plugin-ruby-813
[ "812" ]
637b841734fca2ee6da8237a5625ae499b838d3a
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Changed + +- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddeisz - Splats and blocks withi...
diff --git a/test/js/ruby/nodes/method.test.js b/test/js/ruby/nodes/method.test.js --- a/test/js/ruby/nodes/method.test.js +++ b/test/js/ruby/nodes/method.test.js @@ -245,7 +245,29 @@ describe("method", () => { test("between multi args", () => expect("foo(1, 2, *abc, 3, 4)").toMatchFormat()); + t...
Array splat operator gets pushed before a leading comment ## Metadata * Ruby version: 2.6.5 * `@prettier/plugin-ruby` or `prettier` gem version: 1.5.1 * Options: * [x] `rubyHashLabel` * [x] `rubyModifier` * [x] `rubySingleQuote` * [ ] `rubyToProc` * [ ] `trailingComma` ## Input ```ruby [ #...
Lol wat.
2021-02-04T21:34:44
javascript
Hard
pinojs/pino-pretty
308
pinojs__pino-pretty-308
[ "300" ]
3ff7b1c3bdf3c0c093fbf783c18bf47e7d3e8ae2
diff --git a/Readme.md b/Readme.md --- a/Readme.md +++ b/Readme.md @@ -252,7 +252,7 @@ The options accepted have keys corresponding to the options described in [CLI Ar // You can also configure some SonicBoom options directly sync: false, // by default we write asynchronously append: true, // the file is opene...
diff --git a/test/types/pino-pretty.test-d.ts b/test/types/pino-pretty.test-d.ts --- a/test/types/pino-pretty.test-d.ts +++ b/test/types/pino-pretty.test-d.ts @@ -29,6 +29,8 @@ const options: PinoPretty.PrettyOptions = { } }, sync: false, + append: true, + mkdir: true, }; const options2: PrettyOptions ...
TypeScript declarations missing `destination` option In `index.d.ts` the `PrettyOptions_` interface is missing the `destination` property.
Would you like to send a Pull Request to address this issue? Remember to add unit tests. We use tsd. Yes I will submit a PR probably later this week when I have time, if not already done by someone else.
2022-02-26T04:25:42
javascript
Hard
pinojs/pino-pretty
49
pinojs__pino-pretty-49
[ "48" ]
8101d3bf5b31b05ea608160e56b01b2b44b2c0f1
diff --git a/index.js b/index.js --- a/index.js +++ b/index.js @@ -120,7 +120,7 @@ module.exports = function prettyFactory (options) { log.time = formatTime(log.time, opts.translateTime) } - var line = `[${log.time}]` + var line = log.time ? `[${log.time}]` : '' const coloredLevel = levels.ha...
diff --git a/test/basic.test.js b/test/basic.test.js --- a/test/basic.test.js +++ b/test/basic.test.js @@ -276,7 +276,7 @@ test('basic prettifier tests', (t) => { const log = pino({ timestamp: null }, new Writable({ write (chunk, enc, cb) { const formatted = pretty(chunk.toString()) - t.is(f...
timestamp: false results in empty [] Hiya! I'm trying out `pino(-pretty)` and encountered an unexpected rendering. Here's what I'm seeing in my console: ``` [] INFO (my-logger): test ``` And here's the code to generate it: ```js const logger = pino({ base: { name: my-logger }, prettyPrint: true, t...
Judging by this test, it looks like this might be expected behavior: https://github.com/pinojs/pino-pretty/blob/8101d3bf5b31b05ea608160e56b01b2b44b2c0f1/test/basic.test.js#L273-L284 With that in mind, would y'all be open to a PR that modifies the test (and behavior)? ```diff - t.is(formatted, `[undefined] ...
2018-12-03T03:49:00
javascript
Hard
prettier/plugin-ruby
919
prettier__plugin-ruby-919
[ "917" ]
bd6b8d5eef5e0c143e343efe69d9e5bffc3405ef
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls...
diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js --- a/test/js/globalSetup.js +++ b/test/js/globalSetup.js @@ -9,7 +9,7 @@ process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim(); // it to get back the AST. function globalSetup() { if (!process.env.PRETTIER_RUBY_HOST) { - process...
Strips quotes from hash key containing backslashes ## Metadata - Operating system: MacOS - Ruby version: `ruby 2.6.3p62` - Node version: `v16.3.0` - `@prettier/plugin-ruby` or `prettier` gem version: `1.6.0` - Options: defaults ## Input ```ruby { '\d': 1 } ``` ## Output ```ruby { \d: 1 } ``` ....
2021-06-30T13:30:28
javascript
Hard
vercel/nft
475
vercel__nft-475
[ "474" ]
8e03925a829b8663c12cbdd00043e497961546c1
diff --git a/package-lock.json b/package-lock.json --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,7 @@ "express": "^4.21.2", "fast-glob": "^3.1.1", "fetch-h2": "^2.2.0", - "firebase": "^7", + "firebase": "^11.2.0", "firebase-admin": "^12.0.0", "fl...
diff --git a/test/integration/core-js.js b/test/integration/core-js.js deleted file mode 100644 --- a/test/integration/core-js.js +++ /dev/null @@ -1,2 +0,0 @@ - -require("core-js").Array.prototype.map.call([], () => {}); diff --git a/test/integration/firebase.js b/test/integration/firebase.js --- a/test/integration/fi...
Bump firebase from version 7 to 11 Bump firebase from version 7 to 11.
2025-02-06T06:34:52
javascript
Hard
vercel/nft
289
vercel__nft-289
[ "288" ]
fd365102c1b393f2e6880096749ef9def0b6bdd5
diff --git a/src/utils/static-eval.ts b/src/utils/static-eval.ts --- a/src/utils/static-eval.ts +++ b/src/utils/static-eval.ts @@ -415,6 +415,13 @@ const visitors: Record<string, (this: State, node: Node, walk: Walk) => Promise< } return { value: obj }; }, + 'SequenceExpression': async function SequenceEx...
diff --git a/test/unit/ts-path-join/file.txt b/test/unit/ts-path-join/file.txt new file mode 100644 --- /dev/null +++ b/test/unit/ts-path-join/file.txt @@ -0,0 +1 @@ +file content \ No newline at end of file diff --git a/test/unit/ts-path-join/input.js b/test/unit/ts-path-join/input.js new file mode 100644 --- /dev/nul...
Output from TypeScript 4.4+ no longer traceable Source code: ```ts import { join } from 'path' const file = join(__dirname, 'file.txt') ``` [Output TS 4.3 or older](https://www.typescriptlang.org/play?target=6&module=1&ts=4.3.5#code/JYWwDg9gTgLgBAbzgKwsAdnAvnAZlCEOAcjAEMYALYgKBoGMJ0BneXYAGwFM4BeFNOgAUAfREATY...
@guybedford Thoughts on how to solve this one? It seems like TS is doing this to avoid [this method call](https://2ality.com/2015/12/references.html). @styfle it should be relatively straightforward to substitute the `(0, path1.join)` as a pattern that is supported by the `path.join` style detection. It could be as sim...
2022-05-23T15:40:49
javascript
Hard
vercel/nft
33
vercel__nft-33
[ "31" ]
d22d12bb51aaf250fc59ce4f7bf697ddd734f574
diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules dist coverage test/**/dist +test/**/actual.js diff --git a/azure-pipelines.yml b/azure-pipelines.yml --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,8 +16,5 @@ steps: versionSpec: '10.x' displayName...
diff --git a/test/integration.test.js b/test/integration.test.js --- a/test/integration.test.js +++ b/test/integration.test.js @@ -35,7 +35,7 @@ for (const integrationTest of fs.readdirSync(`${__dirname}/integration`)) { var symlinkPath = await readlink(inPath); } catch (e) { - if (e.code ...
Needs CI for Windows To prevent regressions in `now dev` on Windows (i.e. #30). Recommend [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/).
2019-08-02T20:02:55
javascript
Hard
opencomponents/oc
1,295
opencomponents__oc-1295
[ "831" ]
12da5b8f0fb90fb5be5a325fb6d7f7c80798d517
diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "multer": "1.4.3", "nice-cache": "0.0.5", "oc-client": "4.0.1", - "oc-client-browser": "1.5.7", + "oc-client-browser": "1.5.8", "oc-empty-response-handler": "1.0.2", "oc-get-unix-utc-timesta...
diff --git a/test/fixtures/mocked-components/async-custom-error.js b/test/fixtures/mocked-components/async-custom-error.js new file mode 100644 --- /dev/null +++ b/test/fixtures/mocked-components/async-custom-error.js @@ -0,0 +1,28 @@ +'use strict'; + +module.exports = { + package: { + name: 'async-custom-error-com...
Improvements: Add support to throw custom status like 404,403 instead of only 500s ## *Who* is the bug affecting? OpenComponent, callback excepts first argument as error. What so ever we pass in it, string or object, this always make OC to throw 500s, and client side js keeps on retrying to get the same resource, even...
2022-05-09T11:50:46
javascript
Easy
vercel/nft
392
vercel__nft-392
[ "391", "391" ]
67d76d22b3aa10b5fb7b4ab46d5a196f05ccf35e
diff --git a/package-lock.json b/package-lock.json --- a/package-lock.json +++ b/package-lock.json @@ -122,12 +122,24 @@ "vm2": "^3.9.18", "vue": "^2.6.10", "vue-server-renderer": "^2.6.10", - "when": "^3.7.8" + "when": "^3.7.8", + "zeromq": "^6.0.0-beta.19" }, ...
diff --git a/test/integration/zeromq.js b/test/integration/zeromq.js new file mode 100644 --- /dev/null +++ b/test/integration/zeromq.js @@ -0,0 +1,2 @@ +const zmq = require("zeromq"); +const sock = new zmq.Push; \ No newline at end of file diff --git a/test/unit.test.js b/test/unit.test.js --- a/test/unit.test.js +++ ...
Add support for `zeromq` Some libraries like `zeromq.js` need runtime libraries with bindings which they ship along. Those binaries exist under `node_modules/zeromq/prebuilds`. Simply by creating a new Next.js app, installing https://github.com/zeromq/zeromq.js and trying to import it and running `npm run dev` a...
You can try `npx @vercel/nft@latest print path/to/my/file.js` to see which files are included. If its missing prebuilds, then it is likely an issue with `@vercel/nft`. You can create a PR with a test and special case, similar to PR https://github.com/vercel/nft/pull/37. Or if you want to fix the general case (...
2024-02-13T16:23:47
javascript
Hard
opencomponents/oc
1,303
opencomponents__oc-1303
[ "1193" ]
5699dfe0d0658b1dd0edce2492522ff3be2daed7
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,13 +5,12 @@ name: Node.js CI on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jo...
diff --git a/test/fixtures/mocked-components/env.js b/test/fixtures/mocked-components/env.js new file mode 100644 --- /dev/null +++ b/test/fixtures/mocked-components/env.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = { + package: { + name: 'env-component', + version: '1.0.0', + oc: { + container:...
Ability to have environment variables in your OC components Slightly related to issue #769, if it happens that you package your component beforehand, and then publish the same packaged OC to different registries, it would be nice to have a way to have env variables for each registry. Right now the only way of doing tha...
I believe `context.env` is only used to pass environment name and there are no other things passed in it, so we could have something like: `context.env.values` which would have the environment variables. However, `process.env` seems to be a standard for interacting with env variables so maybe it's better to use tha...
2022-07-22T15:53:37
javascript
Easy
prettier/plugin-ruby
910
prettier__plugin-ruby-910
[ "904" ]
88c45c25ad245f07450047773178ddb692a2f9ee
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddeisz - Support the `--insert-pragma` option for the increme...
diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js --- a/test/js/ruby/nodes/strings.test.js +++ b/test/js/ruby/nodes/strings.test.js @@ -169,14 +169,43 @@ describe("strings", () => { test("with single quotes", () => expect(":'abc'").toMatchFormat()); - test("with double quo...
Prettier doesn't format multiline %s(...) strings properly ## Metadata Note that this issue doesn't happen with `%(...)`; only with `%s(...)`. - Ruby version: 3..0.0 - `@prettier/plugin-ruby`: 1.5.5 - Options: - [x] `rubyHashLabel` - [x] `rubyModifier` - [x] `rubySingleQuote` - [ ] `rubyToProc` -...
Ah, it looks like this is our codebase's mistake--`%s(...)` creates a symbol, not a string, and it's not really standard to create a multi-line symbol. I'll close this out for now. https://ruby-doc.org/core-2.3.0/doc/syntax/literals_rdoc.html#label-Percent+Strings Thanks for reporting! This is actually a bug in pre...
2021-06-23T14:29:35
javascript
Hard
vercel/nft
189
vercel__nft-189
[ "188" ]
751a32f09b3da12b20133174ddc692c40eb33b7a
diff --git a/src/analyze.ts b/src/analyze.ts --- a/src/analyze.ts +++ b/src/analyze.ts @@ -251,7 +251,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi //@ts-ignore if (!ast) { try { - ast = acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module' }); + ast = ...
diff --git a/test/unit/top-level-await/input.js b/test/unit/top-level-await/input.js new file mode 100644 --- /dev/null +++ b/test/unit/top-level-await/input.js @@ -0,0 +1,3 @@ +import {dep} from './module'; + +await Promise.resolve(console.log(dep)); diff --git a/test/unit/top-level-await/module.js b/test/unit/top-lev...
Add support for `top-level await` just noticed an Error in `warnings`: ``` Error: Failed to parse xxx.js as module: Cannot use keyword 'await' outside an async function at Object.analyze [as default] ... ``` it already supported in node>=14.8.0, so i think there will be more and more projects using top-leve...
Looks like we need to pass [allowAwaitOutsideFunction](https://github.com/acornjs/acorn/tree/master/acorn#interface) to acorn. Would you like to submit a PR with a test to fix this?
2021-04-27T01:57:20
javascript
Hard
vercel/nft
123
vercel__nft-123
[ "122" ]
19f05753caf6a6c1269beb70a71e4531a7c0b8fc
diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "pdfkit": "^0.10.0", "pg": "^7.11.0", "phantomjs-prebuilt": "^2.1.16", + "polyfill-library": "3.93.0", "pug": "^2.0.4", "react": "^16.8.6", "react-dom": "^16.8.6", diff --git a/src/utils/wra...
diff --git a/test/integration/polyfill-library.js b/test/integration/polyfill-library.js new file mode 100644 --- /dev/null +++ b/test/integration/polyfill-library.js @@ -0,0 +1,12 @@ +const polyfill = require('polyfill-library') + +async function handler() { + const script = await polyfill.getPolyfillString({ + mi...
Fails to trace `polyfill-library` package: Cannot read property 'type' of null ## Versions Tested with `polyfill-library@3.93.0` and `node-file-trace@0.6.3`. ## Input file ```js const polyfill = require('polyfill-library') async function handler() { const script = await polyfill.getPolyfillString({ m...
2020-06-15T04:45:58
javascript
Hard
Spomky-Labs/otphp
166
Spomky-Labs__otphp-166
[ "165" ]
8cf16dcb41d35f04842ef38e7e61bfaa228f6c2b
diff --git a/doc/AppConfig.md b/doc/AppConfig.md --- a/doc/AppConfig.md +++ b/doc/AppConfig.md @@ -15,7 +15,7 @@ You just have to: <?php use OTPHP\TOTP; -$totp = TOTP::create('JBSWY3DPEHPK3PXP'); // New TOTP with custom secret +$totp = TOTP::createFromSecret('JBSWY3DPEHPK3PXP'); // New TOTP with custom secret $tot...
diff --git a/tests/HOTPTest.php b/tests/HOTPTest.php --- a/tests/HOTPTest.php +++ b/tests/HOTPTest.php @@ -21,7 +21,7 @@ public function labelNotDefined(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('The label is not set.'); - $hotp = HOTP...
`OTPInterface::create(null|string $secret = null)` is prone to misuse ### Description `OTPInterface::create(null|string $secret = null)` API is fundamentally flawed: what happens if the user intention is to create an OTP from a *known* secret, but the variable passed is **unintentionally** `null`? Factory methods...
Hi, I fully agree with you. As you say, named constructors prevent errors like the one you mentioned. A user-friendly API change could be: 1. Add the 2 new methods in `v11.1` 2. Deprecate `::create` in `v11.1` 3. Drop `::create` in `v12` Looks like the best approach. As TOTP and HOTP classes are marked final, ...
2022-10-13T13:20:45
php
Easy
Spomky-Labs/otphp
87
Spomky-Labs__otphp-87
[ "80" ]
fd4ba9a0498779ff1297cae8e6bd6dc918c5918d
diff --git a/composer.json b/composer.json --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^5.5|^7.0", - "christian-riesen/base32": "^1.1", + "paragonie/constant_time_encoding": "^1.0|^2.0", "beberlei/assert": "^2.4", "symfony/polyfill...
diff --git a/tests/TOTPTest.php b/tests/TOTPTest.php --- a/tests/TOTPTest.php +++ b/tests/TOTPTest.php @@ -9,8 +9,8 @@ * of the MIT license. See the LICENSE file for details. */ -use Base32\Base32; use OTPHP\TOTP; +use ParagonIE\ConstantTime\Base32; class TOTPTest extends \PHPUnit_Framework_TestCase { @@ -1...
Consider switching to paragonie/constant_time_encoding | Q | A | -------------------- | ----- | Bug report? | no | Feature request? | yes | BC Break report? | no | RFC? / Specification | no | Library version | 8.3.x, 9.x The base 32 encoding library used by this project...
Hi @larowlan, This is a very interesting report. I will change both v8 and v9 branches in favor of this dependency. As it is easier to bruteforce a n digits code, I am not sure there is a potential security issue at the moment, but that is a risk that I do not want to take. Thanks. Thanks, let me know if you wan...
2017-07-24T10:23:56
php
Hard
Spomky-Labs/otphp
85
Spomky-Labs__otphp-85
[ "80" ]
824496eb1c6a69125fee9cb543590175e452b7ab
diff --git a/composer.json b/composer.json --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.1", - "christian-riesen/base32": "^1.1", + "paragonie/constant_time_encoding": "^2.0", "beberlei/assert": "^2.4" }, "require-dev": { diff --...
diff --git a/tests/TOTPTest.php b/tests/TOTPTest.php --- a/tests/TOTPTest.php +++ b/tests/TOTPTest.php @@ -13,8 +13,8 @@ namespace OTPHP\Test; -use Base32\Base32; use OTPHP\TOTP; +use ParagonIE\ConstantTime\Base32; use PHPUnit\Framework\TestCase; final class TOTPTest extends TestCase @@ -137,9 +137,9 @@ publi...
Consider switching to paragonie/constant_time_encoding | Q | A | -------------------- | ----- | Bug report? | no | Feature request? | yes | BC Break report? | no | RFC? / Specification | no | Library version | 8.3.x, 9.x The base 32 encoding library used by this project...
Hi @larowlan, This is a very interesting report. I will change both v8 and v9 branches in favor of this dependency. As it is easier to bruteforce a n digits code, I am not sure there is a potential security issue at the moment, but that is a risk that I do not want to take. Thanks. Thanks, let me know if you wan...
2017-07-24T10:17:59
php
Hard
Spomky-Labs/otphp
61
Spomky-Labs__otphp-61
[ "60" ]
1c47b5c4a01a0aa73d627b5a9955288b3d5f53f9
diff --git a/src/Factory.php b/src/Factory.php --- a/src/Factory.php +++ b/src/Factory.php @@ -20,7 +20,7 @@ final class Factory * * @throws \InvalidArgumentException * - * @return \OTPHP\TOTP|\OTPHP\HOTP + * @return \OTPHP\TOTPInterface|\OTPHP\HOTPInterface */ public static functio...
diff --git a/tests/HOTPTest.php b/tests/HOTPTest.php --- a/tests/HOTPTest.php +++ b/tests/HOTPTest.php @@ -15,11 +15,22 @@ class HOTPTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Label must be a string. + * @expectedExcept...
Why is label required for the constructor? When only verifying a TOTP code, it doesn't look like label is needed anywhere, yet it is a required constructor parameter for the TOTP class. This means passing in a blank string or random junk for the sake of making it happy. Can this be changed to make it neater? Othe...
Hi @lukos, You are right: the label is only needed when the provisioning URI is computed. Depending on the schemen (TOTP/HOTP), you just need the secret, the digest, the digits and additional parameters required by the scheme (counter, interval). I will not add a static method, from my POV it should be easier to...
2016-12-07T11:17:26
php
Hard
Spomky-Labs/otphp
13
Spomky-Labs__otphp-13
[ "12" ]
a7b5c5602e528a1dc04aacf4295e5c4940074cf4
diff --git a/.travis.yml b/.travis.yml --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,9 @@ before_script: - curl -s http://getcomposer.org/installer | php - php composer.phar update --dev --no-interaction -phpunit: php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml --prefer-dist --dev - sc...
diff --git a/tests/OTPTest.php b/tests/OTPTest.php --- a/tests/OTPTest.php +++ b/tests/OTPTest.php @@ -95,6 +95,11 @@ public function testGenerateUriWithValidLabel() ->method('getSecret') ->will($this->returnValue('JDDK4U6G3BJLEZ7Y')); + $method = self::getMethod('generateURI'); + + ...
Made hasSemicolon public to bring it inline with the docs The documentation linked below has an example implementation which uses hasSemicolon. The hasSemicolon() method is marked as private in OTP.php. I've changed it to public. https://github.com/Spomky-Labs/otphp/blob/3.0.x/doc/Extend.md
2014-07-21T21:07:49
php
Hard
laravel/reverb
122
laravel__reverb-122
[ "121" ]
d1b72f46a0af42ca5e84d5c1d0f97b8013c6dac3
diff --git a/src/Protocols/Pusher/Http/Controllers/EventsController.php b/src/Protocols/Pusher/Http/Controllers/EventsController.php --- a/src/Protocols/Pusher/Http/Controllers/EventsController.php +++ b/src/Protocols/Pusher/Http/Controllers/EventsController.php @@ -34,6 +34,9 @@ public function __invoke(RequestInterfa...
diff --git a/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php --- a/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php @@ -78,6 +78,28 @@ expect($response-...
Broadcast message toOthers throws ApiException in pusher ### Reverb Version 1.0.0-beta4 ### Laravel Version 11.1.0 ### PHP Version 8.3.4 ### Description When i try to send broadcast message via my Event like this `broadcast(new MyEvent())->toOthers()` I receive an Exception ``` [2024-03-28 16:26:08] local.ER...
2024-03-29T15:27:38
php
Hard
laravel/reverb
167
laravel__reverb-167
[ "163" ]
78d8db37d4f7cdad187c0205c1490e1b5df0eb93
diff --git a/src/Protocols/Pusher/Http/Controllers/ChannelController.php b/src/Protocols/Pusher/Http/Controllers/ChannelController.php --- a/src/Protocols/Pusher/Http/Controllers/ChannelController.php +++ b/src/Protocols/Pusher/Http/Controllers/ChannelController.php @@ -4,9 +4,9 @@ use Laravel\Reverb\Protocols\Pushe...
diff --git a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php --- a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php @@ -59,6 +59,15 @@ expect($respo...
Using ssl in valet environment causes error. ### Reverb Version 1.0.0-beta7 ### Laravel Version 11.4.0 ### PHP Version 8.2.16 ### Description I have struggled to get laravel reverb work locally with valet & ssl & Livewire. I can get Echo successfully connet to reverb, but when dispatching event, I get error...
@jksa we pushed a fix for Valet yesterday. Could you maybe try the main branch by requesting `"laravel/reverb":"@dev"` in your composer.json? You'll need to remove all TLS options from your config to test. Installed and removed all tls options. Same error. Reverb version is now: `composer show -i laravel/reve...
2024-04-23T12:38:15
php
Hard
laravel/reverb
253
laravel__reverb-253
[ "224" ]
f412b8db9f241793baa08f35bffdfbb7680a09ec
diff --git a/src/Connection.php b/src/Connection.php --- a/src/Connection.php +++ b/src/Connection.php @@ -5,6 +5,7 @@ use Laravel\Reverb\Concerns\GeneratesIdentifiers; use Laravel\Reverb\Contracts\Connection as ConnectionContract; use Laravel\Reverb\Events\MessageSent; +use Ratchet\RFC6455\Messaging\Frame; class...
diff --git a/tests/FakeConnection.php b/tests/FakeConnection.php --- a/tests/FakeConnection.php +++ b/tests/FakeConnection.php @@ -7,6 +7,7 @@ use Laravel\Reverb\Concerns\GeneratesIdentifiers; use Laravel\Reverb\Contracts\ApplicationProvider; use Laravel\Reverb\Contracts\Connection as BaseConnection; +use Ratchet\RF...
Potential Issue with Pusher Ping/Pong Messages ### Reverb Version 1.0.0-beta14 ### Laravel Version 10.10 ### PHP Version 8.1 ### Description If I am understanding the Pusher protocol correctly, then if the WebSocket implementation supports native ping/pong messages, then Pusher will use those, and ...
So websocket ping/pong is handled here: https://github.com/laravel/reverb/blob/838387607b9223b67eee592a916b36900374bb14/src/Servers/Reverb/Connection.php#L84 Maybe this should call `touch()` on the Pusher connection to reset `lastSeenAt`, and then the `pusher:ping` fallback won't be necessary? I agree with above ...
2024-09-25T09:39:40
php
Hard
laravel/reverb
94
laravel__reverb-94
[ "89" ]
d01860c879afb06813ee02dc81bd15f8daf322a4
diff --git a/src/Protocols/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php b/src/Protocols/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php --- a/src/Protocols/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php +++ b/src/Protocols/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php @@ -2...
diff --git a/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php --- a/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php @@ -405,3 +405,27 @@ expect(channels()->all())->toHaveCount(0); }); + +it...
Reverb process crashes if no $auth parameter is provided ### Reverb Version v1.0.0-beta3 ### Laravel Version v11.0.6 ### PHP Version 8.3 ### Description After putting reverb into production and replacing soketi everything worked fine for an hour and then I started receiving these errors which crash the reverb pr...
Can you put more information? Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue *as one separate commit* on the main/master branch and share the repository here? P...
2024-03-18T13:21:23
php
Hard
laravel/reverb
303
laravel__reverb-303
[ "298" ]
c3a4961d4cafcf4bc340c1253bc47d590ef17600
diff --git a/src/Loggers/CliLogger.php b/src/Loggers/CliLogger.php --- a/src/Loggers/CliLogger.php +++ b/src/Loggers/CliLogger.php @@ -52,7 +52,7 @@ public function message(string $message): void $message['data'] = json_decode($message['data'], true); } - if (isset($message['data']['chann...
diff --git a/tests/Unit/Protocols/Pusher/ServerTest.php b/tests/Unit/Protocols/Pusher/ServerTest.php --- a/tests/Unit/Protocols/Pusher/ServerTest.php +++ b/tests/Unit/Protocols/Pusher/ServerTest.php @@ -329,3 +329,157 @@ ['localhost', '*.localhost'], ], ]); + +it('sends an error if something fails for ev...
Incorrect condition in `CliLogger::message` method ### Reverb Version 1.4 ### Laravel Version 11.36 ### PHP Version 8.3 ### Description There is an incorrect condition in the `CliLogger::message` method in the `vendor/laravel/reverb/src/Loggers/CliLogger.php` file. The condition should check if `message['data'][...
Can you share a screenshot of the issue you are seeing on the CLI? > Can you share a screenshot of the issue you are seeing on the CLI? <img width="1278" alt="Screenshot 1403-10-22 at 14 17 45" src="https://github.com/user-attachments/assets/13d60062-1aa5-4584-991e-82eab7998073" /> As you can see in the image, when t...
2025-01-19T07:48:07
php
Hard
bmitch/churn-php
306
bmitch__churn-php-306
[ "232" ]
369dd927ec21b60595ca54bcf557bfdb998c49aa
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -85,6 +85,11 @@ filesToShow: 10 # Default: 0.1 minScoreToShow: 0 +# The command returns an 1 exit code if the highest score is greater than the threshold. +# Disabled if null. +# Default: null +maxScoreThreshold: 0.9 + # The number of parallel j...
diff --git a/tests/Integration/Command/RunCommandTest.php b/tests/Integration/Command/RunCommandTest.php --- a/tests/Integration/Command/RunCommandTest.php +++ b/tests/Integration/Command/RunCommandTest.php @@ -224,4 +224,17 @@ public function it_can_suppress_normal_output(): void $this->assertEquals(0, $exitC...
Make command fail if score is higher than a configurable threshold It could be used in a CI pipeline.
2021-02-15T20:12:35
php
Hard
bmitch/churn-php
72
bmitch__churn-php-72
[ "57" ]
d08b0ffbf5e9f3635268ba52798597a31a4d0f75
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -59,11 +59,13 @@ composer require bmitch/churn-php --dev ## How to Use? ## ``` -vendor/bin/churn run <path to source code> +vendor/bin/churn run <one or more paths to source code> ... +vendor/bin/churn run src +vendor/bin/churn run src tests ```...
diff --git a/tests/Integration/Managers/FileManagerTest.php b/tests/Integration/Managers/FileManagerTest.php --- a/tests/Integration/Managers/FileManagerTest.php +++ b/tests/Integration/Managers/FileManagerTest.php @@ -25,8 +25,8 @@ public function it_can_be_instantiated() /** @test **/ public function it_can...
[Config] Paths of files Stems from #40
Allow user to configure that path (or paths) of the source files it should process. @bmitch Would you like me to attempt a PR? @josephzidell You bet! That would be great, thanks. @bmitch Running on a folder with 1 file, 8 LOC. My CPU is up to 30% and it's been running for over 3 mins, still no results. Windows 10, PHP ...
2017-08-27T21:12:06
php
Hard
bmitch/churn-php
250
bmitch__churn-php-250
[ "126" ]
b915a1ba34cdff7fcb7c15ca8e746e07469b345e
diff --git a/.gitattributes b/.gitattributes --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,7 @@ .gitignore export-ignore .scrutinizer.yml export-ignore .travis.yml export-ignore +box.json.dist export-ignore CHANGELOG.md export-ignore churn.yml export-ignore codor.xml export-ignore diff --git a/.github/work...
diff --git a/tests/Integration/Command/AssessComplexityCommandTest.php b/tests/Integration/Command/AssessComplexityCommandTest.php new file mode 100644 --- /dev/null +++ b/tests/Integration/Command/AssessComplexityCommandTest.php @@ -0,0 +1,42 @@ +<?php declare(strict_types = 1); + +namespace Churn\Tests\Integration\Co...
Build a "binary" for this project It would be awesome if one could run this tool against a code base without installing it (if said project supports Composer dependencies at all ;)). Sounds like a `.phar` file would be useful. I'll look into what's needed for that and if we can make the build process automated.
@matthiasnoback I just `composer global require` install things and then put ~/.config/composer/vendor/bin into my PATH. @matthewbaggett That's a viable solution, but past experiences have learned me that this can lead to some impossible to solve dependency issues due to incompatible globally installed packages. Hence,...
2020-10-23T11:16:40
php
Hard
bmitch/churn-php
357
bmitch__churn-php-357
[ "356" ]
6c908c11a15eb00d3ae480f347e1c3b83d8b1bba
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -330,4 +330,4 @@ jobs: run: chmod +x churn.phar - name: "Run Phar" - run: ./churn.pha...
diff --git a/tests/Unit/Result/Render/CsvResultsRendererTest.php b/tests/Unit/Result/Render/CsvResultsRendererTest.php --- a/tests/Unit/Result/Render/CsvResultsRendererTest.php +++ b/tests/Unit/Result/Render/CsvResultsRendererTest.php @@ -18,7 +18,7 @@ public function it_can_be_instantiated() } /** @test */...
Support markdown format It would be great to support the markdown format, especially now the GH actions can display it as a job summary: https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/
2022-05-10T08:16:09
php
Hard
bmitch/churn-php
334
bmitch__churn-php-334
[ "333" ]
e56b63746d488b5a21332e86d5a9e9dbf7fefa3a
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -258,7 +258,7 @@ jobs: run: diff -u <(bin/churn -V) <(./churn.phar -V) - name: "Test Phar" -...
diff --git a/tests/Integration/Command/RunCommandTest.php b/tests/Integration/Command/RunCommandTest.php --- a/tests/Integration/Command/RunCommandTest.php +++ b/tests/Integration/Command/RunCommandTest.php @@ -131,7 +131,10 @@ public function it_throws_for_invalid_configuration(): void public function it_throws_w...
Make run the default command See: https://symfony.com/doc/current/components/console/changing_default_command.html There are currently 2 command: `run` and `assess-complexity`, but only `run` is supposed to be used by our users. So by making `run` the default command we could run Churn without arguments (with a p...
2022-01-10T16:35:13
php
Hard
bmitch/churn-php
47
bmitch__churn-php-47
[ "33" ]
858698cf28828d3a2f053894c4198a6b054b369e
diff --git a/src/Collections/FileCollection.php b/src/Collections/FileCollection.php new file mode 100644 --- /dev/null +++ b/src/Collections/FileCollection.php @@ -0,0 +1,27 @@ +<?php declare(strict_types = 1); + +namespace Churn\Collections; + +use Illuminate\Support\Collection; +use Churn\Values\File; + +class FileC...
diff --git a/tests/Unit/Collections/FileCollectionTest.php b/tests/Unit/Collections/FileCollectionTest.php new file mode 100644 --- /dev/null +++ b/tests/Unit/Collections/FileCollectionTest.php @@ -0,0 +1,37 @@ +<?php + +namespace Churn\Tests\Unit\Collections; + +use Churn\Collections\FileCollection; +use Churn\Values\...
Make FileManager return an object instead of an array?
2017-08-19T21:08:19
php
Hard
bmitch/churn-php
351
bmitch__churn-php-351
[ "146" ]
7b0e1483f5b9176698a7a4b3ac2a98fc3e83d196
diff --git a/bin/CyclomaticComplexityAssessorRunner b/bin/CyclomaticComplexityAssessorRunner --- a/bin/CyclomaticComplexityAssessorRunner +++ b/bin/CyclomaticComplexityAssessorRunner @@ -1,13 +1,16 @@ #!/usr/bin/env php <?php +declare(strict_types=1); + require_once __DIR__ . '/bootstrap.php'; use Churn\Assesso...
diff --git a/tests/Integration/Command/AssessComplexityCommandTest.php b/tests/Integration/Command/AssessComplexityCommandTest.php --- a/tests/Integration/Command/AssessComplexityCommandTest.php +++ b/tests/Integration/Command/AssessComplexityCommandTest.php @@ -17,7 +17,7 @@ class AssessComplexityCommandTest extends B...
CyclomaticComplexityAssessor - Improve by using something like `nikic/PHP-Parser` The score is calculated by using regular expressions which leads to errors. Example of a PHP file containing only a comment: ```php <?php // if ( if ( if ( ``` In this example the score is 3 whereas it should be 1. This kind of...
Thanks @villfa - please feel free to submit a PR if you like. Otherwise I will get to it when I can. Perhaps we can use `nikic/PHP-Parser` to analyse the PHP file being assessed and not have to rely on regular expressions? Should be something interesting to work on. Started a new branch `bmitchell-146` with a new test ...
2022-03-04T21:27:50
php
Hard
bmitch/churn-php
233
bmitch__churn-php-233
[ "230" ]
b41c1a95c6f2f8b0d3181974bac2e1281894d7ec
diff --git a/src/Commands/ChurnCommand.php b/src/Commands/ChurnCommand.php --- a/src/Commands/ChurnCommand.php +++ b/src/Commands/ChurnCommand.php @@ -4,9 +4,9 @@ use Churn\Factories\ResultsRendererFactory; use Churn\Logic\ResultsLogic; -use Churn\Managers\ProcessManager; use Churn\Factories\ProcessFactory; use C...
diff --git a/tests/Integration/Managers/FileManagerTest.php b/tests/Integration/Managers/FileManagerTest.php --- a/tests/Integration/Managers/FileManagerTest.php +++ b/tests/Integration/Managers/FileManagerTest.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types = 1); namespace Churn\Tests\Integration\Managers; ...
Option to disable parallelization Disabling parallelization will force to better structure the code. It will also be the occasion to improve how to handle certain values (eg: when `parallelJobs` < 1).
2020-10-15T12:16:21
php
Hard
bmitch/churn-php
365
bmitch__churn-php-365
[ "364" ]
316da6ef4dc94643df3883041879b5ce3f26aff1
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -183,6 +183,9 @@ jobs: with: dependency-versions: "highest" + - name: "Check for PS...
diff --git a/tests/Integration/Command/Assets/hooks.php b/tests/Integration/Command/Assets/hooks similarity index 100% rename from tests/Integration/Command/Assets/hooks.php rename to tests/Integration/Command/Assets/hooks diff --git a/tests/Integration/Command/config/hook-by-path.yml b/tests/Integration/Command/config...
Fix PSR violations Since [Composer 2.4.0](https://github.com/composer/composer/releases/tag/2.4.0), a new `--strict-psr` flag has been added to `dump-autoload` to check for PSR violations. Here the result for churn-php: ```sh # composer dump-autoload --optimize --strict-psr Generating optimized autoload files ...
2022-09-21T12:51:38
php
Hard
bmitch/churn-php
44
bmitch__churn-php-44
[ "38" ]
a795aaa6080b9b9568fd38afc4277fcfd4453288
diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build composer.lock docs vendor -coverage.xml \ No newline at end of file +coverage.xml +.idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ before_script:...
diff --git a/tests/Integration/Managers/FileManagerTest.php b/tests/Integration/Managers/FileManagerTest.php new file mode 100644 --- /dev/null +++ b/tests/Integration/Managers/FileManagerTest.php @@ -0,0 +1,40 @@ +<?php + +namespace Churn\Tests\Integration\Managers; + +use Churn\Managers\FileManager; +use Churn\Tests\...
Run in parallel With a large number of files the results take a while to come back. Need some way to run the files in parallel. * http://symfony.com/doc/current/components/process.html * http://blog.servergrove.com/2014/04/16/symfony2-components-overview-process/ If we used something like the above then we'd nee...
* Gather all the files needed for processing. Could be a collection of files. * While there are files to run: * Launch a process to get the commit count. * Store results in a class that contains filename and output. * This class can go into a collection of CommitCountProcessResults. * Launch a pr...
2017-08-12T19:06:57
php
Hard
bmitch/churn-php
59
bmitch__churn-php-59
[ "42" ]
c1ea2c1c1c7b2c57bc596ad03e12fe082cc48254
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -8,36 +8,45 @@ Helps discover good candidates for refactoring. * [Compatibility](#compatibility) * [How to Install?](#how-to-install) * [How to Use?](#how-to-use) +* [How to Configure?](#how-to-configure) * [Similar Packages](#similar-packages) ...
diff --git a/tests/Integration/Managers/FileManagerTest.php b/tests/Integration/Managers/FileManagerTest.php --- a/tests/Integration/Managers/FileManagerTest.php +++ b/tests/Integration/Managers/FileManagerTest.php @@ -4,6 +4,7 @@ use Churn\Managers\FileManager; use Churn\Tests\BaseTestCase; +use Churn\Values\Confi...
Add footer with misc data under table? Could show: * Files analyzed. * Time it took to run. * ???
2017-08-23T04:29:13
php
Hard
bmitch/churn-php
297
bmitch__churn-php-297
[ "293" ]
2387fe340523b6a579d3d6ef1e39312c67b3037b
diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\StreamOutput; +use Webmo...
diff --git a/tests/Integration/Command/RunCommandTest.php b/tests/Integration/Command/RunCommandTest.php --- a/tests/Integration/Command/RunCommandTest.php +++ b/tests/Integration/Command/RunCommandTest.php @@ -39,7 +39,10 @@ protected function tearDown() /** @test */ public function it_displays_the_logo_at_t...
Add a --parallel option This option would override the `parallelJobs` configuration. By exposing such option it would be easier to use `churn` in conjunction with `nproc`. Example: ```sh ./churn run src/ --parallel $(nproc) ```
2021-01-31T19:46:57
php
Hard
bmitch/churn-php
303
bmitch__churn-php-303
[ "187" ]
1f8075707ec3ba6d706ab992548f64995efb37b0
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ docker run --rm -ti -v $PWD:/app dockerizedphp/churn run src You may add an optional `churn.yml` file which can be used to configure churn-php. The location of the churn.yml file can be customized using these commands: ``` -Default...
diff --git a/tests/Integration/Command/RunCommandTest.php b/tests/Integration/Command/RunCommandTest.php --- a/tests/Integration/Command/RunCommandTest.php +++ b/tests/Integration/Command/RunCommandTest.php @@ -12,6 +12,9 @@ class RunCommandTest extends BaseTestCase { + + private const BAR = '0 [>---------------...
Use a cache to speed up calculations I just started to use this library. I have not looked into the source yet so Im sorry if I ask a weird question. Would it be possible to use a cache to speed up execution? What if the cache contained complexity and changes for every file in my project up until yesterday. Then ...
Thank you for the suggestion @Nyholm It does sound like a good idea but a couple of notes: * I think most people run this during a CI pipeline which probably would not have access to a cache since every run via the pipeline is essentially fresh. However, if you are running this locally over and over then a cache c...
2021-02-11T19:33:50
php
Hard
bmitch/churn-php
350
bmitch__churn-php-350
[ "330" ]
136c1ade9255448249c0bd1064d167bedeb615dd
diff --git a/.gitattributes b/.gitattributes --- a/.gitattributes +++ b/.gitattributes @@ -10,6 +10,7 @@ CHANGELOG.md export-ignore churn.yml export-ignore CONTRIBUTING.md export-ignore img/ export-ignore +infection.json export-ignore Makefile export-ignore manifest.xml export-ignore phpcs.xml export-ignore diff ...
diff --git a/tests/Integration/Command/AssessComplexityCommandTest.php b/tests/Integration/Command/AssessComplexityCommandTest.php --- a/tests/Integration/Command/AssessComplexityCommandTest.php +++ b/tests/Integration/Command/AssessComplexityCommandTest.php @@ -28,7 +28,7 @@ protected function tearDown() } ...
Add mutation testing The project has a very good code coverage but we don't have metrics about the quality of the tests. A tool like [Infection](https://infection.github.io/) could help with that.
2022-03-03T11:27:30
php
Hard
bmitch/churn-php
362
bmitch__churn-php-362
[ "360" ]
c67da4b5fd43a14228fed588b6e24d82018b8d3c
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -31,4 +31,4 @@ jobs: - name: "Run Infection" run: | git fetch --depth=1 origin $GITHUB_BASE_REF - infection -j$(np...
diff --git a/tests/Integration/Command/config/unrecognized-keys.yml b/tests/Integration/Command/config/unrecognized-keys.yml --- a/tests/Integration/Command/config/unrecognized-keys.yml +++ b/tests/Integration/Command/config/unrecognized-keys.yml @@ -1,2 +1,17 @@ foo: ~ -bar: baz \ No newline at end of file +bar: baz ...
"commitsSince" not recognized When I drop in the example config (modified or verbatim) I get the following warning on launch: ```console Unrecognized configuration keys: commitsSince ``` Fresh install of `church` as `composer require --dev`, both pulled version `1.7.0`. I don't see any other reports of this so far;...
It is because the configuration string is actual the singular `commitSince`: https://github.com/bmitch/churn-php/blob/fca48716d5b958a3bd87ed80adefdf87e0e63f27/src/Configuration/Validator/CommitsSince.php#L20 The Validator is actually the plural though as well. Need a maintainer to advise, then I can send a PR one wa...
2022-09-17T22:17:48
php
Hard
pusher/pusher-http-php
305
pusher__pusher-http-php-305
[ "302" ]
8673f60458ceedb9531fad7a5747eb49de619a8a
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 7.0.0 + +* [DEPRECATED] `get_channel_info`, `get_channels`, `socket_auth`, `presence_auth` in favour of camelCased versions +* [DEPRECATED] `get_users_info` in favour of `getPresenceUsers` +* [DEPRECATED] ...
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.2, 7.3, 7.4, 8.0] + php: [7.3, 7.4, 8.0] stability: [prefer-lowest, prefer...
[6.1] `build_auth_query_params()` returns array instead of string As title says, this [PHPDoc says the function returns a string](https://github.com/pusher/pusher-http-php/blob/master/src/Pusher.php#L276-L299) while it returns an array.
2021-05-10T09:26:56
php
Hard
pusher/pusher-http-php
304
pusher__pusher-http-php-304
[ "302" ]
8673f60458ceedb9531fad7a5747eb49de619a8a
diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tests/config.php vendor .phpunit.result.cache .phplint-cache +.idea diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 7.0.0 +* [CHANGED] Possible backwards compatibl...
diff --git a/tests/acceptance/ChannelQueryTest.php b/tests/acceptance/ChannelQueryTest.php --- a/tests/acceptance/ChannelQueryTest.php +++ b/tests/acceptance/ChannelQueryTest.php @@ -1,100 +1,119 @@ <?php -class ChannelQueryTest extends PHPUnit\Framework\TestCase +namespace acceptance; + +use PHPUnit\Framework\TestC...
[6.1] `build_auth_query_params()` returns array instead of string As title says, this [PHPDoc says the function returns a string](https://github.com/pusher/pusher-http-php/blob/master/src/Pusher.php#L276-L299) while it returns an array.
2021-05-01T13:05:17
php
Hard
pusher/pusher-http-php
298
pusher__pusher-http-php-298
[ "22" ]
e402b838ea316ed0d80d894cb5ac8b41410809d0
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,8 @@ jobs: - name: Prepare README run: | export MAJOR=$(echo "${{ env.VERSION }}" | cut -d'.' -f1) - sed -i "s|\"pusher/push...
diff --git a/tests/acceptance/TriggerAsyncTest.php b/tests/acceptance/TriggerAsyncTest.php new file mode 100644 --- /dev/null +++ b/tests/acceptance/TriggerAsyncTest.php @@ -0,0 +1,121 @@ +<?php + +class TriggerAsyncTest extends PHPUnit\Framework\TestCase +{ + protected function setUp(): void + { + if (PUS...
Provide a way to asynchronously trigger events This is an issue to keep track of the demand for triggering event asynchronously. There are a couple of pull requests to add this functionality but neither provide any tests. See #4 and #11. We're looking at sorting out a number of libraries so I'm cleaning out some olde...
This would be super useful, as triggering events inline presents a serious scaling issue. Has anyone come up with a successful implementation of a trigger_async method for the php client library, or is there a reason this was not possible? Would be preferable to start using Guzzle here, as proposed in #95 Note: t...
2021-03-17T13:57:24
php
Hard
pusher/pusher-http-php
160
pusher__pusher-http-php-160
[ "157" ]
d88d26918a551623928cc15e45b2535c7962ce05
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -345,12 +345,23 @@ $pusher->notify(array("test"), $data); ## Debugging & Logging -The best way to debug your applications interaction with server is to set a logger -for the library so you can see the internal workings within the library and int...
diff --git a/tests/TestLogger.php b/tests/TestLogger.php --- a/tests/TestLogger.php +++ b/tests/TestLogger.php @@ -1,9 +1,21 @@ <?php -class TestLogger +use Psr\Log\AbstractLogger; + +class TestLogger extends AbstractLogger { - public function log($msg) + /** + * {@inheritdoc} + */ + public functio...
Log Level is not defined with Monolog We use Monolog for my Logger implementation in my app. When I set the logger in Pusher client we obtain this error: "Exception: Level "Pusher: INFO: create_curl( https://api-eu.pusher.com:443/apps/*****************&auth_version=1.0&body_md5=************* )" is not defined, use o...
A quick and shitty solution is write a wrapper for encapsulate the `Psr\Log\LoggerInterface`. ```php use Psr\Log\LoggerInterface; class PsrToPusherLogger { protected $defaultLevel; protected $logger; public function __construct(LoggerInterface $logger, $defaultLevel = 100) { $this->logg...
2018-04-04T18:29:09
php
Hard
pusher/pusher-http-php
24
pusher__pusher-http-php-24
[ "23" ]
d5b4e8bec7fc5e53651c879495a74e96b1bc2cea
diff --git a/.travis.yml b/.travis.yml new file mode 100644 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +# see http://about.travis-ci.org/docs/user/languages/php/ for more hints +language: php + +# list any PHP version you want to test against +php: + # using major version aliases + + # aliased to 5.3.29 + - 5....
diff --git a/test/acceptance/channelQueryTest.php b/test/acceptance/channelQueryTest.php --- a/test/acceptance/channelQueryTest.php +++ b/test/acceptance/channelQueryTest.php @@ -1,6 +1,4 @@ <?php - - require_once( dirname(__FILE__) . '/../test_includes.php' ); class PusherChannelQueryTest extends PHPUnit_Framew...
Provide more feedback when cURL execution returns 0 See: http://php.net/manual/en/function.curl-error.php Right now the status code is set to 0 and the body blank. More information should be supplied to make it easier to debug what's going on with the library.
2015-01-20T17:34:44
php
Hard
sdsykes/fastimage
52
sdsykes__fastimage-52
[ "51" ]
88355932a9ca83c176c5fdb492c10c313bdc1d40
diff --git a/README.textile b/README.textile --- a/README.textile +++ b/README.textile @@ -51,6 +51,8 @@ FastImage.size("http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_135066 => FastImage::ImageFetchFailure: FastImage::ImageFetchFailure FastImage.size("http://upload.wikimedia.org/wikipedia/commons/b/b4/Mar...
diff --git a/test/test.rb b/test/test.rb --- a/test/test.rb +++ b/test/test.rb @@ -297,4 +297,18 @@ def test_cant_access_shell ensure %x{rm -f shell_test} end + + def test_content_length + url = "#{TestUrl}with_content_length.gif" + FakeWeb.register_uri(:get, url, :body => File.join(FixturePath, "test...
Can it return file size too? I am planning to develop a PR, but want to know what you think of it. I use Fastimage to validate remote image fetching. It is good for determining both the size and also the type of image. However I often need to validate file size as well. I am guessing this can be done during when Fasti...
2015-05-11T12:08:03
ruby
Hard
yippee-fun/phlex
545
yippee-fun__phlex-545
[ "544" ]
8ee184bf42621ae00dd87858b76ad10232e32b3b
diff --git a/lib/phlex/elements.rb b/lib/phlex/elements.rb --- a/lib/phlex/elements.rb +++ b/lib/phlex/elements.rb @@ -28,6 +28,7 @@ def registered_elements # Register a custom element. This macro defines an element method for the current class and descendents only. There is no global element registry. # @param met...
diff --git a/test/phlex/view/text.rb b/test/phlex/view/plain.rb similarity index 59% rename from test/phlex/view/text.rb rename to test/phlex/view/plain.rb --- a/test/phlex/view/text.rb +++ b/test/phlex/view/plain.rb @@ -39,16 +39,15 @@ def template end end - with "deprecated text method" do + with "an object th...
Raise an error when `plain` is called with an object that can’t be formatted We should extract a specialised private `__text__` method for `yield_content` that doesn’t raise.
2023-03-27T18:30:37
ruby
Hard
yippee-fun/phlex
377
yippee-fun__phlex-377
[ "365" ]
3d8180837afa58ebd7baa969fb8d6785f4063896
diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -5,11 +5,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gemspec -gem "benchmark-ips" -gem "benchmark-memory" -gem "capybara" gem "rubocop" -gem "solargraph" gem "sus" gem "syntax_suggest" gem "zeitwerk"
diff --git a/lib/phlex/testing/capybara.rb b/lib/phlex/testing/capybara.rb deleted file mode 100644 --- a/lib/phlex/testing/capybara.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require "capybara" -require_relative "view_helper" - -module Phlex::Testing - module Capybara - module ViewHelper - ...
Extract nokogiri and capybara testing extensions
2022-11-22T21:33:18
ruby
Hard
JEG2/highline
110
JEG2__highline-110
[ "108" ]
7373e52321c3c1e749199e12f0b503a014329dcb
diff --git a/lib/highline.rb b/lib/highline.rb --- a/lib/highline.rb +++ b/lib/highline.rb @@ -617,13 +617,15 @@ def say( statement ) statement = format_statement(statement) return unless statement.length > 0 - # Don't add a newline if statement ends with whitespace, OR + out = (indentation+statemen...
diff --git a/test/tc_menu.rb b/test/tc_menu.rb --- a/test/tc_menu.rb +++ b/test/tc_menu.rb @@ -75,7 +75,7 @@ def test_unicode_flow # Default: menu.flow = :rows menu.choice "Unicode right single quotation mark: ’" end - assert_equal("1. Unicode right single quotation mark: ’\n? ", @output.string)...
test_unicode_flow(TestMenu) test error I observe the following error: ``` Error: test_unicode_flow(TestMenu) ArgumentError: invalid byte sequence in US-ASCII /builddir/build/BUILD/rubygem-highline-1.6.21/usr/share/gems/gems/highline-1.6.21/lib/highline.rb:724:in `gsub' /builddir/build/BUILD/rubygem-highline-1.6.21/u...
Thanks for sharing the problem and hunting down the cause!
2014-07-09T17:56:11
ruby
Hard
yippee-fun/phlex
917
yippee-fun__phlex-917
[ "919" ]
4921cbe0ffb8dbb6f13a1ec1c689a12ee62aa587
diff --git a/.rubocop-https---www-goodcop-style-base-yml b/.rubocop-https---www-goodcop-style-base-yml --- a/.rubocop-https---www-goodcop-style-base-yml +++ b/.rubocop-https---www-goodcop-style-base-yml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json --- AllCops: DisabledBy...
diff --git a/quickdraw/compilation_equivalence.test.rb b/quickdraw/compilation_equivalence.test.rb new file mode 100644 --- /dev/null +++ b/quickdraw/compilation_equivalence.test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +Dir["./compilation_equivalence_cases/*.rb", base: File.dirname(__FILE__)].each do |file...
Generate source maps We should be able to create source maps from the compiled source back to the original source code.
2025-07-08T14:22:34
ruby
Hard
yippee-fun/phlex
515
yippee-fun__phlex-515
[ "467" ]
850c9be4381dc8b50b3a170ad0adfc932311ee17
diff --git a/lib/phlex/elements.rb b/lib/phlex/elements.rb --- a/lib/phlex/elements.rb +++ b/lib/phlex/elements.rb @@ -20,11 +20,11 @@ def register_element(element, tag: element.name.tr("_", "-")) def __phlex_#{element}__(**attributes, &block) if attributes.length > 0 if block_given? - @_target << "...
diff --git a/test/phlex/view/process_attributes.rb b/test/phlex/view/process_attributes.rb new file mode 100644 --- /dev/null +++ b/test/phlex/view/process_attributes.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +describe Phlex::HTML do + extend ViewHelper + + view do + def template + div(class: "foo") + en...
Provide an official attributes hook A few people have expressed an interest in overriding `__attributes__` in order to prepare or validate their tag attributes in some unique way. This is not a supported use-case and was recently broken by #459. I’m opening this issue to explore the possibility of exposing an offici...
I have a few uses for this... 1. Be able to side load assets (js, css, etc) whenever specific html classes or other attributes are used. 2. Add/remove/modify attributes based on other attributes. Kind of like shortcuts Because these are based on attributes used and will modify the attributes, using the around templ...
2023-03-05T10:22:19
ruby
Hard
yippee-fun/phlex
251
yippee-fun__phlex-251
[ "179" ]
58b5a8231ac45b54a2950632e6fdb39236d6f605
diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem "webrick", group: [:docs] gem "zeitwerk", group: [:docs] gem "redcarpet", group: [:docs] gem "combustion", group: [:test] +gem "i18n", group: [:test] gem "benchmark-ips" gem "htmlbeautifier", group: [:docs] gem "benchmark-memory" dif...
diff --git a/test/phlex/translation.rb b/test/phlex/translation.rb new file mode 100644 --- /dev/null +++ b/test/phlex/translation.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Phlex::Translation do + extend ViewHelper + + describe "#translate" do + with "key starting with '.'...
Better i18n support Currently Phlex does not provide anything for i18n, one can include `I18n` and then use the translation helpers with absolute keys. So while this works, adding the rails helpers for i18n will cause problems, when trying to use relative keys like `t(".new")`, it will raise an error, that there is ...
> as you can see, it's easy to include, but you also need to provide the @virtual_path variable. What are your thoughts about this, I feel like i18n should work out of the box. I agree. Translation should work out of the box when it's available in Rails and we might even be able to provide translation features for n...
2022-10-12T23:56:16
ruby
Hard
rubyzip/rubyzip
411
rubyzip__rubyzip-411
[ "410", "410" ]
2825898f69fbf1efe4e43452adae6ac5d074ec1c
diff --git a/lib/zip.rb b/lib/zip.rb --- a/lib/zip.rb +++ b/lib/zip.rb @@ -1,7 +1,6 @@ require 'delegate' require 'singleton' require 'tempfile' -require 'tmpdir' require 'fileutils' require 'stringio' require 'zlib' diff --git a/lib/zip/streamable_stream.rb b/lib/zip/streamable_stream.rb --- a/lib/zip/streamable...
diff --git a/test/test_helper.rb b/test/test_helper.rb --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,7 @@ require 'minitest/autorun' require 'minitest/unit' require 'fileutils' +require 'tmpdir' require 'digest/sha1' require 'zip' require 'gentestfiles'
Tempfile problems on Windows The same code used on Windows and Linux behaves differently. Everything works fine on Linux, but on Windows I get errors when trying to open a stream from a zip file that includes a folder/directory name. 10: from P:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rubyzip-2.0.0/lib/zip/file...
This does seem a bit odd. I'll have a think about this and work up a fix if I can't see any reason why this is currently set up the way that it is. @jdleesmiller you can assign this to me if you like. This does seem a bit odd. I'll have a think about this and work up a fix if I can't see any reason why this is curre...
2019-10-01T09:39:04
ruby
Hard
yippee-fun/phlex
302
yippee-fun__phlex-302
[ "301" ]
19f103afaa5fea30d686eb7ef58d50c060f8f79f
diff --git a/docs/pages/templates.rb b/docs/pages/templates.rb --- a/docs/pages/templates.rb +++ b/docs/pages/templates.rb @@ -76,6 +76,32 @@ def template e.execute "ChannelControls.new.call" end + render Markdown.new(<<~MD) + ## Processing Attributes + + Sometimes you may want to process, modif...
diff --git a/test/phlex/compilation/standard_element.rb b/test/phlex/compilation/standard_element.rb --- a/test/phlex/compilation/standard_element.rb +++ b/test/phlex/compilation/standard_element.rb @@ -26,7 +26,7 @@ def template expected = <<~RUBY def template - @_target << "<h1" << process_attributes(clas...
Security risk with `process_attributes` override @joelmoss I’ve just realised a possible problem with encouraging people to override `process_attributes`. If you don’t call `super` but return a String instead, you lose a bunch of security features. I wonder if we should go back to the idea of having `process_attribu...
Oh the joys of forgetting 'super' 😩 I would always prefer not having to worry about super, but you you've been quite persistent on maintaining performance. I suppose we have to pick our battles, and consider if it's a minor perf hit. Yeah, I think we should take the performance hit unfortunately. We can optimise it...
2022-10-26T22:00:03
ruby
Hard
JEG2/highline
259
JEG2__highline-259
[ "236" ]
7755f1f3f3b80e4c1c48446ea8234eaf954e6538
diff --git a/lib/highline.rb b/lib/highline.rb --- a/lib/highline.rb +++ b/lib/highline.rb @@ -538,6 +538,7 @@ def get_line_raw_no_echo_mode(question) terminal.raw_no_echo_mode_exec do loop do character = terminal.get_character + raise Interrupt if character == "\u0003" break unless...
diff --git a/test/test_highline.rb b/test/test_highline.rb --- a/test/test_highline.rb +++ b/test/test_highline.rb @@ -1300,6 +1300,20 @@ def test_echoing_with_utf8_when_echo_is_star assert_equal("maçã", answer) end + def test_echo_false_with_ctrl_c_interrupts + @input << "String with a ctrl-c at the end ...
Ctrl-C improperly handled when q.echo = false Hi, Just noticed something a little odd with the handling of a ctrl-c while in an `ask` with echo set to false. ``` #!/usr/bin/env ruby require 'highline' cli = HighLine.new cli.ask("Password?") {|q| q.echo = false} cli.ask("Anything else?") ``` ``` $ ./...
I'll be having a look at it as soon as possible. HighLine dates from a time where all the hard work should be done by it. This is probably an issue related to the fact that HighLine is handling all cases related to special characters like backspace and others. If you come up with a PR, feel free to open it, I would ...
2023-01-04T09:52:48
ruby
Hard
rubyzip/rubyzip
486
rubyzip__rubyzip-486
[ "422", "336" ]
098bce399afacff6bb2534cca570eb97ca8463ef
diff --git a/Changelog.md b/Changelog.md --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ # 3.0.0 (Next) +- Fix restore options consistency. [#486](https://github.com/rubyzip/rubyzip/pull/486) +- View and/or preserve original date created, date modified? (Windows). [#336](https://github.com/rubyzip/rubyzip/issu...
diff --git a/test/file_options_test.rb b/test/file_options_test.rb --- a/test/file_options_test.rb +++ b/test/file_options_test.rb @@ -23,7 +23,7 @@ def teardown ::File.unlink(TXTPATH_755) if ::File.exist?(TXTPATH_755) end - def test_restore_permissions + def test_restore_permissions_true # Copy and se...
Inconsistent behaviour of `Zip::File#get_entry` and `Zip::File#find_entry` exposes options out of sync. This is a funny one that has been exposed by fixing #395... The defaults for `restore_times`, `restore_permissions` and `restore_ownership` are separately specified in both `Zip::File` and `Zip::Entry` and they ar...
Good find. PR approved. > should these options be moved up to the top level I feel like the same (large) application might want to treat zips differently in this regard for one feature vs another, so I am not sure about moving them to top level. A small improvement might be to move the hash with the defaults t...
2021-05-31T17:12:35
ruby
Hard
rubyzip/rubyzip
237
rubyzip__rubyzip-237
[ "204" ]
bbd7cc42167e70eafa4da114e4c8f431bb569789
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -141,6 +141,16 @@ fruit/orange After this, entries in the zip archive will be saved in ordered state. +### Default permissions of zip archives + +On Posix file systems the default file permissions applied to a new archive +are (0666 - umask), wh...
diff --git a/test/file_permissions_test.rb b/test/file_permissions_test.rb new file mode 100644 --- /dev/null +++ b/test/file_permissions_test.rb @@ -0,0 +1,69 @@ +require 'test_helper' + +class FilePermissionsTest < MiniTest::Test + + FILENAME = File.join(File.dirname(__FILE__), "umask.zip") + + def teardown + ::...
0600 ZIP file permissions with umask 0022 I do: ``` ruby Zip::File.open(zip_file, Zip::File::CREATE) do |zip| begin zip.add(name, bin) rescue Zip::ZipEntryExistsError zip.replace(name, bin) end end ``` Is there a reason, I get `0600` file permissions on my `zip_file` instead of `0644`, I would expect? D...
@chillum Rubyzip uses Tempfile for create a file of newly created zip archive. So created file will have only 600 due the security reasons. But you can use `File.chmod` for extend permissions. I'm not sure I follow the logic here. The bug submitted is that rubyzip doesn't do what is generally expected of programs tha...
2015-06-24T17:34:46
ruby
Hard
yippee-fun/phlex
202
yippee-fun__phlex-202
[ "19" ]
e96ea1aaa6adff4688a96cca380e444ee056500e
diff --git a/.rubocop.yml b/.rubocop.yml --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,3 +4,20 @@ inherit_from: AllCops: TargetRubyVersion: 2.7 + +Style/PercentLiteralDelimiters: + Enabled: false + +Layout/CaseIndentation: + Enabled: false + +Style/StringConcatenation: + Enabled: false + + + +Security/Eval: + E...
diff --git a/fixtures/compiler_test_helpers.rb b/fixtures/compiler_test_helpers.rb new file mode 100644 --- /dev/null +++ b/fixtures/compiler_test_helpers.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module CompilerTestHelpers + # @return Array + def compile(view) + @compiler = Phlex::Compiler.new(view) + ou...
Compiled components
2022-09-28T12:12:44
ruby
Hard
yippee-fun/phlex
703
yippee-fun__phlex-703
[ "632" ]
756b006bfd70c8a16a430b94db63a6404d8653f5
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,16 +11,11 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest"] ruby-version: - - "2.7" - - "3.0" - - "3.1" - "3.2" ...
diff --git a/lib/phlex/testing/view_helper.rb b/lib/phlex/testing/view_helper.rb --- a/lib/phlex/testing/view_helper.rb +++ b/lib/phlex/testing/view_helper.rb @@ -7,7 +7,7 @@ def render(view, &block) view = view.new end - view.call(view_context: view_context, &block) + view.call(view_context:, &block) ...
Remove the `<param>` element - [ ] Issue a warning in 1.x - [ ] Remove in 2.0
First item solved by: https://github.com/phlex-ruby/phlex/pull/642 @stephannv That `deprecated: true` argument is just a no-op at the moment. We need to update the generated elemen method to issue a warning if that flag is set.
2024-04-06T01:25:01
ruby
Hard
JEG2/highline
274
JEG2__highline-274
[ "273" ]
3de8af1ea83016ede666f33917233fb7a6854fb7
diff --git a/.rubocop.yml b/.rubocop.yml --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,8 @@ # https://github.com/bbatsov/rubocop/tree/master/config AllCops: - TargetRubyVersion: 2.1 + TargetRubyVersion: 3.3 + NewCops: enable # General @@ -58,7 +59,7 @@ Style/OptionalArguments: - 'lib/highline/list_r...
diff --git a/bin/test b/bin/test new file mode 100755 --- /dev/null +++ b/bin/test @@ -0,0 +1,11 @@ +#!/bin/bash -e +test "$#" -ne 0 && echo "Unsupported args: $@" >&2 && exit 145 +cd "$( dirname "${BASH_SOURCE[0]}" )"/.. + +export COMPOSE_FILE=test/docker-compose.yml +export COMPOSE_PROJECT_NAME=highline_dev + +docker...
`::add_to_color_scheme` improvement Hi, thanks for the useful gem. I've been using the following extension for a while, and if you like it too, I could make it into a PR or something. ```ruby class HighLine class << self def add_to_color_scheme(hash) old_hash = (color_scheme || {}).to_hash fail...
I think this addition doesn't change any previous behavior. So I would welcome a PR as it sounds a good idea. Could you please add tests along the PR? I can help you with any doubt in the code base. Sorry for taking so long to answer.
2024-08-03T21:24:00
ruby
Hard
rubyzip/rubyzip
150
rubyzip__rubyzip-150
[ "57", "57" ]
63d9ae4c3e55a11ce74be42928ff59a57f259560
diff --git a/lib/zip/entry.rb b/lib/zip/entry.rb --- a/lib/zip/entry.rb +++ b/lib/zip/entry.rb @@ -560,6 +560,10 @@ def get_raw_input_stream(&block) end end + def clean_up + # By default, do nothing + end + private def set_time(binary_dos_date, binary_dos_time) diff --git a/lib/zip/...
diff --git a/test/file_test.rb b/test/file_test.rb --- a/test/file_test.rb +++ b/test/file_test.rb @@ -89,6 +89,22 @@ def test_get_output_stream } end + def test_cleans_up_tempfiles_after_close + comment = "a short comment" + + zf = ::Zip::File.new(EMPTY_FILENAME, ::Zip::File::CREATE) + zf.get_outpu...
Temp files created in get_output_stream not unlinked I have an issue when I am using rubyzip in a daemon and a lot of tempfiles are creeated (and persist) in the folder where I am creating the zip files. This seems to be because the temp files which are created are not explicitly unlinked and remain on the disk until ...
It's how works Tempfile. If you don't like it please send me patch. I will have a look into writing a patch. According to the Tempfile docs it is good practice: ## Good practices ### Explicit close When a Tempfile object is garbage collected, or when the Ruby interpreter exits, its associated temporary file is auto...
2014-04-04T21:34:25
ruby
Hard
yippee-fun/phlex
940
yippee-fun__phlex-940
[ "920" ]
8a806f8a7ad4227a6fe0cdef74f3c29760ce66df
diff --git a/lib/phlex/compiler/class_compiler.rb b/lib/phlex/compiler/class_compiler.rb --- a/lib/phlex/compiler/class_compiler.rb +++ b/lib/phlex/compiler/class_compiler.rb @@ -11,11 +11,12 @@ def compile(node) def visit_def_node(node) return if node.name == :initialize + return if node.receiver compiled...
diff --git a/quickdraw/compiler.test.rb b/quickdraw/compiler.test.rb --- a/quickdraw/compiler.test.rb +++ b/quickdraw/compiler.test.rb @@ -28,7 +28,7 @@ def foo compiled = Phlex::Compiler::MethodCompiler.new(Phlex::HTML).compile(snippet) - puts compiled + # puts compiled assert_equal compiled.strip, out = <<~...
Ensure we only compile instance methods
2025-07-09T16:59:48
ruby
Hard
yippee-fun/phlex
889
yippee-fun__phlex-889
[ "887" ]
c868b804fe23807c77b54d7d06af3ea4fe002ec3
diff --git a/lib/phlex/helpers.rb b/lib/phlex/helpers.rb --- a/lib/phlex/helpers.rb +++ b/lib/phlex/helpers.rb @@ -26,6 +26,10 @@ def mix(*args) [old] + new.to_a in [String, String] "#{old} #{new}" + in [_, Hash] + { _: old, **new } + in [Hash, _] + { **old, _: new } in [_, nil] ...
diff --git a/quickdraw/helpers/mix.test.rb b/quickdraw/helpers/mix.test.rb --- a/quickdraw/helpers/mix.test.rb +++ b/quickdraw/helpers/mix.test.rb @@ -33,7 +33,7 @@ { data: { controller: "bar" } }, ) - assert_equal output, { data: { controller: "bar" } } + assert_equal output, { data: { _: ["foo"], controller: "...
Support root hash property with flattened hash attributes ```ruby div(data: { _: "root", foo: "bar" }) ``` ```html <div data="root" data-foo="bar'></div> ``` We should also update `mix` to support this. ```ruby in [_, Hash] { _: old, **new } in [Hash, _] { **old, _: new } ```
2025-04-04T17:59:26
ruby
Hard
sdsykes/fastimage
155
sdsykes__fastimage-155
[ "158" ]
054f5633212c1083aed76fee9e3b09283b45ff83
diff --git a/CHANGELOG b/CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,17 @@ +Version 2.4.0 + +03-Jan-2025 + +- IMPROVED: Refactor code into multiple files +- FIX: error rising from redirects to unknown url scheme +- FIX: Handle tiff format with long dimensions values +- FIX: Remove problematic dependency on bas...
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,10 @@ jobs: - '3.0' - '3.1' - '3.2' + - '3.3' + - '3.4' steps: - - uses: actions/checkout@v3 + - uses: act...
FastImage.size() breaks on some iPhone .DNG/.TIFF images. Possibly ProRaw related? There are some iPhone-generated .DNGs that seem to be causing `FastImage.size()` to return [0,0]. Given these example images (not mine): https://www.dropbox.com/scl/fo/w76njtviyc2tipplny42k/AJuB_2lZhZyiyHgWgGgsyNA?dl=0&e=2&rlkey=fh7r7...
2024-04-01T18:21:29
ruby
Hard
yippee-fun/phlex
697
yippee-fun__phlex-697
[ "657" ]
a68bb2d6b8fb82bc3dff117304e82737bc46a3cc
diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,10 @@ gemspec group :test do gem "sus" + if RUBY_ENGINE == "ruby" && RUBY_VERSION[0] > "3" + gem "async" + end + gem "concurrent-ruby" end group :development do diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb --- a/lib/phlex/sgml.rb +++ ...
diff --git a/test/phlex/sgml/await.rb b/test/phlex/sgml/await.rb new file mode 100644 --- /dev/null +++ b/test/phlex/sgml/await.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +class Example < Phlex::HTML + def initialize(task) + @task = task + end + + def view_template + h1 { "Before" } + + await(@task).then d...
Make `flush` and `await` public
2024-03-27T21:04:17
ruby
Hard
rubyzip/rubyzip
168
rubyzip__rubyzip-168
[ "164" ]
2ef328b11ba55b78ef52bc46e1aedaf7d87b997e
diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,5 @@ .idea *.gem -test/5entry_copy.zip -test/cdirtest.bin -test/cdir64test.bin -test/huge.zip -test/centralEntryHeader.bin -test/data/generated/ -test/deflatertest.bin -test/compressiontest_*.bin -test/dummy.txt -test/localEntryHeader....
diff --git a/test/basic_zip_file_test.rb b/test/basic_zip_file_test.rb --- a/test/basic_zip_file_test.rb +++ b/test/basic_zip_file_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class BasicZipFileTest < MiniTest::Unit::TestCase +class BasicZipFileTest < MiniTest::Test include AssertEntry def setup diff --git...
Seemingly random test failures in Travis I can't reproduce this locally, all tests pass all the time, but on Travis we are seeing different jobs within builds fail each time: - https://travis-ci.org/rubyzip/rubyzip/builds/28115164 (ruby-head and jruby oracle fail) - https://travis-ci.org/rubyzip/rubyzip/builds/28153919...
I've had another look at this and noticed that Travis was installing later versions of some gems than I had installed on my machine. So I did a `bundle update`: ``` $ bundle update Fetching gem metadata from https://rubygems.org/......... Fetching additional metadata from https://rubygems.org/.. Resolving dependencies...
2014-07-15T17:31:22
ruby
Hard
rubyzip/rubyzip
504
rubyzip__rubyzip-504
[ "503" ]
4cf801c5f334d989000aeabfed53edd1263551a0
diff --git a/lib/zip/entry.rb b/lib/zip/entry.rb --- a/lib/zip/entry.rb +++ b/lib/zip/entry.rb @@ -83,14 +83,21 @@ def initialize( @ftype = name_is_directory? ? :directory : :file @zipfile = zipfile - @comment = comment - @compression_method = compression_method - @c...
diff --git a/test/entry_test.rb b/test/entry_test.rb --- a/test/entry_test.rb +++ b/test/entry_test.rb @@ -26,7 +26,10 @@ def test_constructor_and_getters assert_equal(TEST_COMPRESSIONMETHOD, entry.compression_method) assert_equal(TEST_NAME, entry.name) assert_equal(TEST_SIZE, entry.size) - assert_equ...
Can't set time with get_output_stream I'm trying to put an entry with some arbitrary timestamp into the zip file, but it doesn't work, it always writes `Time.now`: ```ruby require 'zip' time = Time.new '2020-01-01' # some random date Zip::File.open 'foo.zip', create: true do |zip| e = Zip::Entry.new zip.name, 's...
Hi @u3shit, thanks for reporting this. I think I see what's going wrong here: presumably the type mismatch between `StreamableStream` and `Entry`. I wasn't around when this was written, so I don't know the subtleties of why `StreamableStream` is a delegate, rather than a subclass, of `Entry`, but just naively wideni...
2021-11-07T22:44:30
ruby
Hard
rubyzip/rubyzip
300
rubyzip__rubyzip-300
[ "294", "294" ]
7aa3666e341b4ecf3b66321d734802a77bba962b
diff --git a/lib/zip/file.rb b/lib/zip/file.rb --- a/lib/zip/file.rb +++ b/lib/zip/file.rb @@ -43,7 +43,7 @@ module Zip # interface for accessing the filesystem, ie. the File and Dir classes. class File < CentralDirectory - CREATE = 1 + CREATE = true SPLIT_SIGNATURE =...
diff --git a/test/file_permissions_test.rb b/test/file_permissions_test.rb --- a/test/file_permissions_test.rb +++ b/test/file_permissions_test.rb @@ -2,58 +2,58 @@ class FilePermissionsTest < MiniTest::Test - FILENAME = File.join(File.dirname(__FILE__), "umask.zip") + ZIPNAME = File.join(File.dirname(__FILE__),...
Set correct file permissions given a umask of 0027 We lock down our umask to 0027 so that files are not globally readable. When creating files via `File.open` this results in files with permissions of 0640 (i.e. `rw-r----`) but zip files created with this library end up with the very odd permission of 0637 (e.g. `rw--w...
2016-09-01T11:40:45
ruby
Hard
rubyzip/rubyzip
413
rubyzip__rubyzip-413
[ "395" ]
e43e36057cd11ced462dd6918dff99f2ce1463fd
diff --git a/lib/zip/dos_time.rb b/lib/zip/dos_time.rb --- a/lib/zip/dos_time.rb +++ b/lib/zip/dos_time.rb @@ -29,6 +29,11 @@ def dos_equals(other) to_i / 2 == other.to_i / 2 end + # Create a DOSTime instance from a vanilla Time instance. + def self.from_time(time) + local(time.year, time.month...
diff --git a/test/file_options_test.rb b/test/file_options_test.rb new file mode 100644 --- /dev/null +++ b/test/file_options_test.rb @@ -0,0 +1,89 @@ +require 'test_helper' + +class FileOptionsTest < MiniTest::Test + ZIPPATH = ::File.join(Dir.tmpdir, 'options.zip').freeze + TXTPATH = ::File.expand_path(::File.join('...
Options not working in File class This code https://github.com/rubyzip/rubyzip/blob/249775f5637e6d65112574b3ac1763dc2393c7f6/lib/zip/file.rb#L88-L89 doesn't do what it is intended to do, because when you pass in `restore_permissions: false` or `restore_times: false`, it will be evaluating to `false || true`, which wi...
Interestingly the options code doesn't agree with the comments about defaults above either: https://github.com/rubyzip/rubyzip/blob/94b7fa276992933592d69eb6bb17fc09105f8395/lib/zip/file.rb#L56-L61 vs https://github.com/rubyzip/rubyzip/blob/94b7fa276992933592d69eb6bb17fc09105f8395/lib/zip/file.rb#L101-L103 I...
2019-10-07T10:22:37
ruby
Hard
yippee-fun/phlex
709
yippee-fun__phlex-709
[ "708" ]
5f9fbb52b307818721c2c3bda61661dfc93291da
diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb --- a/lib/phlex/sgml.rb +++ b/lib/phlex/sgml.rb @@ -393,9 +393,9 @@ def __attributes__(attributes, buffer = +"") when true buffer << " " << name when String - buffer << " " << name << '="' << Phlex::Escape.html_escape(v) << '"' + buffer << " " <...
diff --git a/test/phlex/view/capture.rb b/test/phlex/view/capture.rb --- a/test/phlex/view/capture.rb +++ b/test/phlex/view/capture.rb @@ -92,13 +92,13 @@ def view_template end it "should contain the full capture" do - expect(example.call(view_context: self)).to be == %(<h1>Before</h1><iframe srcdoc="&lt;h1&g...
Attribute values being converted to HTML entities (when they should not) If there's a need to add inline style, with background property ```ruby class Nav < Phlex::HTML def template nav(class: "main-nav", style: "background: url('foo.jpg') no-repeat center center / cover;") { ul { li { a(hre...
oii @fernandes While [single (and double) quotes are allowed](https://developer.mozilla.org/en-US/docs/Web/CSS/url), you can also omit them, and off the top of my head I think I usually see the quotes omitted. So yes this looks like a bug, but I expect that you can easily work around it just by omitting the single q...
2024-04-23T09:19:10
ruby
Hard
rubyzip/rubyzip
507
rubyzip__rubyzip-507
[ "505" ]
f7cd692e15d80addc7abeb7bfde643e1649a1390
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -61,6 +61,7 @@ Style/ClassAndModuleChildren: - 'lib/zip/extra_field/old_unix.rb' - 'lib/zip/extra_field/universal_time.rb' - 'lib/zip/extra_field/unix.rb' + - 'lib/zip/extra_field/unknown.rb' - '...
diff --git a/test/extra_field_test.rb b/test/extra_field_test.rb --- a/test/extra_field_test.rb +++ b/test/extra_field_test.rb @@ -6,17 +6,29 @@ class ZipExtraFieldTest < MiniTest::Test def test_new extra_pure = ::Zip::ExtraField.new('') extra_withstr = ::Zip::ExtraField.new('foo') + extra_withstr_local...
Unknown extra fields are not merged correctly when loading. When loading extra fields from both the central directory and local headers, unknown fields are not merged correctly. Currently they are appended, which means that we end up with the two versions stuck together. This potentially causes all sorts of subtle i...
2021-11-16T21:54:53
ruby
Hard
rubyzip/rubyzip
554
rubyzip__rubyzip-554
[ "540" ]
58f053afb09e287c936bced568b9b1034763c062
diff --git a/lib/zip/entry.rb b/lib/zip/entry.rb --- a/lib/zip/entry.rb +++ b/lib/zip/entry.rb @@ -247,21 +247,25 @@ def next_header_offset #:nodoc:all local_entry_offset + compressed_size end - # Extracts entry to file dest_path (defaults to @name). - # NB: The caller is responsible for making sure...
diff --git a/test/file_extract_directory_test.rb b/test/file_extract_directory_test.rb --- a/test/file_extract_directory_test.rb +++ b/test/file_extract_directory_test.rb @@ -48,7 +48,7 @@ def test_extract_directory_exists_as_file_overwrite called = false extract_test_dir do |entry, dest_path| called =...
Directory traversal vulnerability ## Summary In version 2.3.2, we are again experiencing the exact same problem as below. https://github.com/rubyzip/rubyzip/issues/315 ## PoC ``` root@ea8d5cb86e9f:/work# ruby -v ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux] root@ea8d5cb86e9f:/work# uname -a ...
Sorry. I missed reading the following. https://github.com/rubyzip/rubyzip/blob/v2.3.2/lib/zip/entry.rb#L174 Is there any particular plan to correct this issue? If not, we will close this Issue and propose a fix in the Security Advisory. https://github.com/github/advisory-database/pull/832 Hi @wonda-tea-coffee and t...
2023-04-08T06:49:40
ruby
Hard
JEG2/highline
222
JEG2__highline-222
[ "221" ]
413ad89036ab535e53642c66333e9622323fdf32
diff --git a/Changelog.md b/Changelog.md --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,9 @@ Below is a complete listing of changes for each revision of HighLine. +### 2.0.0-develop.14 / 2017-11-21 +* PR #222 / I #221 - Fix inconsistent behaviour when using agree with readline (@abinoam, @ailisp) + ### 2.0.0-de...
diff --git a/test/acceptance/at_readline_agree.rb b/test/acceptance/at_readline_agree.rb new file mode 100644 --- /dev/null +++ b/test/acceptance/at_readline_agree.rb @@ -0,0 +1,18 @@ +# coding: utf-8 + +require_relative "acceptance_test" + +HighLine::AcceptanceTest.check do |t| + t.desc = + "This step checks if th...
Incosistent behavior when ask with a validator and readline=true Hi, we're using highline in a console for a cloud management platform: https://github.com/manageiq/manageiq-appliance_console. Recently we add all `Highline.ask` with `readline=true` option to add arrow key navigation. It works fine for no validator `ask`...
Hi @ailisp, Thanks for reporting the issue. What exactly is happening on your setup? What **behaviour** is inconsistent? Hi @abinoam Thanks for quick response. In a clone of current master branch. save the content I provide in previous comment as test.rb: ``` [boyao@new-host highline]$ bundler exec ./test.rb ...
2017-11-22T01:09:40
ruby
Hard
rubyzip/rubyzip
363
rubyzip__rubyzip-363
[ "356" ]
8887b703490337f7ab68ebfb4880354db28ba648
diff --git a/lib/zip/filesystem.rb b/lib/zip/filesystem.rb --- a/lib/zip/filesystem.rb +++ b/lib/zip/filesystem.rb @@ -573,6 +573,10 @@ def get_output_stream(fileName, permissionInt = nil, &aProc) @zipFile.get_output_stream(expand_to_entry(fileName), permissionInt, &aProc) end + def glob(pattern,...
diff --git a/test/filesystem/directory_test.rb b/test/filesystem/directory_test.rb --- a/test/filesystem/directory_test.rb +++ b/test/filesystem/directory_test.rb @@ -3,6 +3,7 @@ class ZipFsDirectoryTest < MiniTest::Test TEST_ZIP = 'test/data/generated/zipWithDirs_copy.zip' + GLOB_TEST_ZIP = 'test/data/globTest....
`Zip::FileSystem::ZipFsDir#glob` triggers non-existing `Zip::FileSystem::ZipFileNameMapper#glob` method Code: ```ruby require 'zip' require 'zip/filesystem' Zip::File.open('archive.zip') do |zip_file| zip_file.dir.glob('flags/**/*') end ``` Output: ``` NoMethodError: undefined method `glob' for #<Zi...
2018-04-30T21:46:51
ruby
Hard
rubyzip/rubyzip
462
rubyzip__rubyzip-462
[ "461", "461" ]
e5e3f97ec891cb596f1af8950fc9749c99b809e9
diff --git a/Changelog.md b/Changelog.md --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ # X.X.X (Next) +- Fix input stream partial read error. [#462](https://github.com/rubyzip/rubyzip/pull/462) + Tooling: - Update rubocop again and run it in CI. [#444](https://github.com/rubyzip/rubyzip/pull/444) diff --...
diff --git a/test/input_stream_test.rb b/test/input_stream_test.rb --- a/test/input_stream_test.rb +++ b/test/input_stream_test.rb @@ -179,4 +179,14 @@ def test_ungetc assert_equal('$VERBOSE =', zis.read(10)) end end + + def test_readline_then_read + ::Zip::InputStream.open(TestZipFile::TEST_ZIP2.zip...
read remainder of entry through input stream fails if a partial read has already been performed. /lib/zip/ioextras/abstract_input_stream.rb line 22 does not check number_of_bytes for nil before using it. If the output buffer is not empty due to a partial read on the stream, and a read with no parameters is performed t...
2020-11-08T17:49:33
ruby
Hard
JEG2/highline
171
JEG2__highline-171
[ "168", "168" ]
38ea035ae6866523e8a14e4e45a95b008b810c67
diff --git a/lib/highline/paginator.rb b/lib/highline/paginator.rb --- a/lib/highline/paginator.rb +++ b/lib/highline/paginator.rb @@ -19,12 +19,12 @@ def initialize(highline) def page_print(text) return text unless highline.page_at - lines = text.scan(/[^\n]*\n?/) + lines = text.lines.to_a ...
diff --git a/test/test_paginator.rb b/test/test_paginator.rb --- a/test/test_paginator.rb +++ b/test/test_paginator.rb @@ -27,4 +27,47 @@ def test_paging (45..50).map { |n| "This is line #{n}.\n"}.join, @output.string ) end + + def test_statement_lines_count_equal_to_page_at_sh...
TypeError when calling say When calling `HighLine#say` a `TypeError` is raised when printing the same number of lines as your `$terminal.page_at` value. It can be reproduced with this gist: https://gist.github.com/carbonin/4163f462345581956f4b Traceback: ``` /home/ncarboni/.gem/ruby/2.2.2/gems/highline-1.7.7/lib/hig...
@carbonin I was not able to reproduce the issue with the code on your gist. Could rerun the gist exactly as it is and confirm the issue? Can you share the output of the following? ``` $ ruby -r highline -ve 'p [HighLine::VERSION, HighLine::SystemExtensions::CHARACTER_MODE]' ``` My output is as follow: ``` ruby 2....
2015-10-09T18:42:18
ruby
Hard
JEG2/highline
122
JEG2__highline-122
[ "98" ]
c59543d2a3f5a52aa025ae48a76d1dbfc40e1662
diff --git a/lib/highline.rb b/lib/highline.rb --- a/lib/highline.rb +++ b/lib/highline.rb @@ -715,7 +715,7 @@ def output_rows private def format_statement statement - statement = (statement || "").dup.to_str + statement = String(statement || "").dup return statement unless statement.length > 0 ...
diff --git a/test/tc_highline.rb b/test/tc_highline.rb --- a/test/tc_highline.rb +++ b/test/tc_highline.rb @@ -1094,6 +1094,19 @@ def test_say assert_equal("", @output.string) end + def test_say_handles_non_string_argument + integer = 10 + hash = { :a => 20 } + + assert_nothing_raised { @terminal...
Highline v1.6.2 Error Hi James, I was working on a chef setup with vagrant and hit a wall with it dying on https://github.com/JEG2/highline/blob/master/lib/highline.rb#L711 ``` chef] Destroying VM and associated drives... [chef] Running cleanup tasks for 'chef_solo' provisioner... /Users/mdesilva/.vagrant.d/gems/gems...
If you want to work up a patch for this I'm happy to apply it. I wouldn't say it's HighLine bug. You're passing Hash to `format_statement` but it doesn't make sense. It's supposed to be a string. Why Hash? That's a fair point. I didn't look at that error message closely enough. It's bubbling up through from Vagrant...
2015-02-02T04:22:11
ruby
Hard
rubyzip/rubyzip
448
rubyzip__rubyzip-448
[ "433" ]
e397af3e0d918516f74202c45d5d1f5aa644e6a5
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -9,21 +9,21 @@ # Offense count: 5 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 570 + Max: 610 # Offense count: 26 Metrics/CyclomaticComplexity: - Max: 14 + Max: 15 # Offense coun...
diff --git a/test/case_sensitivity_test.rb b/test/case_sensitivity_test.rb --- a/test/case_sensitivity_test.rb +++ b/test/case_sensitivity_test.rb @@ -7,7 +7,7 @@ class ZipCaseSensitivityTest < MiniTest::Test ['test/data/file2.txt', 'testFILE.rb']] def teardown - ::Zip.case_insensitive_match = f...
Set compression on a per-operation basis There may already be an API for this that I'm not seeing, but it would be nice to be able to set the compression on a per-operation basis. Something along the lines of: ``` def write(compress: false) entries = Dir.entries(@inputDir); entries.delete("."); entries.delete...
Yes. Looking at this, it seems that there is an API a bit deeper in to be able to do this per entry even, but it's not exposed higher up the stack. Before I go any further looking at this, what is the behaviour you are looking for here? Above you are suggesting that it would be good to be able to control this per zi...
2020-05-24T20:55:36
ruby
Hard
sdsykes/fastimage
131
sdsykes__fastimage-131
[ "130" ]
4bdc51424956af7743b3ece9ccbec675c1f3949d
diff --git a/lib/fastimage.rb b/lib/fastimage.rb --- a/lib/fastimage.rb +++ b/lib/fastimage.rb @@ -589,6 +589,7 @@ def initialize(stream) end def width_and_height + @rotation = 0 @max_size = nil @primary_box = nil @ipma_boxes = [] @@ -599,11 +600,19 @@ def width_and_height ...
diff --git a/test/fixtures/heic/inverted.heic b/test/fixtures/heic/inverted.heic new file mode 100644 Binary files /dev/null and b/test/fixtures/heic/inverted.heic differ diff --git a/test/test.rb b/test/test.rb --- a/test/test.rb +++ b/test/test.rb @@ -48,6 +48,7 @@ "heic/heic-maybebroken.HEIC"=>[:heic,[4032,3024]]...
Inverted width and height for HEIC portrait image (taken in upright position) Hello, I was testing the HEIC support on 2.2.4 and noticed the width and height are inverted for images taken on an iPhone XR (heic format; iOS 14.4.2). The phone was upright, in portrait orientation and not rotated to any side, so the wid...
@stefanoverna any ideas here? Looks to me like we would be open for a PR to fix this. @azharbeebeejaun can you confirm we compensate for rotation on jpgs? @SamSaffron yes indeed, jpgs work great. Here are the output for pictures taken on the same phone but in .jpg format (changed the format setting to most c...
2021-08-06T13:59:41
ruby
Hard
JEG2/highline
260
JEG2__highline-260
[ "43" ]
8e5f773e9e4180f30f850a6ec364a082b8bc8f3f
diff --git a/lib/highline.rb b/lib/highline.rb --- a/lib/highline.rb +++ b/lib/highline.rb @@ -546,6 +546,9 @@ def get_line_raw_no_echo_mode(question) if character == "\b" || character == "\u007F" chopped = line.chop! output_erase_char if chopped && question.echo + elsif character ...
diff --git a/test/test_highline.rb b/test/test_highline.rb --- a/test/test_highline.rb +++ b/test/test_highline.rb @@ -349,6 +349,44 @@ def test_after_some_chars_backspace_does_not_enter_prompt_when_utf8 assert_equal(4, @output.string.count("\b")) end + def test_erase_line_does_not_enter_prompt + @input <...
Does not support CTRL-U in password mode Type "helloCTRL-Uworld" ``` ruby ask("Usrename: ") -> "world" ask("Password: "){|q| q.echo = false} -> "hello\x15world" ```
Wow, you really type passwords like that? :) It's true that we have to setup some special terminal modes to avoid echoing the password. That swallows some key combinations. I have found that to be a problem thus far, but I'll take patches from people it bothers who can find a way around it. Hi @GutenYe , just to b...
2023-01-07T01:12:50
ruby
Hard
yippee-fun/phlex
192
yippee-fun__phlex-192
[ "191" ]
bb358e7942749d7834f679bb8c6e54115d5616cd
diff --git a/docs/components/callout.rb b/docs/components/callout.rb --- a/docs/components/callout.rb +++ b/docs/components/callout.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Components - class Callout < Phlex::Component + class Callout < Phlex::View def template(&block) div(class: "rounded bg-o...
diff --git a/fixtures/test_helper.rb b/fixtures/test_helper.rb --- a/fixtures/test_helper.rb +++ b/fixtures/test_helper.rb @@ -10,4 +10,4 @@ config.autoload_paths << "#{root}/app" end -require "component_helper" +require "view_helper" diff --git a/test/phlex/rails.rb b/test/phlex/rails.rb --- a/test/phlex/rails.rb...
Rename `Phlex::Component` → `Phlex::View` Phlex can be used to build layouts and pages as well as components. I think the word "component" it quite limiting. It refers to _part of something_ but not _the whole of something_.
2022-09-27T13:58:22
ruby
Hard
yippee-fun/phlex
817
yippee-fun__phlex-817
[ "816" ]
86e565d3f0f81272e4f3ffca364f4f8b004ca111
diff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb --- a/lib/phlex/sgml.rb +++ b/lib/phlex/sgml.rb @@ -401,9 +401,16 @@ def __attributes__(attributes, buffer = +"") unless Phlex::SGML::SafeObject === v normalized_name = lower_name.delete("^a-z-") - if value != true && REF_ATTRIBUTES.include?(normalized_na...
diff --git a/quickdraw/sgml/attributes.test.rb b/quickdraw/sgml/attributes.test.rb --- a/quickdraw/sgml/attributes.test.rb +++ b/quickdraw/sgml/attributes.test.rb @@ -26,6 +26,14 @@ end end +test "href with hash" do + expect { + phlex { a(href: {}) } + }.to_raise(Phlex::ArgumentError) do |error| + expect(error.m...
If you pass a Hash to `href`, you get an error about calling `downcase` on it
2024-10-29T21:44:08
ruby
Hard
rubyzip/rubyzip
489
rubyzip__rubyzip-489
[ "485" ]
22a54853e6c1dc39579e6d18a527ab11b200b637
diff --git a/lib/zip/entry.rb b/lib/zip/entry.rb --- a/lib/zip/entry.rb +++ b/lib/zip/entry.rb @@ -164,8 +164,9 @@ def name_safe? return false unless cleanpath.relative? root = ::File::SEPARATOR - naive_expanded_path = ::File.join(root, cleanpath.to_s) - ::File.absolute_path(cleanpath.to_s, ro...
diff --git a/test/data/.gitattributes b/test/data/.gitattributes new file mode 100644 --- /dev/null +++ b/test/data/.gitattributes @@ -0,0 +1,2 @@ +file1.txt eol=lf +file2.txt eol=lf diff --git a/test/entry_test.rb b/test/entry_test.rb --- a/test/entry_test.rb +++ b/test/entry_test.rb @@ -151,32 +151,35 @@ def test_ent...
Many tests failing under Windows. A lot of failures appear to be due to hardcoded paths into places like `/tmp` which should be easy to fix. Other tests appear to fail due to unexpected line endings - `\r\n` vs `\n` - which I think suggests that we're testing what comes out of a zip file (`\n`) with a text file that ha...
2021-06-06T13:05:49
ruby
Hard
rubyzip/rubyzip
421
rubyzip__rubyzip-421
[ "395" ]
d3027eab9556c7b803686a7256843b4a764ef116
diff --git a/lib/zip/extra_field/universal_time.rb b/lib/zip/extra_field/universal_time.rb --- a/lib/zip/extra_field/universal_time.rb +++ b/lib/zip/extra_field/universal_time.rb @@ -4,24 +4,51 @@ class ExtraField::UniversalTime < ExtraField::Generic HEADER_ID = 'UT' register_map + ATIME_MASK = 0b010 + ...
diff --git a/test/extra_field_ut_test.rb b/test/extra_field_ut_test.rb new file mode 100644 --- /dev/null +++ b/test/extra_field_ut_test.rb @@ -0,0 +1,97 @@ +require 'test_helper' + +class ZipExtraFieldUTTest < MiniTest::Test + + PARSE_TESTS = [ + ["UT\x05\x00\x01PS>A", 0b001, true, true, false], + ["UT\x05\x00\...
Options not working in File class This code https://github.com/rubyzip/rubyzip/blob/249775f5637e6d65112574b3ac1763dc2393c7f6/lib/zip/file.rb#L88-L89 doesn't do what it is intended to do, because when you pass in `restore_permissions: false` or `restore_times: false`, it will be evaluating to `false || true`, which wi...
Interestingly the options code doesn't agree with the comments about defaults above either: https://github.com/rubyzip/rubyzip/blob/94b7fa276992933592d69eb6bb17fc09105f8395/lib/zip/file.rb#L56-L61 vs https://github.com/rubyzip/rubyzip/blob/94b7fa276992933592d69eb6bb17fc09105f8395/lib/zip/file.rb#L101-L103 I...
2019-10-30T17:21:57
ruby
Hard
yippee-fun/phlex
308
yippee-fun__phlex-308
[ "262" ]
e8a4afd4026ce4dd6aaf1bcf09dd0daaccdc6fec
diff --git a/docs/components/code_block.rb b/docs/components/code_block.rb --- a/docs/components/code_block.rb +++ b/docs/components/code_block.rb @@ -11,7 +11,7 @@ def initialize(code, syntax:) def template pre(class: "highlight p-5 whitespace-pre-wrap bg-stone-50") { - raw FORMATTER.format( + unsafe_ra...
diff --git a/test/phlex/view/raw.rb b/test/phlex/view/unsafe_raw.rb similarity index 85% rename from test/phlex/view/raw.rb rename to test/phlex/view/unsafe_raw.rb --- a/test/phlex/view/raw.rb +++ b/test/phlex/view/unsafe_raw.rb @@ -8,7 +8,7 @@ with "raw content" do view do def template - raw %(<h1 class="t...
Rename `raw` to indicate just how unsafe it is
2022-10-31T20:22:16
ruby
Hard
hyperium/h2
160
hyperium__h2-160
[ "11" ]
0ed146001640f12e538ac5eed7c45837e2d63d69
diff --git a/src/proto/streams/prioritize.rs b/src/proto/streams/prioritize.rs --- a/src/proto/streams/prioritize.rs +++ b/src/proto/streams/prioritize.rs @@ -1,7 +1,7 @@ use super::*; use super::store::Resolve; -use frame::Reason; +use frame::{Reason, StreamId}; use codec::UserError; use codec::UserError::*; @...
diff --git a/tests/stream_states.rs b/tests/stream_states.rs --- a/tests/stream_states.rs +++ b/tests/stream_states.rs @@ -367,6 +367,60 @@ fn recv_goaway_finishes_processed_streams() { h2.join(srv).wait().expect("wait"); } +#[test] +fn skipped_stream_ids_are_implicitly_closed() { + let _ = ::env_logger::ini...
Beware: Idle states I noticed [the following](http://httpwg.org/specs/rfc7540.html#StreamIdentifiers): > The first use of a new stream identifier implicitly closes all streams in the "idle" state that might have been initiated by that peer with a lower-valued stream identifier. For example, if a client sends a HEADE...
This issue can be closed once there is a test ensuring this behavior is followed. I am pretty sure this behavior is already implemented. To expand on my comment above: we need the client's send side (i.e. prioritize.rs) to ensure that headers are sent in stream-id-order. > In fact, h2 probably should have an assert tha...
2017-10-20T18:38:54
rust
Hard
hyperium/h2
428
hyperium__h2-428
[ "427" ]
37b66e89810f6d3d5a73760c853b86d496a166f1
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,9 +47,9 @@ jobs: # TODO: Change it to stable after Rust 1.38 release run: ./ci/h2spec.sh if: matrix.rust == 'nightly' - - name: Check minimal versions - ...
diff --git a/src/hpack/test/fixture.rs b/src/hpack/test/fixture.rs --- a/src/hpack/test/fixture.rs +++ b/src/hpack/test/fixture.rs @@ -1,6 +1,6 @@ use crate::hpack::{Decoder, Encoder, Header}; -use bytes::BytesMut; +use bytes::{buf::BufMutExt, BytesMut}; use hex::FromHex; use serde_json::Value; @@ -71,8 +71,10 @...
Update to tokio 0.2
2019-11-26T22:43:14
rust
Hard
servo/rust-url
240
servo__rust-url-240
[ "160" ]
1be1b3be4d9d03ddd9b0d342d93f52f618ba4326
diff --git a/idna/src/uts46.rs b/idna/src/uts46.rs --- a/idna/src/uts46.rs +++ b/idna/src/uts46.rs @@ -198,12 +198,10 @@ fn validate(label: &str, flags: Flags, errors: &mut Vec<Error>) { } // Can not contain '.' since the input is from .split('.') - if { - let mut chars = label.chars().skip(2); - ...
diff --git a/tests/unit.rs b/tests/unit.rs --- a/tests/unit.rs +++ b/tests/unit.rs @@ -192,6 +192,7 @@ fn host_serialization() { fn test_idna() { assert!("http://goșu.ro".parse::<Url>().is_ok()); assert_eq!(Url::parse("http://☃.net/").unwrap().host(), Some(Host::Domain("xn--n3h.net"))); + assert!("https:/...
Consider ignoring UTS46 validity criteria V2 ``` Each of the following criteria must be satisfied for a label: 2. The label must not contain a U+002D HYPHEN-MINUS character in both the third and fourth positions. ``` However, it seems that other UAs don't enforce this, and it matches domains commonly used on youtube....
In that case, UTS-46 should probably be changed to match reality. It says: > Please submit corrigenda and other comments with the online reporting form [[Feedback](http://www.unicode.org/reporting.html)]. so please do that. But since Unicode doesn’t have a public bug tracker, it’d be good to also track it in https://...
2016-11-18T21:05:22
rust
Hard
shuttle-hq/synth
405
shuttle-hq__synth-405
[ "271" ]
1ff5eacff8f0435b5b918d24562e1a97d60d2bf2
diff --git a/core/src/graph/number.rs b/core/src/graph/number.rs --- a/core/src/graph/number.rs +++ b/core/src/graph/number.rs @@ -51,6 +51,7 @@ macro_rules! any_range_int_impl { } } +any_range_int_impl! { u16 } any_range_int_impl! { u32 } any_range_int_impl! { u64 } @@ -218,6 +219,7 @@ macro_rules! standar...
diff --git a/synth/testing_harness/postgres/0_complete_schema.sql b/synth/testing_harness/postgres/0_complete_schema.sql --- a/synth/testing_harness/postgres/0_complete_schema.sql +++ b/synth/testing_harness/postgres/0_complete_schema.sql @@ -12,7 +12,7 @@ create table types string_bpchar bpchar(6) NOT NULL, stri...
bug: generating int2 for postgres gives 'incorrect binary data format' error **Describe the bug** Trying to generate a number for a postgres `int2` column gives an 'incorrect binary data format' error. **To Reproduce** Steps to reproduce the behavior: 1. Schema (postgres) ```sql CREATE TABLE test ( age int2 ...
2022-12-20T00:40:32
rust
Hard
kivikakk/comrak
86
kivikakk__comrak-86
[ "52" ]
8e382ae1b9e1916e974a49706b1a2e657c35eaee
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ FLAGS: OPTIONS: --default-info-string <INFO> Default value for fenced code block's info strings if none is given - -e, --extension <EXTENSION>... Specify an extension name to use [values: strikethrough, tagfilter...
diff --git a/src/tests.rs b/src/tests.rs --- a/src/tests.rs +++ b/src/tests.rs @@ -898,3 +898,68 @@ fn nul_replacement_4() { fn nul_replacement_5() { html("a\r\n\0b", "<p>a\n\u{fffd}b</p>\n"); } + +#[test] +fn description_lists() { + html_opts( + concat!( + "Term 1\n", + "\n", + ...
Description List as an extension There is an open [thread about description lists](https://talk.commonmark.org/t/description-list/289) in [talk.commonmark.org](https://talk.commonmark.org/). Since comrak has support for [some extensions](https://github.com/kivikakk/comrak/blob/dfe55ae29482c038c0ba2f4adf925421c6709008/s...
Awesome! I'd happily accept a PR that implemented this. 😊
2018-08-19T04:48:33
rust
Easy
sunng87/handlebars-rust
185
sunng87__handlebars-rust-185
[ "178" ]
8d103041fa420ff522c0f09e76ec77eca010a5df
diff --git a/src/context.rs b/src/context.rs --- a/src/context.rs +++ b/src/context.rs @@ -33,6 +33,12 @@ fn parse_json_visitor_inner<'a>( let mut seg_stack: VecDeque<Pair<Rule, StrInput>> = VecDeque::new(); for seg in parsed_path { + if seg.as_str() == "@root" { + seg_stack.clear(); + ...
diff --git a/tests/root_var.rs b/tests/root_var.rs new file mode 100644 --- /dev/null +++ b/tests/root_var.rs @@ -0,0 +1,18 @@ +extern crate handlebars; +#[macro_use] +extern crate serde_json; + +use handlebars::Handlebars; + +#[test] +fn test_root_var() { + let hbs = Handlebars::new(); + + let data = json!({ + ...
@root support? Howdy, Is this something easy to add? https://stackoverflow.com/questions/17364897/access-to-root-context-in-handlebar-js-template In essence, using ``@root`` from any depth should return a reference to the root RenderContext variables. Also, is it really necessary to clone the variables when in...
Hi @hammett @root is not supported for now and I will definitely support it. Currently I'm working on pest upgrade #177, which involves lots of changes so I will be working on this right after #177 is done. For the second question I will look into it and come back to you this weekend. Thanks @sunng87 I looked at the ...
2017-09-16T09:33:09
rust
Hard