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 +10 -6
- data/groute.gemspec +1 -1
- data/lib/groute/version.rb +1 -1
- metadata +5 -5
data/bin/groute
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
if ARGV.
|
3
|
-
puts
|
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
|
-
|
10
|
-
`
|
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
|
data/groute.gemspec
CHANGED
@@ -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/
|
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
|
|
data/lib/groute/version.rb
CHANGED
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
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-
|
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/
|
41
|
+
homepage: http://jordandcarter.github.com/groute
|
42
42
|
licenses: []
|
43
43
|
|
44
44
|
post_install_message:
|