mdpress 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/mdpress +14 -1
  2. metadata +4 -4
@@ -6,6 +6,7 @@ require 'impress_renderer'
6
6
  require 'trollop'
7
7
  require 'tempfile'
8
8
  require 'launchy'
9
+ require 'httparty'
9
10
 
10
11
  THEMES_DIRNAME = './themes/'
11
12
 
@@ -78,6 +79,7 @@ EOS
78
79
  opt :list, "List all available stylesheets."
79
80
  opt :run, "Run presentation (automatically compiles to a tmp directory and opens in a browser window)"
80
81
  opt :verbose, "Be verbose."
82
+ opt :upload, "Upload presentation to mdpress.me"
81
83
  end
82
84
 
83
85
  if OPTS[:list]
@@ -87,6 +89,7 @@ end
87
89
 
88
90
  Trollop::die("no file specified") if ARGV.empty? # show help screen
89
91
 
92
+
90
93
  if OPTS[:run]
91
94
  file = ARGV[0]
92
95
  tmp = Tempfile.new("mdpress")
@@ -112,6 +115,16 @@ unless File.exist?(STYLESHEET)
112
115
  exit
113
116
  end
114
117
 
118
+ if OPTS[:upload]
119
+ res = HTTParty.post("http://mdpress.me/presentations", { :body => {
120
+ :content => File.read(ARGV[0]),
121
+ :css => File.read(STYLESHEET),
122
+ :html => File.read(STYLESHEET_HEAD)
123
+ }
124
+ })
125
+ puts "presentation link: #{res.body}"
126
+ end
127
+
115
128
  if File.exist?(DIRNAME)
116
129
  unless File.directory?(DIRNAME)
117
130
  puts "please delete the file: #{DIRNAME} before continuing."
@@ -132,7 +145,7 @@ FileUtils.cp(STYLESHEET, DIRNAME + "/css/style.css")
132
145
  def auto
133
146
  while true
134
147
  sleep 2
135
- if FileUtils.uptodate?(FILENAME, DIRNAME + "/index.html")
148
+ if FileUtils.uptodate?(FILENAME, [DIRNAME + "/index.html"])
136
149
  log "updating from #{FILENAME}"
137
150
  render
138
151
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdpress
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aditya Bhargava
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-17 00:00:00 -07:00
18
+ date: 2012-10-29 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency