gidget 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ Gidget is a minimalist blog engine designed to run on Heroku with a Git-based wo
7
7
  == Basic Structure
8
8
 
9
9
  * Sinatra based server
10
- * A singleton array containing post information (the body of the a post is lazily-loaded)
10
+ * A singleton array containing post information (the body of a post is lazily-loaded)
11
11
  * A class to handle post information
12
12
 
13
13
  == Routing
@@ -34,9 +34,23 @@ File name and structure (other than the .txt extension) don't matter. Gidget wi
34
34
 
35
35
  Gidget is meant to run on a Heroku. It offers version management through Git, and uses the advantages provided by running behind a reverse-proxy cache such as Varnish. Gidget is meant to be minimalist in design while taking these factors into consideration.
36
36
 
37
+ == Getting Started
38
+
39
+ To get started using Gidget, first install the gem:
40
+
41
+ gem install gidget
42
+
43
+ Once them gem is installed you can use the gidget generator to create a stub for you:
44
+
45
+ gidget blog
46
+
47
+ This would create a stub in a directory named blog. To run the site simply run rackup from the root:
48
+
49
+ cd blog
50
+ rackup
51
+
37
52
  == TO BE DONE
38
53
 
39
- * Create a simple generator to build out the stub of a web app using Gidget.
40
54
  * Add a paging route to allow /page/1 type usage.
41
55
  * Update the post route to pass the array of all posts and the current post index. This allows for previous/next links for each post to be created by the template.
42
56
 
@@ -0,0 +1 @@
1
+ gem "gidget"
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require
5
+
6
+ run Gidget::Server
@@ -0,0 +1,4 @@
1
+ title: This is the awesome title to a post
2
+ date: 2010-11-15
3
+
4
+ Hello world!
@@ -0,0 +1,9 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title My Awesome Site
5
+ %body
6
+ %header
7
+ %h1 About
8
+ %article
9
+ %p This blog is run by Gidget.
@@ -0,0 +1,9 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title My Awesome Site
5
+ %body
6
+ %header
7
+ %h1 My Blog
8
+ %article
9
+ %h1= "I found #{posts.size} posts!"
@@ -0,0 +1,10 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title My Awesome Site
5
+ %body
6
+ %header
7
+ %h1 My Blog
8
+ %article
9
+ %h1= posts[0][:title]
10
+ = markdown(posts[0][:body])
@@ -0,0 +1,10 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title My Awesome Site
5
+ %body
6
+ %header
7
+ %h1 My Blog
8
+ %article
9
+ %h1= post[:title]
10
+ = markdown(post[:body])
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+ require 'FileUtils'
3
+
4
+
5
+ class App
6
+ def initialize(arguments, stdin)
7
+ @arguments = arguments
8
+ end
9
+
10
+
11
+ def run
12
+ puts "Creating web app stub for '#{@arguments[0]}'"
13
+
14
+ source = File.expand_path(File.join(File.dirname(__FILE__), '../_stub_'))
15
+ destination = File.expand_path(File.join(Dir.pwd, @arguments[0]))
16
+
17
+ FileUtils.mkdir(destination)
18
+ FileUtils.cp_r(source + "/.", destination)
19
+ end
20
+ end
21
+
22
+
23
+ app = App.new(ARGV, STDIN)
24
+ app.run
@@ -47,7 +47,7 @@ module Gidget
47
47
  begin
48
48
  expires(86400, :public)
49
49
 
50
- haml request.path.to_sym, :locals => { :posts => posts }
50
+ haml request.path.to_sym, :locals => { :posts => PostIndex.instance }
51
51
  rescue
52
52
  pass
53
53
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gidget
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Forrest Robertson
@@ -16,7 +16,7 @@ bindir: bin
16
16
  cert_chain: []
17
17
 
18
18
  date: 2010-11-21 00:00:00 -07:00
19
- default_executable:
19
+ default_executable: gidget
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  type: :runtime
@@ -128,14 +128,21 @@ dependencies:
128
128
  requirement: *id007
129
129
  description: Gidget is a minimalist blog engine designed to run on Heroku with a Git-based workflow.
130
130
  email: forrest@hasmanytrees.com
131
- executables: []
132
-
131
+ executables:
132
+ - gidget
133
133
  extensions: []
134
134
 
135
135
  extra_rdoc_files:
136
136
  - LICENSE.txt
137
137
  - README.rdoc
138
138
  files:
139
+ - _stub_/Gemfile
140
+ - _stub_/config.ru
141
+ - _stub_/posts/first-post.txt
142
+ - _stub_/views/about.haml
143
+ - _stub_/views/archive.haml
144
+ - _stub_/views/index.haml
145
+ - _stub_/views/post.haml
139
146
  - lib/gidget.rb
140
147
  - lib/gidget/ext.rb
141
148
  - lib/gidget/post.rb
@@ -143,6 +150,7 @@ files:
143
150
  - lib/gidget/server.rb
144
151
  - LICENSE.txt
145
152
  - README.rdoc
153
+ - bin/gidget
146
154
  has_rdoc: true
147
155
  homepage: http://github.com/hasmanytrees/gidget
148
156
  licenses: