drumknott 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +2 -0
- data/drumknott.gemspec +1 -1
- data/lib/drumknott.rb +1 -0
- data/lib/drumknott/outputs.rb +6 -0
- data/lib/drumknott/outputs/progress_bar.rb +10 -0
- data/lib/drumknott/outputs/silent.rb +17 -0
- data/lib/drumknott/refresh.rb +15 -2
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9339ecbc7b7de3bd690f0dea5bbe9d8121c16356
|
4
|
+
data.tar.gz: 0c960ae61a94806b72be20e57a73a95b9e820f7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e275414f772076a8c6fb694992fd87ab9f01768175ab30eb078d4ca44f1246effb1e063eb187a6e86eae0bf7c1c06caed9e1636beaae53b96c8726f4369ee61
|
7
|
+
data.tar.gz: 1b44931fc983e83dcb0ce25220ea7d79022a1cff341b42a0e3284711dfd24ad0157c90d506b16773cfc9a014e87b7c57de292368d4c9d016094f5a2ade068df5
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -17,6 +17,8 @@ The `keys` command will save your credentials to a `.drumknott` file in your sit
|
|
17
17
|
|
18
18
|
By default, both posts and normal pages will be uploaded to Drumknott. If you only wish to include posts, the INCLUDE_PAGES argument in the `keys` command should be `'no'`. This can also be managed via the `DRUMKNOTT_PAGES` environment variable.
|
19
19
|
|
20
|
+
You can have visual output of the refresh if you also include the `ruby-progressbar` gem in your Gemfile (or, if you're not using a Gemfile, just have that gem installed). However, if you prefer quiet even though the gem's installed, set the `DRUMKNOTT_SILENT` environment variable to be `'true'`.
|
21
|
+
|
20
22
|
## Development
|
21
23
|
|
22
24
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/drumknott.gemspec
CHANGED
data/lib/drumknott.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
class Drumknott::Outputs::Silent
|
2
|
+
def self.call(&block)
|
3
|
+
new(&block).call
|
4
|
+
end
|
5
|
+
|
6
|
+
def initialize(&block)
|
7
|
+
@block = block
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(label, collection)
|
11
|
+
collection.each { |item| block.call item }
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
attr_reader :block
|
17
|
+
end
|
data/lib/drumknott/refresh.rb
CHANGED
@@ -38,13 +38,26 @@ class Drumknott::Refresh
|
|
38
38
|
@include_pages
|
39
39
|
end
|
40
40
|
|
41
|
+
def output
|
42
|
+
@output ||= output_class.new { |document| update_document document }
|
43
|
+
end
|
44
|
+
|
45
|
+
def output_class
|
46
|
+
return Drumknott::Outputs::Silent if ENV['DRUMKNOTT_SILENT']
|
47
|
+
|
48
|
+
require 'ruby-progressbar'
|
49
|
+
Drumknott::Outputs::ProgressBar
|
50
|
+
rescue LoadError
|
51
|
+
Drumknott::Outputs::Silent
|
52
|
+
end
|
53
|
+
|
41
54
|
def site
|
42
55
|
@site ||= Jekyll::Site.new Jekyll.configuration
|
43
56
|
end
|
44
57
|
|
45
58
|
def update
|
46
|
-
site.posts.docs
|
47
|
-
site.pages
|
59
|
+
output.call "Posts", site.posts.docs
|
60
|
+
output.call "Pages", site.pages if include_pages?
|
48
61
|
end
|
49
62
|
|
50
63
|
def update_document(document)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drumknott
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -103,6 +103,9 @@ files:
|
|
103
103
|
- lib/drumknott/cli.rb
|
104
104
|
- lib/drumknott/include_pages.rb
|
105
105
|
- lib/drumknott/keys.rb
|
106
|
+
- lib/drumknott/outputs.rb
|
107
|
+
- lib/drumknott/outputs/progress_bar.rb
|
108
|
+
- lib/drumknott/outputs/silent.rb
|
106
109
|
- lib/drumknott/refresh.rb
|
107
110
|
homepage: https://github.com/pat/drumknott
|
108
111
|
licenses:
|
@@ -124,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
127
|
version: '0'
|
125
128
|
requirements: []
|
126
129
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.5.1
|
128
131
|
signing_key:
|
129
132
|
specification_version: 4
|
130
133
|
summary: Jekyll content uploader for Drumknott's search service.
|