Skip to content

Commit

Permalink
Merge pull request email-spec#74 from spraints/master
Browse files Browse the repository at this point in the history
Use launchy
  • Loading branch information
bmabey committed Sep 27, 2011
2 parents c25367e + 40da3bb commit f9f2f2b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -22,3 +22,5 @@ gem 'capybara'
gem 'database_cleaner'

gem "test-unit"

gemspec
12 changes: 12 additions & 0 deletions Gemfile.lock
@@ -1,3 +1,11 @@
PATH
remote: .
specs:
email_spec (1.2.1)
launchy (~> 2.0)
mail (~> 2.2)
rspec (~> 2.0)

GEM
remote: http://gemcutter.org/
specs:
Expand Down Expand Up @@ -28,6 +36,7 @@ GEM
activemodel (= 3.0.0.rc)
activesupport (= 3.0.0.rc)
activesupport (3.0.0.rc)
addressable (2.2.6)
arel (0.4.0)
activesupport (>= 3.0.0.beta)
autotest (4.3.2)
Expand Down Expand Up @@ -79,6 +88,8 @@ GEM
rubyforge (>= 2.0.0)
json (1.4.6)
json_pure (1.4.6)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.2.9)
activesupport (>= 2.3.6)
i18n (~> 0.4.1)
Expand Down Expand Up @@ -156,6 +167,7 @@ DEPENDENCIES
cucumber-sinatra
database_cleaner
delayed_job (>= 2.0.3)
email_spec!
growl-glue
jeweler
mail
Expand Down
3 changes: 3 additions & 0 deletions email_spec.gemspec
Expand Up @@ -175,13 +175,16 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<mail>, ["~> 2.2"])
s.add_runtime_dependency(%q<rspec>, ["~> 2.0"])
s.add_runtime_dependency(%q<launchy>, ["~> 2.0"])
else
s.add_dependency(%q<mail>, ["~> 2.2"])
s.add_dependency(%q<rspec>, ["~> 2.0"])
s.add_dependency(%q<launchy>, ["~> 2.0"])
end
else
s.add_dependency(%q<mail>, ["~> 2.2"])
s.add_dependency(%q<rspec>, ["~> 2.0"])
s.add_dependency(%q<launchy>, ["~> 2.0"])
end
end

6 changes: 5 additions & 1 deletion examples/rails3_root/Gemfile.lock
@@ -1,7 +1,8 @@
PATH
remote: ../../
specs:
email_spec (1.2.0)
email_spec (1.2.1)
launchy (~> 2.0)
mail (~> 2.2)
rspec (~> 2.0)

Expand Down Expand Up @@ -35,6 +36,7 @@ GEM
activemodel (= 3.0.0.rc)
activesupport (= 3.0.0.rc)
activesupport (3.0.0.rc)
addressable (2.2.6)
arel (0.4.0)
activesupport (>= 3.0.0.beta)
builder (2.1.2)
Expand Down Expand Up @@ -67,6 +69,8 @@ GEM
trollop (~> 1.16.2)
i18n (0.4.1)
json_pure (1.4.3)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.2.5)
activesupport (>= 2.3.6)
mime-types
Expand Down
4 changes: 2 additions & 2 deletions lib/email_spec/email_viewer.rb
Expand Up @@ -73,11 +73,11 @@ def self.save_and_open_email_attachments_list(mail)

# TODO: use the launchy gem for this stuff...
def self.open_in_text_editor(filename)
`open #{filename}`
Launchy.open(URI.parse("file://#{File.expand_path(filename)}"), :application => :editor)
end

def self.open_in_browser(filename)
`open #{filename}`
Launchy.open(URI.parse("file://#{File.expand_path(filename)}"))
end

def self.tmp_email_filename(extension = '.txt')
Expand Down

0 comments on commit f9f2f2b

Please sign in to comment.