ongaku_ryoho_server 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ongaku Ryoho Server
2
2
 
3
- A little Sinatra web server (with Thin) wrapped in a gem specifically for the Ongaku Ryoho client.
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: 3000)
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 thin cli options
35
+ + all the other puma cli options
36
36
  ```
@@ -1,45 +1,38 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "rubygems"
3
- require "thin"
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
- log_file = "#{gem_dir}/../log/#{current_directory_name}.log"
18
- pid_file = "#{gem_dir}/../tmp/#{current_directory_name}.pid"
13
+ pid_file = "#{gem_dir}/../tmp/#{OngakuRyohoServer::List.get_digest}.pid"
19
14
 
20
- # thin arguments
15
+ # puma arguments
21
16
  argv = ARGV
22
- argv << ["--tag", "Ongaku Ryoho Server"]
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", "3000"] unless ARGV.include?("-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
- # thin cli
34
- thin_runner = Thin::Runner.new(argv.flatten)
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
- thin: thin_runner.options
34
+ puma: puma_cli.instance_variable_get("@options")
40
35
  }
41
36
 
42
- # exec thin
43
- thin_runner.run!
44
-
45
-
37
+ # exec puma
38
+ puma_cli.run
data/history.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.3.1 / 2012-11-16
2
+
3
+ * use puma instead of thin (better streaming support, daemonizing coming soon)
4
+ * removed the unnecessary "/available" route
5
+
6
+
1
7
  === 0.3.0 / 2012-11-10
2
8
 
3
9
  * use thin cli (ability to daemonize)
@@ -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
@@ -14,4 +14,4 @@ end
14
14
  #
15
15
  # Run the application
16
16
 
17
- run OngakuRyohoServer::Application.new(options[:thin])
17
+ run OngakuRyohoServer::Application.new(options[:puma])
@@ -2,5 +2,5 @@ module OngakuRyohoServer
2
2
  #
3
3
  # { VERSION }
4
4
 
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
@@ -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 'thin', '~> 1.5.0'
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.0
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-10 00:00:00.000000000 Z
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: thin
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.5.0
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.5.0
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: 3827745549629188482
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: 3827745549629188482
139
+ hash: -3003266274688567412
140
140
  requirements: []
141
141
  rubyforge_project:
142
142
  rubygems_version: 1.8.24