This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Put this file into the root of rails repo | |
| # 2. `bundle exec rackup -b 0.0.0.0` | |
| # 3. `open localhost:9292` | |
| require 'rails/all' | |
| tmpdir = Dir.mktmpdir | |
| Dir.chdir(tmpdir) | |
| ENV['DATABASE_URL'] = "sqlite3://#{File.join(tmpdir, 'database.sql')}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class YAMLTreeBuilder < YAML::TreeBuilder | |
| def initialize | |
| super | |
| @path_stack = [] | |
| end | |
| def scalar(*) | |
| super.tap do | |
| if YAML::Nodes::Mapping === @last |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script> | |
| document.title = 'aaaaa'; | |
| setTimeout(() => { | |
| history.pushState({}, "", "/xxxxxxxxxx"); | |
| }, 3000); | |
| </script> | |
| </body> | |
| Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 2.1 | |
| workflows: | |
| version: 2 | |
| test: | |
| jobs: | |
| - test | |
| jobs: | |
| test: | |
| docker: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app@e0d06d8801e4:/app/actionpack$ ruby -e "puts 100.times.select { system('bin/test test/controller/render_test.rb') }.count" | |
| Run options: --seed 10537 | |
| # Running: | |
| ................................................................. | |
| Finished in 1.416651s, 45.8829 runs/s, 222.3554 assertions/s. | |
| 65 runs, 315 assertions, 0 failures, 0 errors, 0 skips | |
| Run options: --seed 27092 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -eux | |
| wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip" | |
| unzip BrowserStackLocal-linux-x64.zip | |
| ./BrowserStackLocal $ACCESS_KEY & | |
| bundle exec cucumber |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2020/05/24 10:12:22 Doing playback at 10.00x speed | |
| 2020/05/24 10:12:22 Preprocessing file | |
| 2020/05/24 10:13:22 Preprocess complete | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly | |
| 2020/05/24 10:14:10 context.Execute error: error executing op: Closed explicitly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const postQuery = async <TData, TVariables>(query: string, variables: TVariables) => { | |
| const token = await firebase.auth().currentUser!.getIdToken(); | |
| const resonse = await fetch('/graphql', { | |
| method: 'POST', | |
| credentials: 'include', | |
| headers: { | |
| 'content-type': 'application/json', | |
| 'authorization': `Bearer ${token}`, | |
| 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')!.getAttribute('content')! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const postQuery = async <TData, TVariables>(query: string, variables: TVariables) => { | |
| const token = await firebase.auth().currentUser!.getIdToken(); | |
| const resonse = await fetch('/graphql', { | |
| method: 'POST', | |
| body: JSON.stringify({ query, variables }) | |
| }); | |
| const json: { data: TData, errors: Array<any> | undefined } = await resonse.json(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArticleEntity < ArticleCommonEntity; end | |
| def as_json | |
| {id: @article.id, thumbnail_url: @article.thumbnail_url} | |
| end | |
| end | |
| get "/articles" do | |
| Article.all.map {|a| ArticleEntity.new(a) }.to_json | |
| end |