planaria 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49519b1d3c6430dfe60a6e0a13254a86c7947dd2
4
- data.tar.gz: 60c94d086775507ad227639ea8a426f89cbd0991
3
+ metadata.gz: 7c7009bfe53c00019be8767d7ac9f2d9957c76ff
4
+ data.tar.gz: 447fb1f203589dadba2528c060804ee2f259de59
5
5
  SHA512:
6
- metadata.gz: eebd5ea77c5a0fba8ef659f6c97c1923b93611924270082ac622f7fe2478de9229a925111366b14a1e34e3c3eb06547e2f579361e16978206b09d4f1796e27fc
7
- data.tar.gz: e4c587ec1202e5986b5917490d6d2c71511b340fbf826c2e4088a8fae48a99d73aaf44fc2f075f79911d042326ec848a23df89dd06dbd1a72ee3b8da1f3b60a5
6
+ metadata.gz: 73b79d7627afda926f75cd0d2ae4e4c8f48ab90e266181bdb946de5dc9ff82776493165c3d99857f6b17f9948d57ae35cc3e7d30ce626dd59bb1b89888001e09
7
+ data.tar.gz: bb5d417d8ea975fe9e154d5dfa4641bea484426fcbc5875b99c7911b2bd2a4443a5922ab8c6cba44e37cb2913aa2954fbd10680a69ff7a76e5afe7937b0089f7
data/README.md CHANGED
@@ -22,7 +22,59 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```sh
26
+ $ pln
27
+
28
+ Commands:
29
+ pln build -n, --name=NAME # Create template
30
+ pln divide -b, --base=BASE -n, --name=NAME # Divide project
31
+ pln help [COMMAND] # Describe available commands or one specific command
32
+ pln init -n, --name=NAME # Create new template directories
33
+ ```
34
+
35
+ #### init
36
+
37
+ ```sh
38
+ $ pln init -n awesome_project
39
+
40
+ Create awesome_project project
41
+ ./awesome_project
42
+ +--css
43
+ | `--awesome_project.css
44
+ +--html
45
+ | `--index.html.erb
46
+ +--img
47
+ +--js
48
+ | `--awesome_project.js
49
+ +--yamls
50
+ `--base.yml
51
+ ```
52
+
53
+ #### build
54
+
55
+ ```sh
56
+ $ pln build -n awesome_project
57
+
58
+ Generate awesome_project/base/index.html
59
+ ```
60
+
61
+ #### divide
62
+
63
+ ```sh
64
+ $ pln divide -n great_project -b awesome_project
65
+
66
+ Divide great_project project from awesome_project
67
+ ./great_project
68
+ +--css
69
+ | `--great_project.css
70
+ +--html
71
+ | `--index.html.erb
72
+ +--img
73
+ +--js
74
+ | `--great_project.js
75
+ +--yamls
76
+ `--base.yml
77
+ ```
26
78
 
27
79
  ## Development
28
80
 
@@ -14,7 +14,8 @@ module Planaria::Generator
14
14
  instance_variable_set("@#{k}", v)
15
15
  end
16
16
 
17
- ::File.open "./#{@name}/#{file_name}.html", "w" do |file|
17
+ create_directory file_name
18
+ ::File.open "./#{@name}/#{file_name}/index.html", "w" do |file|
18
19
  file.write erb.result(binding)
19
20
  end
20
21
  end
@@ -29,6 +30,10 @@ module Planaria::Generator
29
30
  def erb
30
31
  ::ERB.new(File.read "./#{@name}/html/index.html.erb")
31
32
  end
33
+
34
+ def create_directory(file_name)
35
+ FileUtils.mkdir_p "./#{@name}/#{file_name}"
36
+ end
32
37
  end
33
38
  end
34
39
  end
@@ -8,7 +8,7 @@ module Planaria::Generator
8
8
 
9
9
  def run
10
10
  @executer.yaml_files.each do |file|
11
- puts "Generate #{@name}/#{file.split("/").last.split(".").first}.html"
11
+ puts "Generate #{@name}/#{file.split("/").last.split(".").first}/index.html"
12
12
  end
13
13
  end
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module Planaria
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planaria
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - onigra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-19 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler