kinit 0.1.3 → 0.1.4

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3504f1c11810db558c5731063bebce122bda4df1
4
+ data.tar.gz: 1a8690a7a85145325735f6748ddcbf179a7107fb
5
+ SHA512:
6
+ metadata.gz: 5b839d0bbf756a54f156f58c18a0c7789c97ce3461de765d383cf0ca6ae110038815ebbc66cf69cbdf3b8e409097ba1254bbfa2236d366dee24f4ed037c11173
7
+ data.tar.gz: 9679c15826daba7122dc0f7a270f176439b6aadc50cf77cae9cac6326b1fb1d582f9addcf9c82bc9e2d90a10d4b7769ed8eab0892581955cc9cccf22266b7644
data/kinit_config.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  bestPracticesGems:
2
+ - bullet
2
3
  - cane
3
- - rack-mini-profiler
4
4
  - rails_best_practices
5
5
  - reek
6
+ - rubocop
6
7
  - simplecov
7
8
 
8
9
  testingGems:
9
10
  - factory_girl_rails
10
11
  - rspec
11
- - shoulda
12
12
 
13
13
  suggestions:
14
- - CodeClimate
14
+ - CodeClimate
data/lib/kinit.rb CHANGED
@@ -9,7 +9,7 @@ module Kinit
9
9
 
10
10
  GemError = Class.new(ArgumentError)
11
11
  CONFIG_FILE = "kinit_config.yml"
12
-
12
+
13
13
  def initialize(options={})
14
14
  default_config = File.join(File.dirname(__FILE__), "..", CONFIG_FILE)
15
15
  custom_config = File.join(base_path, 'config/kinit_config.yml')
@@ -23,31 +23,30 @@ module Kinit
23
23
  def base_path=(path)
24
24
  @base_path = path
25
25
  end
26
-
26
+
27
27
  def base_path
28
28
  @base_path || "."
29
29
  end
30
30
 
31
31
  def checkGemsForCategory(gemListHash, category_name)
32
- if gemListHash.has_key?(category_name)
33
- gemListHash[category_name].each do |gemname|
34
- gem_available?(gemname) ?
35
- (plain_output "\nGem '#{gemname}' is present in your project. Neat." , 'green')
36
- :
32
+ if gemListHash.has_key?(category_name)
33
+ gemListHash[category_name].each do |gemname|
34
+ gem_available?(gemname) ?
35
+ (plain_output "\nGem '#{gemname}' is present in your project. Neat." , 'green')
36
+ :
37
37
  (add_error "Gem '#{gemname}' is not present in your project. Not Good.")
38
38
  # if Gem::Specification.find_by_name(gem)
39
39
  # raise GemsEnforcer::GemError, "Please include gem 'cane' to the project."
40
40
  end
41
- end
41
+ end
42
42
  end
43
43
 
44
- def CheckIsGemPresent
44
+ def CheckIsGemPresent
45
45
  gemListHash = YAML.load_file @config
46
- #puts gemList.inspect
47
46
 
48
47
  if gemListHash
49
48
  checkGemsForCategory(gemListHash, "bestPracticesGems")
50
- checkGemsForCategory(gemListHash, "testingGems")
49
+ checkGemsForCategory(gemListHash, "testingGems")
51
50
  output_terminal_errors
52
51
 
53
52
  if gemListHash.has_key?("suggestions")
@@ -58,7 +57,6 @@ module Kinit
58
57
 
59
58
  return true
60
59
  else
61
- #puts gemList.inspect
62
60
  plain_output "Please define checks in your config/kinit_config.yml to enforce best practices.", 'red'
63
61
  return false
64
62
  end
@@ -72,15 +70,15 @@ module Kinit
72
70
  @errors ||= []
73
71
  end
74
72
 
75
- def gem_available?(name)
76
- show_wait_cursor(0.3)
73
+ def gem_available?(name)
74
+ show_wait_cursor(0.3)
77
75
  Gem::Specification.find_by_name(name)
78
76
  rescue Gem::LoadError
79
77
  false
80
78
  rescue
81
79
  Gem.available?(name)
82
80
  end
83
-
81
+
84
82
  def output_terminal_errors
85
83
  if errors.empty?
86
84
  plain_output("\nNo issues or errors found. Good! Your project passed Kinit checks.", 'green')
data/lib/kinit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kinit
2
- VERSION = "0.1.3"
3
- end
2
+ VERSION = "0.1.4"
3
+ end
@@ -1,6 +1,6 @@
1
1
  desc 'my plugins rake task'
2
2
  task :do_kinit_enforce do
3
- puts "Enforcing best practices."
3
+ puts "Scanning..."
4
4
  gen = Kinit::GemsEnforcer.new
5
- gen.CheckIsGemPresent
6
- end
5
+ gen.CheckIsGemPresent
6
+ end
metadata CHANGED
@@ -1,68 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.1.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Rohan Daxini at Kiprosh.com
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.3'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
- description: ! "A gem enforcer tool to check and enforce important \n gems
63
- and best practices for code quality in ruby and \n rails
64
- code. Its configurable to enable disable what \n all to
65
- enforce."
55
+ description: |-
56
+ Kinit will make your Rails application better by
57
+ adhering to good practices.
66
58
  email:
67
59
  - rohan@kiprosh.com
68
60
  executables:
@@ -71,39 +63,38 @@ extensions:
71
63
  - ext/kinit/extconf.rb
72
64
  extra_rdoc_files: []
73
65
  files:
66
+ - bin/run_kinit
67
+ - ext/kinit/extconf.rb
68
+ - kinit_config.yml
69
+ - lib/kinit.rb
74
70
  - lib/kinit/railtie.rb
75
71
  - lib/kinit/version.rb
76
- - lib/kinit.rb
77
- - bin/run_kinit
78
72
  - lib/tasks/kinit_enforcer.rake
79
- - kinit_config.yml
80
- - ext/kinit/extconf.rb
81
73
  homepage: https://github.com/rohandaxini/kinit
82
74
  licenses:
83
75
  - MIT
76
+ metadata: {}
84
77
  post_install_message:
85
78
  rdoc_options: []
86
79
  require_paths:
87
80
  - lib
88
81
  - ext
89
82
  required_ruby_version: !ruby/object:Gem::Requirement
90
- none: false
91
83
  requirements:
92
- - - ! '>='
84
+ - - ">="
93
85
  - !ruby/object:Gem::Version
94
86
  version: '0'
95
87
  required_rubygems_version: !ruby/object:Gem::Requirement
96
- none: false
97
88
  requirements:
98
- - - ! '>='
89
+ - - ">="
99
90
  - !ruby/object:Gem::Version
100
91
  version: '0'
101
92
  requirements: []
102
93
  rubyforge_project:
103
- rubygems_version: 1.8.25
94
+ rubygems_version: 2.5.1
104
95
  signing_key:
105
- specification_version: 3
106
- summary: A gem enforcer tool to check and enforce important gems and best practices
107
- for code quality in ruby and rails code. Its configurable to enable disable what
108
- all to enforce.
96
+ specification_version: 4
97
+ summary: A Gem enforcer tool to check and enforce important gems and best practices
98
+ for code quality in a Rails application. Its configurable to enable disable what
99
+ all you want to enforce.
109
100
  test_files: []