shining 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +5 -0
- data/VERSION +1 -1
- data/lib/ext/filemethods.rb +7 -1
- data/lib/shining.js +3 -1
- data/lib/shining.rb +1 -0
- data/lib/shining/errors.rb +4 -0
- data/lib/shining/preso.rb +2 -6
- data/shining.gemspec +3 -2
- data/spec/filemethods_spec.rb +14 -0
- metadata +4 -3
data/CHANGELOG.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.3
|
data/lib/ext/filemethods.rb
CHANGED
@@ -44,7 +44,13 @@ module FileMethods
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def json file
|
47
|
-
|
47
|
+
begin
|
48
|
+
JSON.parse read_file(file)
|
49
|
+
rescue Errno::ENOENT
|
50
|
+
raise Shining::NoSuchFile, "File #{file} doesn't exist"
|
51
|
+
rescue
|
52
|
+
raise Shining::CantParseJSONFile, "File #{file} doesn't appear to be valid JSON"
|
53
|
+
end
|
48
54
|
end
|
49
55
|
|
50
56
|
def expand path
|
data/lib/shining.js
CHANGED
@@ -322,7 +322,9 @@
|
|
322
322
|
}
|
323
323
|
|
324
324
|
function centerStage() {
|
325
|
-
|
325
|
+
var top = ($(window).height() - $('#stage').outerHeight()) / 2;
|
326
|
+
if (top < 0) top = 0;
|
327
|
+
$('#stage').css({ top: top });
|
326
328
|
}
|
327
329
|
|
328
330
|
Shining.init();
|
data/lib/shining.rb
CHANGED
data/lib/shining/preso.rb
CHANGED
@@ -18,15 +18,11 @@ class Preso
|
|
18
18
|
copy_templates
|
19
19
|
vendorize!
|
20
20
|
end
|
21
|
-
@config = json(@path/'config.json')
|
21
|
+
@config = json(@path/'config.json')
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.open dir
|
25
|
-
|
26
|
-
new dir, false
|
27
|
-
rescue
|
28
|
-
raise "#{dir} is not a Shining presentation!"
|
29
|
-
end
|
25
|
+
new dir, false
|
30
26
|
end
|
31
27
|
|
32
28
|
def config refresh = false
|
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.3.
|
8
|
+
s.version = "1.3.3"
|
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-05-
|
12
|
+
s.date = %q{2010-05-26}
|
13
13
|
s.default_executable = %q{shine}
|
14
14
|
s.description = %q{HTML + CSS + Javascript = awesome presos}
|
15
15
|
s.email = %q{julio.ody@gmail.com}
|
@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
|
|
44
44
|
"lib/shCore.js",
|
45
45
|
"lib/shining.js",
|
46
46
|
"lib/shining.rb",
|
47
|
+
"lib/shining/errors.rb",
|
47
48
|
"lib/shining/heroku.rb",
|
48
49
|
"lib/shining/player.rb",
|
49
50
|
"lib/shining/preso.rb",
|
data/spec/filemethods_spec.rb
CHANGED
@@ -24,6 +24,20 @@ describe Shining::FileMethods do
|
|
24
24
|
dir?(TMP/'temp'/'adir').should be_true
|
25
25
|
end
|
26
26
|
|
27
|
+
context '#json' do
|
28
|
+
it 'parses JSON' do
|
29
|
+
File.open(TMP/'foo.json', 'w') { |file| file << "[1, 2, 3]" }
|
30
|
+
json(TMP/'foo.json').should be_a Array
|
31
|
+
end
|
32
|
+
it "raises Shining::NoSuchFile if the file doesn't exist" do
|
33
|
+
lambda do json(TMP/'aaabbbbbbcccc') end.should raise_error Shining::NoSuchFile
|
34
|
+
end
|
35
|
+
it "raises Shining::CantParseJSONFile if the file isn't valid JSON" do
|
36
|
+
File.open(TMP/'foo.json', 'w') { |file| file << "oaskdo ksdp kdpo asdk apos" }
|
37
|
+
lambda do json(TMP/'foo.json') end.should raise_error Shining::CantParseJSONFile
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
27
41
|
context '#move and #copy' do
|
28
42
|
before do
|
29
43
|
FileUtils.mkdir TMP/'temp'/'dir1'
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 1.3.
|
8
|
+
- 3
|
9
|
+
version: 1.3.3
|
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-05-
|
17
|
+
date: 2010-05-26 00:00:00 +10:00
|
18
18
|
default_executable: shine
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- lib/shCore.js
|
164
164
|
- lib/shining.js
|
165
165
|
- lib/shining.rb
|
166
|
+
- lib/shining/errors.rb
|
166
167
|
- lib/shining/heroku.rb
|
167
168
|
- lib/shining/player.rb
|
168
169
|
- lib/shining/preso.rb
|