bcms_tools 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 0.1.0
1
+ 0.2.0
2
2
 
data/bcms_tools.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bcms_tools}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["buzzware"]
12
- s.date = %q{2010-04-30}
12
+ s.date = %q{2010-06-23}
13
13
  s.description = %q{Tools for BrowserCms.}
14
14
  s.email = %q{contact@buzzware.com.au}
15
15
  s.extra_rdoc_files = [
data/bcms_tools.vpj CHANGED
@@ -6,7 +6,7 @@
6
6
  <Config
7
7
  Name="Release"
8
8
  OutputFile=""
9
- CompilerConfigName="Latest Version">
9
+ CompilerConfigName="">
10
10
  <Menu>
11
11
  <Target
12
12
  Name="Compile"
@@ -44,14 +44,14 @@
44
44
  MenuCaption="E&amp;xecute"
45
45
  SaveOption="SaveNone"
46
46
  RunFromDir="%rw">
47
- <Exec CmdLine='"FrescoClient.exe"'/>
47
+ <Exec CmdLine='".exe"'/>
48
48
  </Target>
49
49
  </Menu>
50
50
  </Config>
51
51
  <CustomFolders>
52
52
  <Folder
53
53
  Name="Source Files"
54
- Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl"/>
54
+ Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d"/>
55
55
  <Folder
56
56
  Name="Header Files"
57
57
  Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if"/>
@@ -67,27 +67,14 @@
67
67
  </Folder>
68
68
  </CustomFolders>
69
69
  <Files AutoFolders="DirectoryView">
70
- <Folder Name="lib">
71
- <F
72
- N="lib/*"
73
- Recurse="1"
74
- Refilter="0"
75
- Excludes=""/>
76
- </Folder>
77
- <Folder Name="rails">
78
- <F N="rails/init.rb"/>
79
- </Folder>
80
- <Folder Name="test">
81
- <F
82
- N="test/*"
83
- Recurse="1"
84
- Refilter="0"
85
- Excludes=""/>
86
- </Folder>
87
70
  <F
88
- N="*"
89
- Recurse="0"
90
- Refilter="0"
91
- Excludes=""/>
71
+ N="*.rb"
72
+ Recurse="1"
73
+ Refilter="1"
74
+ Excludes=".svn/"/>
75
+ <F N="bcms_tools.gemspec"/>
76
+ <F N="Rakefile"/>
77
+ <F N="README.rdoc"/>
78
+ <F N="VERSION"/>
92
79
  </Files>
93
80
  </Project>
@@ -29,8 +29,6 @@ Paperclip::Geometry.class_eval do
29
29
  end
30
30
  end
31
31
 
32
- # !!! must also fix /Library/Ruby/Gems/1.8/gems/paperclip-2.3.1.1/lib/paperclip/thumbnail.rb:54
33
- # and put in lighthouse
34
32
  Paperclip::Thumbnail.class_eval do
35
33
 
36
34
  attr_accessor :basename # need access to basename so we can change it away from bizarre file names that cause problems. could auto generate better names here
@@ -61,6 +59,20 @@ Paperclip::Thumbnail.class_eval do
61
59
  dst
62
60
  end
63
61
 
62
+ # returns true if succesful or false
63
+ def make_custom(aDestpath)
64
+ src = @file
65
+ srcpath = File.expand_path(src.path).gsub('$','\$') # escape $, more chars may need to be added
66
+ command = "#{ source_file_options } \"#{ srcpath }[0]\" #{ transformation_command } \"#{ File.expand_path(aDestpath) }\""
67
+ success = false
68
+ begin
69
+ success = (Paperclip.run("convert", command)=='') # assuming output always mean failure
70
+ rescue Paperclip::PaperclipCommandLineError
71
+ raise Paperclip::PaperclipError, "There was an error processing the thumbnail for #{@basename}" if @whiny
72
+ end
73
+ success
74
+ end
75
+
64
76
  end
65
77
 
66
78
  # END Paperclip 2.3.1.1 fixes for funky filenames
@@ -175,12 +187,10 @@ module Buzzcore
175
187
  pathThumb = File.join(aDestFolder,nameThumb)
176
188
 
177
189
  if !File.exists?(pathThumb)
178
- throw RuntimeError.new("Failed reading image #{aSource}") unless objThumb = Paperclip::Thumbnail.new(File.new(aSource), :geometry => resize_spec+resize_mod, :format => :jpg)
190
+ throw RuntimeError.new("Failed reading image #{aSource}") unless objThumb = Paperclip::Thumbnail.new(File.new(aSource), :geometry => resize_spec+resize_mod, :format => :jpg, :convert_options => '-quality 85')
179
191
  objThumb.basename = MiscUtils.file_no_extension(nameThumb)
180
- throw RuntimeError.new("Failed making thumbnail #{aSource}") unless foThumb = objThumb.make
181
- FileUtils.cp(foThumb.path,pathThumb)
192
+ throw RuntimeError.new("Failed making thumbnail #{aSource}") unless objThumb.make_custom(pathThumb)
182
193
  FileUtils.chmod(0644,pathThumb)
183
- FileUtils.rm(foThumb.path)
184
194
  end
185
195
  src = File.join(aBaseUrl,nameThumb)
186
196
  details.merge!({
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcms_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzzware
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-30 00:00:00 +08:00
12
+ date: 2010-06-23 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency