shining 1.1.7 → 1.1.8

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.7
1
+ 1.1.8
data/bin/shine CHANGED
@@ -9,7 +9,8 @@ ACTIONS = {
9
9
  :new_slide! => ['slide'],
10
10
  :compile_templates! => ['compile'],
11
11
  :vendorize => ['vendor', 'vendorize'],
12
- :play => ['play', 'go']
12
+ :play => ['play', 'go'],
13
+ :deploy => ['deploy']
13
14
  }
14
15
 
15
16
  def bail! reason
@@ -64,4 +65,9 @@ def play
64
65
  player.go!
65
66
  end
66
67
 
68
+ def deploy name = nil
69
+ preso = Shining::Preso.open Dir.pwd
70
+ Shining::Heroku.deploy preso, name
71
+ end
72
+
67
73
  figure_what_to_do!
@@ -12,6 +12,10 @@ module FileMethods
12
12
  File.directory? dir
13
13
  end
14
14
 
15
+ def change_dir to
16
+ Dir.chdir to
17
+ end
18
+
15
19
  def move from, to
16
20
  Shining.say("Moving #{from} to #{to}") { FileUtils.mv(from, to) }
17
21
  end
@@ -0,0 +1,28 @@
1
+ # Class that handles deploying a presentation to Heroku.
2
+ # This is REALLY hard to spec, so I just won't. I'm sure you can forgive me.
3
+
4
+ module Shining
5
+
6
+ class Heroku
7
+ extend FileMethods
8
+ class << self
9
+ def deploy preso, name
10
+ check_for_git_and_heroku
11
+ preso.vendorize! unless preso.vendorized?
12
+ copy Shining.root/'lib'/'config.ru', preso.path
13
+ change_dir preso.path
14
+ `git init && git add . && git commit -m 'heroku deploy'`
15
+ `heroku create #{name}`
16
+ `git push heroku master`
17
+ Shining.say "Done!"
18
+ end
19
+
20
+ private
21
+ def check_for_git_and_heroku
22
+ raise RuntimeError, 'You need to install the heroku gem before deploying! (Usually "sudo gem install heroku")' if `which heroku`.empty?
23
+ raise RuntimeError, 'Git is either not installed or not in your PATH. Check and try again.' if `which git`.empty?
24
+ end
25
+ end
26
+ end
27
+
28
+ end
@@ -7,7 +7,7 @@ module Shining
7
7
  class Player
8
8
  include FileMethods and extend FileMethods
9
9
 
10
- def initialize(preso)
10
+ def initialize preso
11
11
  raise ArgumentError, "argument needs to be an instance of Shining::Preso" unless preso.is_a? Shining::Preso
12
12
  @preso = preso
13
13
  end
data/lib/shining.rb CHANGED
@@ -5,6 +5,7 @@ require 'ext/string'
5
5
  require 'ext/filemethods'
6
6
  require 'shining/preso'
7
7
  require 'shining/player'
8
+ require 'shining/heroku'
8
9
  require 'term/ansicolor'
9
10
 
10
11
  module Shining
data/shining.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{shining}
8
- s.version = "1.1.7"
8
+ s.version = "1.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julio Cesar Ody"]
12
- s.date = %q{2010-04-20}
12
+ s.date = %q{2010-04-22}
13
13
  s.description = %q{Webkit + CSS + Javascript = awesome presos}
14
14
  s.email = %q{julio.ody@gmail.com}
15
15
  s.executables = ["console", "shine"]
@@ -40,6 +40,7 @@ Gem::Specification.new do |s|
40
40
  "lib/shBrushAll.js",
41
41
  "lib/shCore.js",
42
42
  "lib/shining.rb",
43
+ "lib/shining/heroku.rb",
43
44
  "lib/shining/player.rb",
44
45
  "lib/shining/preso.rb",
45
46
  "shining.gemspec",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 7
9
- version: 1.1.7
8
+ - 8
9
+ version: 1.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Julio Cesar Ody
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-20 00:00:00 +10:00
17
+ date: 2010-04-22 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -161,6 +161,7 @@ files:
161
161
  - lib/shBrushAll.js
162
162
  - lib/shCore.js
163
163
  - lib/shining.rb
164
+ - lib/shining/heroku.rb
164
165
  - lib/shining/player.rb
165
166
  - lib/shining/preso.rb
166
167
  - shining.gemspec