feedcellar 0.4.0 → 0.4.1
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/.travis.yml +1 -0
- data/{license/lgpl-2.1.txt → LICENSE.txt} +0 -0
- data/NEWS.md +12 -0
- data/README.md +3 -12
- data/Rakefile +18 -0
- data/bin/feedcellar +18 -0
- data/bin/feedcellar-clear-cache +18 -0
- data/config.ru +18 -0
- data/feedcellar.gemspec +21 -0
- data/lib/feedcellar.rb +18 -0
- data/lib/feedcellar/command.rb +18 -0
- data/lib/feedcellar/curses_view.rb +18 -0
- data/lib/feedcellar/feed.rb +18 -0
- data/lib/feedcellar/groonga_database.rb +20 -2
- data/lib/feedcellar/groonga_searcher.rb +18 -0
- data/lib/feedcellar/opml.rb +18 -0
- data/lib/feedcellar/resource.rb +18 -0
- data/lib/feedcellar/tree_view.rb +2 -0
- data/lib/feedcellar/version.rb +19 -1
- data/lib/feedcellar/views/index.haml +6 -3
- data/lib/feedcellar/web.rb +46 -3
- data/lib/feedcellar/window.rb +2 -0
- data/test/run-test.rb +18 -0
- data/test/test-command.rb +18 -0
- data/test/test-curses_view.rb +18 -0
- data/test/test-opml.rb +18 -0
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcfa9e77897b4d4d13dfb10c1d9f790c81a7af69
|
4
|
+
data.tar.gz: 8cca83a201985ae667e952db218b905b90aae003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e20797bb035fd7047da253b321c58d3b384b6e5e6bf13517eab8c175dc8451a5ae5bbcd8a47c09fa55aa3d475f0395b0c732284134aa8e97a2f3252b8f0c20
|
7
|
+
data.tar.gz: 5709b3c2cba9482a236d2360158f1dd1a039fa22749289fb059fb1b610f1a18be5187c717aaa4e30f28bacca41fb1eb7e3b845364007bcef0bc82f2ed0b349f2
|
data/.travis.yml
CHANGED
File without changes
|
data/NEWS.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# NEWS
|
2
2
|
|
3
|
+
## 0.4.1: 2015-04-04
|
4
|
+
|
5
|
+
Support to paginate!
|
6
|
+
|
7
|
+
### Changes
|
8
|
+
|
9
|
+
* Improvements
|
10
|
+
* web: Added /register.opml root.
|
11
|
+
* web: Added %p to the feed list.
|
12
|
+
* Use Padrino::Helpers.
|
13
|
+
* Introduced to paginate.
|
14
|
+
|
3
15
|
## 0.4.0: 2014-08-29
|
4
16
|
|
5
17
|
Browser and GUI support!
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# feedcellar - a feed reader
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/feedcellar)
|
3
4
|
[](http://travis-ci.org/myokoym/feedcellar)
|
4
5
|
|
5
6
|
Feedcellar is a full-text searchable RSS feed reader and data store.
|
@@ -12,16 +13,6 @@ Powered by [Groonga][] (via [Rroonga][]) with [Ruby][].
|
|
12
13
|
|
13
14
|
## Installation
|
14
15
|
|
15
|
-
Add this line to your application's Gemfile:
|
16
|
-
|
17
|
-
gem 'feedcellar'
|
18
|
-
|
19
|
-
And then execute:
|
20
|
-
|
21
|
-
$ bundle
|
22
|
-
|
23
|
-
Or install it yourself as:
|
24
|
-
|
25
16
|
$ gem install feedcellar
|
26
17
|
|
27
18
|
## Usage
|
@@ -52,7 +43,7 @@ Or install it yourself as:
|
|
52
43
|
|
53
44
|
### Word search from titles and descriptions
|
54
45
|
|
55
|
-
$ feedcellar search
|
46
|
+
$ feedcellar search WORD1 [WORD2...]
|
56
47
|
|
57
48
|
### Show feeds in a web browser
|
58
49
|
|
@@ -92,7 +83,7 @@ Copyright (c) 2013-2014 Masafumi Yokoyama `<myokoym@gmail.com>`
|
|
92
83
|
|
93
84
|
LGPLv2.1 or later.
|
94
85
|
|
95
|
-
See '
|
86
|
+
See 'LICENSE.txt' or 'http://www.gnu.org/licenses/lgpl-2.1' for details.
|
96
87
|
|
97
88
|
## Contributing
|
98
89
|
|
data/Rakefile
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# Rakefile
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "bundler/gem_tasks"
|
2
20
|
|
3
21
|
desc "Run test"
|
data/bin/feedcellar
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# executable: feedcellar
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2
20
|
|
3
21
|
require "feedcellar/command"
|
4
22
|
|
data/bin/feedcellar-clear-cache
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# executable: feedcellar-clear-cache
|
4
|
+
#
|
5
|
+
# Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2
20
|
|
3
21
|
require "racknga"
|
4
22
|
require "racknga/cache_database"
|
data/config.ru
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# config.ru
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
base_dir = File.expand_path(File.dirname(__FILE__))
|
2
20
|
lib_dir = File.join(base_dir, "lib")
|
3
21
|
$LOAD_PATH.unshift(lib_dir)
|
data/feedcellar.gemspec
CHANGED
@@ -1,4 +1,23 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
#
|
3
|
+
# feedcellar.gemspec
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
+
|
2
21
|
lib = File.expand_path('../lib', __FILE__)
|
3
22
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
23
|
require 'feedcellar/version'
|
@@ -22,6 +41,8 @@ Gem::Specification.new do |spec|
|
|
22
41
|
spec.add_runtime_dependency("thor")
|
23
42
|
#spec.add_runtime_dependency("gtk2")
|
24
43
|
spec.add_runtime_dependency("sinatra")
|
44
|
+
spec.add_runtime_dependency("padrino-helpers")
|
45
|
+
spec.add_runtime_dependency("kaminari")
|
25
46
|
spec.add_runtime_dependency("haml")
|
26
47
|
spec.add_runtime_dependency("launchy")
|
27
48
|
spec.add_runtime_dependency("racknga")
|
data/lib/feedcellar.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# modlue Feedcellar
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "feedcellar/version"
|
2
20
|
require "feedcellar/groonga_database"
|
3
21
|
require "feedcellar/opml"
|
data/lib/feedcellar/command.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::Command
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "thor"
|
2
20
|
require "feedcellar/version"
|
3
21
|
require "feedcellar/groonga_database"
|
@@ -1,3 +1,21 @@
|
|
1
|
+
# module Feedcellar::CursesView
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "curses"
|
2
20
|
|
3
21
|
module Feedcellar
|
data/lib/feedcellar/feed.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::Feed
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "rss"
|
2
20
|
|
3
21
|
module Feedcellar
|
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::GroongaDatabase
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "groonga"
|
2
20
|
|
3
21
|
module Feedcellar
|
@@ -113,7 +131,7 @@ module Feedcellar
|
|
113
131
|
|
114
132
|
schema.create_table("Terms",
|
115
133
|
:type => :patricia_trie,
|
116
|
-
:
|
134
|
+
:normalizer => "NormalizerAuto",
|
117
135
|
:default_tokenizer => "TokenBigram") do |table|
|
118
136
|
table.index("Feeds.title")
|
119
137
|
table.index("Feeds.description")
|
@@ -166,7 +184,7 @@ module Feedcellar
|
|
166
184
|
|
167
185
|
schema.create_table("Terms",
|
168
186
|
:type => :patricia_trie,
|
169
|
-
:
|
187
|
+
:normalizer => "NormalizerAuto",
|
170
188
|
:default_tokenizer => "TokenBigram") do |table|
|
171
189
|
table.index("Feeds.title")
|
172
190
|
table.index("Feeds.description")
|
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::GroongaSearcher
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
module Feedcellar
|
2
20
|
class GroongaSearcher
|
3
21
|
class << self
|
data/lib/feedcellar/opml.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::Opml
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "rexml/document"
|
2
20
|
|
3
21
|
module Feedcellar
|
data/lib/feedcellar/resource.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class Feedcellar::Resource
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "rss"
|
2
20
|
|
3
21
|
module Feedcellar
|
data/lib/feedcellar/tree_view.rb
CHANGED
data/lib/feedcellar/version.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# constant Feedcellar::VERSION
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
module Feedcellar
|
2
|
-
VERSION = "0.4.
|
20
|
+
VERSION = "0.4.1"
|
3
21
|
end
|
@@ -6,8 +6,11 @@
|
|
6
6
|
- if @feeds
|
7
7
|
%p
|
8
8
|
- grouping(@feeds).each do |resource|
|
9
|
-
=
|
9
|
+
= link_to(drilled_label(resource), drilled_url(resource))
|
10
|
+
= paginate(@paginated_feeds)
|
10
11
|
%ul
|
11
|
-
- @
|
12
|
+
- @paginated_feeds.each do |feed|
|
12
13
|
%li
|
13
|
-
%
|
14
|
+
%p
|
15
|
+
= link_to("#{feed.title} - #{feed.resource.title}", feed.link)
|
16
|
+
= paginate(@paginated_feeds)
|
data/lib/feedcellar/web.rb
CHANGED
@@ -1,9 +1,31 @@
|
|
1
|
+
# class Feedcellar::Web
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2015 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "sinatra/base"
|
2
20
|
require "haml"
|
21
|
+
require "padrino-helpers"
|
22
|
+
require "kaminari/sinatra"
|
3
23
|
require "feedcellar/command"
|
4
24
|
|
5
25
|
module Feedcellar
|
6
26
|
class Web < Sinatra::Base
|
27
|
+
helpers Kaminari::Helpers::SinatraHelpers
|
28
|
+
|
7
29
|
get "/" do
|
8
30
|
haml :index
|
9
31
|
end
|
@@ -17,9 +39,23 @@ module Feedcellar
|
|
17
39
|
options ||= {}
|
18
40
|
options[:resource_id] = params[:resource_id] if params[:resource_id]
|
19
41
|
@feeds = search(words, options)
|
42
|
+
if @feeds
|
43
|
+
page = params[:page]
|
44
|
+
n_per_page = options[:n_per_page] || 50
|
45
|
+
@paginated_feeds = pagenate_feeds(@feeds, page, n_per_page)
|
46
|
+
end
|
20
47
|
haml :index
|
21
48
|
end
|
22
49
|
|
50
|
+
get "/registers.opml" do
|
51
|
+
content_type :xml
|
52
|
+
opml = nil
|
53
|
+
GroongaDatabase.new.open(Command.new.database_dir) do |database|
|
54
|
+
opml = Opml.build(database.resources.records)
|
55
|
+
end
|
56
|
+
opml
|
57
|
+
end
|
58
|
+
|
23
59
|
helpers do
|
24
60
|
def search(words, options={})
|
25
61
|
database = GroongaDatabase.new
|
@@ -27,14 +63,21 @@ module Feedcellar
|
|
27
63
|
GroongaSearcher.search(database, words, options)
|
28
64
|
end
|
29
65
|
|
66
|
+
def pagenate_feeds(feeds, page, n_per_page)
|
67
|
+
Kaminari.paginate_array(feeds.to_a).page(page).per(n_per_page)
|
68
|
+
end
|
69
|
+
|
30
70
|
def grouping(table)
|
31
71
|
key = "resource"
|
32
72
|
table.group(key).sort_by {|item| item.n_sub_records }.reverse
|
33
73
|
end
|
34
74
|
|
35
|
-
def
|
36
|
-
|
37
|
-
|
75
|
+
def drilled_url(resource)
|
76
|
+
url("/search?resource_id=#{resource._id}&word=#{params[:word]}")
|
77
|
+
end
|
78
|
+
|
79
|
+
def drilled_label(resource)
|
80
|
+
"#{resource.title} (#{resource.n_sub_records})"
|
38
81
|
end
|
39
82
|
|
40
83
|
def groonga_version
|
data/lib/feedcellar/window.rb
CHANGED
data/test/run-test.rb
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# run-test.rb
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2
20
|
|
3
21
|
require "test-unit"
|
4
22
|
require "test/unit/notify"
|
data/test/test-command.rb
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# class CommandTest
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
6
|
+
#
|
7
|
+
# This library is free software; you can redistribute it and/or
|
8
|
+
# modify it under the terms of the GNU Lesser General Public
|
9
|
+
# License as published by the Free Software Foundation; either
|
10
|
+
# version 2.1 of the License, or (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
+
# Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public
|
18
|
+
# License along with this library; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2
20
|
|
3
21
|
require "fileutils"
|
4
22
|
require "stringio"
|
data/test/test-curses_view.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class CursesViewTest
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "feedcellar/curses_view"
|
2
20
|
|
3
21
|
class CursesViewTest < Test::Unit::TestCase
|
data/test/test-opml.rb
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# class OpmlTest
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
1
19
|
require "feedcellar/opml"
|
2
20
|
|
3
21
|
class OpmlTest < Test::Unit::TestCase
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedcellar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rroonga
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: padrino-helpers
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: kaminari
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: haml
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,6 +205,7 @@ files:
|
|
177
205
|
- ".gitignore"
|
178
206
|
- ".travis.yml"
|
179
207
|
- Gemfile
|
208
|
+
- LICENSE.txt
|
180
209
|
- NEWS.md
|
181
210
|
- README.md
|
182
211
|
- Rakefile
|
@@ -198,7 +227,6 @@ files:
|
|
198
227
|
- lib/feedcellar/views/layout.haml
|
199
228
|
- lib/feedcellar/web.rb
|
200
229
|
- lib/feedcellar/window.rb
|
201
|
-
- license/lgpl-2.1.txt
|
202
230
|
- test/fixtures/subscriptions.xml
|
203
231
|
- test/run-test.rb
|
204
232
|
- test/test-command.rb
|