diff --git a/vendor/plugins/mile_marker/README b/vendor/plugins/mile_marker/README deleted file mode 100644 index 70327dc23..000000000 --- a/vendor/plugins/mile_marker/README +++ /dev/null @@ -1,55 +0,0 @@ -= MileMarker Plugin - -Author:: Chad Pytel (mailto:cpytel@thoughtbot.com) -Copyright:: Copyright(c) 2007 thoughtbot, inc. -License:: Distributes under the same terms as Ruby -Website:: http://www.thoughtbot.com/projects/mile_marker - -A Ruby on Rails plugin for visually setting expectations throughout application development. - -Adds a helper for marking page elements with the milestone they are slated to be developed, and makes them unable to be interacted with. - -Usage: - -Once the plugin has been installed, in your views you can now do: - -
> -
Your Name
-
- -When viewed in development mode, the person div would be overlaid with a grey box with the words "Milestone 6" in it. - -If you happen to not call your milestones, "milestones", or for any other reason want the label to be something different, just supply a string instead: - -
> -
Your Name
-
- -And that will still result in the marker being labeled with "Next Week" instead. - -By default, the milestone markers will be only appear in the Rails development environment. To customize this, add the following to the config file of the other environments you want the markers to appear: - -Thoughtbot::MileMarker.enable - -If you prefer not to have it on in development, add the following to development.rb - -Thoughtbot::MileMarker.disable - -Or, if you prefer, add something like the following to environment.rb: - -Thoughtbot::MileMarker.environments = %w(development staging production) - -You can also change some of the styling options (as of right now, just the z-index and background color) by modifying the options hash: - -Thoughtbot::MileMarker.options.update( - :z_index => 100, - :background_color => "purple" -) - -== Requirements - -The overlay functionality requires javascript, and uses the prototype library. So, any page that is using this functionality must also include prototype. - -== Todo - -* Rake task to find and print out (with line numbers) all of the milestone markers diff --git a/vendor/plugins/mile_marker/Rakefile b/vendor/plugins/mile_marker/Rakefile deleted file mode 100644 index 5d087c6e3..000000000 --- a/vendor/plugins/mile_marker/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the mile_marker plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the mile_marker plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Mile Marker' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/vendor/plugins/mile_marker/init.rb b/vendor/plugins/mile_marker/init.rb deleted file mode 100644 index d9db1f74f..000000000 --- a/vendor/plugins/mile_marker/init.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'mile_marker' -ActionView::Base.send :include, Thoughtbot::MileMarkerHelper -ActionController::Base.send :include, Thoughtbot::MileMarkerHelper -ActionController::Base.send :after_filter, :add_initialize_mile_marker \ No newline at end of file diff --git a/vendor/plugins/mile_marker/install.rb b/vendor/plugins/mile_marker/install.rb deleted file mode 100644 index f7732d379..000000000 --- a/vendor/plugins/mile_marker/install.rb +++ /dev/null @@ -1 +0,0 @@ -# Install hook code here diff --git a/vendor/plugins/mile_marker/lib/mile_marker.rb b/vendor/plugins/mile_marker/lib/mile_marker.rb deleted file mode 100644 index 95832bf02..000000000 --- a/vendor/plugins/mile_marker/lib/mile_marker.rb +++ /dev/null @@ -1,100 +0,0 @@ -module Thoughtbot - module MileMarkerHelper - def mile(detail="") - return unless MileMarker.enabled? - "mile=\"" + (detail.is_a?(Fixnum) ? "Milestone " : "") + "#{detail}\"" - end - - def initialize_mile_marker(request = nil) - return unless MileMarker.enabled? - MileMarker.initialize_mile_marker() - end - - def add_initialize_mile_marker() - init_code = initialize_mile_marker() - return if init_code.nil? || init_code.empty? - response.body.gsub! /<\/(head)>/i, init_code + '' if response.body.respond_to?(:gsub!) - end - end - - class MileMarker - # The environments in which to enable the Mile Marker functionality to run. Defaults - # to 'development' only. - @@environments = ['development'] - class << self - attr_accessor :environments - end - - def self.options - @options ||= { - :z_index => 1000, - :background_color => "#000" - } - end - - # Return true if the Mile Marker functionality is enabled for the current environment - def self.enabled? - environments.include?(ENV['RAILS_ENV']) - end - - def self.enable - environments.push ENV['RAILS_ENV'] - end - - def self.disable - environments.delete ENV['RAILS_ENV'] - end - - def self.initialize_mile_marker() - %Q~ - -~ - end - end -end diff --git a/vendor/plugins/mile_marker/test/mile_marker_test.rb b/vendor/plugins/mile_marker/test/mile_marker_test.rb deleted file mode 100644 index 5744756e7..000000000 --- a/vendor/plugins/mile_marker/test/mile_marker_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) - -class MileMarkerTest < Test::Unit::TestCase - include Thoughtbot::MileMarkerHelper - - def test_mile_helper_should_return_nothing_if_no_enabled - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="test_environment" - output = mile("Milestone 1") - assert_nil output - end - - def test_mile_helper_should_include_detail_when_supplied_detail - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="development" - output = mile("Milestone 1") - assert_equal "mile=\"Milestone 1\"", output - end - - def test_mile_helper_should_include_add_milestone_when_supplied_integer - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="development" - output = mile(1) - assert_equal "mile=\"Milestone 1\"", output - end - - def test_mile_helper_should_include_no_detail_when_supplied_no_detail - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="development" - output = mile - assert_equal "mile=\"\"", output - end - - def test_calling_enabled_should_add_current_environment_to_environments - Thoughtbot::MileMarker.environments = [] - ENV['RAILS_ENV']="test_environment" - Thoughtbot::MileMarker.enable - assert Thoughtbot::MileMarker.environments.include?(ENV['RAILS_ENV']) - end - - def test_calling_disabled_should_remove_current_environment_from_environments - Thoughtbot::MileMarker.environments = [] - ENV['RAILS_ENV']="test_environment" - Thoughtbot::MileMarker.enable - assert Thoughtbot::MileMarker.environments.include?(ENV['RAILS_ENV']) - Thoughtbot::MileMarker.disable - assert !Thoughtbot::MileMarker.environments.include?(ENV['RAILS_ENV']) - end - - def test_initialize_mile_should_return_nothing_if_not_enabled - ENV['RAILS_ENV']="test_environment" - output = initialize_mile_marker - assert_nil output - end - - def test_initialize_mile_should_return_javascript_if_enabled - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="development" - output = initialize_mile_marker - assert_match /function init_miles/, output - end - - def test_javascript_should_be_added_to_head_if_enabled - Thoughtbot::MileMarker.environments = ['development'] - ENV['RAILS_ENV']="development" - response.body = "" - add_initialize_mile_marker - assert_match /script/, response.body - end - - def test_z_index_and_other_options_in_css_set_as_specified_in_options - Thoughtbot::MileMarker.environments = ['development'] - Thoughtbot::MileMarker.options[:z_index] = "1234" - Thoughtbot::MileMarker.options[:background_color] = "purple" - ENV['RAILS_ENV']="development" - response.body = "" - add_initialize_mile_marker - assert_match /script/, response.body - assert_match /z-index: 1234/, response.body - assert_match /background-color: purple/, response.body - end -end \ No newline at end of file diff --git a/vendor/plugins/mile_marker/test/test_helper.rb b/vendor/plugins/mile_marker/test/test_helper.rb deleted file mode 100644 index 9e49cdf58..000000000 --- a/vendor/plugins/mile_marker/test/test_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -$:.unshift(File.dirname(__FILE__) + '/../lib') - -ENV['RAILS_ENV'] = 'test' - -require 'test/unit' -require File.join(File.dirname(File.dirname(__FILE__)), "lib", "mile_marker") -require 'ostruct' - -module MockResponse - def response - @test_response ||= OpenStruct.new({:body => ""}) - end -end -Test::Unit::TestCase.send :include, MockResponse -Thoughtbot::MileMarkerHelper.send :include, MockResponse diff --git a/vendor/plugins/mile_marker/uninstall.rb b/vendor/plugins/mile_marker/uninstall.rb deleted file mode 100644 index 973833346..000000000 --- a/vendor/plugins/mile_marker/uninstall.rb +++ /dev/null @@ -1 +0,0 @@ -# Uninstall hook code here