spraypaint 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ module Penknife
2
+ end
@@ -0,0 +1,41 @@
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
@@ -0,0 +1,79 @@
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
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spraypaint
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Tom Ward (tomafro)
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-18 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: tom@popdog.net
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ files:
25
+ - .gitignore
26
+ - CHANGELOG
27
+ - MIT-LICENSE
28
+ - Rakefile
29
+ - TODO
30
+ - VERSION.yml
31
+ - about.yml
32
+ - generators/spraypaint_migration/spraypaint_migration_generator.rb
33
+ - generators/spraypaint_migration/templates/spraypaint_migration.rb
34
+ - lib/spraypaint.rb
35
+ - lib/spraypaint/behaviour.rb
36
+ - lib/spraypaint/behaviour/discovery.rb
37
+ - lib/spraypaint/behaviour/manipulation.rb
38
+ - lib/spraypaint/behaviour/persistence.rb
39
+ - lib/spraypaint/default_sanitizer.rb
40
+ - lib/spraypaint/model/tag.rb
41
+ - lib/spraypaint/model/tagging.rb
42
+ - lib/spraypaint/sanitizer.rb
43
+ - rails/init.rb
44
+ - spraypaint.gemspec
45
+ - test/config/boot.rb
46
+ - test/config/database.yml
47
+ - test/config/environment.rb
48
+ - test/config/environments/test.rb
49
+ - test/db/schema.rb
50
+ - test/spec/default_sanitizer_spec.rb
51
+ - test/spec/models/tag_spec.rb
52
+ - test/spec/models/tagging_spec.rb
53
+ - test/spec/spec_helper.rb
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
+ has_rdoc: true
60
+ homepage: http://github.com/tomafro/spraypaint
61
+ licenses: []
62
+
63
+ post_install_message:
64
+ rdoc_options:
65
+ - --charset=UTF-8
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ version:
80
+ requirements: []
81
+
82
+ rubyforge_project:
83
+ rubygems_version: 1.3.5
84
+ signing_key:
85
+ specification_version: 3
86
+ summary: Simple tagging in a can
87
+ test_files:
88
+ - test/config/boot.rb
89
+ - test/config/environment.rb
90
+ - test/config/environments/test.rb
91
+ - test/db/schema.rb
92
+ - test/spec/default_sanitizer_spec.rb
93
+ - test/spec/models/tag_spec.rb
94
+ - test/spec/models/tagging_spec.rb
95
+ - test/spec/spec_helper.rb
96
+ - test/spec/spraypaint_spec.rb