aerial 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.gitignore +4 -1
  2. data/README.md +23 -28
  3. data/Rakefile +27 -52
  4. data/VERSION +1 -1
  5. data/aerial.gemspec +134 -0
  6. data/articles/congratulations/congratulations-aerial-is-configured-correctly.article +6 -0
  7. data/bin/aerial +5 -0
  8. data/config/config.sample.ru +19 -0
  9. data/config/config.sample.yml +29 -0
  10. data/config/config.test.yml +49 -0
  11. data/config/config.yml +3 -3
  12. data/config/thin.sample.yml +13 -0
  13. data/examples/articles/congratulations/congratulations-aerial-is-configured-correctly.article +6 -0
  14. data/{lib/spec/fixtures → examples}/public/javascripts/application.js +0 -0
  15. data/{lib/spec/fixtures → examples}/public/javascripts/jquery-1.3.1.min.js +0 -0
  16. data/{lib/spec/fixtures → examples}/public/javascripts/jquery.template.js +0 -0
  17. data/{lib/spec/fixtures → examples}/views/article.haml +1 -1
  18. data/{lib/spec/fixtures → examples}/views/articles.haml +0 -0
  19. data/{lib/spec/fixtures → examples}/views/comment.haml +1 -1
  20. data/{lib/spec/fixtures → examples}/views/home.haml +0 -0
  21. data/{lib/spec/fixtures → examples}/views/layout.haml +1 -1
  22. data/examples/views/not_found.haml +1 -0
  23. data/{lib/spec/fixtures → examples}/views/post.haml +0 -0
  24. data/{lib/spec/fixtures → examples}/views/rss.haml +2 -2
  25. data/{lib/spec/fixtures → examples}/views/sidebar.haml +8 -0
  26. data/{lib/spec/fixtures → examples}/views/style.sass +0 -0
  27. data/{lib/features → features}/article.feature +0 -0
  28. data/features/home.feature +16 -0
  29. data/{lib/features → features}/step_definitions/article_steps.rb +0 -0
  30. data/{lib/features → features}/step_definitions/home_steps.rb +0 -0
  31. data/{lib/features → features}/support/env.rb +0 -0
  32. data/{lib/features → features}/support/pages/article.rb +0 -0
  33. data/{lib/features → features}/support/pages/homepage.rb +0 -0
  34. data/index.html +164 -0
  35. data/lib/aerial.rb +38 -87
  36. data/lib/aerial/app.rb +93 -0
  37. data/lib/aerial/article.rb +28 -30
  38. data/lib/aerial/base.rb +24 -32
  39. data/lib/aerial/comment.rb +10 -19
  40. data/lib/aerial/content.rb +12 -21
  41. data/lib/aerial/installer.rb +119 -0
  42. data/public/javascripts/application.js +109 -0
  43. data/public/javascripts/jquery-1.3.1.min.js +19 -0
  44. data/public/javascripts/jquery.template.js +255 -0
  45. data/spec/aerial_spec.rb +19 -0
  46. data/{lib/spec/aerial_spec.rb → spec/app_spec.rb} +32 -40
  47. data/{lib/spec → spec}/article_spec.rb +21 -21
  48. data/{lib/spec → spec}/base_spec.rb +1 -5
  49. data/{lib/spec → spec}/comment_spec.rb +8 -8
  50. data/{lib/spec → spec}/config_spec.rb +0 -0
  51. data/spec/fixtures/articles/congratulations-aerial-is-configured-correctly/congratulations-aerial-is-configured-correctly.article +6 -0
  52. data/spec/fixtures/articles/sample-article/sample-article.article +6 -0
  53. data/spec/fixtures/articles/test-article-one/test-article.article +7 -0
  54. data/spec/fixtures/articles/test-article-three/test-article.article +7 -0
  55. data/spec/fixtures/articles/test-article-two/comment-missing-fields.comment +8 -0
  56. data/spec/fixtures/articles/test-article-two/test-article.article +7 -0
  57. data/spec/fixtures/articles/test-article-two/test-comment.comment +10 -0
  58. data/{lib/spec → spec}/fixtures/config.yml +0 -0
  59. data/spec/fixtures/public/javascripts/application.js +109 -0
  60. data/spec/fixtures/public/javascripts/jquery-1.3.1.min.js +19 -0
  61. data/spec/fixtures/public/javascripts/jquery.template.js +255 -0
  62. data/spec/fixtures/views/article.haml +19 -0
  63. data/spec/fixtures/views/articles.haml +2 -0
  64. data/spec/fixtures/views/comment.haml +8 -0
  65. data/spec/fixtures/views/home.haml +2 -0
  66. data/spec/fixtures/views/layout.haml +22 -0
  67. data/spec/fixtures/views/not_found.haml +1 -0
  68. data/spec/fixtures/views/post.haml +27 -0
  69. data/spec/fixtures/views/rss.haml +15 -0
  70. data/spec/fixtures/views/sidebar.haml +29 -0
  71. data/spec/fixtures/views/style.sass +163 -0
  72. data/{lib/spec → spec}/spec_helper.rb +15 -3
  73. data/views/article.haml +19 -0
  74. data/views/articles.haml +2 -0
  75. data/views/comment.haml +8 -0
  76. data/views/home.haml +2 -0
  77. data/views/layout.haml +22 -0
  78. data/views/not_found.haml +1 -0
  79. data/views/post.haml +27 -0
  80. data/views/rss.haml +15 -0
  81. data/views/sidebar.haml +29 -0
  82. data/views/style.sass +163 -0
  83. metadata +86 -40
  84. data/lib/features/home.feature +0 -16
  85. data/lib/spec/fixtures/articles/sample-article/sample-article.article +0 -6
  86. data/lib/spec/fixtures/articles/test-article-one/test-article.article +0 -7
  87. data/lib/spec/fixtures/articles/test-article-three/test-article.article +0 -7
  88. data/lib/spec/fixtures/articles/test-article-two/comment-missing-fields.comment +0 -8
  89. data/lib/spec/fixtures/articles/test-article-two/test-article.article +0 -7
  90. data/lib/spec/fixtures/articles/test-article-two/test-comment.comment +0 -10
data/.gitignore CHANGED
@@ -1 +1,4 @@
1
- lib/spec/repo
1
+ spec/repo
2
+ coverage
3
+ content
4
+ pkg
data/README.md CHANGED
@@ -23,52 +23,47 @@ Aerial is still in active development.
23
23
  * YAML configuration
24
24
  * 100% code coverage
25
25
 
26
- ## Requirements #############################################################
26
+ ## Installation #############################################################
27
27
 
28
- * sinatra (for awesomeness)
29
- * git (http://git-scm.com)
30
- * grit (interface to git)
31
- * yaml (for configuration)
32
- * rdiscount (markdown-to-html)
33
- * Haml (can easily be switch to erb, or whatever)
34
- * jQuery (http://jquery.com)
28
+ $ gem install aerial
29
+ $ aerial install /home/user/myblog
30
+ # Navigate to <http://0.0.0.0:4567>
31
+
32
+ This will create a new directory and a few files, mainly the views, config files, and a sample article to get you started. Then, edit config.yml to your liking.
35
33
 
36
- ## Source ###################################################################
34
+ ## From Source ##############################################################
37
35
 
38
- Grit's Git repo is available on GitHub, which can be browsed at:
36
+ Aerial's Git repo is available on GitHub, which can be browsed at:
39
37
 
40
38
  http://github.com/mattsears/aerial
41
39
 
42
40
  and cloned with:
43
41
 
44
- git clone git://github.com/mattsears/aerial.git
45
-
46
- ## Getting Started ###########################################################
47
-
48
- Install the following Rubygems:
49
-
50
- sudo gem install sinatra rack thin rdiscount grit haml
42
+ $ git clone git://github.com/mattsears/aerial.git
43
+ $ rake launch
44
+ # Navigate to <http://0.0.0.0:4567>
51
45
 
52
- Add your custom settings to the configuration file:
53
-
54
- config/config.yml
55
-
56
- Run the bootstrap Rake task to get started with a sample article
57
-
58
- rake bootstrap
59
-
60
- Now open your browser to:
46
+ ## Requirements #############################################################
61
47
 
62
- http://localhost:4567
48
+ * sinatra (for awesomeness)
49
+ * git (http://git-scm.com)
50
+ * grit (interface to git)
51
+ * yaml (for configuration)
52
+ * rdiscount (markdown-to-html)
53
+ * Haml (can easily be switch to erb, or whatever)
54
+ * jQuery (http://jquery.com)
63
55
 
64
56
  ## Todo #####################################################################
65
57
 
66
58
  * Enable/disable comments for an article.
67
59
  * Limit the number of comments for an article.
68
60
  * Improve bootstrap tasks
61
+ * Add article limit setting to config.yml
62
+ * Support atom feeds
63
+ * Add support for including non article content (pages)
69
64
  * Add more details to this README
70
65
 
71
66
  ## License ###################################################################
72
67
 
73
68
  Aerial is Copyright © 2009 Matt Sears, Littlelines. It is free software,
74
- and may be redistributed under the terms specified in the MIT-LICENSE file.
69
+ and may be redistributed under the terms specified in the MIT-LICENSE file.
data/Rakefile CHANGED
@@ -1,73 +1,31 @@
1
- # $:.unshift(File.dirname(__FILE__) + '/../../../lib')
2
-
3
1
  require 'rubygems'
4
2
  require 'spec/version'
5
3
  require 'spec/rake/spectask'
6
- require 'cucumber/rake/task'
7
-
8
- AERIAL_ROOT = "."
9
- require File.join(AERIAL_ROOT, 'lib', 'aerial')
4
+ require 'git'
5
+ require 'grit'
6
+ # TODO: refactor config file loading in base.rb
7
+ require 'lib/aerial/config'
10
8
 
11
9
  # Rspec setup
12
10
  desc "Run all specs"
13
11
  Spec::Rake::SpecTask.new do |t|
14
- t.spec_files = FileList['lib/spec/**/*_spec.rb']
12
+ t.spec_files = FileList['spec/**/*_spec.rb']
15
13
  end
16
14
 
17
15
  namespace :spec do
18
16
  desc "Run all specs with rcov"
19
17
  Spec::Rake::SpecTask.new('rcov') do |t|
20
- t.spec_files = FileList['lib/spec/**/*_spec.rb']
18
+ t.spec_files = FileList['spec/**/*_spec.rb']
21
19
  t.rcov = true
22
20
  t.rcov_dir = 'coverage'
23
21
  t.rcov_opts = ['--exclude',
24
- "lib/spec.rb,spec\/spec,bin\/spec,examples,\.autotest,#{ENV['GEM_HOME']}"]
25
- end
26
- end
27
-
28
- desc "Setup the directory structure"
29
- task :bootstrap do
30
- Rake::Task['setup:articles_directory'].invoke
31
- Rake::Task['setup:views_directory'].invoke
32
- Rake::Task['setup:public_directory'].invoke
33
- Rake::Task['run'].invoke
34
- end
35
-
36
- desc 'Run Aerial in development mode'
37
- task :run do
38
- exec "ruby lib/aerial.rb"
39
- end
40
-
41
- namespace :setup do
42
-
43
- desc "Copy over a sample article"
44
- task :articles_directory do
45
- puts "* Creating article directory in " + Aerial.config.views.dir
46
- article_dir = File.join(AERIAL_ROOT, 'lib','spec','fixtures',
47
- 'articles', 'sample-article')
48
- FileUtils.mkdir_p( Aerial.config.articles.dir )
49
- FileUtils.cp_r(article_dir, Aerial.config.articles.dir )
50
- Aerial::Git.commit(Aerial.config.articles.dir, "Initial import of first article")
51
- end
52
-
53
- task :public_directory do
54
- puts "* Creating public directory in " + Aerial.config.public.dir
55
- FileUtils.cp_r(File.join(AERIAL_ROOT, 'lib', 'spec',
56
- 'fixtures', 'public'),
57
- Aerial.config.public.dir )
58
- end
59
-
60
- task :views_directory do
61
- puts "* Creating views directory in " + Aerial.config.views.dir
62
- FileUtils.cp_r(File.join(AERIAL_ROOT, 'lib', 'spec',
63
- 'fixtures', 'views'),
64
- Aerial.config.views.dir )
22
+ "lib/spec.rb,spec\/spec,bin\/spec,examples,\.autotest,#{Gem.path.join(',')}"]
65
23
  end
66
24
  end
67
25
 
68
- # Cucumber setup
69
- Cucumber::Rake::Task.new(:features) do |t|
70
- t.cucumber_opts = "--format pretty"
26
+ desc "Launch Aerial cartwheel"
27
+ task :launch do
28
+ ruby "bin/aerial launch"
71
29
  end
72
30
 
73
31
  # Vlad setup
@@ -78,6 +36,17 @@ rescue LoadError
78
36
  # do nothing
79
37
  end
80
38
 
39
+ desc "Build a gem"
40
+ task :gem => [ :gemspec, :build ] do
41
+ command = "gem install --local ./pkg/aerial-0.1.0.gem"
42
+ sh command
43
+ end
44
+
45
+ desc "Build a gem"
46
+ task :rdoc do
47
+ sh 'mkdir rdoc'
48
+ sh 'echo documentation is at http://github.com/mattsears/aerial > rdoc/README.rdoc'
49
+ end
81
50
 
82
51
  begin
83
52
  require 'jeweler'
@@ -89,8 +58,14 @@ begin
89
58
  gemspec.homepage = "http://github.com/mattsears/aerial"
90
59
  gemspec.description = "A simple, blogish software build with Sinatra, jQuery, and uses Git for data storage"
91
60
  gemspec.authors = ["Matt Sears"]
61
+ gemspec.rubyforge_project = 'aerial'
62
+ end
63
+ Jeweler::RubyforgeTasks.new do |rubyforge|
64
+ rubyforge.doc_task = "rdoc"
92
65
  end
93
66
  Jeweler::GemcutterTasks.new
94
67
  rescue LoadError
95
68
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
96
69
  end
70
+
71
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
@@ -0,0 +1,134 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{aerial}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Matt Sears"]
12
+ s.date = %q{2009-10-21}
13
+ s.default_executable = %q{aerial}
14
+ s.description = %q{A simple, blogish software build with Sinatra, jQuery, and uses Git for data storage}
15
+ s.email = %q{matt@mattsears.com}
16
+ s.executables = ["aerial"]
17
+ s.extra_rdoc_files = [
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "MIT-LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "aerial.gemspec",
27
+ "articles/congratulations/congratulations-aerial-is-configured-correctly.article",
28
+ "bin/aerial",
29
+ "config/config.sample.ru",
30
+ "config/config.sample.yml",
31
+ "config/config.test.yml",
32
+ "config/config.yml",
33
+ "config/deploy.rb",
34
+ "config/thin.sample.yml",
35
+ "examples/articles/congratulations/congratulations-aerial-is-configured-correctly.article",
36
+ "examples/public/javascripts/application.js",
37
+ "examples/public/javascripts/jquery-1.3.1.min.js",
38
+ "examples/public/javascripts/jquery.template.js",
39
+ "examples/views/article.haml",
40
+ "examples/views/articles.haml",
41
+ "examples/views/comment.haml",
42
+ "examples/views/home.haml",
43
+ "examples/views/layout.haml",
44
+ "examples/views/not_found.haml",
45
+ "examples/views/post.haml",
46
+ "examples/views/rss.haml",
47
+ "examples/views/sidebar.haml",
48
+ "examples/views/style.sass",
49
+ "features/article.feature",
50
+ "features/home.feature",
51
+ "features/step_definitions/article_steps.rb",
52
+ "features/step_definitions/home_steps.rb",
53
+ "features/support/env.rb",
54
+ "features/support/pages/article.rb",
55
+ "features/support/pages/homepage.rb",
56
+ "index.html",
57
+ "lib/aerial.rb",
58
+ "lib/aerial/app.rb",
59
+ "lib/aerial/article.rb",
60
+ "lib/aerial/base.rb",
61
+ "lib/aerial/comment.rb",
62
+ "lib/aerial/config.rb",
63
+ "lib/aerial/content.rb",
64
+ "lib/aerial/installer.rb",
65
+ "lib/aerial/vendor/akismetor.rb",
66
+ "lib/aerial/vendor/cache.rb",
67
+ "public/javascripts/application.js",
68
+ "public/javascripts/jquery-1.3.1.min.js",
69
+ "public/javascripts/jquery.template.js",
70
+ "spec/aerial_spec.rb",
71
+ "spec/app_spec.rb",
72
+ "spec/article_spec.rb",
73
+ "spec/base_spec.rb",
74
+ "spec/comment_spec.rb",
75
+ "spec/config_spec.rb",
76
+ "spec/fixtures/articles/congratulations-aerial-is-configured-correctly/congratulations-aerial-is-configured-correctly.article",
77
+ "spec/fixtures/articles/sample-article/sample-article.article",
78
+ "spec/fixtures/articles/test-article-one/test-article.article",
79
+ "spec/fixtures/articles/test-article-three/test-article.article",
80
+ "spec/fixtures/articles/test-article-two/comment-missing-fields.comment",
81
+ "spec/fixtures/articles/test-article-two/test-article.article",
82
+ "spec/fixtures/articles/test-article-two/test-comment.comment",
83
+ "spec/fixtures/config.yml",
84
+ "spec/fixtures/public/javascripts/application.js",
85
+ "spec/fixtures/public/javascripts/jquery-1.3.1.min.js",
86
+ "spec/fixtures/public/javascripts/jquery.template.js",
87
+ "spec/fixtures/views/article.haml",
88
+ "spec/fixtures/views/articles.haml",
89
+ "spec/fixtures/views/comment.haml",
90
+ "spec/fixtures/views/home.haml",
91
+ "spec/fixtures/views/layout.haml",
92
+ "spec/fixtures/views/not_found.haml",
93
+ "spec/fixtures/views/post.haml",
94
+ "spec/fixtures/views/rss.haml",
95
+ "spec/fixtures/views/sidebar.haml",
96
+ "spec/fixtures/views/style.sass",
97
+ "spec/spec_helper.rb",
98
+ "views/article.haml",
99
+ "views/articles.haml",
100
+ "views/comment.haml",
101
+ "views/home.haml",
102
+ "views/layout.haml",
103
+ "views/not_found.haml",
104
+ "views/post.haml",
105
+ "views/rss.haml",
106
+ "views/sidebar.haml",
107
+ "views/style.sass"
108
+ ]
109
+ s.homepage = %q{http://github.com/mattsears/aerial}
110
+ s.rdoc_options = ["--charset=UTF-8"]
111
+ s.require_paths = ["lib"]
112
+ s.rubyforge_project = %q{aerial}
113
+ s.rubygems_version = %q{1.3.5}
114
+ s.summary = %q{A simple, blogish software build with Sinatra, jQuery, and uses Git for data storage}
115
+ s.test_files = [
116
+ "spec/aerial_spec.rb",
117
+ "spec/app_spec.rb",
118
+ "spec/article_spec.rb",
119
+ "spec/base_spec.rb",
120
+ "spec/comment_spec.rb",
121
+ "spec/config_spec.rb",
122
+ "spec/spec_helper.rb"
123
+ ]
124
+
125
+ if s.respond_to? :specification_version then
126
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
127
+ s.specification_version = 3
128
+
129
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
130
+ else
131
+ end
132
+ else
133
+ end
134
+ end
@@ -0,0 +1,6 @@
1
+ Title : Congratulations! Aerial is configured correctly
2
+ Tags : ruby, sinatra, git, aerial
3
+ Publish Date : 03/31/2009
4
+ Author : Aerial
5
+
6
+ Congratulations! Aerial appears to be up and running. This is a sample article created during the bootstrap process. You may overwrite this article or create a new one.
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH << File.join(File.dirname(__FILE__), '..')
3
+ require 'rubygems'
4
+ require File.dirname(__FILE__) + "/../lib/aerial/installer"
5
+ Aerial::Installer.start
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "aerial"
4
+
5
+ env = ENV['RACK_ENV'].to_sym
6
+ root = File.dirname(__FILE__)
7
+
8
+ # Load configuration and initialize Aerial
9
+ Aerial.new(root, "/config.yml")
10
+
11
+ # You probably don't want to edit anything below
12
+ Aerial::App.set :environment, ENV["RACK_ENV"] || :production
13
+ Aerial::App.set :port, 4567
14
+ Aerial::App.set :cache_enabled, env == :production ? true : false
15
+ Aerial::App.set :cache_page_extension, '.html'
16
+ Aerial::App.set :cache_output_dir, ''
17
+ Aerial::App.set :root, root
18
+
19
+ run Aerial::App
@@ -0,0 +1,29 @@
1
+ # Title and Subtitle of the Site Aerail will be running
2
+ title: "Aerial"
3
+ subtitle: "Friendly "
4
+
5
+ # Information about you
6
+ name: "Awesome Ruby Developer"
7
+ author: "Not sure what this is for?"
8
+ email: "aerial@example.com"
9
+
10
+ # This is where you articles are stored
11
+ articles:
12
+ dir: "articles"
13
+
14
+ # Images, stylesheets, javascripts, etc
15
+ public:
16
+ dir: "public"
17
+
18
+ # Pages
19
+ views:
20
+ dir: "app/views"
21
+ default: "home"
22
+
23
+ # Check for span when folks add comments to your blog
24
+ akismet:
25
+ key: ""
26
+ url: ""
27
+
28
+ # Path to the Aerial log file
29
+ :log: /var/log/aerial.log
@@ -0,0 +1,49 @@
1
+ title: "Aerial"
2
+ subtitle: "Articles, Pages, and Such"
3
+ name: "Aerial"
4
+ author: "Awesome Ruby Developer"
5
+ email: "aerial@example.com"
6
+
7
+ # You can add any meta element pairs here
8
+ # name => content
9
+ meta:
10
+ description: "describe this site"
11
+ keywords: "aerial,git,sinatra,jquery"
12
+
13
+ public:
14
+ dir: "public"
15
+
16
+ views:
17
+ dir: "app/views"
18
+ default: "home"
19
+
20
+ # Content repository
21
+ git:
22
+ url: "git://github.com/jrobeson/aerial-sample-content.git"
23
+ path: "spec/repo"
24
+ name: "origin"
25
+ branch: "master"
26
+
27
+ # If you want to add synchronizing via Github post-receive hooks,
28
+ # insert some secure password here. Then set a "Post-Receive URL"
29
+ # in Github administration to http://{YOUR SERVER}/sync?token={WHAT YOU SET BELOW}
30
+ github_token: ~
31
+
32
+ # Akismet spam protection. Get your key at http://akismet.com
33
+ akismet:
34
+ key: ""
35
+ url: ""
36
+
37
+ # http://antispam.typepad.com/info/developers.html
38
+ typekey_antispam:
39
+ key: ""
40
+ url: ""
41
+
42
+ # You should not need to modify anything below this line
43
+
44
+ # Directory where articles are stored inside your content repository
45
+ articles:
46
+ dir: "articles"
47
+ env:
48
+ # Path to git or other required executables (separated by colons)
49
+ path: ""