polishgeeks-dev-tools 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +3 -2
  4. data/CHANGELOG.md +69 -0
  5. data/Gemfile.lock +76 -81
  6. data/README.md +28 -22
  7. data/Rakefile +4 -3
  8. data/config/rubocop.yml +16 -16
  9. data/config/rubocop_todo.yml +14 -0
  10. data/lib/polish_geeks/dev_tools.rb +26 -0
  11. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/allowed_extensions.rb +4 -4
  12. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/base.rb +18 -3
  13. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/brakeman.rb +5 -2
  14. data/lib/polish_geeks/dev_tools/commands/bundler_audit.rb +23 -0
  15. data/lib/{polishgeeks/dev-tools/commands/empty_method.rb → polish_geeks/dev_tools/commands/empty_methods.rb} +3 -13
  16. data/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/file_parser.rb +1 -1
  17. data/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/string_refinements.rb +2 -2
  18. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/examples_comparator.rb +13 -7
  19. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/expires_in.rb +6 -6
  20. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/final_blank_line.rb +1 -11
  21. data/lib/polish_geeks/dev_tools/commands/gemfile.rb +39 -0
  22. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/haml_lint.rb +0 -0
  23. data/lib/polish_geeks/dev_tools/commands/required_files.rb +38 -0
  24. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec.rb +24 -5
  25. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_names.rb +1 -1
  26. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_structure.rb +22 -9
  27. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubocop.rb +10 -8
  28. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubycritic.rb +0 -0
  29. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/simplecov.rb +0 -0
  30. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/tasks_files_names.rb +0 -0
  31. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yard.rb +0 -0
  32. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yml_parser.rb +0 -0
  33. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/config.rb +24 -16
  34. data/lib/polish_geeks/dev_tools/config_manager.rb +68 -0
  35. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/errors.rb +0 -0
  36. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/hash.rb +0 -0
  37. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/logger.rb +3 -3
  38. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/output_storer.rb +0 -0
  39. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/runner.rb +0 -0
  40. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/shell.rb +0 -0
  41. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/tasks/dev-tools.rake +0 -0
  42. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/base.rb +2 -2
  43. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/rails.rb +0 -0
  44. data/lib/polish_geeks/dev_tools/validators/rubocop.rb +12 -0
  45. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/simplecov.rb +1 -1
  46. data/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/version.rb +1 -1
  47. data/lib/polishgeeks-dev-tools.rb +6 -31
  48. data/polishgeeks_dev_tools.gemspec +6 -5
  49. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/allowed_extensions_spec.rb +5 -17
  50. data/spec/lib/polish_geeks/dev_tools/commands/base_spec.rb +90 -0
  51. data/spec/lib/polish_geeks/dev_tools/commands/brakeman_spec.rb +99 -0
  52. data/spec/lib/polish_geeks/dev_tools/commands/bundler_audit_spec.rb +52 -0
  53. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/file_parser_spec.rb +1 -1
  54. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method → polish_geeks/dev_tools/commands/empty_methods}/string_refinements_spec.rb +1 -1
  55. data/spec/lib/{polishgeeks/dev-tools/commands/empty_method_spec.rb → polish_geeks/dev_tools/commands/empty_methods_spec.rb} +7 -54
  56. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/examples_comparator_spec.rb +8 -8
  57. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/expires_in_spec.rb +1 -1
  58. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/final_blank_line_spec.rb +2 -45
  59. data/spec/lib/polish_geeks/dev_tools/commands/gemfile_spec.rb +91 -0
  60. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/haml_lint_spec.rb +13 -21
  61. data/spec/lib/polish_geeks/dev_tools/commands/required_files_spec.rb +51 -0
  62. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_names_spec.rb +2 -2
  63. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rspec_files_structure_spec.rb +19 -32
  64. data/spec/lib/polish_geeks/dev_tools/commands/rspec_spec.rb +106 -0
  65. data/spec/lib/polish_geeks/dev_tools/commands/rubocop_spec.rb +131 -0
  66. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/rubycritic_spec.rb +5 -3
  67. data/spec/lib/polish_geeks/dev_tools/commands/simplecov_spec.rb +136 -0
  68. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/tasks_files_names_spec.rb +8 -8
  69. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yard_spec.rb +10 -10
  70. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/commands/yml_parser_spec.rb +2 -2
  71. data/spec/lib/polish_geeks/dev_tools/config_manager_spec.rb +124 -0
  72. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/config_spec.rb +3 -3
  73. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/errors_spec.rb +0 -0
  74. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/hash_spec.rb +8 -8
  75. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/logger_spec.rb +9 -9
  76. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/output_storer_spec.rb +1 -1
  77. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/runner_spec.rb +0 -0
  78. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/shell_spec.rb +1 -1
  79. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/base_spec.rb +0 -0
  80. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/rails_spec.rb +0 -0
  81. data/spec/lib/polish_geeks/dev_tools/validators/rubocop_spec.rb +29 -0
  82. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/validators/simplecov_spec.rb +1 -1
  83. data/spec/lib/{polishgeeks/dev-tools → polish_geeks/dev_tools}/version_spec.rb +0 -0
  84. data/spec/lib/{polishgeeks-dev-tools_spec.rb → polish_geeks/dev_tools_spec.rb} +2 -2
  85. data/spec/spec_helper.rb +1 -1
  86. metadata +141 -99
  87. data/lib/polishgeeks/dev-tools/commands/readme.rb +0 -32
  88. data/spec/lib/polishgeeks/dev-tools/commands/base_spec.rb +0 -55
  89. data/spec/lib/polishgeeks/dev-tools/commands/brakeman_spec.rb +0 -96
  90. data/spec/lib/polishgeeks/dev-tools/commands/readme_spec.rb +0 -38
  91. data/spec/lib/polishgeeks/dev-tools/commands/rspec_spec.rb +0 -63
  92. data/spec/lib/polishgeeks/dev-tools/commands/rubocop_spec.rb +0 -127
  93. data/spec/lib/polishgeeks/dev-tools/commands/simplecov_spec.rb +0 -134
@@ -21,16 +21,35 @@ module PolishGeeks
21
21
 
22
22
  # @return [Boolean] true if there were no Rspec failures, false otherwise
23
23
  def valid?
24
- output.include?('0 failures')
24
+ failures_count.zero? && disallow_pending_valid?
25
25
  end
26
26
 
27
27
  # @return [String] default label for this command
28
28
  def label
29
- examples = output.scan(EXAMPLES_REGEXP).flatten.first.to_i
30
- failures = output.scan(FAILURES_REGEXP).flatten.first.to_i
31
- pending = output.scan(PENDING_REGEXP).flatten.first.to_i
29
+ "Rspec (#{examples_count} ex, #{failures_count} fa, #{pending_count} pe)"
30
+ end
31
+
32
+ private
33
+
34
+ # @return [Integer] how many examples
35
+ def examples_count
36
+ output.scan(EXAMPLES_REGEXP).flatten.first.to_i
37
+ end
38
+
39
+ # @return [Integer] how many failures
40
+ def failures_count
41
+ output.scan(FAILURES_REGEXP).flatten.first.to_i
42
+ end
43
+
44
+ # @return [Integer] how many pending
45
+ def pending_count
46
+ output.scan(PENDING_REGEXP).flatten.first.to_i
47
+ end
32
48
 
33
- "Rspec (#{examples} ex, #{failures} fa, #{pending} pe)"
49
+ # @return [Boolean] true if pending specs count is zero or we allow
50
+ # pending tests, false otherwise
51
+ def disallow_pending_valid?
52
+ PolishGeeks::DevTools.config.rspec_disallow_pending? ? pending_count.zero? : true
34
53
  end
35
54
  end
36
55
  end
@@ -13,7 +13,7 @@ module PolishGeeks
13
13
  CHECKED_DIRS = %w(
14
14
  aggregators controllers helpers lib libs models decorators
15
15
  presenters services workers mailers requests polishgeeks*
16
- )
16
+ ).freeze
17
17
 
18
18
  # Regexp used to check names in spec files
19
19
  CHECK_REGEXP = /(\_spec\.rb)$/
@@ -13,20 +13,20 @@ module PolishGeeks
13
13
  FILES_CHECKED = %w(
14
14
  app/**/*.rb
15
15
  lib/**/*.rb
16
- )
16
+ ).freeze
17
17
 
18
18
  # From where should we take spec files
19
19
  RSPEC_FILES = %w(
20
20
  spec/**/*_spec.rb
21
- )
21
+ ).freeze
22
22
 
23
23
  # Executes this command
24
24
  # @return [Array<String>] empty array if all the files have corresponding
25
25
  # rspec files, otherwise array will contain files that doesn't
26
26
  def execute
27
27
  @output = {
28
- app: analyzed_files - rspec_files,
29
- rspec: rspec_files - analyzed_files
28
+ app: analyzed_files - analyzed_rspec_files,
29
+ rspec: analyzed_rspec_files - analyzed_files
30
30
  }
31
31
  end
32
32
 
@@ -53,9 +53,7 @@ module PolishGeeks
53
53
  # @return [Array<String>] array with list of files that we want to compare with
54
54
  # those from Rspec that should exist
55
55
  def analyzed_files
56
- files = FILES_CHECKED.map do |dir|
57
- Dir[File.join(DevTools.app_root, dir)]
58
- end
56
+ files = checked_files
59
57
 
60
58
  files.flatten!
61
59
  files.uniq!
@@ -70,8 +68,8 @@ module PolishGeeks
70
68
  end
71
69
 
72
70
  # @return [Array<String>] rspec files that should correspond with analyzed_files
73
- def rspec_files
74
- files = RSPEC_FILES.map { |dir| Dir[File.join(DevTools.app_root, dir)] }
71
+ def analyzed_rspec_files
72
+ files = rspec_files
75
73
 
76
74
  files.flatten!
77
75
 
@@ -128,6 +126,21 @@ module PolishGeeks
128
126
  def excludes
129
127
  DevTools.config.rspec_files_structure_ignored || []
130
128
  end
129
+
130
+ # @return [Array<String>] files that should be analyzed
131
+ def directory_files(dir)
132
+ Dir[File.join(DevTools.app_root, dir)]
133
+ end
134
+
135
+ # @return [Array<String>] array with list of files that we want to compare
136
+ def checked_files
137
+ FILES_CHECKED.map { |dir| directory_files(dir) }
138
+ end
139
+
140
+ # @return [Array<String>] array with list of files that we want to compare
141
+ def rspec_files
142
+ RSPEC_FILES.map { |dir| directory_files(dir) }
143
+ end
131
144
  end
132
145
  end
133
146
  end
@@ -4,6 +4,7 @@ module PolishGeeks
4
4
  # Command wrapper for Rubocop validation
5
5
  # It informs us if code is formatted in a proper way
6
6
  class Rubocop < Base
7
+ self.config_manager = ConfigManager.new('rubocop.yml')
7
8
  self.type = :validator
8
9
 
9
10
  # Regexp used to get number of inspected files
@@ -14,13 +15,10 @@ module PolishGeeks
14
15
  # Executes this command
15
16
  # @return [String] command output
16
17
  def execute
17
- loc_config = File.join(DevTools.gem_root, 'config', 'rubocop.yml')
18
- app_config = File.join(DevTools.app_root, '.rubocop.yml')
19
-
20
- config = File.exist?(app_config) ? app_config : loc_config
21
- cmd = "bundle exec rubocop -c #{config} #{PolishGeeks::DevTools.app_root}"
22
-
23
- @output = Shell.new.execute(cmd)
18
+ cmd = ["bundle exec rubocop #{PolishGeeks::DevTools.app_root}"]
19
+ cmd << "-c #{self.class.config_manager.path}" if self.class.config_manager.present?
20
+ cmd << '--require rubocop-rspec' if Config.config.rubocop_rspec?
21
+ @output = Shell.new.execute(cmd.join(' '))
24
22
  end
25
23
 
26
24
  # @return [Boolean] true if there were no Rubocop offenses detected
@@ -30,7 +28,11 @@ module PolishGeeks
30
28
 
31
29
  # @return [String] default label for this command
32
30
  def label
33
- "Rubocop (#{files_count} files, #{offenses_count} offenses)"
31
+ msg = []
32
+ msg << 'Rubocop'
33
+ msg << 'with RSpec' if Config.config.rubocop_rspec?
34
+ msg << "(#{files_count} files, #{offenses_count} offenses)"
35
+ msg.join(' ')
34
36
  end
35
37
 
36
38
  private
@@ -20,40 +20,48 @@ module PolishGeeks
20
20
  end
21
21
  end
22
22
 
23
- attr_accessor :simplecov_threshold
24
-
25
23
  %i(
26
- rspec_files_structure
27
- expires_in_files
28
- final_blank_line
29
- empty_method
24
+ required_files_include
25
+ rspec_files_structure_ignored
26
+ expires_in_files_ignored
27
+ final_blank_line_ignored
28
+ empty_methods_ignored
29
+ simplecov_threshold
30
30
  ).each do |attr|
31
- attr_accessor "#{attr}_ignored"
31
+ attr_accessor attr
32
32
  end
33
33
 
34
34
  # Available commands
35
35
  # All commands will be executed in this order (first rubocop, then rspec, etc)
36
36
  COMMANDS = %i(
37
- readme
37
+ required_files
38
+ gemfile
38
39
  expires_in
40
+ examples_comparator
41
+ allowed_extensions
42
+ yml_parser
43
+ final_blank_line
39
44
  brakeman
40
45
  rubocop
41
- final_blank_line
42
- empty_method
46
+ bundler_audit
47
+ empty_methods
43
48
  haml_lint
44
- allowed_extensions
45
- yml_parser
46
49
  rspec_files_names
47
50
  rspec_files_structure
48
51
  tasks_files_names
49
52
  rspec
50
53
  simplecov
51
54
  yard
52
- examples_comparator
53
55
  rubycritic
54
- )
56
+ ).freeze
57
+
58
+ # Additional options for commands
59
+ COMMANDS_OPTIONS = %i(
60
+ rubocop_rspec
61
+ rspec_disallow_pending
62
+ ).freeze
55
63
 
56
- COMMANDS.each do |attr_name|
64
+ (COMMANDS + COMMANDS_OPTIONS).each do |attr_name|
57
65
  attr_accessor attr_name
58
66
 
59
67
  # @return [Boolean] is given command enabled
@@ -65,7 +73,7 @@ module PolishGeeks
65
73
  # Initializes configuration and turn on by default
66
74
  # all the commands
67
75
  def initialize
68
- COMMANDS.each do |attr_name|
76
+ (COMMANDS + COMMANDS_OPTIONS).each do |attr_name|
69
77
  public_send(:"#{attr_name}=", true)
70
78
  end
71
79
 
@@ -0,0 +1,68 @@
1
+ module PolishGeeks
2
+ module DevTools
3
+ # Config manager which is able to check if config file exist either in local
4
+ # or application path
5
+ # @example
6
+ # config_manager = ConfigManager.new('rubocop.yml')
7
+ # config_manager.present? = true
8
+ # config_manager.path = /home/pg/project/.rubocop.yml
9
+ class ConfigManager
10
+ def initialize(file_name)
11
+ @file_name = file_name
12
+ end
13
+
14
+ # @return [Boolean] true if there is a local or application config file present
15
+ def present?
16
+ application? || local?
17
+ end
18
+
19
+ # If there is an application config file use that, if not
20
+ # check if local config file is available if not return nil
21
+ # @return [String] path to config file or nil
22
+ # @example
23
+ # /home/pg/project/.rubocop.yml
24
+ def path
25
+ application? ? application_path : local_path
26
+ end
27
+
28
+ private
29
+
30
+ # @return [Boolean] true if there is a config present locally
31
+ def local?
32
+ !@file_name.nil? && !local_path.nil?
33
+ end
34
+
35
+ # Provides path to local config file if it exists
36
+ # @return [String] path to local config file
37
+ def local_path
38
+ fetch_path(DevTools.gem_root)
39
+ end
40
+
41
+ # @return [Boolean] true if there is a config present in the application
42
+ def application?
43
+ !@file_name.nil? && !application_path.nil?
44
+ end
45
+
46
+ # Provides path to application config file if it exists
47
+ # @return [String] path to application config file
48
+ def application_path
49
+ fetch_path(DevTools.app_root)
50
+ end
51
+
52
+ # Searches for provided file name as well as one with dot in front of it
53
+ # in main directory and config subdirectory
54
+ # @return [String] path to config file if it exists
55
+ # @example
56
+ # /home/pg/project/.rubocop.yml
57
+ def fetch_path(start_path)
58
+ ['', 'config'].each do |directory|
59
+ ['', '.'].each do |prefix|
60
+ path = File.join(start_path, directory, "#{prefix}#{@file_name}")
61
+ return path if File.exist?(path)
62
+ end
63
+ end
64
+ nil
65
+ end
66
+ end
67
+ end
68
+ end
@@ -16,7 +16,7 @@ module PolishGeeks
16
16
  info(task)
17
17
  else
18
18
  fatal(task)
19
- fail Errors::RequirementsError
19
+ raise Errors::RequirementsError
20
20
  end
21
21
  end
22
22
 
@@ -31,9 +31,9 @@ module PolishGeeks
31
31
  msg = 'GENERATED' if task.class.generator?
32
32
  msg = 'OK' if task.class.validator?
33
33
 
34
- fail Errors::UnknownTaskType unless msg
34
+ raise Errors::UnknownTaskType unless msg
35
35
 
36
- printf('%-40s %2s', "#{label(task)} ", "\e[32m#{msg}\e[0m\n")
36
+ printf('%-50s %2s', "#{label(task)} ", "\e[32m#{msg}\e[0m\n")
37
37
  end
38
38
 
39
39
  # Will print message when task did fail while running
@@ -12,13 +12,13 @@ module PolishGeeks
12
12
  # This should be implemented in a subclass
13
13
  # @return [Boolean] if validation check is valid or not
14
14
  def valid?
15
- fail Errors::NotImplementedError
15
+ raise Errors::NotImplementedError
16
16
  end
17
17
 
18
18
  # @raise [PreCommandValidationError] when valid? return false
19
19
  # @return [Boolean] if validation check is valid or not
20
20
  def validate!
21
- fail Errors::PreCommandValidationError unless valid?
21
+ raise Errors::PreCommandValidationError unless valid?
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,12 @@
1
+ module PolishGeeks
2
+ module DevTools
3
+ module Validators
4
+ # It verifies if Rubocop is enabled
5
+ class Rubocop < Base
6
+ def valid?
7
+ PolishGeeks::DevTools.config.rubocop == true
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -7,7 +7,7 @@ module PolishGeeks
7
7
  MATCH_REGEXP = /\(\d+.\d+\%\) covered/
8
8
 
9
9
  def valid?
10
- Object.const_defined?('SimpleCov') || (!output.nil? && output.length > 0)
10
+ Object.const_defined?('SimpleCov') || (!output.nil? && !output.empty?)
11
11
  end
12
12
 
13
13
  # Searches if we have SimpleCov hooked to rspec
@@ -3,6 +3,6 @@ module PolishGeeks
3
3
  # Dev Tools for PolishGeeks developers
4
4
  module DevTools
5
5
  # Current version of dev tools
6
- VERSION = '1.2.1'
6
+ VERSION = '1.3.0'.freeze
7
7
  end
8
8
  end
@@ -11,9 +11,9 @@
11
11
  %w(
12
12
  validators/base
13
13
  commands/base
14
- commands/empty_method
15
- commands/empty_method/string_refinements
16
- ).each { |lib| require "polishgeeks/dev-tools/#{lib}" }
14
+ commands/empty_methods
15
+ commands/empty_methods/string_refinements
16
+ ).each { |lib| require "polish_geeks/dev_tools/#{lib}" }
17
17
 
18
18
  %w(
19
19
  *.rb
@@ -21,34 +21,9 @@
21
21
  commands/*.rb
22
22
  commands/**/*.rb
23
23
  ).each do |path|
24
- base_path = File.dirname(__FILE__) + "/polishgeeks/dev-tools/#{path}"
24
+ base_path = File.dirname(__FILE__) + "/polish_geeks/dev_tools/#{path}"
25
25
  Dir[base_path].each { |file| require file }
26
26
  end
27
27
 
28
- module PolishGeeks
29
- module DevTools
30
- # This is just an alias so we can use it from DevTools directly
31
- # @return [PolishGeeks::DevTools::Config.config]
32
- def self.config
33
- Config.config
34
- end
35
-
36
- # @return [String] root path of this gem
37
- def self.gem_root
38
- File.expand_path('../..', __FILE__)
39
- end
40
-
41
- # @return [String] app root path
42
- def self.app_root
43
- File.dirname(ENV['BUNDLE_GEMFILE'])
44
- end
45
-
46
- # Sets up the whole configuration
47
- # @param [Block] block
48
- def self.setup(&block)
49
- Config.setup(&block)
50
- end
51
- end
52
- end
53
-
54
- load 'polishgeeks/dev-tools/tasks/dev-tools.rake'
28
+ require 'polish_geeks/dev_tools'
29
+ load 'polish_geeks/dev_tools/tasks/dev-tools.rake'