sinatra-croon 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sinatra/croon.rb +16 -4
  2. metadata +4 -4
data/lib/sinatra/croon.rb CHANGED
@@ -3,7 +3,7 @@ require "sinatra/base"
3
3
 
4
4
  module Sinatra
5
5
  module Croon
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
 
8
8
  def self.registered(app)
9
9
  app.helpers Croon::Helpers
@@ -57,10 +57,22 @@ module Sinatra
57
57
  def self.parse_route_documentation(filename, line)
58
58
  all_lines = File.read(filename).split("\n").reverse
59
59
  index_start = all_lines.length - line + 1
60
- num_lines = all_lines[index_start..-1].index { |l| !['', '#'].include?(l.strip[0..0]) }
61
- doc_lines = all_lines[index_start, num_lines].reverse
60
+ lines = []
61
+ started = false
62
+
63
+ all_lines[index_start..-1].each do |line|
64
+ case line.strip[0..0]
65
+ when '#' then
66
+ started = true
67
+ lines << line.strip
68
+ when '' then
69
+ break(2) if started
70
+ else
71
+ break(2)
72
+ end
73
+ end
62
74
 
63
- parse_comments(doc_lines)
75
+ parse_comments(lines.reverse)
64
76
  end
65
77
 
66
78
  def self.parse_comments(comments)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-croon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Dollar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-26 00:00:00 -04:00
18
+ date: 2010-07-27 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency