squash_rails 1.2.0 → 1.3.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
+ data.tar.gz: cb21ef0e33a376269cfa1789384059ddc6444bee
4
+ metadata.gz: 0591b9bef1196fd70ada7e20f42864b51982154c
5
+ SHA512:
6
+ data.tar.gz: a540f3c103cd1301147464e1c44ecb33532e4d0f1a1654528a38a8cb4f6bf6f58162ef1f58f7fab3758f1880f2e5b844ca5827359969ac7038b3456cefee5163
7
+ metadata.gz: 7da8faaf5c2fa0499573dcb8ab03b92a1923cc85052758b974ad6e3817e929a3588aa09c4a6c4c9e24ce788d51d44ac9aa82ab8b3f7493d20a16d88c803d9798
data/README.md CHANGED
@@ -95,8 +95,24 @@ Deploys
95
95
  -------
96
96
 
97
97
  Squash works best when you notify it if your web app's deploys. If you're using
98
- Capistrano, this is easy: Just add `require 'squash/rails/capistrano'` to your
99
- `config/deploy.rb` file. Everything else should be taken care of.
98
+ Capistrano, this is easy. For **Capistrano 2**, just add
99
+ `require 'squash/rails/capistrano2'` to your `config/deploy.rb` file. Everything
100
+ else should be taken care of. For **Capistrano 3**, just add
101
+ `require 'squash/rails/capistrano3'` to your `Capfile`.
102
+
103
+ If you do not deploy to a live Git directory, you will need to write a
104
+ `REVISION` file to your app root. To do this, include the following in your
105
+ `config/deploy.rb` file in Capistrano 3:
106
+
107
+ ```` ruby
108
+ before 'deploy:publishing', 'squash:write_revision'
109
+ ````
110
+
111
+ or in Capistrano 2:
112
+
113
+ ```` ruby
114
+ before 'deploy:assets:precompile', 'squash:write_revision'
115
+ ````
100
116
 
101
117
  If you're not using Capistrano, you will need to configure your deploy script
102
118
  so that it runs the `squash:notify` Rake task on every deploy target. This Rake
@@ -16,6 +16,12 @@
16
16
 
17
17
  Capistrano::Configuration.instance.load do
18
18
  namespace :squash do
19
+ # USAGE: before 'deploy:assets:precompile', 'squash:write_revision'
20
+ desc "Writes a REVISION file to the application's root directory"
21
+ task :write_revision, :roles => :app do
22
+ run %{echo "#{real_revision}" > #{release_path}/REVISION}
23
+ end
24
+
19
25
  desc "Notifies Squash of a new deploy."
20
26
  task :notify, :roles => :web, :only => {:primary => true}, :except => {:no_release => true} do
21
27
  rails_env = fetch(:rails_env, 'production')
@@ -0,0 +1,2 @@
1
+ load(File.dirname(__FILE__) + '/../../tasks/squash.cap')
2
+
@@ -0,0 +1,45 @@
1
+ # Copyright 2013 Square Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Capistrano tasks for Rails apps using Squash.
16
+
17
+ set :current_revision, lambda { `git rev-parse #{fetch :branch}`.chomp }
18
+
19
+ namespace :squash do
20
+ # USAGE: before 'deploy:publishing', 'squash:write_revision'
21
+ desc "Writes a REVISION file to the application's root directory"
22
+ task :write_revision do
23
+ on roles(:app) do
24
+ execute %{echo "#{fetch :current_revision}" > #{release_path.join('REVISION')}}
25
+ end
26
+ end
27
+
28
+ desc "Notifies Squash of a new deploy"
29
+ task :notify do
30
+ on roles(:web), :limit => 1 do
31
+ within release_path do
32
+ with :rails_env => fetch(:rails_env) do
33
+ command = if test("[ -e #{release_path.join('bin', 'rails')} ]")
34
+ 'bin/rails'
35
+ else
36
+ 'script/rails'
37
+ end
38
+ execute command, "runner 'Squash::Ruby.notify_deploy #{fetch(:rails_env).inspect}, #{fetch(:current_revision).inspect}, #{Socket.gethostname.inspect}'"
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ after 'deploy:finishing', 'squash:notify'
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squash_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease:
6
- segments:
7
- - 1
8
- - 2
9
- - 0
10
- version: 1.2.0
4
+ version: 1.3.0
11
5
  platform: ruby
12
6
  authors:
13
7
  - Tim Morgan
@@ -15,92 +9,61 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2013-09-06 00:00:00 Z
12
+ date: 2013-11-26 00:00:00 Z
19
13
  dependencies:
20
14
  - !ruby/object:Gem::Dependency
21
- name: squash_ruby
15
+ type: :runtime
22
16
  version_requirements: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
17
  requirements:
25
- - - ">="
18
+ - &id002
19
+ - ">="
26
20
  - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
21
  version: "0"
22
+ name: squash_ruby
31
23
  prerelease: false
32
- type: :runtime
33
24
  requirement: *id001
34
25
  - !ruby/object:Gem::Dependency
35
- name: rails
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 3
42
- segments:
43
- - 0
44
- version: "0"
45
- prerelease: false
46
26
  type: :development
47
- requirement: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: rspec
50
27
  version_requirements: &id003 !ruby/object:Gem::Requirement
51
- none: false
52
28
  requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- hash: 3
56
- segments:
57
- - 0
58
- version: "0"
29
+ - *id002
30
+ name: rails
59
31
  prerelease: false
60
- type: :development
61
32
  requirement: *id003
62
33
  - !ruby/object:Gem::Dependency
63
- name: yard
34
+ type: :development
64
35
  version_requirements: &id004 !ruby/object:Gem::Requirement
65
- none: false
66
36
  requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
37
+ - *id002
38
+ name: rspec
73
39
  prerelease: false
74
- type: :development
75
40
  requirement: *id004
76
41
  - !ruby/object:Gem::Dependency
77
- name: redcarpet
42
+ type: :development
78
43
  version_requirements: &id005 !ruby/object:Gem::Requirement
79
- none: false
80
44
  requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
45
+ - *id002
46
+ name: yard
87
47
  prerelease: false
88
- type: :development
89
48
  requirement: *id005
90
49
  - !ruby/object:Gem::Dependency
91
- name: jeweler
50
+ type: :development
92
51
  version_requirements: &id006 !ruby/object:Gem::Requirement
93
- none: false
94
52
  requirements:
95
- - - ">="
53
+ - - <
96
54
  - !ruby/object:Gem::Version
97
- hash: 3
98
- segments:
99
- - 0
100
- version: "0"
55
+ version: 3.0.0
56
+ name: redcarpet
101
57
  prerelease: false
102
- type: :development
103
58
  requirement: *id006
59
+ - !ruby/object:Gem::Dependency
60
+ type: :development
61
+ version_requirements: &id007 !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - *id002
64
+ name: jeweler
65
+ prerelease: false
66
+ requirement: *id007
104
67
  description: This client library records Ruby on Rails exceptions to Squash.
105
68
  email: tim@squareup.com
106
69
  executables: []
@@ -114,46 +77,38 @@ files:
114
77
  - LICENSE.txt
115
78
  - README.md
116
79
  - lib/squash/rails.rb
117
- - lib/squash/rails/capistrano.rb
80
+ - lib/squash/rails/capistrano2.rb
81
+ - lib/squash/rails/capistrano3.rb
118
82
  - lib/squash/rails/configure.rb
119
83
  - lib/squash/rails/rack.rb
120
84
  - lib/squash/rails/sidekiq.rb
121
85
  - lib/squash/rails/tasks.rake
122
86
  - lib/squash/ruby/controller_methods.rb
123
87
  - lib/squash/ruby/railtie.rb
88
+ - lib/tasks/squash.cap
124
89
  - rails/init.rb
125
90
  homepage: http://github.com/SquareSquash/rails
126
91
  licenses:
127
92
  - Apache 2.0
93
+ metadata: {}
94
+
128
95
  post_install_message:
129
96
  rdoc_options: []
130
97
 
131
98
  require_paths:
132
99
  - lib
133
100
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
101
  requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- hash: 3
139
- segments:
140
- - 0
141
- version: "0"
102
+ - *id002
142
103
  required_rubygems_version: !ruby/object:Gem::Requirement
143
- none: false
144
104
  requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- hash: 3
148
- segments:
149
- - 0
150
- version: "0"
105
+ - *id002
151
106
  requirements: []
152
107
 
153
108
  rubyforge_project:
154
- rubygems_version: 1.8.25
109
+ rubygems_version: 2.0.11
155
110
  signing_key:
156
- specification_version: 3
111
+ specification_version: 4
157
112
  summary: Squash client for Ruby on Rails projects
158
113
  test_files: []
159
114