rrimm 0.5.0 → 0.6.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjVmZjhiNTQwODZhMDc1YTFkMmE1MjU2NDdiMWMxOTFmMGRjYjQ4Yg==
4
+ NWM5MjRiNDNmMGQ1MGFmZjVhNjcwYWEyNGIwNjhkNmI1NTA3MmQ5Yg==
5
5
  data.tar.gz: !binary |-
6
- NGViNGJlOGFiYWYxODU2MWE1OTk3MmNkN2JjY2I4Njk5MGMyODNmYw==
6
+ NzIzMGNkYmU0NTJkMDYyNGZjODZlMmI3MDdmZTM0NDdhMWM2MWYwYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzEzMGE3NTIzNjU2MTViOTI4ZmNlZTRhZGI5YzYzOWM5M2M0Yzc0MGEwNDc4
10
- MTNlMjJlZGVjNWZkMzcyYmRiZTkyOWU5ODU5YzZkZTc3N2E1NGI4YjQ2ZTYz
11
- M2UyOGQ2ZWEzMDJmNzdkYWFjMzJiNDJiMjc1OWI2MTE5MTRkMDM=
9
+ N2M0MDNlOWFiNTZjODg5ZTAzYjQ1NzFhOTliYTM5MWZjYTU1NzY4NzhhZjEz
10
+ ZjZiNWYyMDAxMWI5MGI0MWEwNjc3MDQzOTA5NjgwYmYyZjc2NDQ1MDFlNzUy
11
+ NGJiN2E1MzQ5YWM1NTcwNDBlNDFhMjIxOTliOTJkMjMxZDNhNTI=
12
12
  data.tar.gz: !binary |-
13
- ZTY4YjFiMzNjYjE5ZjU1YjZiMDlmY2IzM2MzMzY4ZTJjZjJhYTU4ZmZhNDY2
14
- OTRhMzNmOTBlZGZiNmM5ZjVlMzljODllNjZjNmVhYzliZTBjM2E4NGVjYzU1
15
- NWU3NTNjY2VkYThjMWVkNWY1YmJhMjBlY2U4ODg3MmFlMjE3Yjc=
13
+ OWY4ZjNiMjFlOWM4MDY2YzNhY2FlNjJjYjQ4ZWYwZTMxOGM0MjkzMmJkYTBm
14
+ OTIxMzlhNDZiYjY5ZmUzNjBjOGU4MWEyYjI2NWMxMDA1NmNlY2M3NWViOTRj
15
+ MDc1YWY4MGE3ZWY4MTVlNmE1ZTRjZDMwODIwNjA0MjY4ZjY5MzM=
@@ -1 +1 @@
1
- repo_token: G8AokJUfHiYeVA34AOcVjPu8Hnw8VY7KH
1
+ service_name: travis-ci
@@ -4,5 +4,7 @@ How-to
4
4
  There are several ways to contribute and all kinds are welcome.
5
5
 
6
6
  Report bugs : open a github issue, describe the issue and how to reproduce it
7
+
7
8
  Feature request : open a github issue, describe the feature of your dreams
9
+
8
10
  Propose a patch : open a PR
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rrimm (0.5.0)
4
+ rrimm (0.6.0)
5
5
  colorize
6
6
  feedzirra
7
7
  open_uri_redirections
@@ -41,12 +41,11 @@ module RRImm
41
41
  timestamp.to_i
42
42
  end
43
43
 
44
- def save(feed, timestamp)
44
+ def save(feed, timestamp, force=true)
45
45
  file_path = cache_file(feed)
46
- File.write(file_path, timestamp)
46
+ File.write(file_path, timestamp) if (force or timestamp != read(feed))
47
47
  end
48
48
 
49
-
50
49
  private
51
50
  def sanitize(name)
52
51
  cleaned_name = INVALID_PATTERNS.inject(name) do |memo,pattern|
@@ -42,7 +42,7 @@ module RRImm
42
42
  items.each do |item|
43
43
  feed_config.format(feed, item)
44
44
  end
45
- @config.get_cache.save(feed_config, last_read.to_i)
45
+ @config.get_cache.save(feed_config, last_read.to_i, false)
46
46
  end
47
47
  end
48
48
  end
@@ -30,6 +30,7 @@ module RRImm
30
30
  def format(feed, item, feed_config, pipe)
31
31
  pipe.write "From: #{from [item.author, default_author(feed_config)]}\n"
32
32
  pipe.write "To: #{dest}\n"
33
+ pipe.write "Date: #{item.published.rfc2822}\n"
33
34
  pipe.write "Subject: #{subject(feed, item, feed_config)}\n"
34
35
  pipe.write "Content-Type: text/html;\n"
35
36
  pipe.write "\n"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rrimm'
3
- s.version = '0.5.0'
3
+ s.version = '0.6.0'
4
4
  s.licenses = ['Apache Licence v2']
5
5
  s.summary = "RSS to email tool"
6
6
  s.description = "imm reboot in ruby. Retrieve rss feeds and send them by email"
@@ -15,7 +15,7 @@ describe RRImm::ItemFormatter::Mail do
15
15
  config.should_receive(:category).twice.and_return nil
16
16
  config.should_receive(:default_name?).and_return(true, false)
17
17
  mail_formatter.format(feed, feed.entries.first, config, s)
18
- expect(s.string).to eq "From: RRImm <from@example.com>\nTo: to@example.com\nSubject: When You Assume\nContent-Type: text/html;\n\nhttp://xkcd.com/1339/\n\n<img src=\"http://imgs.xkcd.com/comics/when_you_assume.png\" title=\"You know what happens when you assert--you make an ass out of the emergency response team.\" alt=\"You know what happens when you assert--you make an ass out of the emergency response team.\" />\n"
18
+ expect(s.string).to eq "From: RRImm <from@example.com>\nTo: to@example.com\nDate: Fri, 07 Mar 2014 05:00:00 -0000\nSubject: When You Assume\nContent-Type: text/html;\n\nhttp://xkcd.com/1339/\n\n<img src=\"http://imgs.xkcd.com/comics/when_you_assume.png\" title=\"You know what happens when you assert--you make an ass out of the emergency response team.\" alt=\"You know what happens when you assert--you make an ass out of the emergency response team.\" />\n"
19
19
  s = StringIO.new
20
20
 
21
21
  config.should_receive(:name).and_return "Randall Munroe"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rrimm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-23 00:00:00.000000000 Z
11
+ date: 2014-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open_uri_redirections