cheepub 0.1.0 → 0.2.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 +4 -4
- data/README.md +23 -4
- data/lib/cheepub/cli.rb +12 -1
- data/lib/cheepub/content.rb +2 -0
- data/lib/cheepub/generator.rb +0 -1
- data/lib/cheepub/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a8208f7e95b12fbe291fa305052ab6845b86727ad9d6c32eeaebe4290946a64
|
4
|
+
data.tar.gz: 2c38721ff77731851add0e51e952c69286995316cf86e726909b69b922e774cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1495dad487da24e6a782966908b3d8228b249b71e23fdc66d818fe64c37cba241da061b5e4320debbabf0946a5b4e58352ff24da7304c95f24a0e80b2efe1252
|
7
|
+
data.tar.gz: eb7146ec19ff947c938f291161f5d1459f51badf7e6c1140b759cadbd2738c0e4841e455f2d8e04325ca97408b5c824333b66cb1b5ead7504a9eaead3ab03bc8
|
data/README.md
CHANGED
@@ -6,7 +6,11 @@ Cheepub uses [Kramdown](https://github.com/gettalong/kramdown) and [Gepub](https
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
|
9
|
+
You can install just use `gem` command:
|
10
|
+
|
11
|
+
$ gem install cheepub
|
12
|
+
|
13
|
+
If you use the gem in your project, add this line to your application's Gemfile:
|
10
14
|
|
11
15
|
```ruby
|
12
16
|
gem 'cheepub'
|
@@ -16,16 +20,31 @@ And then execute:
|
|
16
20
|
|
17
21
|
$ bundle
|
18
22
|
|
19
|
-
|
23
|
+
## Usage
|
20
24
|
|
21
|
-
|
25
|
+
You can add options `--title` and `--author`.
|
22
26
|
|
23
|
-
|
27
|
+
```sh
|
28
|
+
$ cheepub --title foo --author bar source.md
|
29
|
+
```
|
30
|
+
|
31
|
+
If you use front-matter section like Jekyll, you can execute without any options:
|
24
32
|
|
25
33
|
```sh
|
26
34
|
$ cheepub source.md
|
27
35
|
```
|
28
36
|
|
37
|
+
## History
|
38
|
+
|
39
|
+
### 0.2.0
|
40
|
+
|
41
|
+
- add option `--title`, `--author`, `--config`
|
42
|
+
|
43
|
+
### 0.1.0
|
44
|
+
|
45
|
+
- First release.
|
46
|
+
|
47
|
+
|
29
48
|
## Development
|
30
49
|
|
31
50
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/cheepub/cli.rb
CHANGED
@@ -1,14 +1,25 @@
|
|
1
1
|
module Cheepub
|
2
2
|
class CLI < Clamp::Command
|
3
|
+
using Cheepub::ExtHash
|
4
|
+
|
3
5
|
option ["-v", "--version"], :flag, "Show version" do
|
4
6
|
puts Cheepub::VERSION
|
5
7
|
exit(0)
|
6
8
|
end
|
9
|
+
option ["--author"], "AUTOR", "author of the book"
|
10
|
+
option ["--title"], "TITLE", "title of the book"
|
11
|
+
option ["--config"], "CONFIG", "configuration file"
|
7
12
|
|
8
13
|
parameter "SRC", "source file"
|
9
14
|
|
10
15
|
def execute
|
11
|
-
|
16
|
+
params = {}
|
17
|
+
if config
|
18
|
+
params = YAML.safe_load(config).symbolize_keys!
|
19
|
+
end
|
20
|
+
params[:author] = author if author
|
21
|
+
params[:title] = title if title
|
22
|
+
gen = Cheepub::Generator.new(src, params)
|
12
23
|
begin
|
13
24
|
gen.execute
|
14
25
|
rescue Cheepub::Error => e
|
data/lib/cheepub/content.rb
CHANGED
data/lib/cheepub/generator.rb
CHANGED
data/lib/cheepub/version.rb
CHANGED