groute 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/groute CHANGED
@@ -1,13 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
- if ARGV.nil? || ARGV.size == 0
3
- puts "Usage: groute PATTERN"
2
+ if ARGV.first == '-h' || ARGV.first == '--help'
3
+ puts 'Usage: groute <PATTERN>'
4
4
  puts "Description: Equivalent to 'rake routes | grep <PATTERN>' but caches output. Relies on config/routes.rb modification time to refresh cache."
5
5
  else
6
- search_term = ARGV.first
7
6
  groutes_store = File.expand_path('tmp/.groutes')
8
7
  routes_file = File.expand_path('config/routes.rb')
9
- unless File.exists?(groutes_store) && File.mtime(groutes_store) > File.mtime(routes_file)
10
- `rake routes > #{groutes_store}`
8
+ if ARGV.nil? || ARGV.size == 0
9
+ puts `cat #{groutes_store}`
10
+ else
11
+ search_term = ARGV.first
12
+ unless File.exists?(groutes_store) && File.mtime(groutes_store) > File.mtime(routes_file)
13
+ `rake routes > #{groutes_store}`
14
+ end
15
+ puts `cat #{groutes_store} | grep --color=always -i #{search_term}`
11
16
  end
12
- puts `cat #{groutes_store} | grep --color=always -i #{search_term}`
13
17
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Groute::VERSION
8
8
  s.authors = ["Jordan Carter"]
9
9
  s.email = ["jordan.d.carter@gmail.com"]
10
- s.homepage = "http://github.com/jordandcarter/groute"
10
+ s.homepage = "http://jordandcarter.github.com/groute"
11
11
  s.summary = %q{Caches your rake routes output and greps it, cache updates when routes.rb timestamp updated}
12
12
  s.description = %q{Grep over your routes often? This will speed it up a bit}
13
13
 
@@ -1,3 +1,3 @@
1
1
  module Groute
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groute
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Carter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-30 00:00:00 +13:00
18
+ date: 2012-04-09 00:00:00 +12:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -38,7 +38,7 @@ files:
38
38
  - lib/groute.rb
39
39
  - lib/groute/version.rb
40
40
  has_rdoc: true
41
- homepage: http://github.com/jordandcarter/groute
41
+ homepage: http://jordandcarter.github.com/groute
42
42
  licenses: []
43
43
 
44
44
  post_install_message: