From 7e2aa5acfb3855db0b18da2d38fe2c877d3d00a4 Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Tue, 22 Jul 2014 19:02:22 -0400 Subject: [PATCH] Move discourse_plugin to lib --- Gemfile | 4 - Gemfile.lock | 6 - config/application.rb | 2 + .../lib => lib}/discourse_event.rb | 0 .../discourse_plugin.rb | 0 .../components}/discourse_event_spec.rb | 3 +- .../components}/discourse_plugin_spec.rb | 3 +- vendor/gems/discourse_plugin/Gemfile | 10 -- vendor/gems/discourse_plugin/Gemfile.lock | 105 ------------------ vendor/gems/discourse_plugin/LICENSE | 22 ---- vendor/gems/discourse_plugin/README.md | 3 - vendor/gems/discourse_plugin/Rakefile | 7 -- .../discourse_plugin/discourse_plugin.gemspec | 20 ---- .../discourse_plugin/lib/discourse_plugin.rb | 3 - .../lib/discourse_plugin/version.rb | 3 - .../gems/discourse_plugin/spec/spec_helper.rb | 18 --- 16 files changed, 4 insertions(+), 205 deletions(-) rename {vendor/gems/discourse_plugin/lib => lib}/discourse_event.rb (100%) rename {vendor/gems/discourse_plugin/lib/discourse_plugin => lib}/discourse_plugin.rb (100%) rename {vendor/gems/discourse_plugin/spec => spec/components}/discourse_event_spec.rb (97%) rename {vendor/gems/discourse_plugin/spec => spec/components}/discourse_plugin_spec.rb (96%) delete mode 100644 vendor/gems/discourse_plugin/Gemfile delete mode 100644 vendor/gems/discourse_plugin/Gemfile.lock delete mode 100644 vendor/gems/discourse_plugin/LICENSE delete mode 100644 vendor/gems/discourse_plugin/README.md delete mode 100644 vendor/gems/discourse_plugin/Rakefile delete mode 100644 vendor/gems/discourse_plugin/discourse_plugin.gemspec delete mode 100644 vendor/gems/discourse_plugin/lib/discourse_plugin.rb delete mode 100644 vendor/gems/discourse_plugin/lib/discourse_plugin/version.rb delete mode 100644 vendor/gems/discourse_plugin/spec/spec_helper.rb diff --git a/Gemfile b/Gemfile index bf55b8506..dc2269119 100644 --- a/Gemfile +++ b/Gemfile @@ -187,10 +187,6 @@ group :development do gem 'foreman', require: false end -# Gem that enables support for plugins. It is required. -# TODO: does this really need to be a gem ? -gem 'discourse_plugin', path: 'vendor/gems/discourse_plugin' - # this is an optional gem, it provides a high performance replacement # to String#blank? a method that is called quite frequently in current # ActiveRecord, this may change in the future diff --git a/Gemfile.lock b/Gemfile.lock index ef5b4d3fc..cb9167e9a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,3 @@ -PATH - remote: vendor/gems/discourse_plugin - specs: - discourse_plugin (0.0.1) - PATH remote: vendor/gems/rails_multisite specs: @@ -408,7 +403,6 @@ DEPENDENCIES better_errors binding_of_caller certified - discourse_plugin! email_reply_parser-discourse ember-rails ember-source (= 1.6.0.beta.2) diff --git a/config/application.rb b/config/application.rb index b7b75d5a3..0e24c6e63 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,6 +2,8 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' # Plugin related stuff +require_relative '../lib/discourse_event' +require_relative '../lib/discourse_plugin' require_relative '../lib/discourse_plugin_registry' # Global config diff --git a/vendor/gems/discourse_plugin/lib/discourse_event.rb b/lib/discourse_event.rb similarity index 100% rename from vendor/gems/discourse_plugin/lib/discourse_event.rb rename to lib/discourse_event.rb diff --git a/vendor/gems/discourse_plugin/lib/discourse_plugin/discourse_plugin.rb b/lib/discourse_plugin.rb similarity index 100% rename from vendor/gems/discourse_plugin/lib/discourse_plugin/discourse_plugin.rb rename to lib/discourse_plugin.rb diff --git a/vendor/gems/discourse_plugin/spec/discourse_event_spec.rb b/spec/components/discourse_event_spec.rb similarity index 97% rename from vendor/gems/discourse_plugin/spec/discourse_event_spec.rb rename to spec/components/discourse_event_spec.rb index 94a2bb481..0491f0577 100644 --- a/vendor/gems/discourse_plugin/spec/discourse_event_spec.rb +++ b/spec/components/discourse_event_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' -require 'discourse_event' -require 'ostruct' +require_dependency 'discourse_event' describe DiscourseEvent do diff --git a/vendor/gems/discourse_plugin/spec/discourse_plugin_spec.rb b/spec/components/discourse_plugin_spec.rb similarity index 96% rename from vendor/gems/discourse_plugin/spec/discourse_plugin_spec.rb rename to spec/components/discourse_plugin_spec.rb index 2b22fb3fc..1fcbf2057 100644 --- a/vendor/gems/discourse_plugin/spec/discourse_plugin_spec.rb +++ b/spec/components/discourse_plugin_spec.rb @@ -1,6 +1,5 @@ require 'spec_helper' -require 'discourse_plugin' -require 'ostruct' +require_dependency 'discourse_plugin' describe DiscoursePlugin do diff --git a/vendor/gems/discourse_plugin/Gemfile b/vendor/gems/discourse_plugin/Gemfile deleted file mode 100644 index 4bfb4319a..000000000 --- a/vendor/gems/discourse_plugin/Gemfile +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' - -group :test do - gem 'rails' - gem 'rspec' - gem 'mocha' -end - -# Specify your gem's dependencies in rails_multisite.gemspec -gemspec diff --git a/vendor/gems/discourse_plugin/Gemfile.lock b/vendor/gems/discourse_plugin/Gemfile.lock deleted file mode 100644 index 3ae47f0f6..000000000 --- a/vendor/gems/discourse_plugin/Gemfile.lock +++ /dev/null @@ -1,105 +0,0 @@ -PATH - remote: . - specs: - discourse_plugin (0.0.1) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.8) - actionpack (= 3.2.8) - mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) - i18n (~> 0.6) - multi_json (~> 1.0) - arel (3.0.2) - builder (3.0.3) - diff-lcs (1.1.3) - erubis (2.7.0) - hike (1.2.1) - i18n (0.6.1) - journey (1.0.4) - json (1.7.5) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - metaclass (0.0.1) - mime-types (1.19) - mocha (0.12.7) - metaclass (~> 0.0.1) - multi_json (1.3.6) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.2) - rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) - bundler (~> 1.0) - railties (= 3.2.8) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.1) - rspec-expectations (2.11.3) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.3) - sprockets (2.1.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - thor (0.16.0) - tilt (1.3.3) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.33) - -PLATFORMS - ruby - -DEPENDENCIES - discourse_plugin! - mocha - rails - rspec diff --git a/vendor/gems/discourse_plugin/LICENSE b/vendor/gems/discourse_plugin/LICENSE deleted file mode 100644 index 1561959f6..000000000 --- a/vendor/gems/discourse_plugin/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Robin Ward - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/gems/discourse_plugin/README.md b/vendor/gems/discourse_plugin/README.md deleted file mode 100644 index a582de1fc..000000000 --- a/vendor/gems/discourse_plugin/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Discourse Plugin - -The basic stuff a plugin needs to exist in Discourse diff --git a/vendor/gems/discourse_plugin/Rakefile b/vendor/gems/discourse_plugin/Rakefile deleted file mode 100644 index 56bb7292a..000000000 --- a/vendor/gems/discourse_plugin/Rakefile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env rake -require "bundler/gem_tasks" -require "rspec/core/rake_task" - -RSpec::Core::RakeTask.new(:test) do |spec| - spec.pattern = 'spec/*_spec.rb' -end diff --git a/vendor/gems/discourse_plugin/discourse_plugin.gemspec b/vendor/gems/discourse_plugin/discourse_plugin.gemspec deleted file mode 100644 index 4d1a38d14..000000000 --- a/vendor/gems/discourse_plugin/discourse_plugin.gemspec +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -require File.expand_path('../lib/discourse_plugin/version', __FILE__) - -Gem::Specification.new do |gem| - gem.authors = ["Robin Ward"] - gem.email = ["robin.ward@gmail.com"] - gem.description = %q{Toolkit for creating a discourse plugin} - gem.summary = %q{Toolkit for creating a discourse plugin} - gem.homepage = "" - - # when this is extracted comment it back in, prd has no .git - # gem.files = `git ls-files`.split($\) - gem.files = Dir['README*','LICENSE','lib/**/*.rb'] - - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) - gem.name = "discourse_plugin" - gem.require_paths = ["lib"] - gem.version = DiscoursePlugin::VERSION -end diff --git a/vendor/gems/discourse_plugin/lib/discourse_plugin.rb b/vendor/gems/discourse_plugin/lib/discourse_plugin.rb deleted file mode 100644 index a715dec89..000000000 --- a/vendor/gems/discourse_plugin/lib/discourse_plugin.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'discourse_event' -require 'discourse_plugin/version' -require 'discourse_plugin/discourse_plugin' \ No newline at end of file diff --git a/vendor/gems/discourse_plugin/lib/discourse_plugin/version.rb b/vendor/gems/discourse_plugin/lib/discourse_plugin/version.rb deleted file mode 100644 index 04bedde42..000000000 --- a/vendor/gems/discourse_plugin/lib/discourse_plugin/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -class DiscoursePlugin - VERSION = "0.0.1" -end diff --git a/vendor/gems/discourse_plugin/spec/spec_helper.rb b/vendor/gems/discourse_plugin/spec/spec_helper.rb deleted file mode 100644 index dc473379e..000000000 --- a/vendor/gems/discourse_plugin/spec/spec_helper.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rubygems' -require 'rails' - -ENV["RAILS_ENV"] ||= 'test' - - -RSpec.configure do |config| - - config.mock_framework = :mocha - config.color_enabled = true - - config.before(:each) do - DiscourseEvent.clear - end - -end - -