Permalink
Browse files

Starting to take shape.

  • Loading branch information...
1 parent 37148dc commit 2461a2f607085ac8a5b423c74506d5a34be792d1 @aantix committed Nov 10, 2010
View
@@ -1,6 +1,9 @@
## MAC OS
.DS_Store
+*.gem
+build.sh
+
## TEXTMATE
*.tmproj
tmtags
@@ -18,4 +21,6 @@ coverage
rdoc
pkg
+.idea
+
## PROJECT::SPECIFIC
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Settings><!--This file was automatically generated by Ruby plugin.
+You are allowed to:
+1. Remove rake task
+2. Add existing rake tasks
+To add existing rake tasks automatically delete this file and reload the project.
+--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
View
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
+ <component name="ProjectRootManager" version="2" project-jdk-name="Ruby SDK 1.9.2-p0 [rails3]" project-jdk-type="RUBY_SDK" />
+</project>
+
View
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/sex_it_up.iml" filepath="$PROJECT_DIR$/.idea/sex_it_up.iml" />
+ </modules>
+ </component>
+</project>
+
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="RUBY_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] rake (v0.8.7, /Users/jjones/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rake-0.8.7)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] rspec (v2.0.0, /Users/jjones/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-2.0.0)" level="application" />
+ </component>
+</module>
+
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="" />
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
+
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,17 +1,25 @@
-= sex_it_up
+== Description
+Turn your boring "Lorem ipsum" website and placeholder images into a beautiful display of artwork.
-Description goes here.
+== View Helper
+# Searches wikimedia for passed in term. Caches all initial results.
+# As you search through results, image files will generally follow the form e.g. "File:<image name>.jpg - Wikimedia Commons"
+# Retains the original image and will generate scaled versions based on coordinates passed in
+# Allow for an optional watermark that defaults to the text "Placeholder"
+sexy_image('dogs', :width => 100, :height => 100)
-== Note on Patches/Pull Requests
-
-* Fork the project.
-* Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a
- future version unintentionally.
-* Commit, do not mess with rakefile, version, or history.
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-* Send me a pull request. Bonus points for topic branches.
+== Model
+# If you want to replace your boring user place holder image, you can do the following
+user.icon = SexItUp.sexy_image(['flowers','stars','butterflies'], :width => 75, :height => 75)
+
+== Rake Task
+# The inital caching of images for a given term may be slow (hence causing your initial page view to be slow), so you can "pre-warm" the image
+# cache for a given search term by using the following rake task.
+rake sex_it_up:cache butterflies
+
+# Show Lovdbyless or some other social site with a before (with boring placeholders) and after (with exciting images)
+# Show a screenshot of a sample site with the Lorem text and placeholder images
== Copyright
Copyright (c) 2010 Jim Jones. See LICENSE for details.
View
@@ -10,37 +10,30 @@ begin
gem.email = "jjones@aantix.com"
gem.homepage = "http://github.com/aantix/sex_it_up"
gem.authors = ["Jim Jones"]
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
+ gem.add_development_dependency "paperclip", ">= 2.3.5"
+ gem.add_development_dependency "rspec", ">= 1.2.9"
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
+require 'spec/rake/spectask'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
end
-task :test => :check_dependencies
-
-task :default => :test
+task :spec => :check_dependencies
+task :default => :spec
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
@@ -0,0 +1,13 @@
+class SexItUpGenerator < Rails::Generator::Base
+
+ def manifest
+ record do |m|
+ m.migration_template "sex_it_up_migration.rb.erb", File.join('db', 'migrate'), :migration_file_name => 'create_sex_it_up_images'
+ end
+ end
+
+ def banner
+ %{Usage: #{$0} #{spec.name}\nCopies needed migrations to project.}
+ end
+
+end
@@ -0,0 +1,16 @@
+class CreateSexItUp < ActiveRecord::Migration
+
+ def self.up
+ create_table "sex_it_up_images" do |t|
+ t.string :image_file_name
+ t.string :image_content_type
+ t.integer :image_file_size
+ t.datetime :image_updated_at
+ end
+ end
+
+ def self.down
+ drop_table :sex_it_up_images
+ end
+
+end
View
@@ -0,0 +1,33 @@
+require 'rubygems'
+require 'socket'
+require 'lockfile'
+require 'active_record'
+require 'action_view'
+require 'active_support'
+require 'action_controller'
+
+module SexItUp
+
+ class SexItUpImage < ActiveRecord::Base
+ # Want to give each user a unique avatar? Assign their profile image to the image returned here.
+ def self.find_all(term)
+ end
+
+ end
+
+
+ module SexItUpViewHelper
+
+ # Searches wikimedia for passed in term. Caches all initial results.
+ # As you search through results, image files will generally follow the form e.g. "File:<image name>.jpg - Wikimedia Commons"
+ # Retains the original image and will generate scaled versions based on coordinates passed in
+ # Allow for an optional watermark that defaults to the text "Placeholder"
+ def sexy_image(term, opts = {})
+
+ end
+
+ end
+
+end
+
+ActionView::Base.send :include, SexItUp::SexItUpFormHelper
View
@@ -0,0 +1,10 @@
+require 'sex_it_up'
+
+namespace :sex_it_up do
+
+ desc "Retrieve and cache all of the public domain images for a given search term."
+ task :cache, :term, :needs => :environment do |t, args|
+ SexItUp::SexItUp.find_all(args[:term])
+ end
+
+end
View
@@ -0,0 +1,7 @@
+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+
+describe "SexItUp" do
+ it "fails" do
+ fail "hey buddy, you should probably rename this file and start specing for real"
+ end
+end
View
@@ -0,0 +1 @@
+--color
@@ -1,10 +1,9 @@
-require 'rubygems'
-require 'test/unit'
-require 'shoulda'
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'sex_it_up'
+require 'spec'
+require 'spec/autorun'
-class Test::Unit::TestCase
+Spec::Runner.configure do |config|
+
end
View
@@ -1,7 +0,0 @@
-require 'helper'
-
-class TestSexItUp < Test::Unit::TestCase
- should "probably rename this file and start testing for real" do
- flunk "hey buddy, you should probably rename this file and start testing for real"
- end
-end

0 comments on commit 2461a2f

Please sign in to comment.