ongaku_ryoho_server 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -3
- data/bin/ongaku_ryoho_server +13 -20
- data/history.txt +6 -0
- data/lib/ongaku_ryoho_server/application.rb +0 -7
- data/lib/ongaku_ryoho_server/config.ru +1 -1
- data/lib/ongaku_ryoho_server/version.rb +1 -1
- data/ongaku_ryoho_server.gemspec +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ongaku Ryoho Server
|
2
2
|
|
3
|
-
A little Sinatra web server (with
|
3
|
+
A little Sinatra web server (with Puma) wrapped in a gem specifically for the Ongaku Ryoho client.
|
4
4
|
|
5
5
|
## How to use
|
6
6
|
|
@@ -27,10 +27,10 @@ ongaku_ryoho_server stop (must be in the same directory)
|
|
27
27
|
### Options
|
28
28
|
|
29
29
|
```
|
30
|
-
-p set the port (default:
|
30
|
+
-p set the port (default: 7000)
|
31
31
|
-d daemonize
|
32
32
|
|
33
33
|
--update update the cached collection
|
34
34
|
|
35
|
-
+ all the other
|
35
|
+
+ all the other puma cli options
|
36
36
|
```
|
data/bin/ongaku_ryoho_server
CHANGED
@@ -1,45 +1,38 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "rubygems"
|
3
|
-
require "
|
3
|
+
require "puma/cli"
|
4
4
|
|
5
5
|
|
6
|
-
#
|
7
|
-
# Thin CLI
|
8
|
-
|
9
6
|
gem_dir = File.dirname(__FILE__)
|
10
|
-
current_directory_name = File.basename(Dir.pwd)
|
11
7
|
|
12
8
|
# require library
|
13
9
|
require "#{gem_dir}/../lib/ongaku_ryoho_server.rb"
|
14
10
|
|
15
11
|
# files
|
16
12
|
rackup_file = "#{gem_dir}/../lib/ongaku_ryoho_server/config.ru"
|
17
|
-
|
18
|
-
pid_file = "#{gem_dir}/../tmp/#{current_directory_name}.pid"
|
13
|
+
pid_file = "#{gem_dir}/../tmp/#{OngakuRyohoServer::List.get_digest}.pid"
|
19
14
|
|
20
|
-
#
|
15
|
+
# puma arguments
|
21
16
|
argv = ARGV
|
22
|
-
argv << ["--
|
23
|
-
argv << ["-R", rackup_file] unless ARGV.include?("-R")
|
24
|
-
argv << ["-P", pid_file] unless ARGV.include?("-P")
|
25
|
-
argv << ["-l", log_file] unless ARGV.include?("-l")
|
17
|
+
argv << ["--pidfile", pid_file] unless ARGV.include?("--pidfile")
|
26
18
|
argv << ["-e", "production"] unless ARGV.include?("-e")
|
27
|
-
argv << ["-p", "
|
19
|
+
argv << ["-p", "7000"] unless ARGV.include?("-p")
|
20
|
+
|
21
|
+
# rackup file
|
22
|
+
argv << rackup_file
|
28
23
|
|
29
24
|
# special arguments
|
30
25
|
update_collection = argv.include?("--update")
|
31
26
|
argv.delete("--update") if update_collection
|
32
27
|
|
33
|
-
#
|
34
|
-
|
28
|
+
# puma cli
|
29
|
+
puma_cli = Puma::CLI.new(argv.flatten)
|
35
30
|
|
36
31
|
# keep options
|
37
32
|
OngakuRyohoServer::OPTIONS = {
|
38
33
|
update_collection: update_collection,
|
39
|
-
|
34
|
+
puma: puma_cli.instance_variable_get("@options")
|
40
35
|
}
|
41
36
|
|
42
|
-
# exec
|
43
|
-
|
44
|
-
|
45
|
-
|
37
|
+
# exec puma
|
38
|
+
puma_cli.run
|
data/history.txt
CHANGED
@@ -9,7 +9,6 @@ module OngakuRyohoServer
|
|
9
9
|
|
10
10
|
class Application < Sinatra::Base
|
11
11
|
set :environment, :production
|
12
|
-
set :server, :thin
|
13
12
|
|
14
13
|
FILE_FORMATS = %w{ mp3 mp4 m4a ogg flac wav wma }
|
15
14
|
|
@@ -21,12 +20,6 @@ module OngakuRyohoServer
|
|
21
20
|
end
|
22
21
|
|
23
22
|
|
24
|
-
# availability
|
25
|
-
get "/available?" do
|
26
|
-
"As it happens, I am."
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
23
|
# compare filelists
|
31
24
|
post "/check" do
|
32
25
|
content_type :json
|
data/ongaku_ryoho_server.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.add_dependency 'json', '~> 1.7.5'
|
19
19
|
gem.add_dependency 'taglib-ruby', '~> 0.5.2'
|
20
20
|
gem.add_dependency 'sinatra', '~> 1.3.3'
|
21
|
-
gem.add_dependency '
|
21
|
+
gem.add_dependency 'puma', '~> 1.6.3'
|
22
22
|
|
23
23
|
gem.add_development_dependency 'rake'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ongaku_ryoho_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -60,13 +60,13 @@ dependencies:
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.3.3
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: puma
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.
|
69
|
+
version: 1.6.3
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.
|
77
|
+
version: 1.6.3
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rake
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: -3003266274688567412
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
segments:
|
138
138
|
- 0
|
139
|
-
hash:
|
139
|
+
hash: -3003266274688567412
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
142
|
rubygems_version: 1.8.24
|