Skip to content

Commit

Permalink
Merge pull request #131 from keyasuda/release0_3_0
Browse files Browse the repository at this point in the history
0.3.0
  • Loading branch information
keyasuda authored Jan 27, 2024
2 parents 660ccac + 9236dd9 commit 16e7800
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 52 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.3.0] - 2024-01-27

- use sinatra >= 4.0.0

## [0.2.0] - 2023-07-30

- use ruby.wasm 2.0.0
Expand Down
27 changes: 16 additions & 11 deletions gem/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PATH
remote: .
specs:
bormashino (0.2.0)
bormashino (0.3.0)
json_pure (~> 2.6, >= 2.6.1)
os (~> 1.1, >= 1.1.4)
ruby2_keywords (= 0.0.4)
sinatra (~> 2.2)
sinatra (>= 4.0.0)

GEM
remote: https://rubygems.org/
Expand All @@ -16,6 +16,7 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
coderay (1.1.3)
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -52,7 +53,7 @@ GEM
lumberjack (1.2.8)
method_source (1.0.0)
minitest (5.19.0)
mustermann (2.0.2)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nenv (0.3.0)
notiffany (0.1.3)
Expand All @@ -65,9 +66,12 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
rack (2.2.7)
rack-protection (2.2.4)
rack
rack (3.0.8)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
Expand Down Expand Up @@ -117,13 +121,14 @@ GEM
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.4)
shellany (0.0.1)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.4)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
thor (1.2.2)
tilt (2.1.0)
tilt (2.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
Expand Down
2 changes: 1 addition & 1 deletion gem/bormashino.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"
spec.add_dependency 'json_pure', '~> 2.6', '>= 2.6.1'
spec.add_dependency 'sinatra', '~> 2.2'
spec.add_dependency 'sinatra', '>= 4.0.0'
spec.add_dependency 'ruby2_keywords', '0.0.4'
spec.add_dependency 'os', '~> 1.1', '>= 1.1.4'

Expand Down
2 changes: 1 addition & 1 deletion gem/lib/bormashino/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Bormashino
VERSION = '0.2.0'
VERSION = '0.3.0'
end
2 changes: 1 addition & 1 deletion gem/spec/bormashino/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class MockApp < Sinatra::Base

it 'sends referer' do
expect(subject.first).to eq 302
expect(subject[1]['Location']).to eq 'http://example.com:0/referer'
expect(subject[1]['location']).to eq 'http://example.com:0/referer'
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bormashino",
"description": "The package to build SPAs with Ruby",
"homepage": "https://github.com/keyasuda/bormashino",
"version": "0.2.0",
"version": "0.3.0",
"main": "src/index.js",
"scripts": {
"test": "jest --notify src/",
Expand Down
4 changes: 2 additions & 2 deletions npm/src/applyServerResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export const applyServerResult = (src, target, router) => {
return true

case 302:
const loc = new URL(src[1]['Location'])
const loc = new URL(src[1]['location'])

if (loc.host == 'example.com:0') {
const path = loc.pathname + loc.search
router.pushState(path)
} else {
location.href = src[1]['Location']
location.href = src[1]['location']
}
return false

Expand Down
6 changes: 3 additions & 3 deletions npm/src/applyServerResult.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('applyServerResult', () => {

describe('302 relative location', () => {
beforeEach(() => {
content = [302, { Location: 'http://example.com:0/location' }, []]
content = [302, { location: 'http://example.com:0/location' }, []]
ret = applyServerResult(content, target, router)
})

Expand All @@ -132,13 +132,13 @@ describe('applyServerResult', () => {
delete window.location
window.location = { assign: jest.fn() }

content = [302, { Location: 'http://absolute.example.com/location' }, []]
content = [302, { location: 'http://absolute.example.com/location' }, []]

ret = applyServerResult(content, target, router)
})

it('navigates to the location', () => {
expect(location.href).toEqual(content[1]['Location'])
expect(location.href).toEqual(content[1]['location'])
})

it('returns true', () => {
Expand Down
27 changes: 16 additions & 11 deletions test-app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ GIT
PATH
remote: ../gem
specs:
bormashino (0.2.0)
bormashino (0.3.0)
json_pure (~> 2.6, >= 2.6.1)
os (~> 1.1, >= 1.1.4)
ruby2_keywords (= 0.0.4)
sinatra (~> 2.2)
sinatra (>= 4.0.0)

GEM
remote: https://rubygems.org/
Expand All @@ -28,6 +28,7 @@ GEM
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
capybara (3.39.1)
addressable
matrix
Expand Down Expand Up @@ -92,7 +93,7 @@ GEM
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.19.0)
mustermann (2.0.2)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nenv (0.3.0)
nokogiri (1.15.1-x86_64-linux)
Expand All @@ -109,9 +110,12 @@ GEM
method_source (~> 1.0)
public_suffix (5.0.1)
racc (1.6.2)
rack (2.2.7)
rack-protection (2.2.4)
rack
rack (3.0.8)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
Expand Down Expand Up @@ -163,13 +167,14 @@ GEM
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.4)
shellany (0.0.1)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.4)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
thor (1.2.2)
tilt (2.1.0)
tilt (2.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
Expand Down
20 changes: 10 additions & 10 deletions test-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-app/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class JSConsoleLogger
def puts(log)
src = log.strip.sub(/\A.+[ 0-9.▶◀]+\{/, '{')
src = JSON.parse(src)
$stdout.puts src['params']['args'].map { |a| a['value'] } if src['method'] == 'Runtime.consoleAPICalled'
$stdout.puts src['params']['args'].pluck('value') if src['method'] == 'Runtime.consoleAPICalled'
rescue StandardError
# do nothing
end
Expand Down
2 changes: 1 addition & 1 deletion test-app/spec/test_app_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'test_app', type: :feature, retry: 10 do
RSpec.describe 'test_app', retry: 10, type: :feature do
subject { page }

before do
Expand Down
19 changes: 12 additions & 7 deletions test-app/src/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
GEM
remote: https://rubygems.org/
specs:
base64 (0.2.0)
json_pure (2.6.3)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
rack (2.2.7)
rack-protection (3.0.6)
rack
rack (3.0.8)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
ruby2_keywords (0.0.4)
sinatra (3.0.6)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
tilt (2.1.0)
tilt (2.3.0)

PLATFORMS
ruby
Expand Down

0 comments on commit 16e7800

Please sign in to comment.