mina-tail 0.0.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.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +75 -0
- data/Rakefile +2 -0
- data/lib/mina/tail/tasks.rake +27 -0
- data/lib/mina/tail/version.rb +5 -0
- data/lib/mina/tail.rb +1 -0
- data/mina-tail.gemspec +27 -0
- metadata +123 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e932ba79b9935829385dd58a808b5697257cc1f2
|
4
|
+
data.tar.gz: 31e81023a79b54c7cca8a6738b77968a19711e0e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e400f67f257350156ca674ed86cba67d0a7c2991322e6f7f603683224ea5bbe4f8bf1676ece8a790d9c94d9dbcea160059f6abc38eca503aae991e2687a9e3c0
|
7
|
+
data.tar.gz: 78f7f5e23dae62733536e99b762cb097b01220e4e3c6398677feb0aeb9a560e98f8ed3a02733bc7c65862731ff11ee808b7c826d7dbe500add5c452602d1e890
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Daniel Senff
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Mina-Tail
|
2
|
+
|
3
|
+
Tasks for tailing Rails log files in a Mina deployment environment
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```rb
|
10
|
+
gem 'mina-tail', require: false
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```shell
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
|
22
|
+
Require `mina/tail` in your `config/deploy.rb`:
|
23
|
+
|
24
|
+
```rb
|
25
|
+
require 'mina/tail'
|
26
|
+
require 'mina/bundler'
|
27
|
+
require 'mina/rails'
|
28
|
+
require 'mina/git'
|
29
|
+
|
30
|
+
...
|
31
|
+
|
32
|
+
task setup: :environment do
|
33
|
+
...
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
## Usage
|
38
|
+
|
39
|
+
```shell
|
40
|
+
$ mina production tail:live
|
41
|
+
```
|
42
|
+
|
43
|
+
Tails `log/production.log` live.
|
44
|
+
|
45
|
+
```shell
|
46
|
+
$ mina production tail:live file=unicorn.err.log
|
47
|
+
```
|
48
|
+
|
49
|
+
Tails `log/unicorn.err.log` live.
|
50
|
+
|
51
|
+
```shell
|
52
|
+
$ mina production tail:last
|
53
|
+
```
|
54
|
+
|
55
|
+
Returns the last 2000 lines of the `log/production.log`
|
56
|
+
|
57
|
+
```shell
|
58
|
+
$ mina production tail:last lines=20
|
59
|
+
```
|
60
|
+
|
61
|
+
Returns the last 20 lines of the `log/production.log`
|
62
|
+
|
63
|
+
```shell
|
64
|
+
$ mina production tail:last file=unicorn.err.log lines=20
|
65
|
+
```
|
66
|
+
|
67
|
+
Returns the last 20 lines of the `log/unicorn.err.log`
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
1. Fork it
|
72
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
74
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
namespace :tail do
|
2
|
+
desc "Lists logs available to tail"
|
3
|
+
task :list => :environment do
|
4
|
+
in_directory "#{app_path}" do
|
5
|
+
log_path = "#{deploy_to!}/#{current_path!}/log"
|
6
|
+
queue %{
|
7
|
+
echo "-----> Log files in #{log_path}"
|
8
|
+
#{%[ls #{log_path} | grep log]}
|
9
|
+
}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
desc "Shows live environment logs"
|
13
|
+
task :live => :environment do
|
14
|
+
in_directory "#{app_path}" do
|
15
|
+
file = ENV['file'] || "#{rails_env}.log"
|
16
|
+
queue! %[tail -f log/#{file}]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
desc "Shows live environment logs"
|
20
|
+
task :last => :environment do
|
21
|
+
in_directory "#{app_path}" do
|
22
|
+
lines = ENV['lines'] || 2000
|
23
|
+
file = ENV['file'] || "#{rails_env}.log"
|
24
|
+
queue! %[tail -#{lines} log/#{file}]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/mina/tail.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tail/tasks.rake", __FILE__)
|
data/mina-tail.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mina/tail/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mina-tail"
|
8
|
+
spec.version = Mina::Tail::VERSION
|
9
|
+
spec.authors = ["Daniel Senff"]
|
10
|
+
spec.email = ["daniel.senff@modomoto.de"]
|
11
|
+
spec.summary = %q{Tasks for tailing Rails log files in a Mina deployment environment.}
|
12
|
+
spec.description = %q{Tasks for tailing log files with mina.}
|
13
|
+
spec.homepage = "http://github.com/modomoto/mina-tail"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "mina", ">= 0.2.1"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "rspec-nc"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-tail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Senff
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-nc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Tasks for tailing log files with mina.
|
84
|
+
email:
|
85
|
+
- daniel.senff@modomoto.de
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- lib/mina/tail.rb
|
96
|
+
- lib/mina/tail/tasks.rake
|
97
|
+
- lib/mina/tail/version.rb
|
98
|
+
- mina-tail.gemspec
|
99
|
+
homepage: http://github.com/modomoto/mina-tail
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.4.8
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Tasks for tailing Rails log files in a Mina deployment environment.
|
123
|
+
test_files: []
|