airbrush 0.0.4 → 0.0.5.pre

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/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg
2
+ doc
3
+ coverage
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2008 Square Circle Triangle
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,4 +1,15 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
1
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
3
2
 
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
3
+ begin
4
+ require 'jeweler'
5
+ Jeweler::Tasks.new do |gemspec|
6
+ gemspec.name = "airbrush"
7
+ gemspec.summary = "Image Processing Server"
8
+ gemspec.description = "An Image Processing Server"
9
+ gemspec.email = "nick@whatevernext.org"
10
+ gemspec.homepage = "http://github.com/square-circle-triangle/airbush"
11
+ gemspec.authors = ["Marcus Crafter", "Nick Marfleet"]
12
+ end
13
+ rescue LoadError
14
+ puts "Jeweler not available. Install it with: gem install jeweler"
15
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'active_support'
5
+
6
+ class File
7
+ def self.obsolete?(filename)
8
+ File.mtime(filename) < 1.day.ago
9
+ end
10
+ end
11
+
12
+ Dir['*'].each do |filename|
13
+ next if filename =~ /^airbrush/ # leave queue files alone
14
+ File.delete filename if File.obsolete? filename
15
+ end
@@ -1,16 +1,16 @@
1
+ require 'live_ast'
1
2
  require 'ruby2ruby'
2
- require 'parse_tree'
3
3
 
4
4
  class ParseTreeArray < Array #:nodoc:
5
5
  def self.translate(*args)
6
- sexp = ::ParseTree.translate(*args)
7
- # ParseTree.translate returns [nil] if called on an inherited method, so walk
8
- # up the inheritance chain to find the class that the method was defined in
6
+ clazz, methd = *args
7
+ sexp = clazz.instance_method(methd).to_ast
8
+
9
9
  unless sexp.first
10
10
  klass = args.first.ancestors.detect do |klass|
11
11
  klass.public_instance_methods(false).include?(args.last.to_s)
12
12
  end
13
- sexp = ::ParseTree.translate(klass, args.last) if klass
13
+ sexp = klass.instance_method(args.last).to_ast if klass
14
14
  end
15
15
  self.new(sexp)
16
16
  end
@@ -47,7 +47,7 @@ class ParseTreeArray < Array #:nodoc:
47
47
 
48
48
  lasgns = default_node[1..-1]
49
49
  lasgns.each do |asgn|
50
- args.assoc(asgn[1]) << eval(RubyToRuby.new.process(asgn[2]))
50
+ args.assoc(asgn[1]) << eval(Ruby2Ruby.new.process(asgn[2]))
51
51
  end
52
52
  args
53
53
  end
@@ -2,7 +2,7 @@ module Airbrush #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,19 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
+
3
+ describe ActiveSupport::BufferedLogger, 'log statements' do
4
+
5
+ before do
6
+ @time = Time.now
7
+ Time.stub!(:now).and_return(@time)
8
+ @target = StringIO.new
9
+ @logger = ActiveSupport::BufferedLogger.new(@target)
10
+ @statement = 'this is a test'
11
+ end
12
+
13
+ it 'should automatically include the current time' do
14
+ @logger.debug(@statement)
15
+ @target.rewind
16
+ @target.readline.should == "#{@time}: #{@statement}\n"
17
+ end
18
+
19
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,2 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems'
5
- gem 'rspec'
6
- require 'spec'
7
- end
8
-
9
1
  $:.unshift(File.dirname(__FILE__) + '/../lib')
10
2
  require 'airbrush'
data/tasks/rspec.rake CHANGED
@@ -1,11 +1,11 @@
1
1
  begin
2
- require 'spec'
2
+ require 'rspec'
3
3
  rescue LoadError
4
4
  require 'rubygems'
5
- require 'spec'
5
+ require 'rspec'
6
6
  end
7
7
  begin
8
- require 'spec/rake/spectask'
8
+ require 'rspec/core/rake_task'
9
9
  rescue LoadError
10
10
  puts <<-EOS
11
11
  To use rspec for testing you must install rspec gem:
@@ -15,22 +15,22 @@ EOS
15
15
  end
16
16
 
17
17
  desc "Run the specs under spec"
18
- Spec::Rake::SpecTask.new('spec') do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/**/*_spec.rb']
18
+ RSpec::Core::RakeTask.new('spec') do |t|
19
+ t.rspec_opts = ['--options', "spec/spec.opts"]
20
+ t.pattern = 'spec/**/*_spec.rb'
21
21
  end
22
22
 
23
23
  desc "Run the specs under spec with code coverage"
24
- Spec::Rake::SpecTask.new('rcov') do |t|
25
- t.spec_opts = ['--options', "spec/spec.opts"]
26
- t.spec_files = FileList['spec/**/*_spec.rb']
24
+ RSpec::Core::RakeTask.new('rcov') do |t|
25
+ t.rspec_opts = ['--options', "spec/spec.opts"]
26
+ t.pattern = 'spec/**/*_spec.rb'
27
27
  t.rcov = true
28
28
  t.rcov_opts = ['--exclude', 'spec']
29
29
  end
30
30
 
31
31
  desc "Generate spec HTML report"
32
- Spec::Rake::SpecTask.new('spec-report') do |t|
33
- t.spec_files = FileList['spec/**/*_spec.rb']
34
- t.spec_opts = ["--format", "html:doc/rspec-results.html", "--diff"]
32
+ RSpec::Core::RakeTask.new('spec-report') do |t|
33
+ t.pattern = 'spec/**/*_spec.rb'
34
+ t.rspec_opts = ["--format", "html:doc/rspec-results.html", "--diff"]
35
35
  t.fail_on_error = false
36
36
  end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrush
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 4
9
- version: 0.0.4
4
+ prerelease: 6
5
+ version: 0.0.5.pre
10
6
  platform: ruby
11
7
  authors:
12
8
  - Marcus Crafter
@@ -15,8 +11,7 @@ autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
13
 
18
- date: 2011-02-25 00:00:00 +11:00
19
- default_executable:
14
+ date: 2010-05-19 00:00:00 Z
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
22
17
  name: starling
@@ -26,10 +21,6 @@ dependencies:
26
21
  requirements:
27
22
  - - "="
28
23
  - !ruby/object:Gem::Version
29
- segments:
30
- - 0
31
- - 9
32
- - 8
33
24
  version: 0.9.8
34
25
  type: :runtime
35
26
  version_requirements: *id001
@@ -41,10 +32,6 @@ dependencies:
41
32
  requirements:
42
33
  - - ~>
43
34
  - !ruby/object:Gem::Version
44
- segments:
45
- - 2
46
- - 3
47
- - 10
48
35
  version: 2.3.10
49
36
  type: :runtime
50
37
  version_requirements: *id002
@@ -56,10 +43,6 @@ dependencies:
56
43
  requirements:
57
44
  - - "="
58
45
  - !ruby/object:Gem::Version
59
- segments:
60
- - 1
61
- - 2
62
- - 1
63
46
  version: 1.2.1
64
47
  type: :runtime
65
48
  version_requirements: *id003
@@ -71,49 +54,51 @@ dependencies:
71
54
  requirements:
72
55
  - - "="
73
56
  - !ruby/object:Gem::Version
74
- segments:
75
- - 1
76
- - 0
77
- - 10
78
57
  version: 1.0.10
79
58
  type: :runtime
80
59
  version_requirements: *id004
81
60
  - !ruby/object:Gem::Dependency
82
- name: hoe
61
+ name: live_ast
83
62
  prerelease: false
84
63
  requirement: &id005 !ruby/object:Gem::Requirement
85
64
  none: false
86
65
  requirements:
87
66
  - - ">="
88
67
  - !ruby/object:Gem::Version
89
- segments:
90
- - 2
91
- - 8
92
- - 0
93
- version: 2.8.0
94
- type: :development
68
+ version: "0"
69
+ type: :runtime
95
70
  version_requirements: *id005
96
- description: Distributed image processing server.
97
- email: nickmarfleet@gmail.com
71
+ - !ruby/object:Gem::Dependency
72
+ name: rspec
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ type: :development
81
+ version_requirements: *id006
82
+ description: An Image Processing Server
83
+ email: nick@whatevernext.org
98
84
  executables:
99
85
  - airbrush
100
86
  - airbrush-example-client
101
87
  extensions: []
102
88
 
103
89
  extra_rdoc_files:
104
- - History.txt
105
- - Manifest.txt
90
+ - LICENSE
106
91
  - README.txt
107
- - website/index.txt
108
92
  files:
93
+ - .gitignore
109
94
  - History.txt
110
- - Manifest.txt
95
+ - LICENSE
111
96
  - README.txt
112
97
  - Rakefile
98
+ - VERSION
113
99
  - bin/airbrush
114
100
  - bin/airbrush-example-client
115
- - config/hoe.rb
116
- - config/requirements.rb
101
+ - extras/image_reaper.rb
117
102
  - lib/airbrush.rb
118
103
  - lib/airbrush/client.rb
119
104
  - lib/airbrush/core_ext/get_args.rb
@@ -140,6 +125,7 @@ files:
140
125
  - setup.rb
141
126
  - spec/airbrush/client_spec.rb
142
127
  - spec/airbrush/core_ext/get_args_spec.rb
128
+ - spec/airbrush/core_ext/timestamped_logger_spec.rb
143
129
  - spec/airbrush/handler_spec.rb
144
130
  - spec/airbrush/listeners/listener_spec.rb
145
131
  - spec/airbrush/listeners/memcache_spec.rb
@@ -152,23 +138,19 @@ files:
152
138
  - spec/airbrush_spec.rb
153
139
  - spec/spec.opts
154
140
  - spec/spec_helper.rb
155
- - tasks/deployment.rake
156
141
  - tasks/environment.rake
157
142
  - tasks/rspec.rake
158
- - tasks/website.rake
159
143
  - website/index.html
160
144
  - website/index.txt
161
145
  - website/javascripts/rounded_corners_lite.inc.js
162
146
  - website/stylesheets/screen.css
163
147
  - website/template.rhtml
164
- has_rdoc: true
165
- homepage: http://airbrush.rubyforge.org
148
+ homepage: http://github.com/square-circle-triangle/airbush
166
149
  licenses: []
167
150
 
168
151
  post_install_message:
169
152
  rdoc_options:
170
- - --main
171
- - README.txt
153
+ - --charset=UTF-8
172
154
  require_paths:
173
155
  - lib
174
156
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -176,23 +158,32 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
158
  requirements:
177
159
  - - ">="
178
160
  - !ruby/object:Gem::Version
179
- segments:
180
- - 0
181
161
  version: "0"
182
162
  required_rubygems_version: !ruby/object:Gem::Requirement
183
163
  none: false
184
164
  requirements:
185
165
  - - ">="
186
166
  - !ruby/object:Gem::Version
187
- segments:
188
- - 0
189
167
  version: "0"
190
168
  requirements: []
191
169
 
192
- rubyforge_project: airbrush
193
- rubygems_version: 1.3.7
170
+ rubyforge_project:
171
+ rubygems_version: 1.8.10
194
172
  signing_key:
195
173
  specification_version: 3
196
- summary: Distributed image processing server.
197
- test_files: []
198
-
174
+ summary: Image Processing Server
175
+ test_files:
176
+ - spec/airbrush/client_spec.rb
177
+ - spec/airbrush/core_ext/get_args_spec.rb
178
+ - spec/airbrush/core_ext/timestamped_logger_spec.rb
179
+ - spec/airbrush/handler_spec.rb
180
+ - spec/airbrush/listeners/listener_spec.rb
181
+ - spec/airbrush/listeners/memcache_spec.rb
182
+ - spec/airbrush/processors/image/image_processor_spec.rb
183
+ - spec/airbrush/processors/image/rmagick_spec.rb
184
+ - spec/airbrush/processors/processor_spec.rb
185
+ - spec/airbrush/publishers/memcache_spec.rb
186
+ - spec/airbrush/publishers/publisher_spec.rb
187
+ - spec/airbrush/server_spec.rb
188
+ - spec/airbrush_spec.rb
189
+ - spec/spec_helper.rb
data/Manifest.txt DELETED
@@ -1,55 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- Rakefile
5
- bin/airbrush
6
- bin/airbrush-example-client
7
- config/hoe.rb
8
- config/requirements.rb
9
- lib/airbrush.rb
10
- lib/airbrush/client.rb
11
- lib/airbrush/core_ext/get_args.rb
12
- lib/airbrush/core_ext/timestamped_logger.rb
13
- lib/airbrush/handler.rb
14
- lib/airbrush/listeners/listener.rb
15
- lib/airbrush/listeners/memcache.rb
16
- lib/airbrush/listeners/socket.rb
17
- lib/airbrush/listeners/webservice.rb
18
- lib/airbrush/processors/image/image_processor.rb
19
- lib/airbrush/processors/image/profiles/cmyk-profile.icc
20
- lib/airbrush/processors/image/profiles/srgb-profile.icc
21
- lib/airbrush/processors/image/rmagick.rb
22
- lib/airbrush/processors/processor.rb
23
- lib/airbrush/publishers/http.rb
24
- lib/airbrush/publishers/memcache.rb
25
- lib/airbrush/publishers/publisher.rb
26
- lib/airbrush/server.rb
27
- lib/airbrush/version.rb
28
- log/debug.log
29
- script/destroy
30
- script/generate
31
- script/txt2html
32
- setup.rb
33
- spec/airbrush/client_spec.rb
34
- spec/airbrush/core_ext/get_args_spec.rb
35
- spec/airbrush/handler_spec.rb
36
- spec/airbrush/listeners/listener_spec.rb
37
- spec/airbrush/listeners/memcache_spec.rb
38
- spec/airbrush/processors/image/image_processor_spec.rb
39
- spec/airbrush/processors/image/rmagick_spec.rb
40
- spec/airbrush/processors/processor_spec.rb
41
- spec/airbrush/publishers/memcache_spec.rb
42
- spec/airbrush/publishers/publisher_spec.rb
43
- spec/airbrush/server_spec.rb
44
- spec/airbrush_spec.rb
45
- spec/spec.opts
46
- spec/spec_helper.rb
47
- tasks/deployment.rake
48
- tasks/environment.rake
49
- tasks/rspec.rake
50
- tasks/website.rake
51
- website/index.html
52
- website/index.txt
53
- website/javascripts/rounded_corners_lite.inc.js
54
- website/stylesheets/screen.css
55
- website/template.rhtml
data/config/hoe.rb DELETED
@@ -1,71 +0,0 @@
1
- require 'airbrush/version'
2
-
3
- AUTHOR = ['Marcus Crafter', 'Nick Marfleet'] # can also be an array of Authors
4
- EMAIL = "nickmarfleet@gmail.com"
5
- DESCRIPTION = "Distributed image processing server."
6
- GEM_NAME = 'airbrush' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'airbrush' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
-
11
- @config_file = "~/.rubyforge/user-config.yml"
12
- @config = nil
13
- RUBYFORGE_USERNAME = "nickm"
14
- def rubyforge_username
15
- unless @config
16
- begin
17
- @config = YAML.load(File.read(File.expand_path(@config_file)))
18
- rescue
19
- puts <<-EOS
20
- ERROR: No rubyforge config file found: #{@config_file}
21
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
22
- - See http://newgem.rubyforge.org/rubyforge.html for more details
23
- EOS
24
- exit
25
- end
26
- end
27
- RUBYFORGE_USERNAME.replace @config["username"]
28
- end
29
-
30
-
31
- REV = nil
32
- # UNCOMMENT IF REQUIRED:
33
- # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
34
- VERS = Airbrush::VERSION::STRING + (REV ? ".#{REV}" : "")
35
- RDOC_OPTS = ['--quiet', '--title', 'airbrush documentation',
36
- "--opname", "index.html",
37
- "--line-numbers",
38
- "--main", "README",
39
- "--inline-source"]
40
-
41
- class Hoe
42
- def extra_deps
43
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
44
- @extra_deps
45
- end
46
- end
47
-
48
- # Generate all the Rake tasks
49
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
50
- hoe = Hoe.new(GEM_NAME, VERS) do |p|
51
- p.author = AUTHOR
52
- p.description = DESCRIPTION
53
- p.email = EMAIL
54
- p.summary = DESCRIPTION
55
- p.url = HOMEPATH
56
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
57
- p.test_globs = ["test/**/test_*.rb"]
58
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
59
-
60
- # == Optional
61
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
62
- p.extra_deps = [ [ 'starling', '= 0.9.8' ], [ 'activesupport', '~> 2.3.10' ], [ 'ruby2ruby', '= 1.2.1' ], [ 'daemons', '= 1.0.10' ] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
-
64
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
65
-
66
- end
67
-
68
- CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
69
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
70
- hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
71
- hoe.rsync_args = '-av --delete --ignore-errors'
@@ -1,17 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
16
-
17
- require 'airbrush'
@@ -1,34 +0,0 @@
1
- desc 'Release the website and new gem version'
2
- task :deploy => [:check_version, :website, :release] do
3
- puts "Remember to create SVN tag:"
4
- puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
- "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
- puts "Suggested comment:"
7
- puts "Tagging release #{CHANGES}"
8
- end
9
-
10
- desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
- task :local_deploy => [:website_generate, :install_gem]
12
-
13
- task :check_version do
14
- unless ENV['VERSION']
15
- puts 'Must pass a VERSION=x.y.z release version'
16
- exit
17
- end
18
- unless ENV['VERSION'] == VERS
19
- puts "Please update your version.rb to match the release version, currently #{VERS}"
20
- exit
21
- end
22
- end
23
-
24
- desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
- task :install_gem_no_doc => [:clean, :package] do
26
- sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
- end
28
-
29
- namespace :manifest do
30
- desc 'Recreate Manifest.txt to include ALL files'
31
- task :refresh do
32
- `rake check_manifest | patch -p0 > Manifest.txt`
33
- end
34
- end
data/tasks/website.rake DELETED
@@ -1,17 +0,0 @@
1
- desc 'Generate website files'
2
- task :website_generate => :ruby_env do
3
- (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
4
- sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
5
- end
6
- end
7
-
8
- desc 'Upload website files to rubyforge'
9
- task :website_upload do
10
- host = "#{rubyforge_username}@rubyforge.org"
11
- remote_dir = "/var/www/gforge-projects/#{PATH}/"
12
- local_dir = 'website'
13
- sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
14
- end
15
-
16
- desc 'Generate and upload website files'
17
- task :website => [:website_generate, :website_upload, :publish_docs]