Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #6 from maxmeyer/feature/refactor_lib

reduce clutter of $: and create proper lib directory structure
  • Loading branch information...
commit e38c95b84f5be3b9b8cf9ec799251851b1b4daaa 2 parents ee0f89e + 0c991fa
@wbailey authored
View
4 command_line_reporter.gemspec
@@ -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'
View
9 lib/command_line_reporter.rb
@@ -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
View
1  lib/column.rb → lib/command_line_reporter/column.rb
@@ -1,4 +1,3 @@
-require 'options_validator'
require 'colored'
module CommandLineReporter
View
1  lib/nested_formatter.rb → lib/command_line_reporter/formatter/nested.rb
@@ -1,5 +1,4 @@
require 'singleton'
-require 'options_validator'
require 'colored'
module CommandLineReporter
View
1  lib/progress_formatter.rb → lib/command_line_reporter/formatter/progress.rb
@@ -1,5 +1,4 @@
require 'singleton'
-require 'options_validator'
require 'colored'
module CommandLineReporter
View
0  lib/options_validator.rb → lib/command_line_reporter/options_validator.rb
File renamed without changes
View
3  lib/row.rb → lib/command_line_reporter/row.rb
@@ -1,6 +1,3 @@
-require 'column'
-require 'options_validator'
-
module CommandLineReporter
class Row
include OptionsValidator
View
3  lib/table.rb → lib/command_line_reporter/table.rb
@@ -1,6 +1,3 @@
-require 'row'
-require 'options_validator'
-
module CommandLineReporter
class Table
include OptionsValidator
View
0  lib/version.rb → lib/command_line_reporter/version.rb
File renamed without changes
View
1  spec/column_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'column'
describe CommandLineReporter::Column do
describe '#initialize' do
View
1  spec/command_line_reporter_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'command_line_reporter'
describe CommandLineReporter do
let :use_class do
View
1  spec/nested_formatter_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'nested_formatter'
describe CommandLineReporter::NestedFormatter do
subject { CommandLineReporter::NestedFormatter.instance }
View
1  spec/options_validator_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'options_validator'
describe OptionsValidator do
subject { Class.new.extend(OptionsValidator) }
View
1  spec/progress_formatter_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'progress_formatter'
describe CommandLineReporter::ProgressFormatter do
subject { CommandLineReporter::ProgressFormatter.instance }
View
1  spec/row_spec.rb
@@ -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
6 spec/spec_helper.rb
@@ -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  spec/table_spec.rb
@@ -1,5 +1,4 @@
require 'spec_helper'
-require 'table'
describe CommandLineReporter::Table do
context 'creation' do
Please sign in to comment.
Something went wrong with that request. Please try again.