Permalink
Browse files

Merge pull request #6 from maxmeyer/feature/refactor_lib

reduce clutter of $: and create proper lib directory structure
  • Loading branch information...
2 parents ee0f89e + 0c991fa commit e38c95b84f5be3b9b8cf9ec799251851b1b4daaa @wbailey committed Jun 13, 2012
@@ -1,7 +1,7 @@
-$: << File.join(__FILE__, '..')
+$LOAD_PATH << File.expand_path( File.join( '..' , 'lib' ), __FILE__ )
require 'date'
-require 'lib/version'
+require 'command_line_reporter/version'
Gem::Specification.new do |gem|
gem.name = 'command_line_reporter'
@@ -1,7 +1,12 @@
require 'stringio'
-require 'table'
-Dir[File.join(File.dirname(__FILE__), '*_formatter.rb')].each {|r| require r}
+require 'command_line_reporter/options_validator'
+require 'command_line_reporter/formatter/progress'
+require 'command_line_reporter/formatter/nested'
+require 'command_line_reporter/row'
+require 'command_line_reporter/column'
+require 'command_line_reporter/table'
+require 'command_line_reporter/version'
module CommandLineReporter
include OptionsValidator
@@ -1,4 +1,3 @@
-require 'options_validator'
require 'colored'
module CommandLineReporter
@@ -1,5 +1,4 @@
require 'singleton'
-require 'options_validator'
require 'colored'
module CommandLineReporter
@@ -1,5 +1,4 @@
require 'singleton'
-require 'options_validator'
require 'colored'
module CommandLineReporter
@@ -1,6 +1,3 @@
-require 'column'
-require 'options_validator'
-
module CommandLineReporter
class Row
include OptionsValidator
@@ -1,6 +1,3 @@
-require 'row'
-require 'options_validator'
-
module CommandLineReporter
class Table
include OptionsValidator
File renamed without changes.
View
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'column'
describe CommandLineReporter::Column do
describe '#initialize' do
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'command_line_reporter'
describe CommandLineReporter do
let :use_class do
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'nested_formatter'
describe CommandLineReporter::NestedFormatter do
subject { CommandLineReporter::NestedFormatter.instance }
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'options_validator'
describe OptionsValidator do
subject { Class.new.extend(OptionsValidator) }
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'progress_formatter'
describe CommandLineReporter::ProgressFormatter do
subject { CommandLineReporter::ProgressFormatter.instance }
View
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'row'
describe CommandLineReporter::Row do
let(:cols) { 10.times.map {|v| CommandLineReporter::Column.new("test#{v}")} }
View
@@ -1,4 +1,6 @@
$: << File.join(File.dirname(__FILE__), '..', 'lib')
-Dir[File.dirname(__FILE__) + "../lib/*.rb"].each {|f| require f}
-Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
+require 'command_line_reporter'
+
+require_relative 'support/helpers/stdout'
+require_relative 'support/matchers/argument'
View
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'table'
describe CommandLineReporter::Table do
context 'creation' do

0 comments on commit e38c95b

Please sign in to comment.