power-build 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 837ff8e14530640ef25bbdfaab302f2eb94a88f7
4
- data.tar.gz: a668b9bcb396ffb681046da576b6c44e906f41a3
3
+ metadata.gz: 4deaba60aee516b39ec1f141c758e4afeed77dac
4
+ data.tar.gz: 71c47bd357385c7186ded93c4f76e21b1844859a
5
5
  SHA512:
6
- metadata.gz: 53be60fa8a60a0ece7753bd5461ed09f7c08d8024af68fc6064558ee95e4b353f0f90321b7bcf3cdd4bfab0f497ae9fd49e68467171dc3479703ece5745e60c8
7
- data.tar.gz: eed65f71796c2f9d3ba2fae51e790d60f75381e4f8c6cd6492156dd1827e28e6f7c8915cf050c6f91252e771605b7ec9cf1c7ed740f49d2c50f863b5d8a23791
6
+ metadata.gz: 961f890c061123509f04ec56a8aca9664275082a2e20828dc05b9933cc005abe241a299b291284f96492e41f9b2dc6520f04fb23a8ad09b2836ee1ed99311b60
7
+ data.tar.gz: 433c70b5a2708c735f83d8881c0e9586126190093e1760b9de597f97b986bfe42fe962a8fa4ad06c9a537bf6a9f5a51645c9ad690d059c5d6b1721f34008bd00
data/.gitignore CHANGED
@@ -1,7 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
3
  .bundle
4
- .config
5
4
  .yardoc
6
5
  Gemfile.lock
7
6
  InstalledFiles
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
  gem 'thor'
6
6
  gem 'colorize'
7
7
  gem 'rspec'
8
+ gem 'pry'
data/README.md CHANGED
@@ -2,10 +2,13 @@
2
2
 
3
3
  Power Build is a photo album builder which generates a site based on the images in a project. It works as a command line application.
4
4
 
5
+ #### Visit [Demo Site](http://cstony0917.github.io/warofpic/) for a general understanding.
6
+
5
7
  ## Requirement
6
8
 
7
- 1. Ruby is installed in your Mac or Linux. (Don't use this application in Windows. Nothing has been tested.)
8
- 2. The generated site is to be hosted on [GitHub pages](https://pages.github.com/).
9
+ 1. Ruby version 2.0 or higher
10
+ 2. Mac or Linux (Nothing has been tested on Windows.)
11
+ 3. This tool is for hosting on [GitHub pages](https://pages.github.com/). Other sites may not be compatible.
9
12
 
10
13
  ## Installation
11
14
 
@@ -17,7 +20,7 @@ $gem install power-build
17
20
 
18
21
  or manually write `gem 'power-build'` in the Gemfile before you run `$bundle`.
19
22
 
20
- ## Usage
23
+ ## Commands
21
24
 
22
25
  In the root of your project, run:
23
26
 
@@ -31,4 +34,73 @@ It creates a config file in your project directory. You can adjust the content d
31
34
  $power build
32
35
  ```
33
36
 
34
- You can skip the `build` and just run `power`. This command generates a static site which allows you to host on github pages. Basically it creates a `index.html` and a folder `album` with other pages in it.
37
+ You can skip the `build` and just run `power`. This command generates a static site which allows you to host on github pages. Basically it creates a `index.html` and a folder `assets` with other pages in it.
38
+
39
+ ```
40
+ $power delete
41
+ ```
42
+
43
+ Clean all files generated by power-build.
44
+
45
+ ## Config
46
+
47
+ The config file looks like this:
48
+
49
+ ```
50
+ {
51
+ "title": "Your Site Title",
52
+
53
+ // Displaying the source on you nav-bar
54
+ "host_link": "https://github.com/nkj20932/power-build",
55
+ "host_display_text": "GitHub",
56
+
57
+ // Select the folder you store images
58
+ "root_folder": "storage",
59
+
60
+ // Website language: either "zh-tw" or "en"
61
+ "language": "zh-tw"
62
+ }
63
+
64
+ ```
65
+
66
+ 1. Remember to keep the file content in JSON format. Don't break it.
67
+ 2. Currently there are only two languages for display: English and Traditional Chinese.
68
+ 3. `root_folder` for the images should be in your root folder. Otherwise the links and images will not be displayed. Check the folder structure in the next section.
69
+
70
+ ## Folder Structure
71
+
72
+ Before site generation, you need to include at least the folder of your images:
73
+
74
+ ```
75
+ My_project_folder
76
+ |-- image_root_folder
77
+ ```
78
+
79
+ If so, after site generation, your folder will look like this:
80
+
81
+ ```
82
+ My_project_folder
83
+ |-- image_root_folder
84
+ |-- power-build.config
85
+ |-- assets
86
+ |-- index.html
87
+ ```
88
+
89
+ However, in your image folder, the images should be stored by categories like this:
90
+
91
+ ```
92
+ image_root_folder
93
+ |-- category_1
94
+ | |-- image_1
95
+ | |-- image_2
96
+ | |-- image_3
97
+ |
98
+ |-- category_2
99
+ |-- category_3
100
+ ```
101
+
102
+ Only the structure is followed can the site be generated in the correct format as in the [demo](http://cstony0917.github.io/warofpic/).
103
+
104
+ ## Issues & Contribution
105
+
106
+ The project follows MIT Licence. Any issue, pull-request, feature-request, or comment is welcome.
data/Rakefile CHANGED
@@ -1,2 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ task :install do
4
+ command = %x[cd ~/projects/power-build]
5
+ command = %x[gem build power-build.gemspec]
6
+ command = %x[cd ~/projects/power-build/pkg]
7
+ command = %x[gem install power-build-1.0.0.gem]
8
+ puts "Done!"
9
+ end
data/bin/power CHANGED
File without changes