sora 24.02.26 → 24.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 488c9fe33a89000965087732638fafd292137467592fb99dc5341b45665a8b8a
4
- data.tar.gz: 28c98019e9d9c51260264aec86c558fbc53538ae0aab46da688cd11a5623ee91
3
+ metadata.gz: 7b5ced9f96a91bad46179bfd6c2cb86390ef87c80a43e986c02981a13327de16
4
+ data.tar.gz: 0b58886bafd8d8030b0262846a74da0747688bcd7719b48a88070e0c46173174
5
5
  SHA512:
6
- metadata.gz: 022c2e1247b89595b5e0679739d4d99980d049a782b9ed1f4eaebedd89f92ea765cfc31afa5322dad4697ce45621502d376ed8d126d346f147257a935dd44b25
7
- data.tar.gz: '0798d5c364a33d00dfd422badd7f544f1175ed09ce158294c11f5e881d1a3eae743e169301d2be4a7973da1920d8dab69a57018928f110184a80917d4e3edcfb'
6
+ metadata.gz: 25bd597229224b8d3971ca8492d17cec5c24e27e18dede006bde0e5627f17c07a85f222f9d9488e5da46a94811fccbfa05a56eeb2d66507bd0dd4d1359c8a736
7
+ data.tar.gz: 3e935a72f597d2ca57907625f94059886f2e5390f1c97733ee4041592801886227a8ade6ee1ea3d326cce0321233f8394c6052ccfcf17ea284895139c9f3078a
data/.rubocop.yml CHANGED
@@ -1,22 +1,22 @@
1
- AllCops:
2
- TargetRubyVersion: 2.6
3
-
4
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
7
-
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120
14
-
15
- Layout/EndOfLine:
16
- Enabled: False
17
-
18
- Metrics/MethodLength:
19
- Enabled: False
20
-
21
- Metrics/AbcSize:
22
- Enabled: False
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
14
+
15
+ Layout/EndOfLine:
16
+ Enabled: False
17
+
18
+ Metrics/MethodLength:
19
+ Enabled: False
20
+
21
+ Metrics/AbcSize:
22
+ Enabled: False
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2024-02-24
4
-
5
- - Initial release
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-02-24
4
+
5
+ - Initial release
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,84 +1,84 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 TODO: Write your name
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.ja.md ADDED
@@ -0,0 +1,69 @@
1
+ # sora
2
+ [![Ruby](https://github.com/Himeyama/sora/actions/workflows/main.yml/badge.svg)](https://github.com/Himeyama/sora/actions/workflows/main.yml)
3
+ [![Gem Version](https://badge.fury.io/rb/sora.svg)](https://badge.fury.io/rb/sora)
4
+
5
+ > ![sora](docs/screenshot.png)
6
+
7
+ sora は文字列やファイルを送受信できる Ruby 製 http サーバです。
8
+
9
+ sora (Server Of Ruby for Access) は、ファイルの送受信や、文字列を送信して情報を伝達することができます。
10
+
11
+ - https://rubygems.org/gems/sora
12
+
13
+ ## インストール
14
+ この gem は Windows と Linux で動作確認をしています。
15
+
16
+ ### インストール方法
17
+ ```ps1
18
+ gem install sora
19
+ ```
20
+
21
+ または
22
+
23
+ ```ps1
24
+ rake install # リポジトリからインストールする
25
+ ```
26
+
27
+ ## sora とは
28
+ sora はインストールされたマシンでサーバーを立ち上げる。
29
+ そのマシンにLAN 内にあるスマホや他のマシンからアクセスすることで文字列やファイルを共有できます。
30
+
31
+ 次のコマンドは、sora サーバーを 8001 ポートで立ち上げるコマンドです。
32
+
33
+ ```ps1
34
+ sora -p 8080 # または: sora
35
+ ```
36
+
37
+ 次にブラウザで、sora にアクセスしてみましょう。
38
+
39
+ sora をインストールしたマシンでは、以下の url から sora にアクセスできます。
40
+
41
+ [http://127.0.0.1:8080/](http://127.0.0.1:8080/)
42
+
43
+ 他の端末からはインストールしたマシンの IP アドレスを取得してアクセスします。
44
+ IP アドレスは Windows の「設定」から確認可能で、「IPv4 アドレス」が対象の IP アドレスです。
45
+ コンソールで `ipconfig` を実行して確認してもよいです。
46
+
47
+ ![get ipv4](docs/get-ipaddr.png)
48
+
49
+ ## 開発
50
+ 以下、開発者向けの説明です。
51
+
52
+ - Windows
53
+ - Ruby 3.2.3
54
+
55
+ ### 依存パッケージのインストール
56
+ ```ps1
57
+ bundle install
58
+ ```
59
+
60
+ ### アプリの実行
61
+ ```ps1
62
+ bundle exec sora
63
+ ```
64
+
65
+ ### Webpack でスクリプトをコンパイル
66
+ ```ps1
67
+ rake build:webpack
68
+ ```
69
+
data/README.md CHANGED
@@ -1,20 +1,48 @@
1
- # Sora
2
- sora is an http server in Ruby that can send and receive strings and files.
3
-
4
- sora (Server Of Ruby for Access) can send and receive files, and transmit text strings to communicate information.
5
-
6
- - https://rubygems.org/gems/sora
7
-
8
- ## Installation
9
- This gem is supported on Windows.
10
-
11
- ### How to Install
12
- ```ps1
13
- gem install sora
14
- ```
15
-
16
- or
17
-
18
- ```ps1
19
- rake install # Install from repository
20
- ```
1
+ # sora
2
+ [![Ruby](https://github.com/Himeyama/sora/actions/workflows/main.yml/badge.svg)](https://github.com/Himeyama/sora/actions/workflows/main.yml)
3
+ [![Gem Version](https://badge.fury.io/rb/sora.svg)](https://badge.fury.io/rb/sora)
4
+
5
+ > ![sora](docs/screenshot.png)
6
+
7
+ [日本語の README](/README.ja.md)
8
+
9
+ sora is an http server in Ruby that can send and receive strings and files.
10
+
11
+ sora (Server Of Ruby for Access) can send and receive files, and transmit text strings to communicate information.
12
+
13
+ - https://rubygems.org/gems/sora
14
+
15
+ ## Installation
16
+ This gem is supported on Windows and Linux.
17
+
18
+ ### How to Install
19
+ ```ps1
20
+ gem install sora
21
+ ```
22
+
23
+ or
24
+
25
+ ```ps1
26
+ rake install # Install from repository
27
+ ```
28
+
29
+ ## About sora
30
+ Sola sets up a server on the installed machine. Strings and files can be shared by accessing that machine from smartphones or other machines in the LAN.
31
+
32
+ The following command will bring up the sora server on port 8080.
33
+
34
+ ```ps1
35
+ sora -p 8080 # or: sora
36
+ ```
37
+
38
+ Next, let's access sora with a browser.
39
+
40
+ On a machine with sora installed, you can access sora from the following url.
41
+
42
+ [http://127.0.0.1:8080/](http://127.0.0.1:8080/)
43
+
44
+ From other terminals, the IP address of the installed machine is obtained and accessed.
45
+ The IP address can be checked from the Windows `Settings`, where `IPv4 address` is the target IP address.
46
+ You can also check it by running `ipconfig` in the console.
47
+
48
+ ![get ipv4](docs/get-ipaddr.png)
data/Rakefile CHANGED
@@ -1,8 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rubocop/rake_task"
5
-
6
- RuboCop::RakeTask.new
7
-
8
- task default: :rubocop
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
9
+
10
+ task "build:webpack" do
11
+ sh "yarn --cwd src run webpack --mode production -o www -w"
12
+ end
data/cgi-bin/get.rb CHANGED
@@ -37,11 +37,23 @@ def get_content_type(filename)
37
37
  content_types[ext] || "text/html"
38
38
  end
39
39
 
40
+ #
41
+ # ファイルを取得
42
+ #
43
+ # GET: /get?filename=image.png
44
+ #
40
45
  def file
41
46
  cgi = CGI.new
42
47
  params = cgi.params
43
48
  unless params.key?("filename")
44
- print cgi.header("text/plain")
49
+ print cgi.header("application/json")
50
+ print(JSON.pretty_generate({ status: "NG" }))
51
+ return
52
+ end
53
+
54
+ if params["filename"].empty?
55
+ print cgi.header("application/json")
56
+ print(JSON.pretty_generate({ status: "NG" }))
45
57
  return
46
58
  end
47
59
 
data/cgi-bin/main.rb CHANGED
@@ -16,6 +16,11 @@ def log(text)
16
16
  end
17
17
  end
18
18
 
19
+ #
20
+ # JSON ファイルを読み込んで配列として返す関数
21
+ #
22
+ # text = read_json("data.tmp")
23
+ #
19
24
  def read_json(filename)
20
25
  unless File.exist? filename
21
26
  File.open(filename, "w") do |f|
@@ -29,24 +34,41 @@ def read_json(filename)
29
34
  json
30
35
  end
31
36
 
37
+ #
38
+ # データを取得
39
+ #
40
+ # - データがある場合: データを追加して保存し内容を JSON 形式で表示
41
+ # - データがない場合: 内容を JSON 形式で表示
42
+ #
43
+ # GET: /cgi-bin?data=
44
+ # GET: /cgi-bin?data=12345
45
+ #
32
46
  def get_json(params)
33
47
  return unless params.key?("data")
34
48
 
35
- data = params["data"][0]
49
+ data = params["data"]
36
50
  json = read_json(@json_file_path)
37
51
 
38
- if data != "" && !data.nil?
39
- json.append({
40
- content: data,
41
- uuid: SecureRandom.uuid
42
- })
43
- File.open(@json_file_path, "w") do |f|
44
- f.write JSON.pretty_generate(json)
52
+ unless data.nil?
53
+ content = data[0]
54
+ if content != ""
55
+ json.append({
56
+ content: content,
57
+ uuid: SecureRandom.uuid
58
+ })
59
+ File.open(@json_file_path, "w") do |f|
60
+ f.write JSON.pretty_generate(json)
61
+ end
45
62
  end
46
63
  end
47
64
  print(JSON.pretty_generate(json))
48
65
  end
49
66
 
67
+ #
68
+ # コンテンツを削除する
69
+ #
70
+ # GET: /cgi-bin?delete=9cba8adc-2f1f-4feb-86dd-e6daf0d26d41
71
+ #
50
72
  def delete(params)
51
73
  return unless params.key?("delete")
52
74
 
@@ -86,21 +108,35 @@ end
86
108
  def remove_file(params)
87
109
  return unless params.key?("removefile")
88
110
 
89
- removefile = params["removefile"][0]
111
+ removefiles = params["removefile"]
112
+ if removefiles.empty?
113
+ print JSON.pretty_generate({ status: "NG" })
114
+ return
115
+ end
116
+
117
+ removefile = removefiles[0]
90
118
  response = {
91
119
  filename: removefile,
92
120
  status: "NG"
93
121
  }
94
122
 
95
- return if [".gitignore", "data.json"].include?(response[:filename])
123
+ if [".gitignore", "data.json", ""].include?(removefile)
124
+ print JSON.pretty_generate({ status: "NG" })
125
+ return
126
+ end
96
127
 
97
- file_path = File.join(File.expand_path("../data"), response[:filename])
128
+ file_path = File.join(File.expand_path("../data"), removefile)
98
129
 
99
130
  response[:status] = "OK" if File.exist?(file_path) && File.delete(file_path)
100
131
 
101
132
  print JSON.pretty_generate(response)
102
133
  end
103
134
 
135
+ #
136
+ # ファイル一覧を取得
137
+ #
138
+ # GET: /cgi-bin?files
139
+ #
104
140
  def get_files(params)
105
141
  return unless params.key?("files")
106
142
 
Binary file
Binary file
data/lib/sora/version.rb CHANGED
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Sora
4
- VERSION = "24.02.26"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Sora
4
+ VERSION = "24.8.4"
5
+ end
data/lib/sora.rb CHANGED
@@ -15,14 +15,15 @@ module Sora
15
15
  DocumentRoot: document_root,
16
16
  BindAddress: "0.0.0.0",
17
17
  Port: port,
18
- CGIInterpreter: RbConfig.ruby
18
+ CGIInterpreter: RbConfig.ruby,
19
+ DoNotReverseLookup: true
19
20
  }
20
21
  )
21
22
  srv.mount("/cgi-bin", WEBrick::HTTPServlet::CGIHandler, "#{document_root}/../cgi-bin/main.rb")
22
23
  srv.mount("/get", WEBrick::HTTPServlet::CGIHandler, "#{document_root}/../cgi-bin/get.rb")
23
24
  srv.mount("/", WEBrick::HTTPServlet::FileHandler, "#{document_root}/index.html")
24
25
  srv.mount("/style", WEBrick::HTTPServlet::FileHandler, "#{document_root}/style.css")
25
- srv.mount("/js", WEBrick::HTTPServlet::FileHandler, "#{document_root}/main.js")
26
+ srv.mount("/js", WEBrick::HTTPServlet::FileHandler, "#{document_root}/bundle.js")
26
27
  trap("INT") { srv.shutdown }
27
28
  srv.start
28
29
  end
data/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "sora",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "repository": "git@github.com:Himeyama/sora.git",
6
+ "author": "MURATA Mitsuharu <hikari.photon+dev@gmail.com>",
7
+ "license": "MIT",
8
+ "devDependencies": {
9
+ "@fluentui/web-components": "^2.6.1",
10
+ "css-loader": "^7.1.2",
11
+ "i18next": "^23.12.2",
12
+ "style-loader": "^4.0.0",
13
+ "ts-loader": "^9.5.1",
14
+ "typescript": "^5.5.4",
15
+ "webpack": "^5.93.0",
16
+ "webpack-cli": "^5.1.4"
17
+ }
18
+ }
data/sig/sora.rbs CHANGED
@@ -1,4 +1,4 @@
1
- module Sora
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end
1
+ module Sora
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end