index_html 0.0.2 → 0.0.3

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: 2d68b84941c8ca51f4c7b7715ea05f1d6ac8abdd
4
- data.tar.gz: f05c48927f488b3169b24af1a67e83c04e5e235a
3
+ metadata.gz: 4ee2bdfbf9791893c926b1b3ef1903c9585fad61
4
+ data.tar.gz: a4d2ea882d162a6b5f3e9b97013d83168dfa6070
5
5
  SHA512:
6
- metadata.gz: 96f3de95fbbe36d95fd79a31815ca614f4b45658e8e9ad66f416da0c78ba96316bdbc7fc67803c4320112f7860acd601f5edf54f1a0e333557a5a517269d3025
7
- data.tar.gz: 63d08c59b063e5f61833a58c25edfbbed2a67b3b7fc7172f4f4fe6d57ebfe3c2ac8a537a98639e3f13d4c4a6d44a7db1c6fa5becaef105b6b5de18d5a52ebd6f
6
+ metadata.gz: f7885ca65b0582debbdd7d6b76d95f78133372c0a31aa83044b26ea35ca3a010713eead94a7493477c2509c1fda2bfc082cea53e9ebeb6ba8321a51a9283f31f
7
+ data.tar.gz: 2113aed5a8f324aad8df43d827d0d7e1fd5b6b66fc77ac00f0c6379131825e7b4d7d12ebe92d3fb385cf3027b20e4a6c9a5108dfa745cf50c420ee7c6aa764dd
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in file_indexer.gemspec
4
4
  gemspec
5
5
 
6
- gem 'code_lister', "~> 0.0.4"
6
+ gem 'code_lister', "~> 0.0.5"
7
7
  gem 'gem-ctags'
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
- # IndexHtml
1
+ ## IndexHtml
2
2
 
3
- Quickly generate the index.html files based on your select criteria.
3
+ [![Gem Version](https://badge.fury.io/rb/index_html.svg)](http://badge.fury.io/rb/index_html)
4
4
 
5
- ## Installation
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
- ## Usage
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
- ## Help/Usage:
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
- ## Sample output
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
- ## Contributing
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.4"
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"
@@ -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
- method_option :base_dir,
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}"
@@ -1,3 +1,3 @@
1
1
  module IndexHtml
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/index_html.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'uri'
2
+ require 'code_lister'
2
3
  require_relative "./index_html/version"
3
4
  require_relative "./index_html/cli"
4
5
  require_relative "./index_html/main"
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.2
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.4
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.4
26
+ version: 0.0.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement