ruhoh 1.1 → 2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. data/Gemfile +3 -3
  2. data/README.md +3 -2
  3. data/Rakefile +1 -22
  4. data/bin/ruhoh +1 -5
  5. data/history.json +16 -0
  6. data/lib/ruhoh.rb +229 -84
  7. data/lib/ruhoh/base/collection.rb +280 -0
  8. data/lib/ruhoh/base/compiler.rb +55 -0
  9. data/lib/ruhoh/base/model.rb +220 -0
  10. data/lib/ruhoh/base/model_view.rb +152 -0
  11. data/lib/ruhoh/base/watcher.rb +25 -0
  12. data/lib/ruhoh/cache.rb +46 -0
  13. data/lib/ruhoh/client.rb +162 -0
  14. data/lib/ruhoh/collections.rb +172 -0
  15. data/lib/ruhoh/console_methods.rb +21 -0
  16. data/lib/ruhoh/{converters/converter.rb → converter.rb} +4 -1
  17. data/lib/ruhoh/programs/compile.rb +22 -0
  18. data/lib/ruhoh/programs/preview.rb +63 -0
  19. data/lib/ruhoh/programs/watch.rb +45 -0
  20. data/lib/ruhoh/resources/dash/collection.rb +10 -0
  21. data/lib/ruhoh/resources/dash/model.rb +5 -0
  22. data/lib/ruhoh/resources/dash/model_view.rb +5 -0
  23. data/lib/ruhoh/resources/dash/previewer.rb +13 -0
  24. data/lib/ruhoh/resources/data/collection.rb +9 -0
  25. data/lib/ruhoh/resources/data/collection_view.rb +23 -0
  26. data/lib/ruhoh/resources/javascripts/collection.rb +9 -0
  27. data/lib/ruhoh/resources/javascripts/collection_view.rb +46 -0
  28. data/lib/ruhoh/resources/javascripts/compiler.rb +5 -0
  29. data/lib/ruhoh/resources/layouts/client.rb +45 -0
  30. data/lib/ruhoh/resources/layouts/model.rb +16 -0
  31. data/lib/ruhoh/resources/media/collection.rb +9 -0
  32. data/lib/ruhoh/resources/media/compiler.rb +27 -0
  33. data/lib/ruhoh/resources/pages/client.rb +124 -0
  34. data/lib/ruhoh/resources/pages/collection.rb +86 -0
  35. data/lib/ruhoh/resources/pages/collection_view.rb +73 -0
  36. data/lib/ruhoh/resources/pages/compiler.rb +101 -0
  37. data/lib/ruhoh/resources/pages/model.rb +5 -0
  38. data/lib/ruhoh/resources/pages/model_view.rb +5 -0
  39. data/lib/ruhoh/resources/pages/previewer.rb +72 -0
  40. data/lib/ruhoh/resources/partials/model.rb +11 -0
  41. data/lib/ruhoh/resources/stylesheets/collection.rb +9 -0
  42. data/lib/ruhoh/resources/stylesheets/collection_view.rb +45 -0
  43. data/lib/ruhoh/resources/stylesheets/compiler.rb +5 -0
  44. data/lib/ruhoh/resources/theme/collection.rb +14 -0
  45. data/lib/ruhoh/resources/theme/compiler.rb +54 -0
  46. data/lib/ruhoh/resources/widgets/collection.rb +26 -0
  47. data/lib/ruhoh/resources/widgets/collection_view.rb +34 -0
  48. data/lib/ruhoh/resources/widgets/compiler.rb +27 -0
  49. data/lib/ruhoh/resources/widgets/model.rb +16 -0
  50. data/lib/ruhoh/routes.rb +29 -0
  51. data/lib/ruhoh/utils.rb +32 -49
  52. data/lib/ruhoh/version.rb +2 -2
  53. data/lib/ruhoh/views/helpers/categories.rb +38 -0
  54. data/lib/ruhoh/views/helpers/paginator.rb +39 -0
  55. data/lib/ruhoh/views/helpers/tags.rb +37 -0
  56. data/lib/ruhoh/views/master_view.rb +183 -0
  57. data/lib/ruhoh/views/rmustache.rb +24 -0
  58. data/ruhoh.gemspec +6 -82
  59. data/spec/spec_helper.rb +1 -1
  60. data/spec/support/shared_contexts.rb +6 -5
  61. data/system/{scaffolds/post.html → _scaffold.html} +1 -1
  62. data/system/{dash.html → dash/index.html} +37 -51
  63. data/system/{scaffolds/layout.html → layouts/_scaffold.html} +0 -0
  64. data/system/layouts/paginator.html +28 -0
  65. data/system/plugins/sprockets/javascripts/compiler.rb +25 -0
  66. data/system/plugins/sprockets/javascripts/previewer.rb +17 -0
  67. data/system/plugins/sprockets/stylesheets/compiler.rb +26 -0
  68. data/system/plugins/sprockets/stylesheets/previewer.rb +17 -0
  69. data/system/widgets/analytics/{layouts/getclicky.html → getclicky.html} +6 -2
  70. data/system/widgets/analytics/{layouts/google.html → google.html} +5 -1
  71. data/system/widgets/comments/{layouts/disqus.html → disqus.html} +6 -2
  72. data/system/widgets/comments/{layouts/facebook.html → facebook.html} +9 -2
  73. data/system/widgets/comments/{layouts/intensedebate.html → intensedebate.html} +5 -1
  74. data/system/widgets/comments/{layouts/livefyre.html → livefyre.html} +5 -1
  75. data/system/widgets/google_prettify/{layouts/google_prettify.html → default.html} +6 -2
  76. metadata +69 -66
  77. data/lib/ruhoh/client/client.rb +0 -306
  78. data/lib/ruhoh/client/console_methods.rb +0 -9
  79. data/lib/ruhoh/client/help.yml +0 -56
  80. data/lib/ruhoh/compiler.rb +0 -72
  81. data/lib/ruhoh/compilers/rss.rb +0 -39
  82. data/lib/ruhoh/compilers/theme.rb +0 -46
  83. data/lib/ruhoh/config.rb +0 -62
  84. data/lib/ruhoh/db.rb +0 -50
  85. data/lib/ruhoh/deployers/s3.rb +0 -71
  86. data/lib/ruhoh/page.rb +0 -106
  87. data/lib/ruhoh/parsers/javascripts.rb +0 -55
  88. data/lib/ruhoh/parsers/layouts.rb +0 -32
  89. data/lib/ruhoh/parsers/pages.rb +0 -79
  90. data/lib/ruhoh/parsers/partials.rb +0 -42
  91. data/lib/ruhoh/parsers/payload.rb +0 -49
  92. data/lib/ruhoh/parsers/posts.rb +0 -259
  93. data/lib/ruhoh/parsers/routes.rb +0 -20
  94. data/lib/ruhoh/parsers/scaffolds.rb +0 -35
  95. data/lib/ruhoh/parsers/site.rb +0 -19
  96. data/lib/ruhoh/parsers/stylesheets.rb +0 -63
  97. data/lib/ruhoh/parsers/theme_config.rb +0 -30
  98. data/lib/ruhoh/parsers/widgets.rb +0 -104
  99. data/lib/ruhoh/paths.rb +0 -83
  100. data/lib/ruhoh/previewer.rb +0 -48
  101. data/lib/ruhoh/program.rb +0 -68
  102. data/lib/ruhoh/templaters/asset_helpers.rb +0 -66
  103. data/lib/ruhoh/templaters/base_helpers.rb +0 -147
  104. data/lib/ruhoh/templaters/helpers.rb +0 -8
  105. data/lib/ruhoh/templaters/rmustache.rb +0 -70
  106. data/lib/ruhoh/urls.rb +0 -50
  107. data/lib/ruhoh/watch.rb +0 -78
  108. data/spec/config_spec.rb +0 -50
  109. data/spec/db_spec.rb +0 -91
  110. data/spec/page_spec.rb +0 -164
  111. data/spec/parsers/layouts_spec.rb +0 -41
  112. data/spec/parsers/pages_spec.rb +0 -120
  113. data/spec/parsers/posts_spec.rb +0 -309
  114. data/spec/parsers/routes_spec.rb +0 -39
  115. data/spec/parsers/site_spec.rb +0 -28
  116. data/spec/setup_spec.rb +0 -12
  117. data/system/scaffolds/draft.html +0 -9
  118. data/system/scaffolds/page.html +0 -4
  119. data/system/widgets/analytics/config.yml +0 -5
  120. data/system/widgets/comments/config.yml +0 -13
  121. data/system/widgets/google_prettify/config.yml +0 -1
@@ -1,39 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Routes
4
-
5
- describe Ruhoh::Parsers::Routes do
6
-
7
- describe "#generate" do
8
- let(:pages){
9
- {
10
- "blah.md" => {'url' => '/blah.html', "id" => "blah.md"},
11
- "yes.md" => {'url' => '/yes.html', "id" => "yes.md"},
12
- "no.md" => {'url' => '/no.html', "id" => "no.md"},
13
- }
14
- }
15
- let(:posts){
16
- {
17
- "dictionary" => {
18
- "post1.md" => {'url' => '/post1.html', "id" => "post1.md"},
19
- "post2.md" => {'url' => '/post2.html', "id" => "post2.md"},
20
- "post3.md" => {'url' => '/post3.html', "id" => "post3.md"},
21
- }
22
- }
23
- }
24
-
25
- it 'should return a dictionary/hash with urls as keys that map to post/draft/page ids as values' do
26
- Ruhoh::DB.should_receive(:pages).and_return(pages)
27
- Ruhoh::DB.should_receive(:posts).and_return(posts)
28
-
29
- routes = Ruhoh::Parsers::Routes.generate
30
-
31
- routes.should be_a_kind_of(Hash)
32
- routes.keys.sort.should == ['/blah.html', '/no.html', '/post1.html', '/post2.html', '/post3.html', '/yes.html']
33
- routes.values.sort.should == ['blah.md', 'no.md', 'post1.md', 'post2.md', 'post3.md', 'yes.md']
34
- end
35
-
36
- end
37
- end
38
-
39
- end
@@ -1,28 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Site
4
-
5
- describe Ruhoh::Parsers::Site do
6
- include_context "write_default_theme"
7
- include_context "default_setup"
8
-
9
- describe "#generate" do
10
- it 'should parse the config and site yaml files' do
11
- Ruhoh::Utils.should_receive(:parse_yaml_file).with(Ruhoh.paths.site_data).and_return({})
12
- Ruhoh::Utils.should_receive(:parse_yaml_file).with(Ruhoh.paths.config_data).and_return({})
13
-
14
- Ruhoh::Parsers::Site.generate
15
- end
16
-
17
- it 'should return a site hash with config set as value to key "config" ' do
18
- Ruhoh::Utils.should_receive(:parse_yaml_file).with(Ruhoh.paths.site_data).and_return({"nav" => [1,2,3]})
19
- Ruhoh::Utils.should_receive(:parse_yaml_file).with(Ruhoh.paths.config_data).and_return({"theme" => "orange"})
20
-
21
- site = Ruhoh::Parsers::Site.generate
22
- site.should == { "nav" => [1,2,3], "config" => {"theme" => "orange"} }
23
- end
24
-
25
- end
26
- end
27
-
28
- end
data/spec/setup_spec.rb DELETED
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Setup
4
- describe "Setup" do
5
- describe "#setup" do
6
- it 'should setup config, paths, and filters' do
7
- Ruhoh::Config.should_receive(:generate).and_return(true)
8
- Ruhoh.setup
9
- end
10
- end
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- ---
2
- title:
3
- date: '{{DATE}}'
4
- description:
5
- categories:
6
- tags: []
7
-
8
- type: draft
9
- ---
@@ -1,4 +0,0 @@
1
- ---
2
- title:
3
- description:
4
- ---
@@ -1,5 +0,0 @@
1
- layout : google
2
- google :
3
- tracking_id : 'UA-123-12'
4
- getclicky :
5
- site_id :
@@ -1,13 +0,0 @@
1
- layout : disqus
2
- disqus :
3
- short_name : jekyllbootstrap # Change This!
4
- livefyre :
5
- site_id : 123
6
- site_name:
7
- intensedebate :
8
- account : 123abc
9
- facebook :
10
- appid : 123
11
- num_posts: 5
12
- width: 580
13
- colorscheme: light
@@ -1 +0,0 @@
1
- linenums : true