index_html 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +23 -8
- data/index_html.gemspec +1 -1
- data/lib/index_html/cli.rb +2 -47
- data/lib/index_html/version.rb +1 -1
- data/lib/index_html.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee2bdfbf9791893c926b1b3ef1903c9585fad61
|
4
|
+
data.tar.gz: a4d2ea882d162a6b5f3e9b97013d83168dfa6070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7885ca65b0582debbdd7d6b76d95f78133372c0a31aa83044b26ea35ca3a010713eead94a7493477c2509c1fda2bfc082cea53e9ebeb6ba8321a51a9283f31f
|
7
|
+
data.tar.gz: 2113aed5a8f324aad8df43d827d0d7e1fd5b6b66fc77ac00f0c6379131825e7b4d7d12ebe92d3fb385cf3027b20e4a6c9a5108dfa745cf50c420ee7c6aa764dd
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
## IndexHtml
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/index_html.svg)](http://badge.fury.io/rb/index_html)
|
4
4
|
|
5
|
-
|
5
|
+
Quickly generate the index.html files based on your simple criteria.
|
6
|
+
|
7
|
+
### Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
8
10
|
|
@@ -16,7 +18,7 @@ Or install it yourself as:
|
|
16
18
|
|
17
19
|
$ gem install index_html
|
18
20
|
|
19
|
-
|
21
|
+
### Usage
|
20
22
|
|
21
23
|
Say you have lots of ebook files (pdf, epub, or mobi) and you have properly named them
|
22
24
|
with something like [ebook_renamer](https://rubygems.org/gems/ebook_renamer).
|
@@ -29,9 +31,12 @@ gem install index_html
|
|
29
31
|
cd ~/Dropbox/ebooks/
|
30
32
|
index_html generate --base-dir . \
|
31
33
|
--exts epub pdf mobi \
|
32
|
-
--inc-words android
|
34
|
+
--inc-words android \
|
35
|
+
--recursive
|
33
36
|
```
|
34
|
-
|
37
|
+
|
38
|
+
### Help/Usage:
|
39
|
+
|
35
40
|
Just type `index_html` without any options to see the list of help
|
36
41
|
|
37
42
|
```
|
@@ -60,7 +65,7 @@ Generate the index.html base on simple criteria
|
|
60
65
|
|
61
66
|
This will generate the file `index.html` that you can open from your favourite browser.
|
62
67
|
|
63
|
-
|
68
|
+
### Sample output
|
64
69
|
|
65
70
|
- Sample list of files from a given directory
|
66
71
|
|
@@ -114,7 +119,17 @@ The output file `index.html` should be something like
|
|
114
119
|
</html>
|
115
120
|
```
|
116
121
|
|
117
|
-
|
122
|
+
### Changelogs
|
123
|
+
|
124
|
+
#### 0.0.3
|
125
|
+
|
126
|
+
- Remove the code duplication by using the shared_option from code_lister gem
|
127
|
+
|
128
|
+
#### 0.0.2
|
129
|
+
|
130
|
+
- Initial release
|
131
|
+
|
132
|
+
### Contributing
|
118
133
|
|
119
134
|
1. Fork it
|
120
135
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/index_html.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "code_lister", "~> 0.0.
|
21
|
+
spec.add_runtime_dependency "code_lister", "~> 0.0.5"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
spec.add_development_dependency "rspec", "~> 2.14"
|
data/lib/index_html/cli.rb
CHANGED
@@ -2,49 +2,10 @@ require 'thor'
|
|
2
2
|
require_relative '../index_html'
|
3
3
|
|
4
4
|
module IndexHtml
|
5
|
-
#TODO: this should be re-use from the 'CodeLister' module
|
6
|
-
class BaseCLI < Thor
|
7
|
-
def self.shared_options
|
8
5
|
|
9
|
-
|
10
|
-
aliases: "-b",
|
11
|
-
desc: "Base directory",
|
12
|
-
default: Dir.pwd
|
13
|
-
|
14
|
-
method_option :exts,
|
15
|
-
aliases: "-e",
|
16
|
-
desc: "List of extensions to search for",
|
17
|
-
type: :array,
|
18
|
-
default: []
|
19
|
-
|
20
|
-
method_option :inc_words,
|
21
|
-
aliases: "-n",
|
22
|
-
desc: "List of words to be included in the result if any",
|
23
|
-
type: :array,
|
24
|
-
default: []
|
25
|
-
|
26
|
-
method_option :exc_words,
|
27
|
-
aliases: "-x",
|
28
|
-
desc: "List of words to be excluded from the result if any",
|
29
|
-
type: :array,
|
30
|
-
default: []
|
31
|
-
|
32
|
-
method_option :ignore_case,
|
33
|
-
aliases: "-i",
|
34
|
-
desc: "Match case insensitively",
|
35
|
-
type: :boolean,
|
36
|
-
default: true
|
37
|
-
|
38
|
-
method_option :recursive,
|
39
|
-
aliases: "-r",
|
40
|
-
desc: "Search for files recursively",
|
41
|
-
type: :boolean,
|
42
|
-
default: true
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class CLI < IndexHtml::BaseCLI
|
6
|
+
class CLI < CodeLister::BaseCLI
|
47
7
|
desc 'generate', 'Generate the index.html base on simple criteria'
|
8
|
+
|
48
9
|
shared_options
|
49
10
|
|
50
11
|
method_option :prefix,
|
@@ -64,12 +25,6 @@ module IndexHtml
|
|
64
25
|
type: :string,
|
65
26
|
default: "index.html"
|
66
27
|
|
67
|
-
method_option :version,
|
68
|
-
aliases: "-v",
|
69
|
-
desc: "Display version information",
|
70
|
-
type: :boolean,
|
71
|
-
default: false
|
72
|
-
|
73
28
|
def generate
|
74
29
|
if options[:version]
|
75
30
|
puts "You are using IndexHtml Version #{IndexHtml::VERSION}"
|
data/lib/index_html/version.rb
CHANGED
data/lib/index_html.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: index_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|