everlog 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/README.md +2 -1
- data/lib/everlog/app/daily.rb +19 -0
- data/lib/everlog/app.rb +1 -13
- data/lib/everlog/dom/entity/aggregate/dailyReport.rb +46 -0
- data/lib/everlog/dom/entity/content.erb +22 -1
- data/lib/everlog/dom/entity.rb +1 -0
- data/lib/everlog/{app → dom/module}/animetick.rb +1 -1
- data/lib/everlog/{app → dom/module}/evernote.rb +2 -2
- data/lib/everlog/dom/module/github.rb +11 -5
- data/lib/everlog/{app → dom/module}/hatena.rb +1 -1
- data/lib/everlog/dom/module/moves.rb +13 -5
- data/lib/everlog/{app → dom/module}/twitter.rb +1 -2
- data/lib/everlog/{app → dom/module}/weather.rb +1 -1
- data/lib/everlog/dom/module.rb +5 -0
- data/lib/everlog/dom/value/footer.rb +13 -0
- data/lib/everlog/dom/value.rb +1 -0
- data/lib/everlog/inf/api/evernote.rb +8 -0
- data/lib/everlog/inf/api/github.rb +6 -4
- data/lib/everlog/inf/api/googlemap.rb +4 -2
- data/lib/everlog/inf/api/hatena.rb +4 -2
- data/lib/everlog/inf/api/moves.rb +6 -4
- data/lib/everlog/inf/api/twitter.rb +6 -4
- data/lib/everlog/version.rb +1 -1
- data/lib/everlog.rb +0 -39
- data/spec/lifelog/{app → dom/module}/animetick_spec.rb +1 -1
- data/spec/lifelog/{app → dom/module}/evernote_spec.rb +2 -4
- data/spec/lifelog/dom/module/github_spec.rb +19 -0
- data/spec/lifelog/{app → dom/module}/hatena_spec.rb +1 -1
- data/spec/lifelog/dom/module/moves_spec.rb +6 -0
- data/spec/lifelog/{app → dom/module}/twitter_spec.rb +1 -1
- data/spec/lifelog/{app → dom/module}/weather_spec.rb +1 -1
- data/spec/lifelog/dom/value/footer_spec.rb +10 -0
- data/spec/lifelog/inf/api/evernote_spec.rb +1 -1
- data/spec/lifelog/inf/api/hatena_spec.rb +0 -5
- metadata +22 -23
- data/lib/everlog/app/github.rb +0 -9
- data/lib/everlog/app/moves.rb +0 -9
- data/spec/lifelog/app/github_spec.rb +0 -22
- data/spec/lifelog/app/moves_spec.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04a54d53fcd53d7266550b8650a6bc9aca875ed4
|
4
|
+
data.tar.gz: 7fd648b9bf03dbdf7712d0eee5e745c20551b513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6abcfcf65a2bb5953974c5dc0eea1dc9451d2ccc73f00ea1aa38e4883122fc3466ed8523f0ed1953335371f389c5671f6791e43b7587ff6f7863cd10444e094c
|
7
|
+
data.tar.gz: 4a7c5046aa67496e8b7dbc23ee59bc74b671e2c654062a098c625f4f460224cb66055c56c327b39151bcd0d3a695d5ac9d9d66f488614892d176c673438cd2ec
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Everlog
|
2
|
+
automatically post daily log to evernote
|
2
3
|
|
3
|
-
|
4
|
+
![](https://dl.dropboxusercontent.com/u/27113412/img/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202014-04-16%2001.03.21.png)
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Everlog
|
2
|
+
class Daily
|
3
|
+
def initialize
|
4
|
+
@content = Dom::Entity::Aggregate::DailyReport.new
|
5
|
+
end
|
6
|
+
|
7
|
+
def push(service, option = {})
|
8
|
+
@content.push(service, option)
|
9
|
+
end
|
10
|
+
|
11
|
+
def footer phrase
|
12
|
+
@content.footer(phrase)
|
13
|
+
end
|
14
|
+
|
15
|
+
def publish(title, access_token = nil, output = 'local')
|
16
|
+
@content.publish(title, access_token, output)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/everlog/app.rb
CHANGED
@@ -1,15 +1,3 @@
|
|
1
1
|
class Everlog
|
2
|
-
|
3
|
-
require 'everlog/app/twitter'
|
4
|
-
require 'everlog/app/hatena'
|
5
|
-
require 'everlog/app/github'
|
6
|
-
require 'everlog/app/moves'
|
7
|
-
require 'everlog/app/animetick'
|
8
|
-
require 'everlog/app/weather'
|
9
|
-
require 'everlog/app/evernote'
|
10
|
-
|
11
|
-
def self.fetch_since
|
12
|
-
raise 'no implemented.'
|
13
|
-
end
|
14
|
-
end
|
2
|
+
require 'everlog/app/daily'
|
15
3
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class Everlog
|
2
|
+
class Dom::Entity::Aggregate
|
3
|
+
class DailyReport < Dom::Entity
|
4
|
+
def initialize
|
5
|
+
@content = Content.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def push(service, option)
|
9
|
+
setup_config(service.to_sym, option)
|
10
|
+
data = Dom::Module.const_get(service.capitalize).fetch_since((DateTime.now - 1).to_time)
|
11
|
+
@content.push(service, data)
|
12
|
+
ensure
|
13
|
+
Config.clear!
|
14
|
+
end
|
15
|
+
|
16
|
+
def footer phrase
|
17
|
+
@content.push(:footer, Dom::Value::Footer.new(phrase))
|
18
|
+
end
|
19
|
+
|
20
|
+
def publish(title, access_token, output)
|
21
|
+
return @content.render if output == 'local'
|
22
|
+
raise EverlogConfigError, 'evernote access_token not given' if access_token.nil?
|
23
|
+
|
24
|
+
Config.evernote.access_secret = access_token
|
25
|
+
Dom::Module::Evernote.publish(title, @content.render, output)
|
26
|
+
ensure
|
27
|
+
Config.clear!
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
def setup_config(service, option)
|
32
|
+
case service
|
33
|
+
when :weather
|
34
|
+
Config.wunderground.access_token = option[:access_token]
|
35
|
+
else
|
36
|
+
Config.send(service).consumer_key = option[:consumer_key]
|
37
|
+
Config.send(service).consumer_secret = option[:consumer_secret]
|
38
|
+
Config.send(service).access_token = option[:access_token]
|
39
|
+
Config.send(service).access_secret = option[:access_secret]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class EverlogConfigError < StandardError; end
|
46
|
+
end
|
@@ -165,6 +165,27 @@
|
|
165
165
|
<% end %>
|
166
166
|
<% end %>
|
167
167
|
<% end %>
|
168
|
+
|
169
|
+
<% unless @footer.nil?%>
|
170
|
+
<tr><td><div></div></td><td><div></div></td><td><div></div></td><td><div></div></td></tr>
|
171
|
+
<tr>
|
172
|
+
<td></td>
|
173
|
+
<td></td>
|
174
|
+
<td></td>
|
175
|
+
<td></td>
|
176
|
+
</tr>
|
177
|
+
<tr>
|
178
|
+
<td></td>
|
179
|
+
<td></td>
|
180
|
+
<td></td>
|
181
|
+
<td></td>
|
182
|
+
</tr>
|
183
|
+
<tr>
|
184
|
+
<td></td>
|
185
|
+
<td></td>
|
186
|
+
<td style="text-align: right;" colspan="2"><font color="5E5E5E"><%= @footer.phrase %></font></td>
|
187
|
+
</tr>
|
188
|
+
<% end %>
|
168
189
|
</table>
|
169
190
|
|
170
|
-
</en-note>
|
191
|
+
</en-note>
|
data/lib/everlog/dom/entity.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Everlog
|
2
|
-
class
|
3
|
-
def publish(title, content, output)
|
2
|
+
class Dom::Module::Evernote < Dom::Module
|
3
|
+
def self.publish(title, content, output)
|
4
4
|
config = Dom::Entity::Config.evernote
|
5
5
|
is_sandbox = output != 'production'
|
6
6
|
Dom::Repository::Evernote.new(is_sandbox, config).save(title, content)
|
@@ -1,12 +1,11 @@
|
|
1
1
|
class Everlog
|
2
|
-
class Dom::Module::Github
|
3
|
-
|
4
|
-
|
5
|
-
@api_config = api_config
|
2
|
+
class Dom::Module::Github < Dom::Module
|
3
|
+
def initialize config
|
4
|
+
@config = config
|
6
5
|
end
|
7
6
|
|
8
7
|
def api_client
|
9
|
-
@api_client ||= Inf::Api::Github.new(@
|
8
|
+
@api_client ||= Inf::Api::Github.new(@config)
|
10
9
|
end
|
11
10
|
|
12
11
|
def repo_names
|
@@ -24,5 +23,12 @@ class Everlog
|
|
24
23
|
return nil if response.empty?
|
25
24
|
response.map { |r| Dom::Value::Github::Commit.new(r) }.reverse
|
26
25
|
end
|
26
|
+
|
27
|
+
class << self
|
28
|
+
def fetch_since date
|
29
|
+
instance = self.new(Dom::Entity::Config.github)
|
30
|
+
instance.repo_names.map { |r| instance.repo_activity(r, date) }.compact
|
31
|
+
end
|
32
|
+
end
|
27
33
|
end
|
28
34
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class Everlog
|
2
|
-
class Dom::Module::Moves
|
2
|
+
class Dom::Module::Moves < Dom::Module
|
3
3
|
def initialize config
|
4
4
|
@config = config
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
8
|
-
@
|
7
|
+
def api_client
|
8
|
+
@api_client ||= Inf::Api::Moves.new(@config)
|
9
9
|
end
|
10
10
|
|
11
11
|
def storyline
|
12
|
-
|
12
|
+
api_client.daily_storyline.map do |story|
|
13
13
|
case story['type']
|
14
14
|
when 'place'
|
15
15
|
Dom::Value::Moves::Referer::Place.new story
|
@@ -20,7 +20,15 @@ class Everlog
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def summary
|
23
|
-
Dom::Value::Moves::Summary.new(
|
23
|
+
Dom::Value::Moves::Summary.new(api_client.daily_summary)
|
24
|
+
end
|
25
|
+
|
26
|
+
class << self
|
27
|
+
# date対応してない
|
28
|
+
def fetch_since date
|
29
|
+
instance = self.new(Dom::Entity::Config.moves)
|
30
|
+
{ summary: instance.summary, storyline: instance.storyline }
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
data/lib/everlog/dom/module.rb
CHANGED
@@ -2,5 +2,10 @@ class Everlog
|
|
2
2
|
class Dom::Module
|
3
3
|
require 'everlog/dom/module/github'
|
4
4
|
require 'everlog/dom/module/moves'
|
5
|
+
require 'everlog/dom/module/twitter'
|
6
|
+
require 'everlog/dom/module/hatena'
|
7
|
+
require 'everlog/dom/module/animetick'
|
8
|
+
require 'everlog/dom/module/weather'
|
9
|
+
require 'everlog/dom/module/evernote'
|
5
10
|
end
|
6
11
|
end
|
data/lib/everlog/dom/value.rb
CHANGED
@@ -23,15 +23,23 @@ class Everlog
|
|
23
23
|
note.title = title
|
24
24
|
note.content = content
|
25
25
|
client.note_store.createNote(@config.access_secret, note)
|
26
|
+
rescue => e
|
27
|
+
raise InfrastructureEvernoteError, "post note error / class:#{e.class} code:#{e.errorCode}"
|
26
28
|
end
|
27
29
|
|
28
30
|
def create_notebook title
|
29
31
|
notebook.name = title
|
30
32
|
client.note_store.createNotebook notebook
|
33
|
+
rescue => e
|
34
|
+
raise InfrastructureEvernoteError, "create_notebook error / class:#{e.class} code:#{e.errorCode}"
|
31
35
|
end
|
32
36
|
|
33
37
|
def notebooks
|
34
38
|
client.note_store.listNotebooks
|
39
|
+
rescue => e
|
40
|
+
raise InfrastructureEvernoteError, "notebooks error / class:#{e.class} code:#{e.errorCode}"
|
35
41
|
end
|
36
42
|
end
|
43
|
+
|
44
|
+
class InfrastructureEvernoteError < StandardError; end
|
37
45
|
end
|
@@ -8,14 +8,14 @@ class Everlog
|
|
8
8
|
|
9
9
|
def repos
|
10
10
|
client.repositories
|
11
|
-
rescue
|
12
|
-
|
11
|
+
rescue => e
|
12
|
+
raise InfrastructureGithubError, "repos error / #{e.message}"
|
13
13
|
end
|
14
14
|
|
15
15
|
def commits_on(repo, date)
|
16
16
|
client.commits_on("#{client.user.name}/#{repo}", utc_from_jst(date))
|
17
|
-
rescue
|
18
|
-
|
17
|
+
rescue => e
|
18
|
+
raise InfrastructureGithubError, "commits_on error / #{e.message}"
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
@@ -23,4 +23,6 @@ class Everlog
|
|
23
23
|
DateTime.parse("#{date} 00:00:00 JST").to_time.utc
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
class InfrastructureGithubError < StandardError; end
|
26
28
|
end
|
@@ -8,8 +8,10 @@ class Everlog
|
|
8
8
|
|
9
9
|
def screen_name(lat, lon)
|
10
10
|
Geocoder.search("#{lat},#{lon}").first.formatted_address
|
11
|
-
rescue
|
12
|
-
|
11
|
+
rescue => e
|
12
|
+
raise InfrastructureGoogleMapError, "screen_name error / #{e.message}"
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
class InfrastructureGoogleMapError < StandardError; end
|
15
17
|
end
|
@@ -8,14 +8,16 @@ class Everlog
|
|
8
8
|
|
9
9
|
def daily_summary(from = (Date.today - 1), to = Date.today)
|
10
10
|
client.daily_summary(from..to).first['summary']
|
11
|
-
rescue
|
12
|
-
|
11
|
+
rescue => e
|
12
|
+
raise InfrastructureMovesError, "daily_summary error / #{e.message}"
|
13
13
|
end
|
14
14
|
|
15
15
|
def daily_storyline(from = (Date.today - 1), to = Date.today)
|
16
16
|
client.daily_storyline(from..to).first['segments']
|
17
|
-
rescue
|
18
|
-
|
17
|
+
rescue => e
|
18
|
+
raise InfrastructureMovesError, "daily_storyline error / #{e.message}"
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
class InfrastructureMovesError < StandardError; end
|
21
23
|
end
|
@@ -13,14 +13,16 @@ class Everlog
|
|
13
13
|
|
14
14
|
def timeline
|
15
15
|
client.user_timeline(screen_name, { count: 200 })
|
16
|
-
rescue
|
17
|
-
|
16
|
+
rescue => e
|
17
|
+
raise InfrastructureTwitterError, "timeline error / #{e.message}"
|
18
18
|
end
|
19
19
|
|
20
20
|
def screen_name
|
21
21
|
client.user.screen_name
|
22
|
-
rescue
|
23
|
-
|
22
|
+
rescue => e
|
23
|
+
raise InfrastructureTwitterError, "screen_name error / #{e.message}"
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
class InfrastructureTwitterError < StandardError; end
|
26
28
|
end
|
data/lib/everlog/version.rb
CHANGED
data/lib/everlog.rb
CHANGED
@@ -1,42 +1,3 @@
|
|
1
1
|
require 'everlog/inf'
|
2
2
|
require 'everlog/dom'
|
3
3
|
require 'everlog/app'
|
4
|
-
|
5
|
-
class Everlog
|
6
|
-
def initialize
|
7
|
-
@content = Dom::Entity::Content.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def push(service, option = {})
|
11
|
-
setup_config(service.to_sym, option)
|
12
|
-
data = App.const_get(service.capitalize).fetch_since((DateTime.now -1).to_time)
|
13
|
-
@content.push(service, data)
|
14
|
-
ensure
|
15
|
-
Dom::Entity::Config.clear!
|
16
|
-
end
|
17
|
-
|
18
|
-
def publish(title, access_token = nil, output = 'local')
|
19
|
-
return @content.render if output == 'local'
|
20
|
-
raise EverlogConfigError, 'evernote access_token not given' if access_token.nil?
|
21
|
-
|
22
|
-
Dom::Entity::Config.evernote.access_token = access_token
|
23
|
-
Dom::App::Evernote.publish(title, @content.render, output)
|
24
|
-
ensure
|
25
|
-
Dom::Entity::Config.clear!
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
def setup_config(service, option)
|
30
|
-
case service
|
31
|
-
when :weather
|
32
|
-
Dom::Entity::Config.wunderground.access_token = option[:access_token]
|
33
|
-
else
|
34
|
-
Dom::Entity::Config.send(service).consumer_key = option[:consumer_key]
|
35
|
-
Dom::Entity::Config.send(service).consumer_secret = option[:consumer_secret]
|
36
|
-
Dom::Entity::Config.send(service).access_token = option[:access_token]
|
37
|
-
Dom::Entity::Config.send(service).access_secret = option[:access_secret]
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
class EverlogConfigError < StandardError; end
|
42
|
-
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Everlog::
|
4
|
-
let(:instance) { described_class.new }
|
5
|
-
|
3
|
+
describe Everlog::Dom::Module::Evernote do
|
6
4
|
describe '#publish' do
|
7
|
-
subject {
|
5
|
+
subject { described_class.publish('title', 'content', false) }
|
8
6
|
before do
|
9
7
|
Everlog::Dom::Repository::Evernote.any_instance.should_receive(:save).with('title', 'content')
|
10
8
|
end
|
@@ -57,4 +57,23 @@ describe Everlog::Dom::Module::Github do
|
|
57
57
|
it { expect(subject).to be_nil }
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
describe '.fetch_since' do
|
62
|
+
subject { described_class.fetch_since((DateTime.now - 1).to_time) }
|
63
|
+
|
64
|
+
context 'with no repository existing' do
|
65
|
+
before { Everlog::Dom::Module::Github.any_instance.stub(:repo_names).and_return([]) }
|
66
|
+
|
67
|
+
it { expect(subject).to eq [] }
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'with no commit existing in repository' do
|
71
|
+
before do
|
72
|
+
Everlog::Dom::Module::Github.any_instance.stub(:repo_activity).and_return(nil)
|
73
|
+
Everlog::Dom::Module::Github.any_instance.stub(:repo_names).and_return(['Everlog'])
|
74
|
+
end
|
75
|
+
|
76
|
+
it { expect(subject).to eq [] }
|
77
|
+
end
|
78
|
+
end
|
60
79
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Everlog::
|
3
|
+
describe Everlog::Dom::Module::Hatena do
|
4
4
|
describe '.fetch_since' do
|
5
5
|
subject { described_class.fetch_since (DateTime.now - 1).to_time }
|
6
6
|
before { Everlog::Inf::Api::Hatena.any_instance.stub(:feed_entry).and_return(response) }
|
@@ -34,4 +34,10 @@ describe Everlog::Dom::Module::Moves do
|
|
34
34
|
it { expect(subject).to be_instance_of Everlog::Dom::Value::Moves::Summary }
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
describe '.fetch_since' do
|
39
|
+
subject { described_class.fetch_since((DateTime.now - 1).to_time) }
|
40
|
+
it { expect(subject).to have_key :summary }
|
41
|
+
it { expect(subject).to have_key :storyline }
|
42
|
+
end
|
37
43
|
end
|
@@ -37,7 +37,7 @@ EOS
|
|
37
37
|
|
38
38
|
context 'duplicate notebook title' do
|
39
39
|
let(:title) { 'from rspec' }
|
40
|
-
it { expect { subject }.to raise_error ::
|
40
|
+
it { expect { subject }.to raise_error ::Everlog::InfrastructureEvernoteError }
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everlog
|
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
|
- gong023
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evernote_oauth
|
@@ -195,27 +195,28 @@ files:
|
|
195
195
|
- everlog.gemspec
|
196
196
|
- lib/everlog.rb
|
197
197
|
- lib/everlog/app.rb
|
198
|
-
- lib/everlog/app/
|
199
|
-
- lib/everlog/app/evernote.rb
|
200
|
-
- lib/everlog/app/github.rb
|
201
|
-
- lib/everlog/app/hatena.rb
|
202
|
-
- lib/everlog/app/moves.rb
|
203
|
-
- lib/everlog/app/twitter.rb
|
204
|
-
- lib/everlog/app/weather.rb
|
198
|
+
- lib/everlog/app/daily.rb
|
205
199
|
- lib/everlog/dom.rb
|
206
200
|
- lib/everlog/dom/entity.rb
|
201
|
+
- lib/everlog/dom/entity/aggregate/dailyReport.rb
|
207
202
|
- lib/everlog/dom/entity/config.rb
|
208
203
|
- lib/everlog/dom/entity/content.erb
|
209
204
|
- lib/everlog/dom/entity/content.rb
|
210
205
|
- lib/everlog/dom/module.rb
|
206
|
+
- lib/everlog/dom/module/animetick.rb
|
207
|
+
- lib/everlog/dom/module/evernote.rb
|
211
208
|
- lib/everlog/dom/module/github.rb
|
209
|
+
- lib/everlog/dom/module/hatena.rb
|
212
210
|
- lib/everlog/dom/module/moves.rb
|
211
|
+
- lib/everlog/dom/module/twitter.rb
|
212
|
+
- lib/everlog/dom/module/weather.rb
|
213
213
|
- lib/everlog/dom/repository.rb
|
214
214
|
- lib/everlog/dom/repository/evernote.rb
|
215
215
|
- lib/everlog/dom/service.rb
|
216
216
|
- lib/everlog/dom/service/nullobject.rb
|
217
217
|
- lib/everlog/dom/value.rb
|
218
218
|
- lib/everlog/dom/value/animetick.rb
|
219
|
+
- lib/everlog/dom/value/footer.rb
|
219
220
|
- lib/everlog/dom/value/github.rb
|
220
221
|
- lib/everlog/dom/value/github/activity.rb
|
221
222
|
- lib/everlog/dom/value/github/commit.rb
|
@@ -246,20 +247,19 @@ files:
|
|
246
247
|
- spec/fixtures/moves/daily_summary_response.json
|
247
248
|
- spec/fixtures/moves/sample_for_erb.json
|
248
249
|
- spec/fixtures/wunderground/yesterday_response.json
|
249
|
-
- spec/lifelog/app/animetick_spec.rb
|
250
|
-
- spec/lifelog/app/evernote_spec.rb
|
251
|
-
- spec/lifelog/app/github_spec.rb
|
252
|
-
- spec/lifelog/app/hatena_spec.rb
|
253
|
-
- spec/lifelog/app/moves_spec.rb
|
254
|
-
- spec/lifelog/app/twitter_spec.rb
|
255
|
-
- spec/lifelog/app/weather_spec.rb
|
256
250
|
- spec/lifelog/dom/entity/config_spec.rb
|
257
251
|
- spec/lifelog/dom/entity/content_spec.rb
|
252
|
+
- spec/lifelog/dom/module/animetick_spec.rb
|
253
|
+
- spec/lifelog/dom/module/evernote_spec.rb
|
258
254
|
- spec/lifelog/dom/module/github_spec.rb
|
255
|
+
- spec/lifelog/dom/module/hatena_spec.rb
|
259
256
|
- spec/lifelog/dom/module/moves_spec.rb
|
257
|
+
- spec/lifelog/dom/module/twitter_spec.rb
|
258
|
+
- spec/lifelog/dom/module/weather_spec.rb
|
260
259
|
- spec/lifelog/dom/repository/evernote_spec.rb
|
261
260
|
- spec/lifelog/dom/service/nullobject_spec.rb
|
262
261
|
- spec/lifelog/dom/value/animetick_spec.rb
|
262
|
+
- spec/lifelog/dom/value/footer_spec.rb
|
263
263
|
- spec/lifelog/dom/value/github/activity_spec.rb
|
264
264
|
- spec/lifelog/dom/value/github/commit_spec.rb
|
265
265
|
- spec/lifelog/dom/value/hatena_spec.rb
|
@@ -310,20 +310,19 @@ test_files:
|
|
310
310
|
- spec/fixtures/moves/daily_summary_response.json
|
311
311
|
- spec/fixtures/moves/sample_for_erb.json
|
312
312
|
- spec/fixtures/wunderground/yesterday_response.json
|
313
|
-
- spec/lifelog/app/animetick_spec.rb
|
314
|
-
- spec/lifelog/app/evernote_spec.rb
|
315
|
-
- spec/lifelog/app/github_spec.rb
|
316
|
-
- spec/lifelog/app/hatena_spec.rb
|
317
|
-
- spec/lifelog/app/moves_spec.rb
|
318
|
-
- spec/lifelog/app/twitter_spec.rb
|
319
|
-
- spec/lifelog/app/weather_spec.rb
|
320
313
|
- spec/lifelog/dom/entity/config_spec.rb
|
321
314
|
- spec/lifelog/dom/entity/content_spec.rb
|
315
|
+
- spec/lifelog/dom/module/animetick_spec.rb
|
316
|
+
- spec/lifelog/dom/module/evernote_spec.rb
|
322
317
|
- spec/lifelog/dom/module/github_spec.rb
|
318
|
+
- spec/lifelog/dom/module/hatena_spec.rb
|
323
319
|
- spec/lifelog/dom/module/moves_spec.rb
|
320
|
+
- spec/lifelog/dom/module/twitter_spec.rb
|
321
|
+
- spec/lifelog/dom/module/weather_spec.rb
|
324
322
|
- spec/lifelog/dom/repository/evernote_spec.rb
|
325
323
|
- spec/lifelog/dom/service/nullobject_spec.rb
|
326
324
|
- spec/lifelog/dom/value/animetick_spec.rb
|
325
|
+
- spec/lifelog/dom/value/footer_spec.rb
|
327
326
|
- spec/lifelog/dom/value/github/activity_spec.rb
|
328
327
|
- spec/lifelog/dom/value/github/commit_spec.rb
|
329
328
|
- spec/lifelog/dom/value/hatena_spec.rb
|
data/lib/everlog/app/github.rb
DELETED
data/lib/everlog/app/moves.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Everlog::App::Github do
|
4
|
-
describe '#fetch_since' do
|
5
|
-
subject { described_class.fetch_since((DateTime.now - 1).to_time) }
|
6
|
-
|
7
|
-
context 'with no repository existing' do
|
8
|
-
before { Everlog::Dom::Module::Github.any_instance.stub(:repo_names).and_return([]) }
|
9
|
-
|
10
|
-
it { expect(subject).to eq [] }
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'with no commit existing in repository' do
|
14
|
-
before do
|
15
|
-
Everlog::Dom::Module::Github.any_instance.stub(:repo_activity).and_return(nil)
|
16
|
-
Everlog::Dom::Module::Github.any_instance.stub(:repo_names).and_return(['Everlog'])
|
17
|
-
end
|
18
|
-
|
19
|
-
it { expect(subject).to eq [] }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|