gumdrop 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ # v0.5.1
2
+ - Bugfix: dev server was rescanning source files multiple times per pages load if build time exceeded 2 seconds... Will now wait 10 seconds before rescanning source.
3
+
1
4
  # v0.5
2
5
  - Gumdrop projects now require a `Gumdrop` file at the root -- contents are what you used to put in lib/site.rb.
3
6
  - Added new `configure` and `view_helpers` methods for use in `Gumdrop` site file.
data/Notes.md CHANGED
@@ -2,10 +2,14 @@
2
2
  - HTML Manifest generation??
3
3
  - Some kind of admin? What would that even do?
4
4
  - If you could specify a 'prototype' for data collections, could be cool.
5
-
5
+ - Multiple source_dir?
6
+ - `set :source_dir, ['./source/a', './source/b']
7
+ - What would happen with conflicts, last one in wins?
8
+ - Multiple data_dir too?
6
9
 
7
10
  # TODO:
8
11
  - New/Update Doc Site
9
12
  - API for retrieving pages and pages under a path (simple query)
10
13
  - Cleanup api and verbiage around blacklisting and ignoring
11
- - YamlDoc support (in data anyway)
14
+ - YamlDoc support (in data anyway)
15
+ - Templates should be stored as short name/path and full path (like partials)
data/Readme.md CHANGED
@@ -2,12 +2,26 @@
2
2
 
3
3
  Gumdrop is a small and sweet cms/prototype tool. It can generate static html with relative paths, and includes a dev server that can be run via any rack server (including POW!).
4
4
 
5
- ## Create New Site
5
+ ## Install
6
+
7
+ gem install gumdrop
8
+
9
+ # Quick Ref
10
+
11
+ ### Create New Site
12
+
13
+ gumdrop --create my_new_site
14
+
15
+ Shorter syntax:
6
16
 
7
17
  gumdrop -c my_new_site
8
18
 
19
+ ### Create New Site From Template
9
20
 
10
- ## Build Static HTML
21
+ gumdrop -c my_new_site -t backbone
22
+
23
+
24
+ ### Build Static HTML
11
25
 
12
26
  gumdrop -b
13
27
 
@@ -16,7 +30,7 @@ Or, you can use Rake:
16
30
  rake build
17
31
 
18
32
 
19
- ## Start Dev Server
33
+ ### Start Dev Server
20
34
 
21
35
  gumdrop -s
22
36
 
@@ -24,16 +38,25 @@ Or, using Rake again:
24
38
 
25
39
  rake serve
26
40
 
41
+ ### Saving The Current Site As A Local Template
42
+
43
+ gumdrop -t my_template
44
+
45
+ You can then create new sites based on your local template:
46
+
47
+ gumdrop -c my_new_from_my_template -t my_template
48
+
49
+ Local templates are stored under `~/.gumdrop/templates/`.
50
+
51
+
27
52
  # Gumdrop Site Structure
28
53
 
54
+ *NOTE:* The following is based on the `default` template, the structure is configurable based on your needs.
55
+
29
56
  This is the file structure that is generated when you run `gumdrop --create site_root`. You can change whatever you'd like under `source/`, this is just a starting point.
30
57
 
31
58
  site_root/
32
- data/
33
- config.yml
34
- lib/
35
- view_helpers.rb
36
- source/
59
+ source/
37
60
  favicon.ico
38
61
  index.html.erb
39
62
  theme/
@@ -45,6 +68,7 @@ This is the file structure that is generated when you run `gumdrop --create site
45
68
  templates/
46
69
  site.template.erb
47
70
  Gemfile
71
+ Gumdrop
48
72
  config.ru
49
73
  Rakefile
50
74
 
@@ -60,3 +84,22 @@ When you run `gumdrop --build` or `rake build` it will generate an `output/` fol
60
84
  app.js
61
85
 
62
86
  You'll notice the templates and partials aren't included in the output.
87
+
88
+ # Gumdrop File
89
+
90
+ Gumdrop looks for a file named `Gumdrop` to indicate the root project folder. It'll walk up the directory structure looking for one, so you can run Gumdrop commands from sub-folders.
91
+
92
+ The `Gumdrop` file is where you configure your site, generate dynamic content, assign view_helpers and more.
93
+
94
+ Have a look at the file here: https://github.com/darthapo/gumdrop/blob/master/templates/default/Gumdrop
95
+
96
+ # Need To Document:
97
+
98
+ - Proxy support
99
+ - Stitch
100
+ - "Dynamic" pages
101
+ - Data support
102
+ - Content filters
103
+ - Partials
104
+ - Config and using in pages
105
+ - Project Templates
@@ -16,7 +16,7 @@ module Gumdrop
16
16
  # redirect '/index.html'
17
17
  # end
18
18
 
19
- Gumdrop.run dry_run:true, log:server_log
19
+ Gumdrop.run dry_run:true, log:server_log, auto_run:true
20
20
 
21
21
  if Gumdrop.config.proxy_enabled
22
22
  require 'gumdrop/proxy_handler'
@@ -61,11 +61,11 @@ module Gumdrop
61
61
  end
62
62
 
63
63
  get '/*' do
64
+ # Gumdrop.log.info "[#{$$}] !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
64
65
  file_path= get_content_path params[:splat].join('/')
65
-
66
- Gumdrop.log.info "[#{$$}] GET /#{params[:splat].join('/')}"
67
- #Gumdrop.log.debug " last built: #{Gumdrop.last_run}"
68
-
66
+ Gumdrop.log.info "[#{$$}] GET /#{params[:splat].join('/')} -> #{file_path}"
67
+ # Gumdrop.log.info " last built: #{Gumdrop.last_run}"
68
+ # Gumdrop.log.info "#{Gumdrop.config.inspect}"
69
69
 
70
70
  if Gumdrop.site.has_key? file_path
71
71
  content= Gumdrop.site[file_path]
@@ -74,13 +74,14 @@ module Gumdrop
74
74
  if Gumdrop.config.force_reload
75
75
  unless %w(.jpg .jpe .jpeg .gif .ico .png).include? File.extname(file_path).to_s
76
76
  since_last_build= Time.now.to_i - Gumdrop.last_run.to_i
77
- if since_last_build > 2
78
- Gumdrop.log.debug "[#{$$}] !!> REBUILDING"
77
+ # Gumdrop.log.info "!>!>>>>> since_last_build: #{since_last_build}"
78
+ if since_last_build > 10
79
+ Gumdrop.log.info "[#{$$}] Rebuilding from Source"
79
80
  Gumdrop.run dry_run:true, log:server_log
80
81
  end
81
82
  end
82
83
  end
83
- Gumdrop.log.info "[#{$$}] *Dynamic: #{file_path}"
84
+ Gumdrop.log.info "[#{$$}] *Dynamic: #{file_path} (#{content.ext})"
84
85
  content_type :css if content.ext == '.css' # Meh?
85
86
  content_type :js if content.ext == '.js' # Meh?
86
87
  content_type :xml if content.ext == '.xml' # Meh?
@@ -91,26 +92,12 @@ module Gumdrop
91
92
  send_file File.join( source_base_path, file_path)
92
93
  end
93
94
  else
94
- # uri_path= params[:splat].join('/')
95
- # puts "LOOKING FOR: #{uri_path}"
96
- # if uri_path =~ /^\-proxy\/(.*)$/
97
- # uri= URI.parse "http://#{$1}"
98
- #
99
- # puts "PROXY TO: #{uri}"
100
- #
101
- # http = Net::HTTP.new(uri.host, uri.port)
102
- # response = http.request(Net::HTTP::Get.new(uri.request_uri))
103
- #
104
- # #[response.code, response.body]
105
- # #halt response.code, {}, response.body.to_s
106
- # puts "Responded with: #{response.body.to_s}"
107
- # #response
108
- # [response.code.to_i, {}, response.body.to_s]
109
- # else
110
- Gumdrop.log.error "[#{$$}] *Missing: #{file_path}"
111
- puts "NOT FOUND: #{file_path}"
112
- "#{file_path} Not Found"
113
- # end
95
+ Gumdrop.log.error "[#{$$}] *Missing: #{file_path}"
96
+ # Gumdrop.log.info "------------------------"
97
+ # Gumdrop.log.info Gumdrop.site.keys.join("\n")
98
+ # Gumdrop.log.info "------------------------"
99
+ puts "NOT FOUND: #{file_path}"
100
+ "#{file_path} Not Found"
114
101
  end
115
102
  end
116
103
 
@@ -1,5 +1,5 @@
1
1
  module Gumdrop
2
2
 
3
- VERSION = "0.5" unless defined?(::Gumdrop::VERSION)
3
+ VERSION = "0.5.1" unless defined?(::Gumdrop::VERSION)
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gumdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-07-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70122408702960 !ruby/object:Gem::Requirement
16
+ requirement: &70144022144960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70122408702960
24
+ version_requirements: *70144022144960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tilt
27
- requirement: &70122408701180 !ruby/object:Gem::Requirement
27
+ requirement: &70144022143820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70122408701180
35
+ version_requirements: *70144022143820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: active_support
38
- requirement: &70122408699020 !ruby/object:Gem::Requirement
38
+ requirement: &70144022142220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70122408699020
46
+ version_requirements: *70144022142220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: trollop
49
- requirement: &70122408697560 !ruby/object:Gem::Requirement
49
+ requirement: &70144022140860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70122408697560
57
+ version_requirements: *70144022140860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: haml
60
- requirement: &70122408696000 !ruby/object:Gem::Requirement
60
+ requirement: &70144022139160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70122408696000
68
+ version_requirements: *70144022139160
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sass
71
- requirement: &70122408695440 !ruby/object:Gem::Requirement
71
+ requirement: &70144022138500 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70122408695440
79
+ version_requirements: *70144022138500
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: i18n
82
- requirement: &70122408688080 !ruby/object:Gem::Requirement
82
+ requirement: &70144022137500 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70122408688080
90
+ version_requirements: *70144022137500
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundle
93
- requirement: &70122408687000 !ruby/object:Gem::Requirement
93
+ requirement: &70144022136600 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70122408687000
101
+ version_requirements: *70144022136600
102
102
  description: A simple cms/prototyping tool.
103
103
  email: matt@elucidata.net
104
104
  executables: