gumdrop 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/gumdrop/dsl.rb DELETED
@@ -1,30 +0,0 @@
1
- module Gumdrop
2
- module DSL
3
-
4
- def self.generate(&block)
5
- # Auto-generated, numerical, key for a site-level generator
6
- Gumdrop.generators[Gumdrop.generators.keys.length] = Generator.new(block)
7
- end
8
-
9
- def self.content_filter(&block)
10
- Gumdrop.content_filters << block
11
- end
12
-
13
- def self.skip(path)
14
- Gumdrop.blacklist << path
15
- end
16
-
17
- def self.ignore(path)
18
- Gumdrop.greylist << path
19
- end
20
-
21
- def self.view_helpers(&block)
22
- Gumdrop::ViewHelpers.class_eval &block
23
- end
24
-
25
- def self.configure(&block)
26
- Gumdrop::Configurator.instance_eval &block
27
- end
28
-
29
- end
30
- end
@@ -1,35 +0,0 @@
1
- # Logging support
2
-
3
- require 'logger'
4
-
5
- module Gumdrop
6
-
7
- module Logging
8
-
9
- class << self
10
-
11
- def log
12
-
13
- end
14
-
15
- def info
16
-
17
- end
18
-
19
- def warn
20
-
21
- end
22
-
23
- def error
24
-
25
- end
26
-
27
- def debug
28
-
29
- end
30
-
31
- end
32
-
33
- end
34
-
35
- end
data/lib/gumdrop/pager.rb DELETED
@@ -1,49 +0,0 @@
1
- module Gumdrop
2
- class Pager
3
- attr_reader :all, :pages, :base_url, :current_page, :page_sets
4
-
5
- def initialize(articles, base_path="/page", page_size=5)
6
- @all= articles
7
- @page_size= page_size
8
- @base_path= base_path
9
- @page_sets= @all.in_groups_of(page_size, false)
10
- @pages= []
11
- @current_page=1
12
- @page_sets.each do |art_ary|
13
- @pages << HashObject.new({
14
- items: art_ary,
15
- page: @current_page,
16
- uri: "#{base_path}/#{current_page}",
17
- pager: self
18
- })
19
- @current_page += 1
20
- end
21
- @current_page= nil
22
- end
23
-
24
- def length
25
- @pages.length
26
- end
27
-
28
- def first
29
- @pages.first
30
- end
31
-
32
- def last
33
- @pages.last
34
- end
35
-
36
- def each
37
- @current_page=1
38
- @pages.each do |page_set|
39
- yield page_set
40
- @current_page += 1
41
- end
42
- @current_page= nil
43
- end
44
-
45
- def [](key)
46
- @pages[key]
47
- end
48
- end
49
- end
data/lib/gumdrop/utils.rb DELETED
@@ -1,20 +0,0 @@
1
-
2
- module Gumdrop
3
-
4
- module Utils
5
-
6
- def self.content_hash(base_path)
7
- Hash.new do |hash, key|
8
- templates= Dir["#{base_path}#{key}*"]
9
- if templates.length > 0
10
- Content.new( templates[0] )
11
- else
12
- puts "NOT FOUND: #{key}"
13
- nil
14
- end
15
- end
16
- end
17
-
18
- end
19
-
20
- end