mail2frontmatter 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ace6e95944c171685f6dc61db3145b2f67c440c
4
- data.tar.gz: ab0297aebb9758ec50afde90e20bc6be471ac4e4
3
+ metadata.gz: e2060ebb3af9ea3b6792caa4423b414ed610649b
4
+ data.tar.gz: e081455cbb6870923e7edb88b5c532ab1abd5ac1
5
5
  SHA512:
6
- metadata.gz: 48a37162365e5015c5a89b39a252a6f2b49e92b14ba14fe4e077467a19b6e8231fbfea3737f66c11f258a2368bc04eb28749f48c94456121117f30d9529c5524
7
- data.tar.gz: 5f702a7aba5ed48c4b4dfce4c75a1fc90ed1a625497dbc0f4ebfad60abac2c227bac1f3a211f689494ce06941526d892147dc8056275a98767389b1c11e7e15f
6
+ metadata.gz: cc1a99d909e3146c48cfd094eb10f25cbaf203e317573bc5471df5bd255b2369a4f46bae17af1b7a67e3414513b4348e1ccd1119c1fa70883a54622f0b86a514
7
+ data.tar.gz: 89d9ebc85b8cdee3fa1413f407310e35a05176fbe312a8aeb692bff12a55c404f6f091002e6e3e9f4d27fe0223dbfc78b21512dd0f8646fd6b4c702edb97e74e
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.2.0
5
+ script: bundle exec rake
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/whistlerbrk/Mail2FrontMatter.svg?branch=master)](https://travis-ci.org/whistlerbrk/Mail2FrontMatter)
2
+
1
3
  # Mail2FrontMatter
2
4
 
3
5
  Email-to-blog parser which creates YAML FrontMatter and saves your attachments.
@@ -24,11 +26,11 @@ And then execute:
24
26
 
25
27
  To run in the foreground:
26
28
 
27
- $ mail2frontmatter
29
+ $ bundle exec mail2frontmatter
28
30
 
29
31
  To detach the process pass the ```-d``` option:
30
32
 
31
- $ mail2frontmatter -d
33
+ $ bundle exec mail2frontmatter -d
32
34
 
33
35
  ```mail2frontmatter``` assumes a configuration file will be present at ```./data/mail2frontmatter.yml```
34
36
 
@@ -97,11 +99,19 @@ Instantiate ```Mail2FrontMatter::Watcher``` and pass it a configuration hash (or
97
99
  watcher.run
98
100
  ```
99
101
 
100
- ### Extending It
102
+ ### Plugins
103
+
104
+ If you've released a plugin of your own and would like to add it to this list, please send me a pull request.
105
+
106
+ [AutoTagSubject](https://github.com/whistlerbrk/m2fm-autotag-subject) - extracts tags from your subject line
101
107
 
102
- Finally you can extend Mail2FrontMatter to further process incoming emails by subclassing ```Mail2FrontMatter::PreProcessor``` and registering it.
108
+ [AutomaticEmbeds](https://github.com/whistlerbrk/m2fm-automatic-embeds) - automatically converts links into embeds (e.g. youtube, soundcloud, vimeo, gist)
109
+
110
+ [AutomaticClowncar](https://github.com/whistlerbrk/m2fm-automatic-clowncar) - makes your incoming image attachments automatic-clowncar compatible (requires Middleman)
111
+
112
+ ### Extending It
103
113
 
104
- for example:
114
+ Finally you can extend Mail2FrontMatter to further process incoming emails by subclassing ```Mail2FrontMatter::PreProcessor``` and registering it. The plugins above all implement the pattern shown.
105
115
 
106
116
  ```ruby
107
117
  module Mail2FrontMatter
@@ -128,6 +138,7 @@ You should always always return metadata and body as shown since this will be pa
128
138
 
129
139
  ### TODO
130
140
 
131
- * White list sanitization!
141
+ * White list sanitization by default
142
+ * Full Jekyll support - PLEASE send pull requests, I want to support Jekyll as well, hence the general project name
132
143
  * Mail2FrontMatter::Watcher handles both configuration for the whole shebang as well as Mailman. Should be split
133
144
  * Some options intended to be configurable (media directory, etc) are not yet and essentially mean you can only run this from a middleman directory installation atm.
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ task default: 'spec'
4
+
3
5
  begin
4
6
  require 'rspec/core/rake_task'
5
7
  RSpec::Core::RakeTask.new(:spec)
data/bin/mail2frontmatter CHANGED
@@ -41,6 +41,11 @@ OptionParser.new do |opts|
41
41
  puts opts
42
42
  exit
43
43
  end
44
+
45
+ opts.on_tail("-v", "--version", "Prints version") do
46
+ puts Mail2FrontMatter::VERSION
47
+ exit
48
+ end
44
49
  end.parse!
45
50
 
46
51
  # TRY TO KILL
@@ -67,6 +72,10 @@ if stop
67
72
  rescue Errno::ESRCH
68
73
  puts "stale pidfile... cleaning"
69
74
 
75
+ # also exit here! but don't move exit 0 to ensure block
76
+ # because "in the future" we may intelligently intercept pkill above
77
+ exit 0
78
+
70
79
  # ALWAYS DELETE PID FILE
71
80
  ensure
72
81
  File.delete(options[:pid_file])
@@ -15,7 +15,8 @@ module Mail2FrontMatter
15
15
 
16
16
  def initialize(message)
17
17
  @message = message
18
- raw_parsed_html = Nokogiri::HTML.parse(@message.html_part.body.raw_source.strip)
18
+ raw_parsed_html = Nokogiri::HTML.parse(@message.html_part.decoded.strip)
19
+
19
20
  @body = raw_parsed_html.at("body")
20
21
 
21
22
  # remove extraneous nesting
@@ -1,3 +1,3 @@
1
1
  module Mail2FrontMatter
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency "activesupport"
24
24
 
25
25
  spec.add_development_dependency "rspec"
26
- spec.add_development_dependency "byebug"
26
+ spec.add_development_dependency "byebug" unless RUBY_VERSION =~ /1.9/
27
27
  spec.add_development_dependency "bundler", "~> 1.7"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  end
data/spec/parser_spec.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'byebug'
3
2
 
4
3
  describe Mail2FrontMatter::Parser, "parsing" do
5
4
 
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'byebug'
3
2
 
4
3
  describe Mail2FrontMatter::PreProcessor, "registration" do
5
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail2frontmatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kunal Shah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mailman
@@ -118,6 +118,7 @@ extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
120
  - ".gitignore"
121
+ - ".travis.yml"
121
122
  - Gemfile
122
123
  - LICENSE.txt
123
124
  - README.md