txtbook 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
- pkg
1
+ pkg
2
+ txtbook.gemspec
data/README.txt CHANGED
@@ -15,6 +15,7 @@ A presentation and training class generation and packaging tool based on rake
15
15
  txtbook myNewPresentation
16
16
  cd myNewPresentation
17
17
  rake
18
+ open work/sample.key
18
19
 
19
20
  == REQUIREMENTS:
20
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -4,6 +4,7 @@ module TxtBook
4
4
  class Factory
5
5
  def self.create(cmd_line_args)
6
6
  textbook_root = cmd_line_args[0]
7
+
7
8
  # DEBT Move to member var
8
9
  template = File.join(File.dirname(__FILE__), 'txtbook', 'new_book_template')
9
10
  FileUtils.cp_r(template, textbook_root)
@@ -20,13 +21,13 @@ module TxtBook
20
21
 
21
22
  def unbind
22
23
  FileUtils.mkdir_p @work_dir
23
- Dir[File.join(@textbook, "slides/*.key")].each do |prez|
24
- FileUtils.cp_r(prez, @work_dir)
25
-
26
- # DEBT Untested
27
- gunzip(File.join(@work_dir, File.basename(prez), "index.apxl.gz"))
24
+ Dir[File.join(@textbook, "slides/*.key")].each do |preso|
25
+ copy_to_working_dir(preso)
28
26
 
29
- @keynote_content = IO.read(File.join(@work_dir, File.basename(prez), "index.apxl"))
27
+ gunzip(File.join(@work_dir, File.basename(preso), "index.apxl.gz"))
28
+
29
+ content_file = File.join(@work_dir, File.basename(preso), "index.apxl")
30
+ @keynote_content = IO.read(content_file)
30
31
  end
31
32
  end
32
33
 
@@ -37,8 +38,8 @@ module TxtBook
37
38
  end
38
39
 
39
40
  def rebind
40
- Dir[File.join(@work_dir, "*.key")].each do |prez|
41
- File.open(File.join(@work_dir, prez, "index.apxl"), "w+") do |file|
41
+ Dir[File.join(@work_dir, "*.key")].each do |preso|
42
+ File.open(File.join(@work_dir, File.basename(preso), "index.apxl"), "w+") do |file|
42
43
  file.write @keynote_content
43
44
  end
44
45
  end
@@ -47,5 +48,11 @@ module TxtBook
47
48
  def gunzip(filename)
48
49
  Kernel.system("gunzip --force #{filename}")
49
50
  end
51
+
52
+ private
53
+
54
+ def copy_to_working_dir(preso)
55
+ FileUtils.cp_r(preso, @work_dir)
56
+ end
50
57
  end
51
- end
58
+ end
@@ -29,7 +29,7 @@ module TxtBook
29
29
  @builder.unbind
30
30
  end
31
31
 
32
- it "should unbind keynote09 files"
32
+ it "should unbind keynote09 files"
33
33
 
34
34
  it "should unbind keynote08 files" do
35
35
  IO.stub!(:read).with(full_path_to_keynote("index.apxl")).and_return("${java/Sample.java}")
@@ -82,4 +82,4 @@ module TxtBook
82
82
  FileUtils.rm_rf('temp-book')
83
83
  end
84
84
  end
85
- end
85
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txtbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Rady
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-21 00:00:00 -05:00
12
+ date: 2009-11-30 00:00:00 -06:00
13
13
  default_executable: txtbook
14
14
  dependencies: []
15
15