marv 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.document +5 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +1 -0
  4. data/CHANGELOG.md +8 -0
  5. data/Gemfile +29 -0
  6. data/Gemfile.lock +140 -0
  7. data/LICENSE +20 -0
  8. data/README.md +49 -0
  9. data/Rakefile +54 -0
  10. data/VERSION +1 -0
  11. data/bin/marv +12 -0
  12. data/features/step_definitions/marv_steps.rb +38 -0
  13. data/features/support/env.rb +17 -0
  14. data/layouts/config/config.tt +19 -0
  15. data/layouts/default/functions/functions.php.erb +34 -0
  16. data/layouts/default/javascripts/admin.js +1 -0
  17. data/layouts/default/javascripts/theme.js +1 -0
  18. data/layouts/default/stylesheets/_header.scss.erb +18 -0
  19. data/layouts/default/stylesheets/_reset.scss +5 -0
  20. data/layouts/default/stylesheets/_typography.scss +5 -0
  21. data/layouts/default/stylesheets/style.css.scss.erb +32 -0
  22. data/layouts/default/templates/404.php.erb +10 -0
  23. data/layouts/default/templates/archive.php.erb +11 -0
  24. data/layouts/default/templates/attachment.php.erb +32 -0
  25. data/layouts/default/templates/comments.php +2 -0
  26. data/layouts/default/templates/footer.php +9 -0
  27. data/layouts/default/templates/header.php.erb +30 -0
  28. data/layouts/default/templates/index.php +4 -0
  29. data/layouts/default/templates/page.php +14 -0
  30. data/layouts/default/templates/partials/loop.php.erb +36 -0
  31. data/layouts/default/templates/search.php.erb +12 -0
  32. data/layouts/default/templates/sidebar.php +9 -0
  33. data/layouts/default/templates/single.php.erb +30 -0
  34. data/lib/guard/marv/assets.rb +31 -0
  35. data/lib/guard/marv/config.rb +34 -0
  36. data/lib/guard/marv/functions.rb +36 -0
  37. data/lib/guard/marv/templates.rb +28 -0
  38. data/lib/marv.rb +11 -0
  39. data/lib/marv/builder.rb +282 -0
  40. data/lib/marv/cli.rb +86 -0
  41. data/lib/marv/config.rb +61 -0
  42. data/lib/marv/engines.rb +12 -0
  43. data/lib/marv/error.rb +8 -0
  44. data/lib/marv/generator.rb +138 -0
  45. data/lib/marv/guard.rb +65 -0
  46. data/lib/marv/project.rb +162 -0
  47. data/lib/marv/version.rb +3 -0
  48. data/marv.gemspec +145 -0
  49. data/spec/lib/marv/config_spec.rb +79 -0
  50. data/spec/lib/marv/project_spec.rb +34 -0
  51. data/spec/spec_helper.rb +13 -0
  52. metadata +404 -0
@@ -0,0 +1 @@
1
+ // Theme Options JavaScript goes here
@@ -0,0 +1 @@
1
+ // Regular theme JavaScript goes here
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Theme Name: <%= config[:name] %>
3
+ * Theme URI: <%= config[:uri] %>
4
+ * Author: <%= config[:author] %>
5
+ * Author URI: <%= config[:author_uri] %>
6
+ * Description: <%= config[:description] if config[:description] %>
7
+ * Version: <%= config[:version_number] if config[:version_number] %>
8
+ <% if config[:template] -%>
9
+ * Template: <%= config[:template] %>
10
+ <% end -%>
11
+ * License: <%= config[:license_name] if config[:license_name] %>
12
+ * License URI: <%= config[:license_uri] if config[:license_uri] %>
13
+ * Tags: <%= config[:tags].join(", ") if config[:tags] %>
14
+ <%- unless config[:comments].nil? || config[:comments].empty? -%>
15
+ *
16
+ * <%= config[:comments] %>
17
+ <%- end -%>
18
+ */
@@ -0,0 +1,5 @@
1
+ /* _reset.scss
2
+ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
3
+
4
+ @import "blueprint/reset";
5
+ @include blueprint-global-reset;
@@ -0,0 +1,5 @@
1
+ /* _typography.scss
2
+ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
3
+
4
+ @import "blueprint/typography";
5
+ @include blueprint-typography;
@@ -0,0 +1,32 @@
1
+ // WordPress theme header
2
+ @import "header";
3
+
4
+ // This is your master stylesheet
5
+
6
+ // Use SASS to include CSS partials
7
+ @import "reset";
8
+ @import "typography";
9
+ @import "blueprint/grid";
10
+
11
+ // Add some basic styling
12
+ .clear {
13
+ clear: both;
14
+ }
15
+
16
+ #container {
17
+ @include container;
18
+ @include prepend(1);
19
+ border-left: 1px solid;
20
+ border-right: 1px solid;
21
+ }
22
+
23
+ #content {
24
+ @include column(15);
25
+ @include border(#555, 2px);
26
+ }
27
+
28
+ #sidebar {
29
+ @include column(7);
30
+ @include prepend(1);
31
+ @include last;
32
+ }
@@ -0,0 +1,10 @@
1
+ <?php get_header(); ?>
2
+ <h1 class="page-title">
3
+ <?php _e( '404: Page Not Found', '<%= theme_id %>' ); ?>
4
+ </h1>
5
+ <div>
6
+ <p><?php _e( 'We are terribly sorry, but the URL you typed no longer exists. It might have been moved or deleted. Try searching the site:', '<%= theme_id %>' ); ?></p>
7
+ <?php get_search_form(); ?>
8
+ </div>
9
+ <?php get_sidebar(); ?>
10
+ <?php get_footer(); ?>
@@ -0,0 +1,11 @@
1
+ <?php get_header(); ?>
2
+ <div id="content" class="clear">
3
+ <?php if ( have_posts() ) : ?>
4
+ <h1 class="small-header"><?php _e( 'Blog Archives', '<%= theme_id %>' ); ?></h1>
5
+ <?php get_template_part( 'loop' ); ?>
6
+ <?php else : ?>
7
+ <p><?php _e( 'No posts found.', '<%= theme_id %>' ); ?></p>
8
+ <?php endif; ?>
9
+ </div><!--end content-->
10
+ <?php get_sidebar(); ?>
11
+ <?php get_footer(); ?>
@@ -0,0 +1,32 @@
1
+ <?php get_header(); ?>
2
+ <?php the_post(); ?>
3
+ <h1 class="page-title"><?php the_title(); ?></h1>
4
+ <div>
5
+ <a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
6
+ <?php
7
+ if ( wp_attachment_is_image ( $post->ID ) ) {
8
+ $img_src = wp_get_attachment_image_src( $post->ID, 'large' );
9
+ $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
10
+ ?>
11
+ <img src="<?php echo esc_url( $img_src[0] ); ?>" alt="<?php esc_attr_e( $alt_text ); ?>">
12
+ <?php
13
+ } else {
14
+ echo basename( $post->guid );
15
+ }
16
+ ?>
17
+ </a>
18
+ <?php if ( $post->post_content ) : ?>
19
+ <div class="description">
20
+ <?php the_content(); ?>
21
+ </div>
22
+ <?php endif; ?>
23
+ <div class="pagination clear">
24
+ <div class="alignleft"><?php previous_image_link( 0, __( '&larr; Previous image', '<%= theme_id %>' ) ); ?></div>
25
+ <div class="alignright"><?php next_image_link( 0, __( 'Next image &rarr;', '<%= theme_id %>' ) ); ?></div>
26
+ </div>
27
+ <div>
28
+ <a href="<?php echo get_permalink( $post->post_parent ); ?>"><?php _e( 'Return to gallery', '<%= theme_id %>' ); ?></a>
29
+ </div>
30
+ </div>
31
+ <?php get_sidebar(); ?>
32
+ <?php get_footer(); ?>
@@ -0,0 +1,2 @@
1
+ <?php
2
+ // Default comments file goes here
@@ -0,0 +1,9 @@
1
+ <div id="footer">
2
+ <p>
3
+ <a href="http://wordpress.org/" rel="generator">Proudly powered by WordPress</a>
4
+ </p>
5
+ </div><!--end footer-->
6
+ </div><!--end container-->
7
+ <?php wp_footer(); ?>
8
+ </body>
9
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html>
2
+ <html <?php language_attributes( 'html' ) ?>>
3
+ <head>
4
+ <meta charset="<?php bloginfo( 'charset' ); ?>" />
5
+ <title><?php wp_title(); ?></title>
6
+
7
+ <!-- WordPress -->
8
+ <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
9
+ <?php wp_head(); ?>
10
+ </head>
11
+ <body <?php body_class(); ?>>
12
+ <div id="container">
13
+ <div id="header" class="clear">
14
+ <div id="title">
15
+ <?php if ( is_front_page() ) echo( '<h1>' ); ?>
16
+ <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
17
+ <?php if ( is_front_page() ) echo( '</h1>' ); ?>
18
+ </div>
19
+ <?php
20
+ wp_nav_menu(
21
+ array(
22
+ 'theme_location' => 'nav-1',
23
+ 'container_id' => 'navigation',
24
+ 'container_class' => 'clear',
25
+ 'menu_class' => 'nav',
26
+ 'depth' => '2'
27
+ )
28
+ );
29
+ ?>
30
+ </div><!--end header-->
@@ -0,0 +1,4 @@
1
+ <?php get_header(); ?>
2
+ <?php get_template_part( 'loop' ); ?>
3
+ <?php get_sidebar(); ?>
4
+ <?php get_footer(); ?>
@@ -0,0 +1,14 @@
1
+ <?php get_header(); ?>
2
+ <?php the_post(); ?>
3
+ <div id="page-<?php the_ID(); ?>">
4
+ <?php if ( has_post_thumbnail() ) { ?>
5
+ <div>
6
+ <?php the_post_thumbnail(); ?>
7
+ </div>
8
+ <?php } ?>
9
+ <h1><?php the_title(); ?></h1>
10
+ <?php the_content(); ?>
11
+ </div>
12
+ <?php comments_template( '', true ); ?>
13
+ <?php get_sidebar(); ?>
14
+ <?php get_footer(); ?>
@@ -0,0 +1,36 @@
1
+ <?php if ( have_posts() ) : ?>
2
+ <?php while ( have_posts() ) : the_post(); ?>
3
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
4
+ <div class="post-header">
5
+ <h2 class="post-title">
6
+ <a href="<?php the_permalink(); ?>" rel="bookmark">
7
+ <?php the_title(); ?>
8
+ </a>
9
+ </h2>
10
+ <p><?php the_time( __( 'F jS, Y', '<%= theme_id %>' ) ); ?></p>
11
+ <p><?php the_author(); ?></p>
12
+ <?php if ( has_post_thumbnail() ) { ?>
13
+ <a href="<?php the_permalink(); ?>">
14
+ <?php the_post_thumbnail(); ?>
15
+ </a>
16
+ <?php } ?>
17
+ </div><!--end post-header-->
18
+ <div class="entry">
19
+ <?php the_content( __( 'Read more', '<%= theme_id %>' )); ?>
20
+ <?php edit_post_link( __( 'Edit this', '<%= theme_id %>' ), '<p>', '</p>' ); ?>
21
+ </div><!--end entry-->
22
+ <div class="post-footer">
23
+ <p><?php comments_popup_link( __( 'Leave a comment', '<%= theme_id %>' ), __( '1 Comment', '<%= theme_id %>' ), __( '% Comments', '<%= theme_id %>' ) ); ?></p>
24
+ </div><!--end post-footer-->
25
+ </div><!--end post-->
26
+ <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
27
+ <div class="pagination index">
28
+ <div class="alignleft">
29
+ <?php previous_posts_link( __( '&larr; Newer entries', '<%= theme_id %>' )); ?>
30
+ </div>
31
+ <div class="alignright">
32
+ <?php next_posts_link( __( 'Older entries &rarr;', '<%= theme_id %>' )); ?>
33
+ </div>
34
+ </div><!--end pagination-->
35
+ <?php else : ?>
36
+ <?php endif; ?>
@@ -0,0 +1,12 @@
1
+ <?php get_header(); ?>
2
+ <h1><?php printf( __( "Search results for '%s'", "<%= theme_id %>" ), get_search_query() ); ?></h1>
3
+ <?php if ( have_posts() ) : ?>
4
+ <?php get_template_part( 'loop' ); ?>
5
+ <?php else : ?>
6
+ <div>
7
+ <p><?php printf( __( 'Sorry, your search for "%s" did not turn up any results. Please try again.', '<%= theme_id %>' ), get_search_query());?></p>
8
+ <?php get_search_form(); ?>
9
+ </div>
10
+ <?php endif; ?>
11
+ <?php get_sidebar(); ?>
12
+ <?php get_footer(); ?>
@@ -0,0 +1,9 @@
1
+ <div id="sidebar">
2
+ <ul>
3
+ <?php
4
+ if ( ! dynamic_sidebar( 'sidebar' ) ) {
5
+ the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 5 ), array( 'widget_id' => NULL ) );
6
+ }
7
+ ?>
8
+ </ul>
9
+ </div><!--end sidebar-->
@@ -0,0 +1,30 @@
1
+ <?php get_header(); ?>
2
+ <?php if ( have_posts() ) : ?>
3
+ <?php while ( have_posts() ) : the_post(); ?>
4
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
5
+ <h1><?php the_title(); ?></h1>
6
+ <div>
7
+ <?php printf( __( 'by %s on', '<%= theme_id %>' ), get_the_author() ); ?> <?php the_date(); ?>
8
+ </div>
9
+ <div class="entry">
10
+ <?php if ( has_post_thumbnail() ) {
11
+ the_post_thumbnail();
12
+ } ?>
13
+ <?php the_content(); ?>
14
+ <?php edit_post_link( __( 'Edit this', '<%= theme_id %>' ), '<p>', '</p>' ); ?>
15
+ <?php wp_link_pages(); ?>
16
+ </div><!--end entry-->
17
+ <div class="post-footer clear">
18
+ <div class="tags">
19
+ <?php the_tags( __( 'Tags: ', '<%= theme_id %>' ), ', ', '' ); ?>
20
+ </div>
21
+ <div class="cats">
22
+ <?php printf( __( 'From: %s', '<%= theme_id %>' ), get_the_category_list( ', ' ) ); ?>
23
+ </div>
24
+ </div><!--end post footer-->
25
+ </div><!--end post-->
26
+ <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
27
+ <?php comments_template( '', true ); ?>
28
+ <?php endif; ?>
29
+ <?php get_sidebar(); ?>
30
+ <?php get_footer(); ?>
@@ -0,0 +1,31 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class MarvAssets < ::Guard::Guard
6
+
7
+ def initialize(watchers=[], options={})
8
+ super
9
+ end
10
+
11
+ def start
12
+ UI.info "Building all assets"
13
+ ::Marv::Guard.builder.build_assets
14
+ end
15
+
16
+ # Called on Ctrl-\ signal
17
+ # This method should be principally used for long action like running all specs/tests/...
18
+ def run_all
19
+ UI.info "Rebuilding all assets"
20
+ ::Marv::Guard.builder.clean_images
21
+ ::Marv::Guard.builder.build_assets
22
+ end
23
+
24
+ # Called on file(s) modifications
25
+ def run_on_change(paths)
26
+ UI.info "Assets have changed, rebuilding..."
27
+ ::Marv::Guard.builder.clean_images
28
+ ::Marv::Guard.builder.build_assets
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,34 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class MarvConfig < ::Guard::Guard
6
+ def initialize(watchers=[], options={})
7
+ super
8
+ end
9
+
10
+ # Called on Ctrl-Z signal
11
+ # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
12
+ def reload
13
+ UI.info "Reloading project config"
14
+ ::Marv::Guard.project.load_config
15
+ end
16
+
17
+ # Called on Ctrl-\ signal
18
+ # This method should be principally used for long action like running all specs/tests/...
19
+ def run_all
20
+ UI.info "Reloading project config"
21
+ ::Marv::Guard.project.load_config
22
+ true
23
+ end
24
+
25
+ # Called on file(s) modifications
26
+ def run_on_change(paths)
27
+ UI.info "Project config changed, reloading"
28
+ ::Marv::Guard.project.load_config
29
+ ::Marv::Guard.builder = ::Marv::Builder.new(::Marv::Guard.project)
30
+ # Rebuild everything if the config changes
31
+ ::Marv::Guard.builder.build
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class MarvFunctions < ::Guard::Guard
6
+ def initialize(watchers=[], options={})
7
+ super
8
+ end
9
+
10
+ def start
11
+ UI.info "Copying functions over"
12
+ ::Marv::Guard.builder.copy_functions
13
+ ::Marv::Guard.builder.copy_includes
14
+ ::Marv::Guard.builder.copy_extras
15
+ end
16
+
17
+ def run_all
18
+ UI.info "Rebuilding all functions"
19
+ ::Marv::Guard.builder.clean_functions
20
+ ::Marv::Guard.builder.copy_functions
21
+ ::Marv::Guard.builder.clean_includes
22
+ ::Marv::Guard.builder.copy_includes
23
+ ::Marv::Guard.builder.copy_extras
24
+ end
25
+
26
+ # Called on file(s) modifications
27
+ def run_on_change(paths)
28
+ UI.info "Functions have changed, copying over"
29
+ ::Marv::Guard.builder.clean_functions
30
+ ::Marv::Guard.builder.copy_functions
31
+ ::Marv::Guard.builder.clean_includes
32
+ ::Marv::Guard.builder.copy_includes
33
+ ::Marv::Guard.builder.copy_extras
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,28 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class MarvTemplates < ::Guard::Guard
6
+ def initialize(watchers=[], options={})
7
+ super
8
+ end
9
+
10
+ def start
11
+ UI.info "Copying templates over"
12
+ ::Marv::Guard.builder.copy_templates
13
+ end
14
+
15
+ def run_all
16
+ UI.info "Rebuilding all templates"
17
+ ::Marv::Guard.builder.clean_templates
18
+ ::Marv::Guard.builder.copy_templates
19
+ end
20
+
21
+ # Called on file(s) modifications
22
+ def run_on_change(paths)
23
+ UI.info "Templates have changed, copying over"
24
+ ::Marv::Guard.builder.clean_templates
25
+ ::Marv::Guard.builder.copy_templates
26
+ end
27
+ end
28
+ end
data/lib/marv.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'marv/error'
2
+
3
+ module Marv
4
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
5
+ autoload :Guard, 'marv/guard'
6
+ autoload :CLI, 'marv/cli'
7
+ autoload :Project, 'marv/project'
8
+ autoload :Builder, 'marv/builder'
9
+ autoload :Generator, 'marv/generator'
10
+ autoload :Config, 'marv/config'
11
+ end