project_templater 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Project Templater
2
2
 
3
- __V0.1.2__
3
+ __V0.2.0__
4
4
 
5
5
  ## Installation
6
6
 
@@ -39,6 +39,7 @@ Run the `sinatra_basic` generator and output to the `pwd/foo/ directory`.
39
39
  - `js_project`
40
40
  - `ruby_project`
41
41
  - `html_proto`
42
+ - `jekyll_basic`
42
43
 
43
44
  ## Adding a Generator
44
45
 
@@ -55,8 +56,14 @@ Define a `run` method that will be called. There are two methods available:
55
56
 
56
57
  You can also define a `post_install` method that is run after the `run` method has. You also have access to the `@base` variable, which is the directory the generator was run in.
57
58
 
59
+ Similarly, there is a `pre_install` method which is run just before `run`. Again, it has access to `@base`.
60
+
58
61
  ## Changelog
59
62
 
63
+ __0.2.0__
64
+ - added `jekyll_basic` generator
65
+ - add `pre_install` method for generators
66
+
60
67
  __0.1.2__
61
68
  - added `html_proto` generator, designed for quick HTML prototypes
62
69
 
@@ -8,6 +8,10 @@ class Generator
8
8
  end
9
9
  end
10
10
 
11
+ def pre_install
12
+
13
+ end
14
+
11
15
  def post_install
12
16
  end
13
17
 
@@ -0,0 +1,15 @@
1
+ require_relative "./generator.rb"
2
+
3
+ class JekyllBasic < Generator
4
+ def run
5
+ make_dir("_posts")
6
+ make_dir("_layouts")
7
+ make_dir("css")
8
+ make_dir("js")
9
+ make_dir("img")
10
+
11
+ make_file("index.html")
12
+ make_file("_layouts/default.html")
13
+ make_file("css/style.css")
14
+ end
15
+ end
@@ -19,6 +19,7 @@ class ProjectTemplater
19
19
  base_dir = Dir.pwd + "/" + (base_dir ||= "")
20
20
  class_name = @template.camel_case
21
21
  instance = Object::const_get(class_name).new(base_dir)
22
+ instance.pre_install
22
23
  instance.run
23
24
  instance.post_install
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: project_templater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -20,6 +20,7 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - lib/generators/generator.rb
22
22
  - lib/generators/html_proto.rb
23
+ - lib/generators/jekyll_basic.rb
23
24
  - lib/generators/js_project.rb
24
25
  - lib/generators/ruby_project.rb
25
26
  - lib/generators/sinatra_basic.rb