zfben_rails_rake 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,32 @@
1
+ == SUMMARY
2
+
3
+ This is plugin to add some useful tasks to rails.
4
+
5
+ rake clear:all # clear all
6
+ rake clear:log # clear log folder
7
+ rake clear:public # clear public folder
8
+ rake clear:tmp # clear tmp folder
9
+
10
+ rake git:commit[comment] # git commit with your comment
11
+ rake git:pull # git pull
12
+ rake git:push[comment] # git push with your comment
13
+
14
+ rake unicorn:restart[env,config] # restart server
15
+ rake unicorn:start[env,config] # start server
16
+ rake unicorn:stop # stop server
17
+
18
+ rake log:analytics # analytics log file
19
+
20
+ == Getting Started
21
+
22
+ 1. adding gem to Gemfile
23
+
24
+ gem 'zfben_rails_rake'
25
+
26
+ 2. update bundle
27
+
28
+ bundle install
29
+
30
+ 3. try `rake -T`, and enjoy it :)
31
+
32
+ take -T
@@ -1,3 +1,3 @@
1
1
  module ZfbenRailsRake
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/tasks/git.rb CHANGED
@@ -6,12 +6,12 @@ namespace 'git' do
6
6
 
7
7
  desc 'git commit with your comment'
8
8
  task :commit, :comment do |task, comment|
9
- if comment == {}
9
+ unless defined? comment.comment
10
10
  comment = 'no comment'
11
11
  else
12
12
  comment = comment.comment
13
13
  end
14
- sys "git commit -m '#{comment}' -a"
14
+ sys "git add .;git commit -m '#{comment}' -a"
15
15
  end
16
16
 
17
17
  desc 'git push with your comment'
data/tasks/log.rb ADDED
@@ -0,0 +1,8 @@
1
+ namespace :log do
2
+ desc 'analytics log file'
3
+ task :analytics do
4
+ Dir[File.join(Rails.root, 'log', '*.log')].each do |log|
5
+ sys 'request-log-analyzer ' + log
6
+ end
7
+ end
8
+ end
data/tasks/unicorn.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  namespace 'unicorn' do
2
2
  desc 'start server'
3
- task :start, :env do |task, env|
3
+ task :start, :env, :config do |task, env, config|
4
4
  cmd = 'unicorn_rails'
5
- cmd << ' -c u.rb' if File.exists? File.join(Rails.root, 'u.rb')
6
- cmd << ' -E ' << env.env if env != {}
5
+ cmd << ' -c u.rb' if defined?(config.config) && File.exists?(File.join(Rails.root, config.config))
6
+ cmd << ' -E ' << env.env if defined? env.env
7
7
  sys cmd << ' -D'
8
8
  end
9
9
 
@@ -13,5 +13,5 @@ namespace 'unicorn' do
13
13
  end
14
14
 
15
15
  desc 'restart server'
16
- task :restart, :env, :needs => [:stop, :start]
16
+ task :restart, :env, :config, :needs => [:stop, :start]
17
17
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency 'rainbow'
22
22
  s.add_dependency 'rails'
23
23
  s.add_dependency 'unicorn'
24
+ s.add_dependency 'request-log-analyzer'
24
25
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zfben_rails_rake
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-18 00:00:00 Z
13
+ date: 2011-05-19 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rainbow
@@ -45,6 +45,17 @@ dependencies:
45
45
  version: "0"
46
46
  type: :runtime
47
47
  version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: request-log-analyzer
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ type: :runtime
58
+ version_requirements: *id004
48
59
  description: ""
49
60
  email:
50
61
  - ben@zfben.com
@@ -57,6 +68,7 @@ extra_rdoc_files: []
57
68
  files:
58
69
  - .gitignore
59
70
  - Gemfile
71
+ - README.rdoc
60
72
  - Rakefile
61
73
  - lib/zfben_rails_rake.rb
62
74
  - lib/zfben_rails_rake/railtie.rb
@@ -64,6 +76,7 @@ files:
64
76
  - tasks/clear.rb
65
77
  - tasks/git.rb
66
78
  - tasks/helper.rb
79
+ - tasks/log.rb
67
80
  - tasks/unicorn.rb
68
81
  - zfben_rails_rake.gemspec
69
82
  homepage: https://github.com/benz303/zfben_rails_rake