everlog 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/everlog/app/daily.rb +19 -0
  4. data/lib/everlog/app.rb +1 -13
  5. data/lib/everlog/dom/entity/aggregate/dailyReport.rb +46 -0
  6. data/lib/everlog/dom/entity/content.erb +22 -1
  7. data/lib/everlog/dom/entity.rb +1 -0
  8. data/lib/everlog/{app → dom/module}/animetick.rb +1 -1
  9. data/lib/everlog/{app → dom/module}/evernote.rb +2 -2
  10. data/lib/everlog/dom/module/github.rb +11 -5
  11. data/lib/everlog/{app → dom/module}/hatena.rb +1 -1
  12. data/lib/everlog/dom/module/moves.rb +13 -5
  13. data/lib/everlog/{app → dom/module}/twitter.rb +1 -2
  14. data/lib/everlog/{app → dom/module}/weather.rb +1 -1
  15. data/lib/everlog/dom/module.rb +5 -0
  16. data/lib/everlog/dom/value/footer.rb +13 -0
  17. data/lib/everlog/dom/value.rb +1 -0
  18. data/lib/everlog/inf/api/evernote.rb +8 -0
  19. data/lib/everlog/inf/api/github.rb +6 -4
  20. data/lib/everlog/inf/api/googlemap.rb +4 -2
  21. data/lib/everlog/inf/api/hatena.rb +4 -2
  22. data/lib/everlog/inf/api/moves.rb +6 -4
  23. data/lib/everlog/inf/api/twitter.rb +6 -4
  24. data/lib/everlog/version.rb +1 -1
  25. data/lib/everlog.rb +0 -39
  26. data/spec/lifelog/{app → dom/module}/animetick_spec.rb +1 -1
  27. data/spec/lifelog/{app → dom/module}/evernote_spec.rb +2 -4
  28. data/spec/lifelog/dom/module/github_spec.rb +19 -0
  29. data/spec/lifelog/{app → dom/module}/hatena_spec.rb +1 -1
  30. data/spec/lifelog/dom/module/moves_spec.rb +6 -0
  31. data/spec/lifelog/{app → dom/module}/twitter_spec.rb +1 -1
  32. data/spec/lifelog/{app → dom/module}/weather_spec.rb +1 -1
  33. data/spec/lifelog/dom/value/footer_spec.rb +10 -0
  34. data/spec/lifelog/inf/api/evernote_spec.rb +1 -1
  35. data/spec/lifelog/inf/api/hatena_spec.rb +0 -5
  36. metadata +22 -23
  37. data/lib/everlog/app/github.rb +0 -9
  38. data/lib/everlog/app/moves.rb +0 -9
  39. data/spec/lifelog/app/github_spec.rb +0 -22
  40. data/spec/lifelog/app/moves_spec.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0917b0218651734025af83c972f25fa6860bdf87
4
- data.tar.gz: 64f9772e5f0a5999dc01dad761dd347c6260dbf3
3
+ metadata.gz: 04a54d53fcd53d7266550b8650a6bc9aca875ed4
4
+ data.tar.gz: 7fd648b9bf03dbdf7712d0eee5e745c20551b513
5
5
  SHA512:
6
- metadata.gz: 9fe192be8b781b85653996f1784a87fffc9587d4c43e7031a41b6f3ef6e025508333cc98f356db0a141b2841c83a5f722ddeefc2ccdf0845228910fbc3f2b4c2
7
- data.tar.gz: 636ff57c7254c4ffa82913d96c5ce231900dbc535e520904ed8c81cf689108f6bb7f3abd6efa774fc681e8ef2e17006e146b75aafe71dcddd719a4bcec4e31e5
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
- TODO: Write a gem description
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
- class App
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>
@@ -2,6 +2,7 @@ class Everlog
2
2
  class Dom::Entity
3
3
  require 'everlog/dom/entity/content'
4
4
  require 'everlog/dom/entity/config'
5
+ require 'everlog/dom/entity/aggregate/dailyreport'
5
6
  attr_reader :id
6
7
 
7
8
  def initialize id = 0
@@ -1,5 +1,5 @@
1
1
  class Everlog
2
- class App::Animetick < App
2
+ class Dom::Module::Animetick < Dom::Module
3
3
  def self.fetch_since date
4
4
  config = Dom::Entity::Config.animetick
5
5
  api_response = Inf::Api::Animetick.new(config).ticket_list
@@ -1,6 +1,6 @@
1
1
  class Everlog
2
- class App::Evernote < App
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
- def initialize api_config
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(@api_config)
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,5 +1,5 @@
1
1
  class Everlog
2
- class App::Hatena < App
2
+ class Dom::Module::Hatena < Dom::Module
3
3
  def self.fetch_since date
4
4
  config = Dom::Entity::Config.hatena
5
5
  api_response = Inf::Api::Hatena.new(config).feed_entry
@@ -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 moves_api
8
- @moves_api ||= Inf::Api::Moves.new(@config)
7
+ def api_client
8
+ @api_client ||= Inf::Api::Moves.new(@config)
9
9
  end
10
10
 
11
11
  def storyline
12
- moves_api.daily_storyline.map do |story|
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(moves_api.daily_summary)
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
@@ -1,6 +1,5 @@
1
1
  class Everlog
2
- class App::Twitter < App
3
-
2
+ class Dom::Module::Twitter < Dom::Module
4
3
  def self.fetch_since date
5
4
  config = Dom::Entity::Config.twitter
6
5
  api_response = Inf::Api::Twitter.new(config).timeline
@@ -1,5 +1,5 @@
1
1
  class Everlog
2
- class App::Weather < App
2
+ class Dom::Module::Weather < Dom::Module
3
3
  def self.fetch_since(date)
4
4
  config = Dom::Entity::Config.wunderground
5
5
  api_response = Inf::Api::Wunderground.new(config).yesterday('Tokyo')
@@ -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
@@ -0,0 +1,13 @@
1
+ class Everlog
2
+ class Dom::Value::Footer < Dom::Value
3
+ include Maybe
4
+
5
+ def initialize phrase
6
+ @phrase = phrase
7
+ end
8
+
9
+ def phrase
10
+ maybe(@phrase).to_s
11
+ end
12
+ end
13
+ end
@@ -6,6 +6,7 @@ class Everlog
6
6
  require 'everlog/dom/value/moves'
7
7
  require 'everlog/dom/value/animetick'
8
8
  require 'everlog/dom/value/weather'
9
+ require 'everlog/dom/value/footer'
9
10
 
10
11
  def initialize(response)
11
12
  @response = response
@@ -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
@@ -13,8 +13,10 @@ class Everlog
13
13
 
14
14
  def feed_entry
15
15
  client.feed['feed']['entry']
16
- rescue
17
- []
16
+ rescue => e
17
+ raise InfrastructureHatenarError, "feed_entry error / #{e.message}"
18
18
  end
19
19
  end
20
+
21
+ class InfrastructureHatenarError < StandardError; end
20
22
  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
@@ -1,3 +1,3 @@
1
1
  class Everlog
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Everlog::App::Animetick do
3
+ describe Everlog::Dom::Module::Animetick do
4
4
  describe '#fetch_since' do
5
5
  subject { described_class.fetch_since((DateTime.now - 1).to_time) }
6
6
 
@@ -1,10 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Everlog::App::Evernote do
4
- let(:instance) { described_class.new }
5
-
3
+ describe Everlog::Dom::Module::Evernote do
6
4
  describe '#publish' do
7
- subject { instance.publish('title', 'content', false) }
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::App::Hatena do
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
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Everlog::App::Twitter do
3
+ describe Everlog::Dom::Module::Twitter do
4
4
 
5
5
  describe '.fetch_since' do
6
6
  subject { described_class.fetch_since (DateTime.now - 1).to_time }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Everlog::App::Weather do
3
+ describe Everlog::Dom::Module::Weather do
4
4
 
5
5
  describe '.fetch_since' do
6
6
  subject { described_class.fetch_since('dummy') }
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe Everlog::Dom::Value::Footer do
4
+ let(:instance) { described_class.new(phrase) }
5
+
6
+ describe '#phrase' do
7
+ let(:phrase) { 'hoge' }
8
+ it { expect(instance.phrase).to eq 'hoge' }
9
+ end
10
+ 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 ::Evernote::EDAM::Error::EDAMUserException }
40
+ it { expect { subject }.to raise_error ::Everlog::InfrastructureEvernoteError }
41
41
  end
42
42
  end
43
43
 
@@ -15,9 +15,4 @@ describe Everlog::Inf::Api::Hatena do
15
15
  expect(instance.client).to be instance.client
16
16
  end
17
17
  end
18
-
19
- describe '#feed_entry' do
20
- subject { instance.feed_entry }
21
- it { expect(subject).to be_instance_of Array }
22
- end
23
18
  end
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.1
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-04-15 00:00:00.000000000 Z
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/animetick.rb
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
@@ -1,9 +0,0 @@
1
- class Everlog
2
- class App::Github < App
3
- def self.fetch_since(date)
4
- mod = Dom::Module::Github.new(Dom::Entity::Config.github)
5
- activities = mod.repo_names.map { |r| mod.repo_activity(r, date) }
6
- activities.compact
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class Everlog
2
- class App::Moves
3
- def self.fetch_since(one_day_ago)
4
- config = Dom::Entity::Config.moves
5
- moves_module = Dom::Module::Moves.new(config)
6
- { summary: moves_module.summary, storyline: moves_module.storyline }
7
- end
8
- end
9
- end
@@ -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
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Everlog::App::Moves do
4
- describe '#fetch_since' do
5
- subject { described_class.fetch_since((DateTime.now - 1).to_time) }
6
- it { expect(subject).to have_key :summary }
7
- it { expect(subject).to have_key :storyline }
8
- end
9
- end