gf-ralbum 0.0.2 → 0.0.5

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.
Files changed (118) hide show
  1. data/VERSION +1 -0
  2. data/bin/{ralbum.rb → ralbum} +1 -1
  3. data/example/example.sh +2 -1
  4. data/example/test_jalbum_phototree/jalbum-settings.jap +321 -0
  5. data/example/test_jalbum_phototree/src/albumfiles.txt +9 -0
  6. data/example/test_jalbum_phototree/src/comments.properties +0 -0
  7. data/example/test_jalbum_phototree/src/flowers/albumfiles.txt +14 -0
  8. data/example/test_jalbum_phototree/src/meta.properties +2 -0
  9. data/example/{test_phototree → test_rubyphoto_phototree}/album.xml +0 -0
  10. data/example/test_rubyphoto_phototree/flowers/IMG_1469.wt.jpg +0 -0
  11. data/example/test_rubyphoto_phototree/flowers/IMG_2291.jpg +0 -0
  12. data/example/test_rubyphoto_phototree/flowers/IMG_2598.jpg +0 -0
  13. data/example/test_rubyphoto_phototree/flowers/IMG_3068.jpg +0 -0
  14. data/example/test_rubyphoto_phototree/flowers/IMG_3323.jpg +0 -0
  15. data/example/test_rubyphoto_phototree/flowers/IMG_3348.jpg +0 -0
  16. data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg +0 -0
  17. data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg.xml +0 -0
  18. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml +0 -0
  19. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml.test +0 -0
  20. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/project.xml +206 -3
  21. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/album.xml +0 -0
  22. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg +0 -0
  23. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg.xml +0 -0
  24. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg +0 -0
  25. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg.xml +0 -0
  26. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg +0 -0
  27. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg.xml +0 -0
  28. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg +0 -0
  29. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg.xml +0 -0
  30. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/album.xml +0 -0
  31. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg +0 -0
  32. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg.xml +0 -0
  33. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg +0 -0
  34. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg.xml +0 -0
  35. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg +0 -0
  36. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg.xml +0 -0
  37. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg +0 -0
  38. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg.xml +0 -0
  39. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg +0 -0
  40. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg.xml +0 -0
  41. data/lib/ralbum.rb +9 -5
  42. data/lib/ralbum/album_tree/album.rb +74 -0
  43. data/lib/ralbum/album_tree/generate_album_tree_node_visitor.rb +73 -0
  44. data/lib/ralbum/album_tree/image_file.rb +88 -0
  45. data/lib/ralbum/{image_pool.rb → album_tree/image_pool.rb} +16 -4
  46. data/lib/ralbum/catalog.rb +7 -7
  47. data/lib/ralbum/cli/cli_ralbum.rb +66 -25
  48. data/lib/ralbum/image_strategies/copy_image_strategy.rb +16 -0
  49. data/lib/ralbum/image_strategies/linked_image_strategy.rb +18 -0
  50. data/lib/ralbum/image_strategies/scaled_image_strategy.rb +52 -0
  51. data/lib/ralbum/image_strategies/sepia_scaled_image_strategy.rb +50 -0
  52. data/lib/{ralbum-common → ralbum}/object_with_properties.rb +0 -0
  53. data/lib/{ralbum-common → ralbum}/object_with_validation.rb +0 -0
  54. data/lib/ralbum/photo_tree/jalbum_photo_tree.rb +83 -0
  55. data/lib/ralbum/photo_tree/photo_file.rb +149 -0
  56. data/lib/ralbum/photo_tree/photo_tree_item.rb +68 -0
  57. data/lib/ralbum/{photo_tree_node.rb → photo_tree/photo_tree_node.rb} +16 -13
  58. data/lib/ralbum/{photo_tree_builder.rb → photo_tree/rubyphoto_photo_tree.rb} +64 -46
  59. data/lib/ralbum/project.rb +48 -12
  60. data/lib/ralbum/skin.rb +34 -27
  61. data/lib/ralbum/skin_engine.rb +32 -17
  62. data/lib/ralbum/skin_engines/erb_skin_engine.rb +2 -5
  63. data/lib/ralbum/skin_engines/kwartz_skin_engine.rb +6 -9
  64. data/lib/ralbum/skin_manager.rb +11 -2
  65. data/lib/ralbum/skins/cgi/cgi_skin.rb +21 -23
  66. data/lib/ralbum/skins/cgi/res/model.rb +30 -32
  67. data/lib/ralbum/skins/gfold/inc/menu_bottom.html +53 -53
  68. data/lib/ralbum/skins/gfold/inc/menu_top.html +71 -71
  69. data/lib/ralbum/skins/gfold/inc/page_footer.html +28 -28
  70. data/lib/ralbum/skins/gfold/out/album_page.rb +316 -316
  71. data/lib/ralbum/skins/gfold/out/image_page.rb +231 -231
  72. data/lib/ralbum/skins/gfold/out/tree_page.rb +96 -96
  73. data/lib/ralbum/skins/gfold/res/prototype.js +3277 -3277
  74. data/lib/ralbum/skins/gfold/template/album_page.html +161 -161
  75. data/lib/ralbum/skins/gfold/template/album_page.plogic +127 -127
  76. data/lib/ralbum/skins/gfold/template/image_page.html +91 -91
  77. data/lib/ralbum/skins/gfold/template/image_page.plogic +70 -70
  78. data/lib/ralbum/skins/gfold/template/tree_page.html +79 -79
  79. data/lib/ralbum/skins/gfold/template/tree_page.plogic +45 -45
  80. data/lib/ralbum/skins/js/out/album_page.rb +2 -2
  81. data/lib/ralbum/skins/js/out/tree_page.rb +18 -17
  82. data/lib/ralbum/skins/js/template/album_page.html +2 -2
  83. data/lib/ralbum/skins/js/template/tree_page.html +1 -1
  84. data/lib/ralbum/skins/test_erb/template/album_page.rhtml +22 -0
  85. data/lib/ralbum/skins/test_erb/template/image_page.rhtml +44 -0
  86. data/lib/ralbum/tasks/compile_skins.rb +8 -0
  87. data/test/ralbum/cli/tc_cli_ralbum.rb +35 -0
  88. data/test/ralbum/image_strategies/tc_scaled_image_strategy.rb +18 -0
  89. data/test/ralbum/image_strategies/tc_sepia_scaled_image_strategy.rb +18 -0
  90. data/test/ralbum/photo_tree/tc_jalbum_photo_tree.rb +39 -0
  91. data/test/ralbum/photo_tree/tc_photo_file.rb +13 -0
  92. data/test/ralbum/{tc_01_photo_tree.rb → photo_tree/tc_photo_tree.rb} +10 -12
  93. data/test/ralbum/photo_tree/tc_rubyalbum_photo_tree.rb +20 -0
  94. data/test/ralbum/tc_album.rb +55 -0
  95. data/test/ralbum/tc_catalog.rb +8 -4
  96. data/test/ralbum/tc_image_pool.rb +37 -0
  97. data/test/ralbum/{tc_05_kwartz_skin_engine.rb → tc_kwartz_skin_engine.rb} +1 -1
  98. data/test/ralbum/{tc_04_skin_manager.rb → tc_skin_manager.rb} +8 -3
  99. data/test/ralbum/test_helper.rb +16 -1
  100. data/test_data/ralbum/test_data/is_test/dummy.txt +0 -0
  101. metadata +78 -81
  102. data/bin/ralbum-JPG2jpg.rb +0 -90
  103. data/bin/ralbum-compile_skins.rb +0 -18
  104. data/bin/ralbum-myconv.rb +0 -81
  105. data/bin/ralbum-readexif.rb +0 -18
  106. data/bin/ralbum-reorder.rb +0 -200
  107. data/lib/ralbum/album.rb +0 -66
  108. data/lib/ralbum/generate_album_tree_node_visitor.rb +0 -60
  109. data/lib/ralbum/image_file.rb +0 -81
  110. data/lib/ralbum/image_strategy.rb +0 -143
  111. data/lib/ralbum/photo_tree_item.rb +0 -89
  112. data/test/ralbum/cli/test_cli_ralbum.rb +0 -13
  113. data/test/ralbum/tc_02_photo_tree_builder.rb +0 -20
  114. data/test/ralbum/tc_03_album.rb +0 -42
  115. data/test/ralbum/tc_06_image_strategy.rb +0 -21
  116. data/test/test_ralbum.rb +0 -14
  117. data/test_data/ralbum/test_data/is_test/r_photo01_scaled.jpg +0 -0
  118. data/test_data/ralbum/test_data/is_test/r_photo01_sepia_scaled.jpg +0 -0
@@ -0,0 +1,55 @@
1
+ require File.join( File.dirname(__FILE__), "test_helper")
2
+
3
+ # ralbum
4
+ require 'ralbum/album_tree/album'
5
+ require 'ralbum/album_tree/image_pool'
6
+ require 'ralbum/album_tree/image_file'
7
+
8
+ class TestAlbum < Test::Unit::TestCase
9
+
10
+ def setup
11
+ @root = Album.new( nil, "key_root", "title_root", "descr_root")
12
+ @subalbum = Album.new( @root, "key_subalbum", "title_subalbum", "descr_subalbum")
13
+ @subsubalbum = Album.new( @subalbum, "key_subsubalbum", "title_subsubalbum", "descr_subsubalbum")
14
+ end
15
+
16
+ def test_breadcrumbs
17
+ breadcrumbs = @subalbum.breadcrumbs
18
+
19
+ # breadcrumb " (index.html) > (/title_b/index.html)"
20
+ assert_equal 2, breadcrumbs.length
21
+ assert_equal "title_root/index.html", breadcrumbs[0][:path]
22
+ assert_equal "title_root", breadcrumbs[0][:title]
23
+ assert_equal "title_root/title_subalbum/index.html", breadcrumbs[1][:path]
24
+ assert_equal "title_subalbum", breadcrumbs[1][:title]
25
+
26
+ @root.prefix_path = "skin"
27
+ breadcrumbs = @subalbum.breadcrumbs
28
+
29
+ # breadcrumb " (skin/index.html) > (skin/title_b/index.html)"
30
+ assert_equal 2, breadcrumbs.length
31
+ # assert_equal "skin/index.html", breadcrumbs[0][:path]
32
+ # assert_equal "skin/title_subalbum/index.html", breadcrumbs[1][:path]
33
+ assert_equal "title_subalbum", breadcrumbs[1][:title]
34
+ end
35
+
36
+ def test_relroot
37
+ assert_equal 2, @subalbum.depth
38
+ assert_equal "../../", @subalbum.relroot
39
+ assert_equal "../../", @subalbum.relroot_with_prefix
40
+
41
+ @subalbum.root.prefix_path = "skin/"
42
+ assert_equal "../../", @subalbum.relroot
43
+ assert_equal "skin/../../", @subalbum.relroot_with_prefix
44
+ end
45
+
46
+ def test_page_url
47
+ assert_equal 3, @subsubalbum.depth
48
+ assert_equal "title_subsubalbum/index.html", @subsubalbum.page_url
49
+ assert_equal "title_root/title_subalbum/title_subsubalbum/index.html", @subsubalbum.page_url_from_root
50
+
51
+ @subalbum.root.prefix_path = "skin/"
52
+ assert_equal "title_subsubalbum/index.html", @subsubalbum.page_url
53
+ # assert_equal "title_root/skin/title_subalbum/title_subsubalbum/index.html", @subsubalbum.page_url_from_root
54
+ end
55
+ end
@@ -8,13 +8,11 @@ require 'ralbum/catalog'
8
8
 
9
9
  class CatalogTest < Test::Unit::TestCase
10
10
 
11
- def setup
12
- @data_dir = File.join($PHOTOTREE_DIRECTORY, "catalog_data")
11
+ def test_new_catalog
12
+ @data_dir = File.join($PHOTOTREE_DIRECTORY, "ralbum")
13
13
  @md5_to_key_file = @data_dir + File::Separator + "md5_to_key.yaml"
14
14
  @md5_to_key_file_test = @data_dir + File::Separator + "md5_to_key.yaml.test"
15
- end
16
15
 
17
- def testNewCatalog
18
16
  cat = Catalog.new( @data_dir )
19
17
  key = cat.register_photo( "md5_0" )
20
18
  assert_equal( 0, key )
@@ -27,5 +25,11 @@ class CatalogTest < Test::Unit::TestCase
27
25
  assert_equal( 0, $? )
28
26
  end
29
27
 
28
+ def test_no_ralbum_dir
29
+ assert_raise RAlbumException do
30
+ Catalog.new("not_existent_dir")
31
+ end
32
+ end
33
+
30
34
  end
31
35
 
@@ -0,0 +1,37 @@
1
+ require File.join( File.dirname(__FILE__), "test_helper")
2
+
3
+ # ralbum
4
+ require 'ralbum'
5
+ require 'ralbum/album_tree/album'
6
+ require 'ralbum/album_tree/image_pool'
7
+ require 'ralbum/album_tree/image_file'
8
+
9
+ class TestImagePool < Test::Unit::TestCase
10
+
11
+ def test_image_pool
12
+ album = Album.new(nil, "key", "title", "description")
13
+ ipool = ImagePool.new(album, "md5", "key", "title", "description" )
14
+
15
+
16
+ thumb_local_path = File.join($PHOTOTREE_DIRECTORY, "r_photo01.jpg" )
17
+ thumb_src_url = ""
18
+ thumb_imagefile = ImageFile.new(ipool, thumb_local_path, "r_photo01.jpg", thumb_src_url )
19
+ thumb = ipool.image( "thumb", thumb_imagefile )
20
+
21
+ default_local_path = File.join($PHOTOTREE_DIRECTORY, "r_photo01.jpg" )
22
+ default_src_url = ""
23
+ default_imagefile = ImageFile.new(ipool, default_local_path, "r_photo01.jpg", default_src_url )
24
+ default = ipool.image( "default", default_imagefile )
25
+
26
+ assert_equal thumb, ipool.thumb
27
+ # assert_equal "", thumb.url
28
+ # assert_equal "r_photo01.jpg", thumb.page_url
29
+ # assert_equal "r_photo01.jpg", thumb.url
30
+
31
+ assert_equal default, ipool.default_image_file
32
+ # assert_equal "", default.url
33
+ # assert_equal "r_photo01.jpg", default.page_url
34
+ # assert_equal "r_photo01.jpg", default.url
35
+ end
36
+
37
+ end
@@ -19,7 +19,7 @@ class TestKwartzSkinEngine < Test::Unit::TestCase
19
19
  path = File.join( skin_engine.skin.skin_dirname, "out", f )
20
20
  FileUtils.rm( path ) if File.exist?(path)
21
21
  }
22
- skin_engine.compile_skin
22
+ skin_engine.compile
23
23
  outputfiles.each { |f|
24
24
  path = File.join( skin_engine.skin.skin_dirname, "out", f )
25
25
  assert File.exist?( path )
@@ -21,10 +21,15 @@ class TestSkinManager < Test::Unit::TestCase
21
21
 
22
22
  def test_skin_engine
23
23
  skin_manager = SkinManager.new
24
-
25
- # test use default skin_engine
26
24
  skin = skin_manager.get_skin("test_kwartz")
27
- assert_equal KwartzSkinEngine, skin.skin_engine.class
25
+ assert_equal KwartzSkinEngine, skin.engine.class
26
+ end
27
+
28
+ def test_each_skin
29
+ skin_manager = SkinManager.new
30
+ nr_skins = 0
31
+ skin_manager.each{ |s| nr_skins += 1}
32
+ assert_equal 5, nr_skins
28
33
  end
29
34
 
30
35
  end
@@ -1,4 +1,5 @@
1
1
  # stdlib
2
+ require 'rubygems'
2
3
  require 'test/unit'
3
4
 
4
5
  # ralbum
@@ -9,5 +10,19 @@ $:.unshift lib_dir unless $:.include?(lib_dir)
9
10
  $:.unshift test_dir unless $:.include?( test_dir )
10
11
 
11
12
  $TEST_DATA = File.join( $RALBUM_HOME, "test_data", "ralbum", "test_data" )
12
- $PHOTOTREE_DIRECTORY = File.join( $RALBUM_HOME, "example", "test_phototree")
13
+ $PHOTOTREE_DIRECTORY = File.join( $RALBUM_HOME, "example", "test_rubyphoto_phototree")
14
+ $JALBUM_PHOTOTREE_DIRECTORY = File.join( $RALBUM_HOME, "example", "test_jalbum_phototree")
13
15
 
16
+
17
+ require "stringio"
18
+ def with_stdout_captured
19
+ old_stdout = $stdout
20
+ out = StringIO.new
21
+ $stdout = out
22
+ begin
23
+ yield
24
+ ensure
25
+ $stdout = old_stdout
26
+ end
27
+ out.string
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gf-ralbum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - gf
@@ -9,31 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-25 00:00:00 -07:00
13
- default_executable:
12
+ date: 2009-06-07 00:00:00 -07:00
13
+ default_executable: ralbum
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: tree_visitor
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: imagesize
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: kwartz
16
+ name: treevisitor
37
17
  type: :runtime
38
18
  version_requirement:
39
19
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,64 +32,78 @@ dependencies:
52
32
  - !ruby/object:Gem::Version
53
33
  version: "0"
54
34
  version:
55
- description:
35
+ description: Another boring and skinnable photo album generator
56
36
  email: giovanni.ferro@gmail.com
57
37
  executables:
58
- - ralbum-readexif.rb
59
- - ralbum-reorder.rb
60
- - ralbum-JPG2jpg.rb
61
- - ralbum-myconv.rb
62
- - ralbum-compile_skins.rb
63
- - ralbum.rb
38
+ - ralbum
64
39
  extensions: []
65
40
 
66
41
  extra_rdoc_files:
67
42
  - LICENSE
68
43
  - README.rdoc
69
44
  files:
45
+ - LICENSE
46
+ - README.rdoc
47
+ - VERSION
70
48
  - example/README.txt
71
49
  - example/example.sh
72
50
  - example/httpd.rb
73
- - example/test_phototree/album.xml
74
- - example/test_phototree/catalog_data/md5_to_key.yaml
75
- - example/test_phototree/catalog_data/md5_to_key.yaml.test
76
- - example/test_phototree/catalog_data/project.xml
77
- - example/test_phototree/r_photo01.jpg
78
- - example/test_phototree/r_photo01.jpg.xml
79
- - example/test_phototree/subalbum01/album.xml
80
- - example/test_phototree/subalbum01/subalbum01_photo01.jpg
81
- - example/test_phototree/subalbum01/subalbum01_photo01.jpg.xml
82
- - example/test_phototree/subalbum01/subalbum01_photo02.jpg
83
- - example/test_phototree/subalbum01/subalbum01_photo02.jpg.xml
84
- - example/test_phototree/subalbum01/subalbum01_photo03.jpg
85
- - example/test_phototree/subalbum01/subalbum01_photo03.jpg.xml
86
- - example/test_phototree/subalbum01/subalbum01_photo04.jpg
87
- - example/test_phototree/subalbum01/subalbum01_photo04.jpg.xml
88
- - example/test_phototree/subalbum02/album.xml
89
- - example/test_phototree/subalbum02/subalbum02_photo01.jpg
90
- - example/test_phototree/subalbum02/subalbum02_photo01.jpg.xml
91
- - example/test_phototree/subalbum02/subalbum02_photo02.jpg
92
- - example/test_phototree/subalbum02/subalbum02_photo02.jpg.xml
93
- - example/test_phototree/subalbum02/subalbum02_photo03.jpg
94
- - example/test_phototree/subalbum02/subalbum02_photo03.jpg.xml
95
- - example/test_phototree/subalbum02/subalbum02_photo04.jpg
96
- - example/test_phototree/subalbum02/subalbum02_photo04.jpg.xml
97
- - example/test_phototree/subalbum02/subalbum02_photo05.jpg
98
- - example/test_phototree/subalbum02/subalbum02_photo05.jpg.xml
99
- - lib/ralbum-common/object_with_properties.rb
100
- - lib/ralbum-common/object_with_validation.rb
51
+ - example/test_jalbum_phototree/jalbum-settings.jap
52
+ - example/test_jalbum_phototree/src/albumfiles.txt
53
+ - example/test_jalbum_phototree/src/comments.properties
54
+ - example/test_jalbum_phototree/src/flowers/albumfiles.txt
55
+ - example/test_jalbum_phototree/src/meta.properties
56
+ - example/test_rubyphoto_phototree/album.xml
57
+ - example/test_rubyphoto_phototree/flowers/IMG_1469.wt.jpg
58
+ - example/test_rubyphoto_phototree/flowers/IMG_2291.jpg
59
+ - example/test_rubyphoto_phototree/flowers/IMG_2598.jpg
60
+ - example/test_rubyphoto_phototree/flowers/IMG_3068.jpg
61
+ - example/test_rubyphoto_phototree/flowers/IMG_3323.jpg
62
+ - example/test_rubyphoto_phototree/flowers/IMG_3348.jpg
63
+ - example/test_rubyphoto_phototree/r_photo01.jpg
64
+ - example/test_rubyphoto_phototree/r_photo01.jpg.xml
65
+ - example/test_rubyphoto_phototree/ralbum/md5_to_key.yaml
66
+ - example/test_rubyphoto_phototree/ralbum/md5_to_key.yaml.test
67
+ - example/test_rubyphoto_phototree/ralbum/project.xml
68
+ - example/test_rubyphoto_phototree/subalbum01/album.xml
69
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo01.jpg
70
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo01.jpg.xml
71
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo02.jpg
72
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo02.jpg.xml
73
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo03.jpg
74
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo03.jpg.xml
75
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo04.jpg
76
+ - example/test_rubyphoto_phototree/subalbum01/subalbum01_photo04.jpg.xml
77
+ - example/test_rubyphoto_phototree/subalbum02/album.xml
78
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo01.jpg
79
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo01.jpg.xml
80
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo02.jpg
81
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo02.jpg.xml
82
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo03.jpg
83
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo03.jpg.xml
84
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo04.jpg
85
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo04.jpg.xml
86
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo05.jpg
87
+ - example/test_rubyphoto_phototree/subalbum02/subalbum02_photo05.jpg.xml
101
88
  - lib/ralbum.rb
102
- - lib/ralbum/album.rb
89
+ - lib/ralbum/album_tree/album.rb
90
+ - lib/ralbum/album_tree/generate_album_tree_node_visitor.rb
91
+ - lib/ralbum/album_tree/image_file.rb
92
+ - lib/ralbum/album_tree/image_pool.rb
103
93
  - lib/ralbum/catalog.rb
104
94
  - lib/ralbum/cli/cli_ralbum.rb
105
- - lib/ralbum/generate_album_tree_node_visitor.rb
106
- - lib/ralbum/image_file.rb
107
- - lib/ralbum/image_pool.rb
108
- - lib/ralbum/image_strategy.rb
95
+ - lib/ralbum/image_strategies/copy_image_strategy.rb
96
+ - lib/ralbum/image_strategies/linked_image_strategy.rb
97
+ - lib/ralbum/image_strategies/scaled_image_strategy.rb
98
+ - lib/ralbum/image_strategies/sepia_scaled_image_strategy.rb
99
+ - lib/ralbum/object_with_properties.rb
100
+ - lib/ralbum/object_with_validation.rb
109
101
  - lib/ralbum/options.rb
110
- - lib/ralbum/photo_tree_builder.rb
111
- - lib/ralbum/photo_tree_item.rb
112
- - lib/ralbum/photo_tree_node.rb
102
+ - lib/ralbum/photo_tree/jalbum_photo_tree.rb
103
+ - lib/ralbum/photo_tree/photo_file.rb
104
+ - lib/ralbum/photo_tree/photo_tree_item.rb
105
+ - lib/ralbum/photo_tree/photo_tree_node.rb
106
+ - lib/ralbum/photo_tree/rubyphoto_photo_tree.rb
113
107
  - lib/ralbum/project.rb
114
108
  - lib/ralbum/ralbum_exception.rb
115
109
  - lib/ralbum/resource.rb
@@ -170,11 +164,14 @@ files:
170
164
  - lib/ralbum/skins/test_erb/info.yml
171
165
  - lib/ralbum/skins/test_erb/out/album_page.rb
172
166
  - lib/ralbum/skins/test_erb/out/image_page.rb
167
+ - lib/ralbum/skins/test_erb/template/album_page.rhtml
168
+ - lib/ralbum/skins/test_erb/template/image_page.rhtml
173
169
  - lib/ralbum/skins/test_kwartz/info.yml
174
170
  - lib/ralbum/skins/test_kwartz/out/album_page.rb
175
171
  - lib/ralbum/skins/test_kwartz/out/image_page.rb
176
172
  - lib/ralbum/skins/test_kwartz/template/album_page.html
177
173
  - lib/ralbum/skins/test_kwartz/template/image_page.html
174
+ - lib/ralbum/tasks/compile_skins.rb
178
175
  - test_data/ralbum/test_data/albums_directory/gfold/album_1/img_0004.jpg.html
179
176
  - test_data/ralbum/test_data/albums_directory/gfold/album_1/img_0005.jpg.html
180
177
  - test_data/ralbum/test_data/albums_directory/gfold/album_1/img_0006.jpg.html
@@ -233,10 +230,7 @@ files:
233
230
  - test_data/ralbum/test_data/albums_directory/test/album_2/index.html
234
231
  - test_data/ralbum/test_data/albums_directory/test/img_0003.jpg.html
235
232
  - test_data/ralbum/test_data/albums_directory/test/index.html
236
- - test_data/ralbum/test_data/is_test/r_photo01_scaled.jpg
237
- - test_data/ralbum/test_data/is_test/r_photo01_sepia_scaled.jpg
238
- - LICENSE
239
- - README.rdoc
233
+ - test_data/ralbum/test_data/is_test/dummy.txt
240
234
  has_rdoc: true
241
235
  homepage: http://github.com/gf/ralbum
242
236
  post_install_message:
@@ -261,16 +255,19 @@ requirements: []
261
255
  rubyforge_project: ralbum
262
256
  rubygems_version: 1.2.0
263
257
  signing_key:
264
- specification_version: 2
265
- summary: another boring and skinnable photo album generator
258
+ specification_version: 3
259
+ summary: Another boring and skinnable photo album generator
266
260
  test_files:
267
- - test/ralbum/tc_01_photo_tree.rb
268
- - test/ralbum/tc_02_photo_tree_builder.rb
269
- - test/ralbum/tc_03_album.rb
270
- - test/ralbum/tc_04_skin_manager.rb
271
- - test/ralbum/cli/test_cli_ralbum.rb
272
- - test/ralbum/tc_06_image_strategy.rb
261
+ - test/ralbum/tc_album.rb
262
+ - test/ralbum/tc_skin_manager.rb
263
+ - test/ralbum/tc_kwartz_skin_engine.rb
264
+ - test/ralbum/photo_tree/tc_rubyalbum_photo_tree.rb
265
+ - test/ralbum/photo_tree/tc_photo_file.rb
266
+ - test/ralbum/photo_tree/tc_photo_tree.rb
267
+ - test/ralbum/photo_tree/tc_jalbum_photo_tree.rb
268
+ - test/ralbum/cli/tc_cli_ralbum.rb
273
269
  - test/ralbum/tc_catalog.rb
274
270
  - test/ralbum/test_helper.rb
275
- - test/ralbum/tc_05_kwartz_skin_engine.rb
276
- - test/test_ralbum.rb
271
+ - test/ralbum/image_strategies/tc_scaled_image_strategy.rb
272
+ - test/ralbum/image_strategies/tc_sepia_scaled_image_strategy.rb
273
+ - test/ralbum/tc_image_pool.rb
@@ -1,90 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $RALBUM_HOME = File.expand_path( File.join( File.dirname( __FILE__), ".." ) )
4
- $:.unshift( File.join($GALLERIES_HOME, "lib" ) )
5
-
6
- # ruby
7
- require 'fileutils'
8
- require 'optparse'
9
- require 'ostruct'
10
-
11
- # rubyalbum
12
- require "ralbum/config"
13
- require "ralbum/recursive_run"
14
-
15
-
16
- def mymove( srcpath, destpath )
17
- if $options.usetempfile
18
- # find a best name for tempfile
19
- temppath = File.dirname( destpath ) + File::Separator + "tempfile"
20
- FileUtils::move( srcpath, temppath )
21
- FileUtils::move( temppath, destpath )
22
- else
23
- FileUtils::move( srcpath, destpath )
24
- end
25
- end
26
-
27
- def run( dir )
28
- begin
29
- Dir.entries( dir ).each { |filename|
30
- next unless filename =~ /\.JPG$/
31
- new_filename = filename.gsub( /\.JPG$/, ".jpg" )
32
- inpath = dir + File::Separator + filename;
33
- newpath = dir + File::Separator + new_filename
34
- mymove( inpath, newpath )
35
- puts "in #{dir}: #{filename} -> #{new_filename}"
36
- }
37
- rescue ArgumentError => e
38
- puts "ERROR : " + e
39
- puts "If you are using a fat32 filesystem try options -t"
40
- rescue Errno::ENOENT => e
41
- puts "ERROR : " + e
42
- end
43
- end
44
-
45
- ###################################################################################
46
- # Main
47
-
48
- $config = Config.new
49
-
50
- $options = OpenStruct.new
51
- $options.force = false
52
- $options.verbose = 0
53
- $options.recursive = false
54
- $options.usetempfile = false
55
-
56
- opts = OptionParser.new do |opts|
57
- opts.banner =
58
- "Usage: #{File.basename($0)} <directory>\n" +
59
- "Rename file.JPG in file.jpg"
60
- opts.on("-v", "--verbose [NUM]", Integer, "verbosity level") { |num|
61
- if num.nil?
62
- $options.verbose = 1
63
- else
64
- $options.verbose = num
65
- end
66
- }
67
- opts.on("-r", "--recursive", "recusive in subdirectories") {
68
- $options.recursive = true
69
- }
70
- opts.on("-t", "--usetempfile", "rename first to temp file and then to dest file") {
71
- $options.usetempfile = true
72
- }
73
- opts.on("--help", "-h", "help!") {
74
- puts opts
75
- exit 0
76
- }
77
- end
78
- opts.parse!(ARGV)
79
-
80
- unless ARGV[0]
81
- puts opts
82
- exit 1
83
- end
84
-
85
- input_dir = ARGV[0]
86
- if $options.recursive
87
- recursive_run( input_dir ) { |d| run d }
88
- else
89
- run input_dir
90
- end