spraypaint 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +44 -13
- data/about.yml +5 -5
- data/lib/spraypaint.rb +7 -0
- data/spraypaint.gemspec +9 -10
- data/test/spec/spraypaint_spec.rb +1 -1
- metadata +8 -12
- data/README +0 -17
- data/vendor/penknife/lib/penknife.rb +0 -2
- data/vendor/penknife/lib/penknife/rake.rb +0 -41
- data/vendor/penknife/lib/penknife/rake/plugin_tasks.rb +0 -79
data/Rakefile
CHANGED
@@ -1,20 +1,51 @@
|
|
1
1
|
$: << File.expand_path(File.join(File.dirname(__FILE__), "lib"))
|
2
|
-
$: << File.expand_path(File.join(File.dirname(__FILE__), "vendor/penknife/lib"))
|
3
2
|
|
4
|
-
require '
|
3
|
+
require 'spraypaint'
|
4
|
+
require 'spec/rake/spectask' rescue nil
|
5
5
|
|
6
6
|
namespace :spraypaint do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
begin
|
8
|
+
require 'jeweler'
|
9
|
+
Jeweler::Tasks.new do |gemspec|
|
10
|
+
gemspec.name = "spraypaint"
|
11
|
+
gemspec.version = Spraypaint::Version::STRING
|
12
|
+
gemspec.summary = "Simple tagging plugin for rails"
|
13
|
+
gemspec.description = "Simple tagging in a can"
|
14
|
+
gemspec.email = "tom@popdog.net"
|
15
|
+
gemspec.homepage = "http://github.com/tomafro/spraypaint.git"
|
16
|
+
gemspec.authors = ['Tom Ward']
|
17
|
+
end
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
20
|
+
end
|
21
|
+
|
22
|
+
if Object.const_defined?(:Spec)
|
23
|
+
desc "Run specs for spraypaint"
|
24
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
25
|
+
t.spec_opts = ["-f n -c"]
|
26
|
+
t.spec_files = FileList["#{File.dirname(__FILE__)}/test/spec/**/*_spec.rb"]
|
27
|
+
end
|
28
|
+
else
|
29
|
+
task :spec do
|
30
|
+
puts "To run specs for spraypaint you must install rspec"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
task 'about.yml' do
|
35
|
+
gemspec = Rake.application.jeweler_tasks.jeweler.gemspec
|
36
|
+
File.open(File.join(File.dirname(__FILE__), "about.yml"), 'w+') do |f|
|
37
|
+
YAML.dump({
|
38
|
+
:name => gemspec.name,
|
39
|
+
:summary => gemspec.summary,
|
40
|
+
:email => 'tom@popdog.net',
|
41
|
+
:homepage => gemspec.homepage,
|
42
|
+
:author => gemspec.authors.join(", "),
|
43
|
+
:plugin => gemspec.homepage,
|
44
|
+
:license => 'MIT',
|
45
|
+
:rails_version => '2.3+',
|
46
|
+
:version => gemspec.version.to_s
|
47
|
+
}, f)
|
48
|
+
end
|
18
49
|
end
|
19
50
|
end
|
20
51
|
|
data/about.yml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
---
|
2
|
-
:
|
2
|
+
:author: Tom Ward
|
3
|
+
:homepage: http://github.com/tomafro/spraypaint.git
|
3
4
|
:license: MIT
|
4
|
-
:rails_version: 2.3+
|
5
|
-
:author: Tom Ward (tomafro)
|
6
|
-
:summary: Simple tagging in a can
|
7
5
|
:plugin: http://github.com/tomafro/spraypaint.git
|
8
6
|
:email: tom@popdog.net
|
7
|
+
:rails_version: 2.3+
|
9
8
|
:name: spraypaint
|
10
|
-
:
|
9
|
+
:version: 1.0.1
|
10
|
+
:summary: Simple tagging plugin for rails
|
data/lib/spraypaint.rb
CHANGED
data/spraypaint.gemspec
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{spraypaint}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Tom Ward
|
12
|
-
s.date = %q{2009-
|
11
|
+
s.authors = ["Tom Ward"]
|
12
|
+
s.date = %q{2009-11-04}
|
13
|
+
s.description = %q{Simple tagging in a can}
|
13
14
|
s.email = %q{tom@popdog.net}
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
"README"
|
16
|
-
]
|
17
15
|
s.files = [
|
18
16
|
".gitignore",
|
19
17
|
"CHANGELOG",
|
@@ -49,11 +47,11 @@ Gem::Specification.new do |s|
|
|
49
47
|
"vendor/penknife/lib/penknife/rake.rb",
|
50
48
|
"vendor/penknife/lib/penknife/rake/plugin_tasks.rb"
|
51
49
|
]
|
52
|
-
s.homepage = %q{http://github.com/tomafro/spraypaint}
|
50
|
+
s.homepage = %q{http://github.com/tomafro/spraypaint.git}
|
53
51
|
s.rdoc_options = ["--charset=UTF-8"]
|
54
52
|
s.require_paths = ["lib"]
|
55
53
|
s.rubygems_version = %q{1.3.5}
|
56
|
-
s.summary = %q{Simple tagging
|
54
|
+
s.summary = %q{Simple tagging plugin for rails}
|
57
55
|
s.test_files = [
|
58
56
|
"test/config/boot.rb",
|
59
57
|
"test/config/environment.rb",
|
@@ -76,3 +74,4 @@ Gem::Specification.new do |s|
|
|
76
74
|
else
|
77
75
|
end
|
78
76
|
end
|
77
|
+
|
@@ -184,7 +184,7 @@ describe Spraypaint::Behaviour do
|
|
184
184
|
@it = Book.new :name => 'Book 5'
|
185
185
|
end
|
186
186
|
|
187
|
-
it "should
|
187
|
+
it "should reconstruct tag string from tags" do
|
188
188
|
@it.tag_string = "some , tags, go , here"
|
189
189
|
@it.save!
|
190
190
|
@it = Book.find(@it.id)
|
metadata
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spraypaint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Tom Ward
|
7
|
+
- Tom Ward
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-04 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: Simple tagging in a can
|
17
17
|
email: tom@popdog.net
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
24
|
files:
|
25
25
|
- .gitignore
|
26
26
|
- CHANGELOG
|
@@ -52,12 +52,8 @@ files:
|
|
52
52
|
- test/spec/models/tagging_spec.rb
|
53
53
|
- test/spec/spec_helper.rb
|
54
54
|
- test/spec/spraypaint_spec.rb
|
55
|
-
- vendor/penknife/lib/penknife.rb
|
56
|
-
- vendor/penknife/lib/penknife/rake.rb
|
57
|
-
- vendor/penknife/lib/penknife/rake/plugin_tasks.rb
|
58
|
-
- README
|
59
55
|
has_rdoc: true
|
60
|
-
homepage: http://github.com/tomafro/spraypaint
|
56
|
+
homepage: http://github.com/tomafro/spraypaint.git
|
61
57
|
licenses: []
|
62
58
|
|
63
59
|
post_install_message:
|
@@ -83,7 +79,7 @@ rubyforge_project:
|
|
83
79
|
rubygems_version: 1.3.5
|
84
80
|
signing_key:
|
85
81
|
specification_version: 3
|
86
|
-
summary: Simple tagging
|
82
|
+
summary: Simple tagging plugin for rails
|
87
83
|
test_files:
|
88
84
|
- test/config/boot.rb
|
89
85
|
- test/config/environment.rb
|
data/README
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Features:
|
2
|
-
|
3
|
-
f = Film.find_by_title("The Umbrella's of Cherbourg")
|
4
|
-
f.tags
|
5
|
-
=> ["french", "umbrella", "catherine-deneuve"]
|
6
|
-
|
7
|
-
Tags can be added using standard array methods
|
8
|
-
|
9
|
-
f.tags << "jacques-demy"
|
10
|
-
f.save!
|
11
|
-
f.reload
|
12
|
-
f.tags
|
13
|
-
=> ["french", "umbrella", "catherine-deneuve", "jacques-demy"]
|
14
|
-
|
15
|
-
Tags maintain their order
|
16
|
-
|
17
|
-
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'penknife'
|
2
|
-
|
3
|
-
begin
|
4
|
-
rspec_base = File.expand_path("#{RAILS_ROOT}/vendor/plugins/rspec/lib")
|
5
|
-
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) && !$LOAD_PATH.include?(rspec_base)
|
6
|
-
require 'spec/rake/spectask'
|
7
|
-
rescue Object => e
|
8
|
-
end
|
9
|
-
|
10
|
-
module Penknife::Rake
|
11
|
-
def self.define_plugin_tasks_for(plugin)
|
12
|
-
plugin = plugin.to_s
|
13
|
-
plugin_path = "#{RAILS_ROOT}/vendor/plugins/#{plugin}"
|
14
|
-
|
15
|
-
namespace plugin do
|
16
|
-
if Object.const_defined?(:Spec)
|
17
|
-
desc "Run #{plugin} specs"
|
18
|
-
Spec::Rake::SpecTask.new(:spec => "db:test:prepare") do |t|
|
19
|
-
t.spec_opts = ["-f n -c"]
|
20
|
-
t.spec_files = FileList["#{plugin_path}/spec/**/*_spec.rb"]
|
21
|
-
end
|
22
|
-
else
|
23
|
-
task :spec do
|
24
|
-
puts "To run specs for #{plugin} you must install rspec"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "#{plugin.titleize} stats"
|
29
|
-
task :stats do
|
30
|
-
require 'code_statistics'
|
31
|
-
::CodeStatistics::TEST_TYPES << "#{plugin.titleize} specs"
|
32
|
-
directories = [
|
33
|
-
[plugin.titleize + " code", "lib"],
|
34
|
-
[plugin.titleize + " specs", "spec"]
|
35
|
-
].collect { |name, dir|
|
36
|
-
[name, File.expand_path(File.join(plugin_path, dir))]}.select { |name, dir| File.directory?(dir) }
|
37
|
-
CodeStatistics.new(*directories).to_s
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'penknife'
|
2
|
-
require 'penknife/rake'
|
3
|
-
require 'rake'
|
4
|
-
require 'rake/tasklib'
|
5
|
-
require 'activesupport'
|
6
|
-
require 'cucumber/rake/task'
|
7
|
-
require 'spec/rake/spectask'
|
8
|
-
require 'jeweler'
|
9
|
-
require 'date'
|
10
|
-
|
11
|
-
class Penknife::Rake::PluginTasks < Jeweler::Tasks
|
12
|
-
def initialize(gemspec = nil, &block)
|
13
|
-
@gemspec = gemspec || Gem::Specification.new()
|
14
|
-
@gemspec.extend(PluginConfig)
|
15
|
-
@gemspec.date = Date.today.to_s
|
16
|
-
super(@gemspec)
|
17
|
-
end
|
18
|
-
|
19
|
-
module PluginConfig
|
20
|
-
attr_accessor :plugin_root, :code, :license, :rails_version
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def define
|
26
|
-
super
|
27
|
-
plugin = @plugin_name.to_s
|
28
|
-
|
29
|
-
if Object.const_defined?(:Spec)
|
30
|
-
desc "Run specs for #{plugin} plugin "
|
31
|
-
Spec::Rake::SpecTask.new(:spec) do |t|
|
32
|
-
t.spec_opts = ["-f n -c"]
|
33
|
-
t.spec_files = FileList["#{@gemspec.plugin_root}/test/spec/**/*_spec.rb"]
|
34
|
-
end
|
35
|
-
else
|
36
|
-
task :spec do
|
37
|
-
puts "To run specs for #{plugin} you must install rspec"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "Run #{plugin} features"
|
42
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
43
|
-
t.profile = ENV["CUCUMBER"] || "default"
|
44
|
-
end
|
45
|
-
|
46
|
-
desc "Calculate stats for #{plugin} plugin"
|
47
|
-
task :stats do
|
48
|
-
require 'code_statistics'
|
49
|
-
::CodeStatistics::TEST_TYPES << "#{@gemspec.name.titleize} specs"
|
50
|
-
::CodeStatistics::TEST_TYPES << "#{@gemspec.name.titleize} features"
|
51
|
-
directories = [
|
52
|
-
[@gemspec.name.titleize + " code", "lib"],
|
53
|
-
[@gemspec.name.titleize + " specs", "test/spec"],
|
54
|
-
[@gemspec.name.titleize + " features", "test/features"]
|
55
|
-
].collect { |name, dir|
|
56
|
-
[name, File.expand_path(File.join(@gemspec.plugin_root, dir))]}.select { |name, dir| File.directory?(dir) }
|
57
|
-
CodeStatistics.new(*directories).to_s
|
58
|
-
end
|
59
|
-
|
60
|
-
desc "Build about.yml for current version"
|
61
|
-
task :"about.yml" do
|
62
|
-
File.open(File.join(@gemspec.plugin_root, "about.yml"), 'w+') do |f|
|
63
|
-
YAML.dump({
|
64
|
-
:name => @gemspec.name,
|
65
|
-
:summary => @gemspec.summary,
|
66
|
-
:email => @gemspec.email,
|
67
|
-
:homepage => @gemspec.homepage,
|
68
|
-
:author => @gemspec.authors.join(", "),
|
69
|
-
:plugin => @gemspec.code,
|
70
|
-
:license => @gemspec.license,
|
71
|
-
:rails_version => @gemspec.rails_version,
|
72
|
-
:version => @jeweler.version
|
73
|
-
}, f)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
task 'generate' => ['gemspec', 'about.yml']
|
78
|
-
end
|
79
|
-
end
|