h2ocube_rails_rainbows 0.0.1

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: 1f33338725d85540a3d605293713f37a8728eef6
4
+ data.tar.gz: a09f951aaf48f1376bb56bf9b57c0e8f4739c50c
5
+ SHA512:
6
+ metadata.gz: 1558c062f698f0bfd071add0ef46c170370c55fbba636c29619aae3a3f031123dea3b1ef2845a240573802ef4635dca31ad2021604dce3c47e7832cbfb612f6c
7
+ data.tar.gz: 3967a2b1a486d62f09c74d0546ad2c80b10a3a30f81842a7976ee9315007fdf1ad8400d8c73212253440c37319442f639eae89ce396dfb7e9ccfe16d6a9ef61d
@@ -0,0 +1,5 @@
1
+ # Logfile created on 2013-12-30 13:30:09 +0800 by logger.rb/44203
2
+ I, [2013-12-30T13:30:09.769206 #5674] INFO -- : 0: rack (1.5.2) from /Users/ben/.rvm/gems/ruby-2.1.0/specifications/rack-1.5.2.gemspec
3
+ I, [2013-12-30T13:30:09.770101 #5674] INFO -- : 0: puma (2.7.1) from /Users/ben/.rvm/gems/ruby-2.1.0/specifications/puma-2.7.1.gemspec
4
+ I, [2013-12-30T13:30:09.785992 #5674] INFO -- : 0: h2ocube_rails_puma (0.0.1) from /Users/ben/dev/h2ocube_rails_puma/h2ocube_rails_puma.gemspec
5
+ I, [2013-12-30T13:30:09.786398 #5674] INFO -- : 0: bundler (1.5.0) from /Users/ben/.rvm/gems/ruby-2.1.0@global/specifications/bundler-1.5.0.gemspec
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in h2ocube_rails_development.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,26 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ h2ocube_rails_rainbows (0.0.1)
5
+ rainbows
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ kgio (2.8.1)
11
+ rack (1.5.2)
12
+ rainbows (4.6.0)
13
+ kgio (~> 2.5)
14
+ rack (~> 1.1)
15
+ unicorn (~> 4.8)
16
+ raindrops (0.12.0)
17
+ unicorn (4.8.1)
18
+ kgio (~> 2.6)
19
+ rack
20
+ raindrops (~> 0.7)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ h2ocube_rails_rainbows!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 H2ocube.com
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # H2ocubeRailsPuma
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/h2ocube_rails_rainbows.png)](http://badge.fury.io/rb/h2ocube_rails_rainbows)
4
+
5
+ Puma helper.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'h2ocube_rails_rainbows', group: [:development, :production]
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install h2ocube_rails_rainbows
20
+
21
+ ## Usage
22
+
23
+ # Capfile
24
+ require 'capistrano/rainbows'
25
+
26
+ Puma specific tasks for Capistrano v3:
27
+
28
+ cap rainbows:start
29
+ cap rainbows:stop
30
+ cap rainbows:restart
31
+ cap rainbows:cold_restart
32
+
33
+ # nginx.conf
34
+ upstream app {
35
+ server unix:/root/app/shared/sockets/rainbows.sock fail_timeout=0;
36
+ }
37
+ server {
38
+ listen 80;
39
+ server_name app.com;
40
+ root /root/app/current/public;
41
+ location / {
42
+ if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]*$") {
43
+ expires max;
44
+ break;
45
+ }
46
+ try_files $uri @app;
47
+ }
48
+ location @app {
49
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50
+ proxy_set_header Host $http_host;
51
+ proxy_set_header X-UA-Compatible IE=edge,chrome=1;
52
+ proxy_redirect off;
53
+ proxy_pass http://app;
54
+ }
55
+ }
56
+
57
+ ## Include
58
+
59
+ * rainbows http://rainbows.rubyforge.org/
60
+
61
+ ## Contributing
62
+
63
+ 1. Fork it
64
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
65
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
66
+ 4. Push to the branch (`git push origin my-new-feature`)
67
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'h2ocube_rails_rainbows'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Ben']
9
+ spec.email = ['ben@zfben.com']
10
+ spec.description = %q{Rainbows! helper}
11
+ spec.summary = %q{Rainbows! helper}
12
+ spec.homepage = 'https://github.com/h2ocube/h2ocube_rails_rainbows'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'rainbows'
21
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/rainbows.cap', __FILE__)
@@ -0,0 +1,37 @@
1
+ namespace :rainbows do
2
+ desc 'Start rainbows'
3
+ task :start do
4
+ on roles :app do
5
+ within release_path do
6
+ execute :bundle, "exec rainbows -C config/rainbows.rb --listen 'unix://#{shared_path}/sockets/rainbows.sock' -E #{fetch(:stage)} --pid '#{shared_path}/pids/rainbows.pid' -D"
7
+ end
8
+ end
9
+ end
10
+
11
+ desc 'Stop rainbows'
12
+ task :stop do
13
+ on roles :app do
14
+ within release_path do
15
+ execute "kill -s QUIT `cat #{shared_path}/pids/rainbows.pid`;true"
16
+ end
17
+ end
18
+ end
19
+
20
+ desc 'Restart rainbows'
21
+ task :restart do
22
+ on roles :app do
23
+ within release_path do
24
+ execute "kill -s USR2 `cat #{shared_path}/pids/rainbows.pid`;true"
25
+ end
26
+ end
27
+ end
28
+
29
+ desc 'Cold Restart rainbows'
30
+ task :cold_restart do
31
+ invoke 'rainbows:stop'
32
+ sleep 3
33
+ invoke 'rainbows:start'
34
+ end
35
+
36
+ before 'deploy:published', 'rainbows:restart'
37
+ end
@@ -0,0 +1,9 @@
1
+ class H2ocubeRailsRainbowsGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../source', __FILE__)
3
+
4
+ desc 'Creates a rainbows.rb to your config/.'
5
+
6
+ def copy_rainbows_rb
7
+ template 'rainbows.rb.erb', 'config/rainbows.rb'
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ app_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
2
+
3
+ worker_processes 1
4
+ preload_app true
5
+ GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true
6
+
7
+ working_directory app_path
8
+
9
+ stderr_path 'log/rainbows.stderr.log'
10
+ stdout_path 'log/rainbows.stdout.log'
11
+
12
+ before_fork do |server, worker|
13
+ ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord)
14
+ end
15
+
16
+ after_fork do |server, worker|
17
+ ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
18
+ end
19
+
20
+ Rainbows! do
21
+ use :ThreadPool
22
+ worker_connections 1024
23
+ end
@@ -0,0 +1,10 @@
1
+ require 'rainbows'
2
+
3
+ module H2ocubeRailsRainbows
4
+ module Rails
5
+ class Rails::Engine < ::Rails::Engine
6
+ initializer 'h2ocube_rails_rainbows.require_dependency' do |app|
7
+ end
8
+ end
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: h2ocube_rails_rainbows
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ben
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rainbows
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
+ description: Rainbows! helper
28
+ email:
29
+ - ben@zfben.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".bundle/install.log"
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - h2ocube_rails_rainbows.gemspec
41
+ - lib/capistrano/rainbows.rb
42
+ - lib/capistrano/tasks/rainbows.cap
43
+ - lib/generators/h2ocube_rails_rainbows_generator.rb
44
+ - lib/generators/source/rainbows.rb.erb
45
+ - lib/h2ocube_rails_rainbows.rb
46
+ homepage: https://github.com/h2ocube/h2ocube_rails_rainbows
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.2.1
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Rainbows! helper
70
+ test_files: []