douban_fm_hotkey 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e4d25b7094a124bdbe5f61c1cdf763aff8b97a9
4
+ data.tar.gz: cec912a835737069e0333cdfedd7d50ff7e0b4cc
5
+ SHA512:
6
+ metadata.gz: b0a3c8a35d6f200fa228008b0e54d608b66dbbed6cca0006c92b4072dec95a58f0a43d8bea3277a7f4b3b98c85986ea39bc4ff553e4129a3a63f53892e765a12
7
+ data.tar.gz: c678ce76107aea87446ae9bccf662d184aa171cf8220e502c7870a844115c024fa8d596dd4b17eff4bd8cd1a33d99c6060edda879a091d6f74c49ac83a43e0d1
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ /pkg
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ douban_fm_hotkey (0.0.1)
5
+ faye
6
+ sinatra
7
+ thor
8
+ vegas
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.3.4)
14
+ cookiejar (0.3.0)
15
+ em-http-request (1.0.3)
16
+ addressable (>= 2.2.3)
17
+ cookiejar
18
+ em-socksify
19
+ eventmachine (>= 1.0.0.beta.4)
20
+ http_parser.rb (>= 0.5.3)
21
+ em-socksify (0.2.1)
22
+ eventmachine (>= 1.0.0.beta.4)
23
+ eventmachine (1.0.3)
24
+ faye (0.8.9)
25
+ cookiejar (>= 0.3.0)
26
+ em-http-request (>= 0.3.0)
27
+ eventmachine (>= 0.12.0)
28
+ faye-websocket (>= 0.4.0)
29
+ rack (>= 1.0.0)
30
+ yajl-ruby (>= 1.0.0)
31
+ faye-websocket (0.6.1)
32
+ eventmachine (>= 0.12.0)
33
+ websocket-driver (>= 0.2.0)
34
+ http_parser.rb (0.5.3)
35
+ rack (1.5.2)
36
+ rack-protection (1.5.0)
37
+ rack
38
+ sinatra (1.4.2)
39
+ rack (~> 1.5, >= 1.5.2)
40
+ rack-protection (~> 1.4)
41
+ tilt (~> 1.3, >= 1.3.4)
42
+ thor (0.18.1)
43
+ tilt (1.4.1)
44
+ vegas (0.1.11)
45
+ rack (>= 1.0.0)
46
+ websocket-driver (0.2.0)
47
+ yajl-ruby (1.1.0)
48
+
49
+ PLATFORMS
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ douban_fm_hotkey!
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # Douban FM Hotkey
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler"
2
+ require "rspec/core/rake_task"
3
+
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
data/bin/dfh_server ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.expand_path('../../lib', __FILE__)
4
+
5
+ require 'douban_fm_hotkey/server'
6
+ require 'vegas'
7
+
8
+ Vegas::Runner.new(DoubanFMHotkey::Server, 'douban_fm_hotkey', :port => 1988)
9
+
@@ -0,0 +1,15 @@
1
+ require File.expand_path("../lib/douban_fm_hotkey/version", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'douban_fm_hotkey'
5
+ s.version = DoubanFMHotkey::VERSION
6
+ s.summary = 'Douban FM global hotkey.'
7
+ s.description = 'Global hotkey for Douban FM web.'
8
+ s.authors = ['Wei Zhu']
9
+ s.email = 'yesmeck@gmail.com'
10
+ s.files = `git ls-files | grep -v '^chrome-extension/'`.split("\n")
11
+ s.homepage = 'http://www.douban.com/people/coolzi'
12
+ s.add_dependency 'faye'
13
+ s.add_dependency 'sinatra'
14
+ s.add_dependency 'vegas'
15
+ end
@@ -0,0 +1,24 @@
1
+ require 'sinatra/base'
2
+ require 'faye'
3
+
4
+ module DoubanFMHotkey
5
+ class Server < Sinatra::Base
6
+
7
+ use Faye::RackAdapter, :mount => '/faye'
8
+
9
+ before do
10
+ @client = Faye::Client.new('http://0.0.0.0:1988/faye')
11
+ end
12
+
13
+ get '/' do
14
+ '<h1>Douban FM Hotkey</h1><p>Made by http://www.douban.com/people/coolzi/</p>'
15
+ end
16
+
17
+ %w{skip pause love ban}.each do |cmd|
18
+ get "/#{cmd}" do
19
+ @client.publish('/hotkey', {cmd: cmd})
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,3 @@
1
+ module DoubanFMHotkey
2
+ VERSION = '1.0.0'
3
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: douban_fm_hotkey
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Wei Zhu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faye
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: vegas
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Global hotkey for Douban FM web.
56
+ email: yesmeck@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - .gitignore
62
+ - Gemfile
63
+ - Gemfile.lock
64
+ - README.md
65
+ - Rakefile
66
+ - bin/dfh_server
67
+ - douban_fm_hotkey.gemspec
68
+ - lib/douban_fm_hotkey/server.rb
69
+ - lib/douban_fm_hotkey/version.rb
70
+ homepage: http://www.douban.com/people/coolzi
71
+ licenses: []
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.0.3
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Douban FM global hotkey.
93
+ test_files: []