fones 0.1.1 → 0.1.2
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile +14 -14
- data/Gemfile.lock +85 -49
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/features/step_definitions/fones_steps.rb +2 -2
- data/fones.gemspec +72 -62
- data/layouts/config/config.tt +37 -1
- data/layouts/default/functions/functions.php.erb +92 -93
- data/layouts/default/functions/library/admin.php.erb +18 -24
- data/layouts/default/functions/library/bones.php.erb +205 -201
- data/layouts/default/functions/library/custom-post-type.php.erb +103 -104
- data/layouts/default/functions/library/translation/de_DE.mo +0 -0
- data/layouts/default/functions/library/translation/default.mo +0 -0
- data/layouts/default/functions/library/translation/default.po +4 -5
- data/layouts/default/functions/library/translation/es_ES.mo +0 -0
- data/layouts/default/functions/library/translation/fr_FR.mo +0 -0
- data/layouts/default/functions/library/translation/he_IL.mo +0 -0
- data/layouts/default/functions/library/translation/hr.mo +0 -0
- data/layouts/default/functions/library/translation/it_IT.mo +0 -0
- data/layouts/default/functions/library/translation/ja.mo +0 -0
- data/layouts/default/functions/library/translation/nb_NO.mo +0 -0
- data/layouts/default/functions/library/translation/nl_NL.mo +0 -0
- data/layouts/default/functions/library/translation/pl_PL.mo +0 -0
- data/layouts/default/functions/library/translation/pt_PT.mo +0 -0
- data/layouts/default/functions/library/translation/ru_RU.mo +0 -0
- data/layouts/default/functions/library/translation/sv_SE.mo +0 -0
- data/layouts/default/functions/library/translation/translation.php.erb +5 -5
- data/layouts/default/functions/library/translation/zh_CN.mo +0 -0
- data/lib/fones.rb +7 -7
- data/lib/{forge → fones}/builder.rb +1 -2
- data/lib/{forge → fones}/cli.rb +5 -5
- data/lib/{forge → fones}/config.rb +12 -5
- data/lib/{forge → fones}/error.rb +0 -0
- data/lib/{forge → fones}/generator.rb +1 -2
- data/lib/{forge → fones}/guard.rb +4 -4
- data/lib/{forge → fones}/project.rb +2 -2
- data/lib/{forge → fones}/version.rb +0 -0
- data/lib/guard/{forge → fones}/assets.rb +1 -1
- data/lib/guard/{forge → fones}/config.rb +1 -1
- data/lib/guard/{forge → fones}/functions.rb +0 -0
- data/lib/guard/{forge → fones}/templates.rb +1 -1
- data/spec/lib/{forge → fones}/config_spec.rb +5 -4
- data/spec/lib/{forge → fones}/project_spec.rb +6 -6
- data/spec/spec_helper.rb +2 -3
- metadata +68 -110
- data/lib/forge/engines.rb +0 -12
- data/pkg/fones-0.1.0.gem +0 -0
@@ -1,122 +1,121 @@
|
|
1
1
|
<?php
|
2
|
-
/*
|
3
|
-
This page walks you through creating
|
2
|
+
/* <%= theme_id %> Custom Post Type Example
|
3
|
+
This page walks you through creating
|
4
4
|
a custom post type and taxonomies. You
|
5
|
-
can edit this one or copy the following code
|
6
|
-
to create another one.
|
5
|
+
can edit this one or copy the following code
|
6
|
+
to create another one.
|
7
7
|
|
8
|
-
I put this in a separate file so as to
|
8
|
+
I put this in a separate file so as to
|
9
9
|
keep it organized. I find it easier to edit
|
10
10
|
and change things if they are concentrated
|
11
11
|
in their own file.
|
12
12
|
|
13
|
-
Developed by:
|
14
|
-
URL:
|
13
|
+
Developed by: <%= config[:author] %>
|
14
|
+
URL: <%= config[:author_uri] %>
|
15
15
|
*/
|
16
16
|
|
17
17
|
|
18
18
|
// let's create the function for the custom type
|
19
19
|
function custom_post_example() {
|
20
|
-
// creating (registering) the custom type
|
20
|
+
// creating (registering) the custom type
|
21
21
|
register_post_type( 'custom_type', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */
|
22
22
|
// let's now add all the options for this post type
|
23
23
|
array('labels' => array(
|
24
|
-
'name' => __('Custom Types', '<%= theme_id %>theme'), /* This is the Title of the Group */
|
25
|
-
'singular_name' => __('Custom Post', '<%= theme_id %>theme'), /* This is the individual type */
|
26
|
-
'all_items' => __('All Custom Posts', '<%= theme_id %>theme'), /* the all items menu item */
|
27
|
-
'add_new' => __('Add New', '<%= theme_id %>theme'), /* The add new menu item */
|
28
|
-
'add_new_item' => __('Add New Custom Type', '<%= theme_id %>theme'), /* Add New Display Title */
|
29
|
-
'edit' => __( 'Edit', '<%= theme_id %>theme' ), /* Edit Dialog */
|
30
|
-
'edit_item' => __('Edit Post Types', '<%= theme_id %>theme'), /* Edit Display Title */
|
31
|
-
'new_item' => __('New Post Type', '<%= theme_id %>theme'), /* New Display Title */
|
32
|
-
'view_item' => __('View Post Type', '<%= theme_id %>theme'), /* View Display Title */
|
33
|
-
'search_items' => __('Search Post Type', '<%= theme_id %>theme'), /* Search Custom Type Title */
|
34
|
-
'not_found' => __('Nothing found in the Database.', '<%= theme_id %>theme'), /* This displays if there are no entries yet */
|
35
|
-
'not_found_in_trash' => __('Nothing found in Trash', '<%= theme_id %>theme'), /* This displays if there is nothing in the trash */
|
36
|
-
'parent_item_colon' => ''
|
37
|
-
), /* end of arrays */
|
38
|
-
'description' => __( 'This is the example custom post type', '<%= theme_id %>theme' ), /* Custom Type Description */
|
39
|
-
'public' => true,
|
40
|
-
'publicly_queryable' => true,
|
41
|
-
'exclude_from_search' => false,
|
42
|
-
'show_ui' => true,
|
43
|
-
'query_var' => true,
|
44
|
-
'menu_position' => 8, /* this is what order you want it to appear in on the left hand side menu */
|
45
|
-
'menu_icon' => get_stylesheet_directory_uri() . '/
|
46
|
-
'rewrite' => array( 'slug' => 'custom_type', 'with_front' => false ), /* you can specify its url slug */
|
47
|
-
'has_archive' => 'custom_type', /* you can rename the slug here */
|
48
|
-
'capability_type' => 'post',
|
49
|
-
'hierarchical' => false,
|
50
|
-
/* the next one is important, it tells what's enabled in the post editor */
|
51
|
-
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')
|
52
|
-
) /* end of options */
|
53
|
-
); /* end of register post type */
|
54
|
-
|
55
|
-
/* this adds your post categories to your custom post type */
|
56
|
-
register_taxonomy_for_object_type('category', 'custom_type');
|
57
|
-
/* this adds your post tags to your custom post type */
|
58
|
-
register_taxonomy_for_object_type('post_tag', 'custom_type');
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
// adding the function to the Wordpress init
|
63
|
-
add_action( 'init', 'custom_post_example');
|
64
|
-
|
65
|
-
/*
|
66
|
-
for more information on taxonomies, go here:
|
67
|
-
http://codex.wordpress.org/Function_Reference/register_taxonomy
|
68
|
-
*/
|
69
|
-
|
70
|
-
// now let's add custom categories (these act like categories)
|
71
|
-
register_taxonomy( 'custom_cat',
|
72
|
-
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
73
|
-
array('hierarchical' => true, /* if this is true, it acts like categories */
|
74
|
-
'labels' => array(
|
75
|
-
'name' => __( 'Custom Categories', '<%= theme_id %>theme' ), /* name of the custom taxonomy */
|
76
|
-
'singular_name' => __( 'Custom Category', '<%= theme_id %>theme' ), /* single taxonomy name */
|
77
|
-
'search_items' => __( 'Search Custom Categories', '<%= theme_id %>theme' ), /* search title for taxomony */
|
78
|
-
'all_items' => __( 'All Custom Categories', '<%= theme_id %>theme' ), /* all title for taxonomies */
|
79
|
-
'parent_item' => __( 'Parent Custom Category', '<%= theme_id %>theme' ), /* parent title for taxonomy */
|
80
|
-
'parent_item_colon' => __( 'Parent Custom Category:', '<%= theme_id %>theme' ), /* parent taxonomy title */
|
81
|
-
'edit_item' => __( 'Edit Custom Category', '<%= theme_id %>theme' ), /* edit custom taxonomy title */
|
82
|
-
'update_item' => __( 'Update Custom Category', '<%= theme_id %>theme' ), /* update title for taxonomy */
|
83
|
-
'add_new_item' => __( 'Add New Custom Category', '<%= theme_id %>theme' ), /* add new title for taxonomy */
|
84
|
-
'new_item_name' => __( 'New Custom Category Name', '<%= theme_id %>theme' ) /* name title for taxonomy */
|
85
|
-
),
|
86
|
-
'show_admin_column' => true,
|
87
|
-
'show_ui' => true,
|
88
|
-
'query_var' => true,
|
89
|
-
'rewrite' => array( 'slug' => 'custom-slug' ),
|
90
|
-
)
|
91
|
-
);
|
92
|
-
|
93
|
-
// now let's add custom tags (these act like categories)
|
94
|
-
register_taxonomy( 'custom_tag',
|
95
|
-
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
96
|
-
array('hierarchical' => false, /* if this is false, it acts like tags */
|
97
|
-
'labels' => array(
|
98
|
-
'name' => __( 'Custom Tags', '<%= theme_id %>theme' ), /* name of the custom taxonomy */
|
99
|
-
'singular_name' => __( 'Custom Tag', '<%= theme_id %>theme' ), /* single taxonomy name */
|
100
|
-
'search_items' => __( 'Search Custom Tags', '<%= theme_id %>theme' ), /* search title for taxomony */
|
101
|
-
'all_items' => __( 'All Custom Tags', '<%= theme_id %>theme' ), /* all title for taxonomies */
|
102
|
-
'parent_item' => __( 'Parent Custom Tag', '<%= theme_id %>theme' ), /* parent title for taxonomy */
|
103
|
-
'parent_item_colon' => __( 'Parent Custom Tag:', '<%= theme_id %>theme' ), /* parent taxonomy title */
|
104
|
-
'edit_item' => __( 'Edit Custom Tag', '<%= theme_id %>theme' ), /* edit custom taxonomy title */
|
105
|
-
'update_item' => __( 'Update Custom Tag', '<%= theme_id %>theme' ), /* update title for taxonomy */
|
106
|
-
'add_new_item' => __( 'Add New Custom Tag', '<%= theme_id %>theme' ), /* add new title for taxonomy */
|
107
|
-
'new_item_name' => __( 'New Custom Tag Name', '<%= theme_id %>theme' ) /* name title for taxonomy */
|
108
|
-
),
|
109
|
-
'show_admin_column' => true,
|
110
|
-
'show_ui' => true,
|
111
|
-
'query_var' => true,
|
112
|
-
)
|
113
|
-
);
|
114
|
-
|
115
|
-
/*
|
116
|
-
looking for custom meta boxes?
|
117
|
-
check out this fantastic tool:
|
118
|
-
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
|
119
|
-
*/
|
24
|
+
'name' => __('Custom Types', '<%= theme_id %>theme'), /* This is the Title of the Group */
|
25
|
+
'singular_name' => __('Custom Post', '<%= theme_id %>theme'), /* This is the individual type */
|
26
|
+
'all_items' => __('All Custom Posts', '<%= theme_id %>theme'), /* the all items menu item */
|
27
|
+
'add_new' => __('Add New', '<%= theme_id %>theme'), /* The add new menu item */
|
28
|
+
'add_new_item' => __('Add New Custom Type', '<%= theme_id %>theme'), /* Add New Display Title */
|
29
|
+
'edit' => __( 'Edit', '<%= theme_id %>theme' ), /* Edit Dialog */
|
30
|
+
'edit_item' => __('Edit Post Types', '<%= theme_id %>theme'), /* Edit Display Title */
|
31
|
+
'new_item' => __('New Post Type', '<%= theme_id %>theme'), /* New Display Title */
|
32
|
+
'view_item' => __('View Post Type', '<%= theme_id %>theme'), /* View Display Title */
|
33
|
+
'search_items' => __('Search Post Type', '<%= theme_id %>theme'), /* Search Custom Type Title */
|
34
|
+
'not_found' => __('Nothing found in the Database.', '<%= theme_id %>theme'), /* This displays if there are no entries yet */
|
35
|
+
'not_found_in_trash' => __('Nothing found in Trash', '<%= theme_id %>theme'), /* This displays if there is nothing in the trash */
|
36
|
+
'parent_item_colon' => ''
|
37
|
+
), /* end of arrays */
|
38
|
+
'description' => __( 'This is the example custom post type', '<%= theme_id %>theme' ), /* Custom Type Description */
|
39
|
+
'public' => true,
|
40
|
+
'publicly_queryable' => true,
|
41
|
+
'exclude_from_search' => false,
|
42
|
+
'show_ui' => true,
|
43
|
+
'query_var' => true,
|
44
|
+
'menu_position' => 8, /* this is what order you want it to appear in on the left hand side menu */
|
45
|
+
'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
|
46
|
+
'rewrite' => array( 'slug' => 'custom_type', 'with_front' => false ), /* you can specify its url slug */
|
47
|
+
'has_archive' => 'custom_type', /* you can rename the slug here */
|
48
|
+
'capability_type' => 'post',
|
49
|
+
'hierarchical' => false,
|
50
|
+
/* the next one is important, it tells what's enabled in the post editor */
|
51
|
+
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')
|
52
|
+
) /* end of options */
|
53
|
+
); /* end of register post type */
|
54
|
+
|
55
|
+
/* this adds your post categories to your custom post type */
|
56
|
+
register_taxonomy_for_object_type('category', 'custom_type');
|
57
|
+
/* this adds your post tags to your custom post type */
|
58
|
+
register_taxonomy_for_object_type('post_tag', 'custom_type');
|
59
|
+
|
60
|
+
}
|
120
61
|
|
62
|
+
// adding the function to the Wordpress init
|
63
|
+
add_action( 'init', 'custom_post_example');
|
64
|
+
|
65
|
+
/*
|
66
|
+
for more information on taxonomies, go here:
|
67
|
+
http://codex.wordpress.org/Function_Reference/register_taxonomy
|
68
|
+
*/
|
69
|
+
|
70
|
+
// now let's add custom categories (these act like categories)
|
71
|
+
register_taxonomy( 'custom_cat',
|
72
|
+
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
73
|
+
array('hierarchical' => true, /* if this is true, it acts like categories */
|
74
|
+
'labels' => array(
|
75
|
+
'name' => __( 'Custom Categories', '<%= theme_id %>theme' ), /* name of the custom taxonomy */
|
76
|
+
'singular_name' => __( 'Custom Category', '<%= theme_id %>theme' ), /* single taxonomy name */
|
77
|
+
'search_items' => __( 'Search Custom Categories', '<%= theme_id %>theme' ), /* search title for taxomony */
|
78
|
+
'all_items' => __( 'All Custom Categories', '<%= theme_id %>theme' ), /* all title for taxonomies */
|
79
|
+
'parent_item' => __( 'Parent Custom Category', '<%= theme_id %>theme' ), /* parent title for taxonomy */
|
80
|
+
'parent_item_colon' => __( 'Parent Custom Category:', '<%= theme_id %>theme' ), /* parent taxonomy title */
|
81
|
+
'edit_item' => __( 'Edit Custom Category', '<%= theme_id %>theme' ), /* edit custom taxonomy title */
|
82
|
+
'update_item' => __( 'Update Custom Category', '<%= theme_id %>theme' ), /* update title for taxonomy */
|
83
|
+
'add_new_item' => __( 'Add New Custom Category', '<%= theme_id %>theme' ), /* add new title for taxonomy */
|
84
|
+
'new_item_name' => __( 'New Custom Category Name', '<%= theme_id %>theme' ) /* name title for taxonomy */
|
85
|
+
),
|
86
|
+
'show_admin_column' => true,
|
87
|
+
'show_ui' => true,
|
88
|
+
'query_var' => true,
|
89
|
+
'rewrite' => array( 'slug' => 'custom-slug' ),
|
90
|
+
)
|
91
|
+
);
|
92
|
+
|
93
|
+
// now let's add custom tags (these act like categories)
|
94
|
+
register_taxonomy( 'custom_tag',
|
95
|
+
array('custom_type'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */
|
96
|
+
array('hierarchical' => false, /* if this is false, it acts like tags */
|
97
|
+
'labels' => array(
|
98
|
+
'name' => __( 'Custom Tags', '<%= theme_id %>theme' ), /* name of the custom taxonomy */
|
99
|
+
'singular_name' => __( 'Custom Tag', '<%= theme_id %>theme' ), /* single taxonomy name */
|
100
|
+
'search_items' => __( 'Search Custom Tags', '<%= theme_id %>theme' ), /* search title for taxomony */
|
101
|
+
'all_items' => __( 'All Custom Tags', '<%= theme_id %>theme' ), /* all title for taxonomies */
|
102
|
+
'parent_item' => __( 'Parent Custom Tag', '<%= theme_id %>theme' ), /* parent title for taxonomy */
|
103
|
+
'parent_item_colon' => __( 'Parent Custom Tag:', '<%= theme_id %>theme' ), /* parent taxonomy title */
|
104
|
+
'edit_item' => __( 'Edit Custom Tag', '<%= theme_id %>theme' ), /* edit custom taxonomy title */
|
105
|
+
'update_item' => __( 'Update Custom Tag', '<%= theme_id %>theme' ), /* update title for taxonomy */
|
106
|
+
'add_new_item' => __( 'Add New Custom Tag', '<%= theme_id %>theme' ), /* add new title for taxonomy */
|
107
|
+
'new_item_name' => __( 'New Custom Tag Name', '<%= theme_id %>theme' ) /* name title for taxonomy */
|
108
|
+
),
|
109
|
+
'show_admin_column' => true,
|
110
|
+
'show_ui' => true,
|
111
|
+
'query_var' => true,
|
112
|
+
)
|
113
|
+
);
|
114
|
+
|
115
|
+
/*
|
116
|
+
looking for custom meta boxes?
|
117
|
+
check out this fantastic tool:
|
118
|
+
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
|
119
|
+
*/
|
121
120
|
|
122
121
|
?>
|
Binary file
|
Binary file
|
@@ -4,17 +4,16 @@ msgstr ""
|
|
4
4
|
"Report-Msgid-Bugs-To: \n"
|
5
5
|
"POT-Creation-Date: 2012-03-02 22:11+0100\n"
|
6
6
|
"PO-Revision-Date: \n"
|
7
|
-
"Language-Team:
|
7
|
+
"Language-Team: fulgor <frag.fulgor@gmail.com>\n"
|
8
8
|
"Language-Team: fulgor <frag.fulgor@gmail.com>\n"
|
9
9
|
"MIME-Version: 1.0\n"
|
10
10
|
"Content-Type: text/plain; charset=UTF-8\n"
|
11
11
|
"Content-Transfer-Encoding: 8bit\n"
|
12
|
-
"X-Poedit-SourceCharset:
|
12
|
+
"X-Poedit-SourceCharset: utf-8\n"
|
13
13
|
"X-Poedit-KeywordsList: __;_e;_n\n"
|
14
|
-
"X-Poedit-Basepath: /
|
14
|
+
"X-Poedit-Basepath: /home/fulgor/GIT/bones\n"
|
15
15
|
"Last-Translator: \n"
|
16
|
-
"X-
|
17
|
-
"X-Poedit-SearchPath-0: /Users/joey/Downloads\n"
|
16
|
+
"X-Poedit-SearchPath-0: /home/fulgor/GIT/bones\n"
|
18
17
|
|
19
18
|
#: comments.php:12
|
20
19
|
msgid "This post is password protected. Enter the password to view comments."
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<?php
|
2
|
-
/* Welcome to
|
3
|
-
Thanks to the fantastic work by
|
4
|
-
the ability to translate
|
2
|
+
/* Welcome to <%= theme_id %> :)
|
3
|
+
Thanks to the fantastic work by <%= theme_id %> users, we've now
|
4
|
+
the ability to translate <%= theme_id %> into different languages.
|
5
5
|
|
6
|
-
Developed by:
|
7
|
-
URL:
|
6
|
+
Developed by: <%= config[:author] %>
|
7
|
+
URL: <%= config[:author_uri] %>
|
8
8
|
*/
|
9
9
|
|
10
10
|
|
Binary file
|
data/lib/fones.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require '
|
1
|
+
require 'fones/error'
|
2
2
|
|
3
3
|
module Fones
|
4
4
|
ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
5
|
-
autoload :Guard, '
|
6
|
-
autoload :CLI, '
|
7
|
-
autoload :Project, '
|
8
|
-
autoload :Builder, '
|
9
|
-
autoload :Generator, '
|
10
|
-
autoload :Config, '
|
5
|
+
autoload :Guard, 'fones/guard'
|
6
|
+
autoload :CLI, 'fones/cli'
|
7
|
+
autoload :Project, 'fones/project'
|
8
|
+
autoload :Builder, 'fones/builder'
|
9
|
+
autoload :Generator, 'fones/generator'
|
10
|
+
autoload :Config, 'fones/config'
|
11
11
|
end
|
data/lib/{forge → fones}/cli.rb
RENAMED
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'yaml'
|
3
|
-
require 'guard/
|
4
|
-
require 'guard/
|
5
|
-
require 'guard/
|
6
|
-
require 'guard/
|
3
|
+
require 'guard/fones/assets'
|
4
|
+
require 'guard/fones/config'
|
5
|
+
require 'guard/fones/templates'
|
6
|
+
require 'guard/fones/functions'
|
7
7
|
|
8
8
|
module Fones
|
9
9
|
class CLI < Thor
|
@@ -23,7 +23,7 @@ module Fones
|
|
23
23
|
|
24
24
|
desc "link PATH", "Create a symbolic link to the compilation directory"
|
25
25
|
long_desc "This command will symlink the compiled version of the theme to the specified path.\n\n"+
|
26
|
-
"To compile the theme use the `
|
26
|
+
"To compile the theme use the `fones watch` command"
|
27
27
|
def link(path)
|
28
28
|
project = Fones::Project.new('.', self)
|
29
29
|
|
@@ -2,6 +2,8 @@ module Fones
|
|
2
2
|
# Reads/Writes a configuration file in the user's home directory
|
3
3
|
#
|
4
4
|
class Config
|
5
|
+
|
6
|
+
require 'yaml'
|
5
7
|
|
6
8
|
@config
|
7
9
|
|
@@ -29,16 +31,18 @@ module Fones
|
|
29
31
|
|
30
32
|
# Returns the path to the user's configuration file
|
31
33
|
def config_file
|
32
|
-
@config_file ||= File.expand_path(File.join('~', '.
|
34
|
+
@config_file ||= File.expand_path(File.join('~', '.fones', 'config.yml'))
|
33
35
|
end
|
34
36
|
|
35
37
|
# Writes the configuration file
|
36
38
|
def write(options={})
|
39
|
+
|
37
40
|
# If we're unit testing then it helps to use a
|
38
41
|
# StringIO object instead of a file buffer
|
39
42
|
io = options[:io] || File.open(self.config_file, 'w')
|
40
43
|
|
41
|
-
io.write JSON.generate(@config)
|
44
|
+
# io.write JSON.generate(@config)
|
45
|
+
io.write @config.to_yaml
|
42
46
|
|
43
47
|
io.close
|
44
48
|
|
@@ -49,11 +53,14 @@ module Fones
|
|
49
53
|
#
|
50
54
|
# If file does not exist then it will be created
|
51
55
|
def read
|
52
|
-
return write unless File.exists?(self.config_file)
|
56
|
+
return write unless File.exists?(self.config_file)
|
57
|
+
|
58
|
+
# data = File.open(self.config_file).read
|
53
59
|
|
54
|
-
|
60
|
+
@config = YAML::load_file(self.config_file) unless self.config_file.empty?
|
55
61
|
|
56
|
-
@config = data.empty? ? {} : JSON.parse(data)
|
62
|
+
# @config = data.empty? ? {} : JSON.parse(data)
|
63
|
+
# @config = data.empty? ? {} : YAML::parse(data)
|
57
64
|
|
58
65
|
self
|
59
66
|
end
|
File without changes
|
@@ -28,19 +28,19 @@ module Fones
|
|
28
28
|
config_file = @project.config_file.gsub(/#{@project.root}\//, '')
|
29
29
|
|
30
30
|
guardfile_contents = %Q{
|
31
|
-
guard '
|
31
|
+
guard 'fonesconfig'#{options_hash} do
|
32
32
|
watch("#{config_file}")
|
33
33
|
end
|
34
|
-
guard '
|
34
|
+
guard 'fonesassets' do
|
35
35
|
watch(%r{#{assets_path}/js/*})
|
36
36
|
watch(%r{#{assets_path}/css/*})
|
37
37
|
watch(%r{#{assets_path}/img/*})
|
38
38
|
end
|
39
|
-
guard '
|
39
|
+
guard 'fonestemplates' do
|
40
40
|
watch(%r{#{source_path}/templates/*})
|
41
41
|
watch(%r{#{source_path}/partials/*})
|
42
42
|
end
|
43
|
-
guard '
|
43
|
+
guard 'fonesfunctions' do
|
44
44
|
watch(%r{#{source_path}/functions/*})
|
45
45
|
watch(%r{#{source_path}/includes/*})
|
46
46
|
end
|
@@ -30,7 +30,7 @@ module Fones
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def build_path
|
33
|
-
File.join(self.root, '.
|
33
|
+
File.join(self.root, '.fones', 'build')
|
34
34
|
end
|
35
35
|
|
36
36
|
def source_path
|
@@ -62,7 +62,7 @@ module Fones
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def global_config_file
|
65
|
-
@global_config_file ||= File.join(ENV['HOME'], '.
|
65
|
+
@global_config_file ||= File.join(ENV['HOME'], '.fones', 'config.rb')
|
66
66
|
end
|
67
67
|
|
68
68
|
# Create a symlink from source to the project build dir
|