honyomi 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +52 -2
- data/README.md +79 -15
- data/honyomi.gemspec +1 -1
- data/lib/honyomi/core.rb +1 -0
- data/lib/honyomi/version.rb +1 -1
- data/test/test_core.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0fc29dda3c181cc991c437254f46cb47ba8091a
|
4
|
+
data.tar.gz: 40d5b7c7530c3615cf984e349826db49506c1a6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df09ae027f1726e161b277f69bba69b70903b26f5ddf079d7fbffc4916a0d20316f28b213dac9585732120d1de2aceb583d48567832d1ef09eecba6238cbecca
|
7
|
+
data.tar.gz: 96fdbdf7e039739af1a8049ebfd56de4e47cb9be93b811ea72219eb11aebcfd7451a8f7bffb0b0c56db8d0977403e9c2b6b10ef28cf792c83033aad344f6dca3
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
=================
|
2
|
+
Honyomi
|
3
|
+
=================
|
2
4
|
|
3
|
-
|
5
|
+
Copyright (c) 2014 ongaeshi
|
4
6
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
8
|
a copy of this software and associated documentation files (the
|
@@ -20,3 +22,51 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
22
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
23
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
24
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
|
26
|
+
=================
|
27
|
+
Bootstrap
|
28
|
+
=================
|
29
|
+
|
30
|
+
Copyright (c) 2011-2014 Twitter, Inc
|
31
|
+
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
34
|
+
in the Software without restriction, including without limitation the rights
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
37
|
+
furnished to do so, subject to the following conditions:
|
38
|
+
|
39
|
+
The above copyright notice and this permission notice shall be included in
|
40
|
+
all copies or substantial portions of the Software.
|
41
|
+
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
48
|
+
THE SOFTWARE.
|
49
|
+
|
50
|
+
=================
|
51
|
+
Bootswatch
|
52
|
+
=================
|
53
|
+
|
54
|
+
Copyright (c) 2013 Thomas Park
|
55
|
+
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
57
|
+
of this software and associated documentation files (the "Software"), to deal
|
58
|
+
in the Software without restriction, including without limitation the rights
|
59
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
60
|
+
copies of the Software, and to permit persons to whom the Software is
|
61
|
+
furnished to do so, subject to the following conditions:
|
62
|
+
|
63
|
+
The above copyright notice and this permission notice shall be included in
|
64
|
+
all copies or substantial portions of the Software.
|
65
|
+
|
66
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
67
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
68
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
69
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
70
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
71
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
72
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,29 +1,93 @@
|
|
1
1
|
# Honyomi
|
2
2
|
|
3
|
-
|
3
|
+
Honyomi is ebook (pdf) search engine written by Ruby. It have command line interface and web application. It will accelerate the ebook of your life.
|
4
4
|
|
5
|
-
|
5
|
+
Honyomi is "本読み". "Read a book" is meaning.
|
6
6
|
|
7
|
-
|
7
|
+
[Milkode](https://github.com/ongaeshi/milkode) are brothers.
|
8
8
|
|
9
|
-
|
9
|
+
![honyomi-01.png](images/honyomi-01.png)
|
10
10
|
|
11
|
-
|
11
|
+
## Installation
|
12
12
|
|
13
|
-
$
|
13
|
+
$ gem install honyomi
|
14
14
|
|
15
|
-
|
15
|
+
When you faild to install Rroonga, Please refer.
|
16
|
+
* [File: install — rroonga - Ranguba](http://ranguba.org/rroonga/en/file.install.html)
|
16
17
|
|
17
|
-
|
18
|
+
And need external tools.
|
19
|
+
* pdftotext - For reading pdf (poppler, xpdf)
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
### Create a database
|
24
|
+
|
25
|
+
```
|
26
|
+
$ honyomi init
|
27
|
+
Create database to "/home/username/.honyomi/db/honyomi.db"
|
28
|
+
```
|
29
|
+
|
30
|
+
Specify database dir. (Commands as well as other)
|
31
|
+
|
32
|
+
```
|
33
|
+
$ HONYOMI_DATABASE_DIR=/path/to/dir honyomi init
|
34
|
+
Create database to "/path/to/dir/db/honyomi.db"
|
35
|
+
```
|
36
|
+
|
37
|
+
### Add book
|
38
|
+
|
39
|
+
```
|
40
|
+
$ honyomi add /path/to/this_is_book.pdf
|
41
|
+
A 1 this_is_book (10 pages)
|
42
|
+
```
|
43
|
+
|
44
|
+
### Edit book
|
45
|
+
|
46
|
+
Change title. Specify book id.
|
47
|
+
|
48
|
+
```
|
49
|
+
$ honyomi edit 1 -t "This is Book"
|
50
|
+
id: 1
|
51
|
+
title: This is Book
|
52
|
+
path: /path/to/this_is_book.pdf
|
53
|
+
pages: 10
|
54
|
+
timestamp: 2013-01-01 00:00:00
|
55
|
+
```
|
56
|
+
|
57
|
+
### List books
|
58
|
+
|
59
|
+
```
|
60
|
+
$ honyomi list
|
61
|
+
1 This is Book (10 pages)
|
62
|
+
2 That is Book (20 pages)
|
63
|
+
```
|
64
|
+
|
65
|
+
Show detail. Specify book id.
|
66
|
+
|
67
|
+
```
|
68
|
+
$ honyomi list 1
|
69
|
+
id: 1
|
70
|
+
title: This is Book
|
71
|
+
path: /path/to/this_is_book.pdf
|
72
|
+
pages: 10
|
73
|
+
timestamp: 2013-01-01 00:00:00
|
74
|
+
```
|
75
|
+
|
76
|
+
### Search command line
|
77
|
+
|
78
|
+
```
|
79
|
+
$ honyomi search bbb
|
80
|
+
1 matches
|
81
|
+
--- This is Book (5 page) ---
|
82
|
+
aaa <<bbb>> ccc
|
83
|
+
```
|
84
|
+
|
85
|
+
### Web application
|
86
|
+
|
87
|
+
```
|
88
|
+
$ honyomi web
|
89
|
+
```
|
90
|
+
|
91
|
+
![honyomi-03.gif](images/honyomi-03.gif)
|
22
92
|
|
23
|
-
## Contributing
|
24
93
|
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
data/honyomi.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files`.split($/).find_all {|f| f !~ /\Aimages\// }
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
data/lib/honyomi/core.rb
CHANGED
data/lib/honyomi/version.rb
CHANGED
data/test/test_core.rb
CHANGED
@@ -21,6 +21,21 @@ module Honyomi
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def test_add_by_relative_path
|
25
|
+
Dir.mktmpdir do |dir|
|
26
|
+
core = Core.new({home_dir: dir})
|
27
|
+
core.init_database
|
28
|
+
|
29
|
+
absolute_path = File.expand_path(datafile("test.pdf"))
|
30
|
+
relative_path = Pathname.new(datafile("test.pdf")).relative_path_from(Pathname.new(Dir.getwd)).to_s
|
31
|
+
assert absolute_path != relative_path
|
32
|
+
|
33
|
+
core.add(relative_path)
|
34
|
+
|
35
|
+
assert_equal absolute_path, core.database.books[1].path
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
24
39
|
def test_add_same_name
|
25
40
|
Dir.mktmpdir do |dir|
|
26
41
|
core = Core.new({home_dir: dir})
|
@@ -158,7 +173,7 @@ module Honyomi
|
|
158
173
|
private
|
159
174
|
|
160
175
|
def datafile(path)
|
161
|
-
File.join(File.dirname(__FILE__), path)
|
176
|
+
File.expand_path(File.join(File.dirname(__FILE__), path))
|
162
177
|
end
|
163
178
|
|
164
179
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honyomi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ongaeshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grn_mini
|